[linux]ssh Connection closed by xxx port 22

环境
  • ubuntu 12.04
  • putty

putty 等ssh工具连不上服务器sshd。

C:\Users\zhengzekai>ssh -v [email protected]
OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
debug1: Connecting to 10.0.244.89 [10.0.244.89] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\zhengzekai/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\zhengzekai/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\zhengzekai/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\zhengzekai/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\zhengzekai/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\zhengzekai/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\zhengzekai/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\zhengzekai/.ssh/id_ed25519-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\zhengzekai/.ssh/id_xmss type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\zhengzekai/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_7.7
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1.10
debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1.10 pat OpenSSH_5* compat 0x0c000000
debug1: Authenticating to 10.0.244.89:22 as 'zekai'
debug1: SSH2_MSG_KEXINIT sent
Connection closed by 10.0.244.89 port 22

查看ls /etc/ssh/ 。文件权限全被制成 0777
解决方法:

sudo rm /etc/ssh/ssh_host_*
sudo dpkg-reconfigure openssh-server

你可能感兴趣的:(linux,linux,ssh)