2015-12-04 193 views
0

關閉我嘗試連接到我的bluemix運行容器,但我得到這個錯誤:SSH連接到我的容器通過遠程主機

ssh -p 22 [email protected]*.*.* 
Connection to 134.*.*.* closed by remote host. 
Connection to 134.*.*.* closed. 

我的安全隱患IP。

在碼頭集裝箱建設期間,我將我的ssh公鑰添加到/home/login/.ssh/authorized_keys。然後我啓動我的容器(運行sshd)並打開22端口。

在本地(使用我的服務器上的docker),我可以使用我的私鑰連接到ssh並將其與容器連接。但是當我在Bluemix上啓動容器時,即使在屬性公共IP地址之後,我也無法連接到ssh,當然,也發佈了22個tcp端口。

要運行我推送到ibm repo的容器,我使用ICE cli使用啓動所有服務(sshd內)的入口點腳本運行容器。

ice run --publish 8572 --publish 8787 --publish 22 --memory 2048 --name boardvisor registry.ng.bluemix.net/org/test:latest /run.sh 

然後我去bluexmix網絡信息中心,以屬性的公共IP地址

當我接收到sshd服務器的響應,容器似乎工作,可達,但我不明白爲什麼我可以在我的連接碼頭服務器,但不在bluemix服務器上。

我爲您提供SSH詳細的連接:

OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013 
debug1: Reading configuration data /etc/ssh/ssh_config 
debug1: /etc/ssh/ssh_config line 56: Applying options for * 
debug2: ssh_connect: needpriv 0 
debug1: Connecting to 134.168.6.95 [134.168.6.95] port 22. 
debug1: Connection established. 
debug3: Incorrect RSA1 identifier 
debug3: Could not load "/home/idcware/.ssh/id_rsa" as a RSA1 public key 
debug1: identity file /home/idcware/.ssh/id_rsa type 1 
debug1: identity file /home/idcware/.ssh/id_rsa-cert type -1 
debug3: Incorrect RSA1 identifier 
debug3: Could not load "/home/idcware/.ssh/id_dsa" as a RSA1 public key 
debug1: identity file /home/idcware/.ssh/id_dsa type -1 
debug1: identity file /home/idcware/.ssh/id_dsa-cert type -1 
debug1: identity file /home/idcware/.ssh/id_ecdsa type -1 
debug1: identity file /home/idcware/.ssh/id_ecdsa-cert type -1 
debug1: identity file /home/idcware/.ssh/id_ed25519 type -1 
debug1: identity file /home/idcware/.ssh/id_ed25519-cert type -1 
debug1: Enabling compatibility mode for protocol 2.0 
debug1: Local version string SSH-2.0-OpenSSH_6.6.1 
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1 
debug1: match: OpenSSH_6.6.1 pat OpenSSH_6.6.1* compat 0x04000000 
debug2: fd 3 setting O_NONBLOCK 
debug3: load_hostkeys: loading entries for host "134.168.6.95" from file "/home/idcware/.ssh/known_hosts" 
debug3: load_hostkeys: found key type ECDSA in file /home/idcware/.ssh/known_hosts:3 
debug3: load_hostkeys: loaded 1 keys 
debug3: order_hostkeyalgs: prefer hostkeyalgs: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521 
debug1: SSH2_MSG_KEXINIT sent 
debug1: SSH2_MSG_KEXINIT received 
debug2: kex_parse_kexinit: [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],[email protected],[email protected],[email protected],ssh-ed25519,ssh-rsa,ssh-dss 
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,[email protected],[email protected],[email protected],aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected] 
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,[email protected],[email protected],[email protected],aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected] 
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-md5,hmac-sha1,[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96 
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected]com,[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-md5,hmac-sha1,[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96 
debug2: kex_parse_kexinit: none,[email protected],zlib 
debug2: kex_parse_kexinit: none,[email protected],zlib 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: kex_parse_kexinit: [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 
debug2: kex_parse_kexinit: ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519 
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,[email protected],[email protected],[email protected],aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected] 
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,[email protected],[email protected],[email protected],aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected] 
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-md5,hmac-sha1,[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96 
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-md5,hmac-sha1,[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96 
debug2: kex_parse_kexinit: none,[email protected] 
debug2: kex_parse_kexinit: none,[email protected] 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: mac_setup: setup [email protected] 
debug1: kex: server->client aes128-ctr [email protected] none 
debug2: mac_setup: setup [email protected] 
debug1: kex: client->server aes128-ctr [email protected] none 
debug1: kex: [email protected] need=16 dh_need=16 
debug1: kex: [email protected] need=16 dh_need=16 
debug1: sending SSH2_MSG_KEX_ECDH_INIT 
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY 
debug1: Server host key: ECDSA f8:88:10:d1:91:bd:42:ec:d1:04:e5:00:c6:ab:11:e9 
debug3: load_hostkeys: loading entries for host "134.168.6.95" from file "/home/idcware/.ssh/known_hosts" 
debug3: load_hostkeys: found key type ECDSA in file /home/idcware/.ssh/known_hosts:3 
debug3: load_hostkeys: loaded 1 keys 
debug1: Host '134.168.6.95' is known and matches the ECDSA host key. 
debug1: Found key in /home/idcware/.ssh/known_hosts:3 
debug1: ssh_ecdsa_verify: signature correct 
debug2: kex_derive_keys 
debug2: set_newkeys: mode 1 
debug1: SSH2_MSG_NEWKEYS sent 
debug1: expecting SSH2_MSG_NEWKEYS 
debug2: set_newkeys: mode 0 
debug1: SSH2_MSG_NEWKEYS received 
debug1: Roaming not allowed by server 
debug1: SSH2_MSG_SERVICE_REQUEST sent 
debug2: service_accept: ssh-userauth 
debug1: SSH2_MSG_SERVICE_ACCEPT received 
debug2: key: /home/idcware/.ssh/id_rsa (0x7fb6e3792fd0), 
debug2: key: /home/idcware/.ssh/id_dsa ((nil)), 
debug2: key: /home/idcware/.ssh/id_ecdsa ((nil)), 
debug2: key: /home/idcware/.ssh/id_ed25519 ((nil)), 
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password 
debug3: start over, passed a different list publickey,gssapi-keyex,gssapi-with-mic,password 
debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password 
debug3: authmethod_lookup gssapi-keyex 
debug3: remaining preferred: gssapi-with-mic,publickey,keyboard-interactive,password 
debug3: authmethod_is_enabled gssapi-keyex 
debug1: Next authentication method: gssapi-keyex 
debug1: No valid Key exchange context 
debug2: we did not send a packet, disable method 
debug3: authmethod_lookup gssapi-with-mic 
debug3: remaining preferred: publickey,keyboard-interactive,password 
debug3: authmethod_is_enabled gssapi-with-mic 
debug1: Next authentication method: gssapi-with-mic 
debug1: Unspecified GSS failure. Minor code may provide more information 
No Kerberos credentials available 
debug1: Unspecified GSS failure. Minor code may provide more information 
No Kerberos credentials available 
debug1: Unspecified GSS failure. Minor code may provide more information 
debug1: Unspecified GSS failure. Minor code may provide more information 
No Kerberos credentials available 
debug2: we did not send a packet, disable method 
debug3: authmethod_lookup publickey 
debug3: remaining preferred: keyboard-interactive,password 
debug3: authmethod_is_enabled publickey 
debug1: Next authentication method: publickey 
debug1: Offering RSA public key: /home/idcware/.ssh/id_rsa 
debug3: send_pubkey_test 
debug2: we sent a publickey packet, wait for reply 
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password 
debug1: Trying private key: /home/idcware/.ssh/id_dsa 
debug1: key_parse_private2: missing begin marker 
debug1: read PEM private key done: type RSA 
debug3: sign_and_send_pubkey: RSA 33:a3:84:5c:55:b4:4e:2d:c9:83:19:51:37:c6:5e:27 
debug2: we sent a publickey packet, wait for reply 
debug1: Authentication succeeded (publickey). 
Authenticated to 134.168.6.95 ([134.168.6.95]:22). 
debug1: channel 0: new [client-session] 
debug3: ssh_session2_open: channel_new: 0 
debug2: channel 0: send open 
debug1: Requesting [email protected] 
debug1: Entering interactive session. 
debug1: channel 0: free: client-session, nchannels 1 
debug3: channel 0: status: The following connections are open: 
    #0 client-session (t3 r-1 i0/0 o0/0 fd 4/5 cc -1) 
Connection to 134.168.6.95 closed by remote host. 
Connection to 134.168.6.95 closed. 
Transferred: sent 3756, received 2112 bytes, in 0.0 seconds 
Bytes per second: sent 278448.9, received 156571.9 
debug1: Exit status -1 

集裝箱日誌,我只有這consignation從bluemix網絡信息中心:

Dec 4 14:16:31 instance-0007a14f syslog-ng[11]: Log statistics; processed='src.internal(s_sys#1)=12', stamp='src.internal(s_sys#1)=1449234391', processed='destination(d_mlal)=0', processed='center(received)=12', processed='destination(d_spol)=0', processed='destination(d_mesg)=24', processed='destination(d_mail)=0', processed='destination(d_auth)=61', processed='destination(d_cron)=0', processed='destination(d_bv_info)=0', processed='center(queued)=85', processed='source(s_bv_syslog)=0', processed='src.none()=0', stamp='src.none()=0', processed='destination(d_bv_crit)=0', processed='global(payload_reallocs)=20', processed='global(sdata_updates)=0', processed='destination(d_bv_all)=0', processed='destination(d_bv_err)=0', processed='destination(d_boot)=0', processed='destination(d_kern)=0', processed='global(msg_clones)=0', processed='source(s_sys)=12', processed='destination(d_bv_process)=0' 
+0

1)連接詳細日誌可能會有所幫助。 2)來自容器的錯誤日誌應該有所幫助。 – Jakuje

+0

感謝您的回答,我提供了ssh詳細信息,但我不明白「錯誤日誌來自容器」的含義。我從容器中沒有日誌。我只有ICE cli來管理容器 –

+0

這看起來像是後自動化失敗。 'sshd'在普通的Linux上將錯誤記錄到'/ var/log/secure'或'/ var/log/auth.log'。這看起來像用戶沒有外殼,有一些錯誤的權限或類似 – Jakuje

回答

0

由於容器的作品,它是可到達,但您只能在Bluemix上訪問它,我建議您直接從Bluemix控制檯使用支持/幫助小組件打開支持請求,或發送電子郵件至[email protected]:這樣您將涉及IBM Containers支持團隊檢查並修復此問題。他們將能夠深入調查您的錯誤。

請提供組織和空間指導以及您使用的圖像的一些細節。

可以使用CF CLI獲取組織和空間的GUID(如果您尚未登錄):

cf org <orgname> --guid 
cf space <spacename> --guid 
+0

沒有理由,我會嘗試這一點,並在這裏發佈結果,當我知道更多。感謝您的回答 –

2

中使用的容器的一個原則是,容器不應該啓動多個進程,你的情況SSH並且無論容器在運行。 也有另一種方式與exec

Scince泊塢窗1.3訪問您的容器,你可以訪問乳寧容器:

docker exec COMMAND

在實踐中bluemix:

cf ic exec -it CONTAINER /bin/bash

這會以絕對路徑(/ bin/bash部分)啓動二進制bash,並以交互方式連接tty並保持連接打開(-i t部分)。

更多的相關信息:https://www.ng.bluemix.net/docs/containers/container_cli_reference_cfic.html#container_cli_reference_cfic__exec

相關問題