我在远程盒子上运行Ubuntu 10.10.我每天都没有问题,但今天突然出现,我得到以下错误:
ssh_exchange_identification:远程主机关闭连接
如果我用-vv连接,我得到以下内容:
OpenSSH_5.6p1,OpenSSL 0.9.8r 8 Feb 2011 debug1: Reading configuration data /Users/bla/.ssh/config debug1: Applying options for ubuntu-server debug1: Reading configuration data /etc/ssh_config debug1: Applying options for * debug2: ssh_connect: needpriv 0 debug1: Connecting to ubuntu-server.com [123.123.123.123] port 22. debug1: Connection established. debug2: key_type_from_name: unknown key type '-----BEGIN' debug2: key_type_from_name: unknown key type '-----END' debug1: identity file /Users/bla/.ssh/id_rsa type -1 debug1: identity file /Users/bla/.ssh/id_rsa-cert type -1 ssh_exchange_identification: Connection closed by remote host
如果我删除密钥,我得到完全相同的输出(没有“debug2:key_type _…).我已设法物理登录并检查我的hosts.allow和hosts.deny但他们没有条目.我试图删除并重新安装OpenSSH,检查authorized_keys和〜/ .ssh权限,并尝试从其他计算机连接只是为了得到相同的错误.我在我的智慧结束,任何帮助将不胜感激.
同样的错误
原文链接:https://www.f2er.com/ubuntu/348693.htmlssh_exchange_identification: Connection closed by remote host
例如,如果有任何私钥
> ssh_host_key
> ssh_host_dsa_key
> ssh_host_rsa_key
在/ etc / ssh /中是chmod 644(应该是chmod 600).
以下权限导致“ssh_exchange_identification:远程主机关闭连接”错误:
root@host:/etc/config/ssh# ls -la drwxrwxrwx 2 root root 0 Aug 24 2005 . drw-rw-rw- 3 root root 0 Apr 3 2007 .. -rw-r--r-- 1 root root 88039 Aug 24 2005 moduli -rw-r--r-- 1 root root 1559 Aug 24 2005 ssh_config -rw-r--r-- 1 root root 668 Aug 24 2005 ssh_host_dsa_key -rw-r--r-- 1 root root 599 Aug 24 2005 ssh_host_dsa_key.pub -rw-r--r-- 1 root root 524 Aug 24 2005 ssh_host_key -rw-r--r-- 1 root root 328 Aug 24 2005 ssh_host_key.pub -rw-r--r-- 1 root root 883 Aug 24 2005 ssh_host_rsa_key -rw-r--r-- 1 root root 219 Aug 24 2005 ssh_host_rsa_key.pub -rw-r--r-- 1 root root 2018 Aug 25 2005 sshd_config
现在应该接受更正的权限,连接:
root@host:/etc/config/ssh# ls -la drwxrwxrwx 2 root root 0 Aug 24 2005 . drw-rw-rw- 3 root root 0 Apr 3 2007 .. -rw-r--r-- 1 root root 88039 Aug 24 2005 moduli -rw-r--r-- 1 root root 1559 Aug 24 2005 ssh_config -rw------- 1 root root 668 Aug 24 2005 ssh_host_dsa_key -rw-r--r-- 1 root root 599 Aug 24 2005 ssh_host_dsa_key.pub -rw------- 1 root root 524 Aug 24 2005 ssh_host_key -rw-r--r-- 1 root root 328 Aug 24 2005 ssh_host_key.pub -rw------- 1 root root 883 Aug 24 2005 ssh_host_rsa_key -rw-r--r-- 1 root root 219 Aug 24 2005 ssh_host_rsa_key.pub -rw-r--r-- 1 root root 2018 Aug 25 2005 sshd_config