当我尝试通过 ssh 连接到远程主机时,我收到以下错误消息:
root@cloudstack-server-1:~/.ssh# ssh ubuntu@172.17.4.17 -v
OpenSSH_5.9p1 Debian-5ubuntu1.1, OpenSSL 1.0.1 14 Mar 2012
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 172.17.4.17 [172.17.4.17] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/id_rsa type 1
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-1024
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-1024
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: identity file /root/.ssh/id_dsa type 2
debug1: Checking blacklist file /usr/share/ssh/blacklist.DSA-1024
debug1: Checking blacklist file /etc/ssh/blacklist.DSA-1024
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: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1.1
debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1.1 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1.1
debug1: SSH2_MSG_KEXINIT sent
Read from socket failed: Connection reset by peer
Run Code Online (Sandbox Code Playgroud)
顺便说一句,我在本地主机中生成了一个密钥对 id_rsa/id_rsa.pub 并将 id_rsa.pub 粘贴到远程主机的文件中authorized_keys。我还在远程主机中启用密码登录。现在,我不知道错误消息 - Read from socket failed: Connection reset by peer。请给我一些建议。
这几乎可以肯定是服务器端的权限问题。假设您有其他方式连接到它(我不知道您是如何将公钥粘贴到它们中的),请检查sshd日志文件(/var/log/auth.log但取决于您的配置文件)。
日志应该为您指明正确的方向,但特别是您应该将~ubuntu/.ssh服务器上的权限设置为700with owner ubuntu。它也可能是~ubuntu/.ssh. 或者/etc/ssh那里的文件(这意味着服务器上的其他帐户应该有相同的 ssh 登录问题)。
| 归档时间: |
|
| 查看次数: |
45999 次 |
| 最近记录: |