![无法从远程服务器连接 SSH](https://linux22.com/image/756323/%E6%97%A0%E6%B3%95%E4%BB%8E%E8%BF%9C%E7%A8%8B%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%BF%9E%E6%8E%A5%20SSH.png)
我无法通过 SSH 从云服务器连接 sFTP。我使用代理进行连接并允许 IP 地址。当我使用相同的代理从本地服务器连接时,连接成功。这只在我尝试从 Heroku 服务器(基于 AWS 构建)连接时才出现问题。我的日志服务器似乎没什么用。
这是来自云服务器的连接失败关闭连接的地方(使用代理)
debug1: PAM: setting PAM_TTY to "ssh"
debug2: monitor_read: 100 used once, disabling now
debug3: mm_inform_authserv entering [preauth]
debug3: mm_request_send entering: type 4 [preauth]
debug2: input_userauth_request: try method none [preauth]
debug3: userauth_finish: failure partial=0 next methods="publickey" [preauth]
debug3: mm_request_receive entering
debug3: monitor_read: checking request 4
debug3: mm_answer_authserv: service=ssh-connection, style=, role=
debug2: monitor_read: 4 used once, disabling now
sshd[1496]: Connection closed by 11.111.11.108 [preauth]
debug1: do_cleanup [preauth]
debug3: PAM: sshpam_thread_cleanup entering [preauth]
debug1: monitor_read_log: child log fd closed
debug3: mm_request_receive entering
debug1: do_cleanup
debug1: PAM: cleanup
debug3: PAM: sshpam_thread_cleanup entering
debug1: Killing privsep child 1497
debug2: channel 0: rcvd adjust 49545
这是从我的本地服务器成功建立的连接,与不成功的连接关闭的同一点(使用相同的代理)
1: PAM: setting PAM_TTY to "ssh"
2: monitor_read: 100 used once, disabling now
3: mm_inform_authserv entering [preauth]
3: mm_request_send entering: type 4 [preauth]
2: input_userauth_request: try method none [preauth]
3: userauth_finish: failure partial=0 next methods="publickey" [preauth]
3: mm_request_receive entering
3: monitor_read: checking request 4
3: mm_answer_authserv: service=ssh-connection, style=, role=
2: monitor_read: 4 used once, disabling now
1: userauth-request for user dev service ssh-connection method publickey [preauth]
1: attempt 1 failures 0 [preauth]
2: input_userauth_request: try method publickey [preauth]
1: test whether pkalg/pkblob are acceptable [preauth]
3: mm_key_allowed entering [preauth]
3: mm_request_send entering: type 22 [preauth]
3: mm_key_allowed: waiting for MONITOR_ANS_KEYALLOWED [preauth]
3: mm_request_receive_expect entering: type 23 [preauth]
3: mm_request_receive entering [preauth]
3: mm_request_receive entering
3: monitor_read: checking request 22
3: mm_answer_keyallowed entering
这两次连接尝试都是相同的(相同的代理、相同的用户、相同的密钥)。我现在真的很困惑,有人知道我该怎么做才能解决这个问题吗?
答案1
确保:远程计算机的 IP 地址正确。SSH 守护程序正在监听的端口未被防火墙阻止或错误转发。您的用户名和密码正确