2016-03-29 25 views
0

Ben docker konteyner ssh den denedim, sadece hata ve hata olmadan sıkışmış. Yani, ile ssh sunucu üzerinde hata ayıklama oturumu çalıştırmak “/ usr/sbin/sshd -d -D -p 222” bu ssh sunucusunassh, sıkışmış var ve hiçbir hata üretildi

debug1: Bind to port 222 on 0.0.0.0. 
Server listening on 0.0.0.0 port 222. 
debug1: Bind to port 222 on ::. 
Server listening on :: port 222. 
debug1: Server will not fork when running in debugging mode. 
debug1: rexec start in 5 out 5 newsock 5 pipe -1 sock 8 
debug1: inetd sockets after dupping: 3, 3 Connection from 103.17.54.193 port 45677 on 128.199.127.170 port 222 
debug1: Client protocol version 2.0; client software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.6 
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.6 pat OpenSSH_6.6.1* compat 0x04000000 
debug1: Enabling compatibility mode for protocol 2.0 
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.3 
debug1: permanently_set_uid: 104/65534 [preauth] 
debug1: list_hostkey_types: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ssh-ed25519 [preauth] 
debug1: SSH2_MSG_KEXINIT sent [preauth] 
debug1: SSH2_MSG_KEXINIT received [preauth] 
debug1: kex: client->server aes128-ctr [email protected] [email protected] [preauth] 
debug1: kex: server->client aes128-ctr [email protected] [email protected] [preauth] 
debug1: expecting SSH2_MSG_KEX_ECDH_INIT [preauth] 

gelen günlük ve ben ssh istemcisi “ssh çalıştırmak, daha - docker kabından v -C -A -X -p 222 root @ server_host ”. Bu ssh sunucunun günlükten ssh istemcisi

OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014 
debug1: Reading configuration data /root/.ssh/config 
debug1: /root/.ssh/config line 5: Applying options for * 
debug1: /root/.ssh/config line 8: Applying options for * 
debug1: /root/.ssh/config line 11: Applying options for * 
debug1: /root/.ssh/config line 14: Applying options for * 
debug1: Reading configuration data /etc/ssh/ssh_config 
debug1: /etc/ssh/ssh_config line 19: Applying options for * 
debug1: Connecting to 128.199.127.170 [128.199.127.170] port 222. 
debug1: Connection established. 
debug1: permanently_set_uid: 0/0 
debug1: identity file /root/.ssh/id_rsa type -1 
debug1: identity file /root/.ssh/id_rsa-cert type -1 
debug1: identity file /root/.ssh/id_dsa type -1 
debug1: identity file /root/.ssh/id_dsa-cert type -1 
debug1: identity file /root/.ssh/id_ecdsa type -1 
debug1: identity file /root/.ssh/id_ecdsa-cert type -1 
debug1: identity file /root/.ssh/id_ed25519 type -1 
debug1: identity file /root/.ssh/id_ed25519-cert type -1 
debug1: Enabling compatibility mode for protocol 2.0 
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.6 
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.3 
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.3 pat OpenSSH_6.6.1* compat 0x04000000 
debug1: SSH2_MSG_KEXINIT sent 

log biz bu ssh sunucusu herhangi gönderilen vermedi SSH2_MSG_KEX_ECDH_INIT ama ssh istemcisi arayan görebilirsiniz olduğunu. Ama aynı docker görüntüsünü başka bir ana bilgisayarda çalıştırmayı denediğimde, her şey kusursuz çalışıyor, docker konteynerinden aynı ssh sunucusuna ssh yapabilirim. Yani, bu ev sahibi bu partiküler docker servisi ile bir ilgisi var sanırım.

Bu liman işçisi ait teftiş edilir the docker container

Biri neler olduğunu söyleyebilir misiniz? Ve nasıl çözülür (eğer mümkün ise)?

cevap

0

İncelemeden, bu ana makine için uygun köprü ağına (varsayılan yerleştirme ağına) sahip görünmüyorsunuz. Gateway ve IPAddress'unuz boş görünüyor.

Aşağıdaki sağlamalıdır:

  • Sen ana bilgisayarda çalışan bir varsayılan liman işçisi arayüzüne sahip ve bir IP kendisine atanmış var. [[email protected] ~]$ ip addr |grep docker 4: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default inet 172.17.0.1/16 scope global docker0 27: [email protected]: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP group default [[email protected] ~]$
  • Kapsayıcıda doğru arabirimlerin olup olmadığını doğrulayabilirsiniz. Kapınız için kapsayıcınız için bir IP alırsanız ifconfig ile. Alternatif olarak, barındırıcınızın tüm arabirimlerini kapsayıcıya almak için kapsayıcınızı docker run --net host ...... seçeneğiyle de başlatabilirsiniz. Bu sadece test amaçlıdır, gerçek kullanım için önerilmez.

Mevcut ağları docker network ls ile listeleyebilir ve listeden diğer ağlarla (ad) deneyebilirsiniz. Bu yardımcı olur ve bize o :)

Teşekkür nasıl gidiyor bildirin

Umut, - Anoop

+0

Merhaba Anoop, zaman ayırdığınız için teşekkürler. Evet, varsayılan varsayılan docker arabirim var. Yani, --net = default seçeneğiyle yeni bir kapsayıcı yaratıyorum, böylece kapsayıcım varsayılan Docker köprüsüne bağlanabilir. Bu, docker'ın [yeni kabın] (http://paste.ubuntu.com/15550077/) olduğunu denetler. Ama yine de, o konteynırdan ssh yapamam. Aynı günlüğü oluşturdu. Neyi özledim? –

+0

Tamam, Ev sahibinizin ağındaki diğer sunuculara ssh edebiliyor musunuz? Ping, telnet vb. Gibi bir şeyi denemeye ne dersiniz, o zaman port 22'nin engellenip engellenmediğini biliyoruz. Burada olduğundan emin değil, sadece tahmin ediyorum. – Maniankara

+0

merhaba, ben --net = 'host' seçeneğini kullanıp kullanmadığımı öğreniyorum, internete ssh yapabilirim. Bu benim [docker ağ incelemesi köprüsü] (http://paste.ubuntu.com/15558237/) ve bu benim [docker ağ inceleme ev sahibi] (http://paste.ubuntu.com/15558238/). Köprü arabiriminde sorun nedir? –

İlgili konular