我有两个正在运行的 Ubuntu 14.04 实例。我正在使用第三方服务,该服务使用其自己生成的密钥对通过 ssh 访问实例,并为我提供公钥。
我采取以下步骤来允许访问。
sudo adduser rjmetric
sudo mkdir /home/rjmetric/.ssh
sudo nano /home/rjmetric/.ssh/authorized_keys <<PASTE PUBLIC KEY>>
sudo chown -R rjmetric:rjmetric /home/rjmetric
sudo chmod -R 700 /home/rjmetric/.ssh
我第一次启动并连接时不记得做过除了上述命令之外的任何其他事情。
最近创建的第二个实例无法连接并给出错误
Connection closed by 54.88.76.97 [preauth]
除了将日志级别设置为 DEBUG3 之外,我没有更改任何一个实例的 sshd_config。
我已经验证了两个实例的防火墙访问规则完全相同。这是故障实例中的目录。
/家
这是尝试连接时 /var/log/auth.log 的输出。
Mar 7 21:18:07 ubuntu sshd[789]: debug3: fd 5 is not O_NONBLOCK
Mar 7 21:18:07 ubuntu sshd[789]: debug1: Forked child 1042.
Mar 7 21:18:07 ubuntu sshd[789]: debug3: send_rexec_state: entering fd = 8 config len 737
Mar 7 21:18:07 ubuntu sshd[789]: debug3: ssh_msg_send: type 0
Mar 7 21:18:07 ubuntu sshd[789]: debug3: send_rexec_state: done
Mar 7 21:18:07 ubuntu sshd[1042]: debug3: oom_adjust_restore
Mar 7 21:18:07 ubuntu sshd[1042]: Set /proc/self/oom_score_adj to 0
Mar 7 21:18:07 ubuntu sshd[1042]: debug1: rexec start in 5 out 5 newsock 5 pipe 7 sock 8
Mar 7 21:18:07 ubuntu sshd[1042]: debug1: inetd sockets after dupping: 3, 3
Mar 7 21:18:07 ubuntu sshd[1042]: Connection from 54.88.76.97 port 55652 on 10.10.1.69 port 22
Mar 7 21:18:07 ubuntu sshd[1042]: debug1: Client protocol version 2.0; client software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.6
Mar 7 21:18:07 ubuntu sshd[1042]: debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.6 pat OpenSSH_6.6.1* compat 0x04000000
Mar 7 21:18:07 ubuntu sshd[1042]: debug1: Enabling compatibility mode for protocol 2.0
Mar 7 21:18:07 ubuntu sshd[1042]: debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.6
Mar 7 21:18:07 ubuntu sshd[1042]: debug2: fd 3 setting O_NONBLOCK
Mar 7 21:18:07 ubuntu sshd[1042]: debug2: Network child is on pid 1043
Mar 7 21:18:07 ubuntu sshd[1042]: debug3: preauth child monitor started
Mar 7 21:18:07 ubuntu sshd[1042]: debug3: privsep user:group 104:65534 [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: debug1: permanently_set_uid: 104/65534 [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: debug1: list_hostkey_types: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: debug1: SSH2_MSG_KEXINIT sent [preauth]
Mar 7 21:18:07 ubuntu sshd[986]: debug1: server_input_channel_req: channel 0 request [email protected] reply 1
Mar 7 21:18:07 ubuntu sshd[986]: debug1: session_by_channel: session 0 channel 0
Mar 7 21:18:07 ubuntu sshd[986]: debug1: session_input_channel_req: session 0 req [email protected]
Mar 7 21:18:07 ubuntu sshd[986]: debug2: channel 0: rcvd adjust 8372
Mar 7 21:18:07 ubuntu sshd[1042]: debug1: SSH2_MSG_KEXINIT received [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: 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 [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: debug2: kex_parse_kexinit: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: 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] [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: 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] [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: 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 [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: 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 [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: debug2: kex_parse_kexinit: none,[email protected] [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: debug2: kex_parse_kexinit: none,[email protected] [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: debug2: kex_parse_kexinit: [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: debug2: kex_parse_kexinit: [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: debug2: kex_parse_kexinit: first_kex_follows 0 [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: debug2: kex_parse_kexinit: reserved 0 [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: 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 [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: 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 [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: 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] [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: 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] [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: 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 [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: 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 [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: debug2: kex_parse_kexinit: none,[email protected],zlib [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: debug2: kex_parse_kexinit: none,[email protected],zlib [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: debug2: kex_parse_kexinit: [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: debug2: kex_parse_kexinit: [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: debug2: kex_parse_kexinit: first_kex_follows 0 [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: debug2: kex_parse_kexinit: reserved 0 [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: debug2: mac_setup: setup [email protected] [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: debug1: kex: client->server aes128-ctr [email protected] none [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: debug2: mac_setup: setup [email protected] [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: debug1: kex: server->client aes128-ctr [email protected] none [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: debug1: expecting SSH2_MSG_KEX_ECDH_INIT [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: debug3: mm_key_sign entering [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: debug3: mm_request_send entering: type 6 [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: debug3: mm_request_receive entering
Mar 7 21:18:07 ubuntu sshd[1042]: debug3: monitor_read: checking request 6
Mar 7 21:18:07 ubuntu sshd[1042]: debug3: mm_answer_sign
Mar 7 21:18:07 ubuntu sshd[1042]: debug3: mm_answer_sign: signature 0x7f583d450730(99)
Mar 7 21:18:07 ubuntu sshd[1042]: debug3: mm_request_send entering: type 7
Mar 7 21:18:07 ubuntu sshd[1042]: debug2: monitor_read: 6 used once, disabling now
Mar 7 21:18:07 ubuntu sshd[1042]: debug3: mm_key_sign: waiting for MONITOR_ANS_SIGN [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: debug3: mm_request_receive_expect entering: type 7 [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: debug3: mm_request_receive entering [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: debug2: kex_derive_keys [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: debug2: set_newkeys: mode 1 [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: debug1: SSH2_MSG_NEWKEYS sent [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: debug1: expecting SSH2_MSG_NEWKEYS [preauth]
Mar 7 21:18:07 ubuntu sshd[986]: debug1: server_input_channel_req: channel 0 request [email protected] reply 1
Mar 7 21:18:07 ubuntu sshd[986]: debug1: session_by_channel: session 0 channel 0
Mar 7 21:18:07 ubuntu sshd[986]: debug1: session_input_channel_req: session 0 req [email protected]
Mar 7 21:18:07 ubuntu sshd[986]: debug2: channel 0: rcvd adjust 8216
Mar 7 21:18:07 ubuntu sshd[1042]: Connection closed by 54.88.76.97 [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: debug1: do_cleanup [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: debug3: PAM: sshpam_thread_cleanup entering [preauth]
Mar 7 21:18:07 ubuntu sshd[1042]: debug3: mm_request_receive entering
Mar 7 21:18:07 ubuntu sshd[1042]: debug1: do_cleanup
Mar 7 21:18:07 ubuntu sshd[1042]: debug3: PAM: sshpam_thread_cleanup entering
Mar 7 21:18:07 ubuntu sshd[1042]: debug1: Killing privsep child 1043
Mar 7 21:18:07 ubuntu sshd[1042]: debug1: audit_event: unhandled event 12
我没有看到任何记录表明存在问题或发生导致连接关闭的情况。
我还验证了我可以使用 Putty 和我自己生成的公钥/私钥以同一个用户身份从我的电脑进行连接。
如果有人能给我指明正确的方向,让我能够将这个该死的东西连接起来,我将不胜感激。