putty远程连接Red Hat Enterprise Linux 出现remote side unexpected closed network-connection错误
查看日志文件/val/log/secure
tail -F /var/log/secure
再次使用putty连接,发现错误fatal : No supported key exchange algorithm[preauth]
解决办法/n
使用root用户登录系统,切换目录到/etc/ssh,将所有带key的文件备份(防止出现错误)然后删除,再重启ssh服务
[root@localhost /]# cd /etc/ssh #切换目录到/etc/ssh
[root@localhost ssh]# ll #查看文件夹下的内容
总用量 280
-rw-r--r--. 1 root root 242153 9月 25 2015 moduli
-rw-r--r--. 1 root root 2208 9月 25 2015 ssh_config
-rw-------. 1 root root 4361 9月 25 2015 sshd_config
-rw-r-----. 1 root ssh_keys 227 5月 24 00:44 ssh_host_ecdsa_key
-rw-r--r--. 1 root root 162 5月 24 00:44 ssh_host_ecdsa_key.pub
-rw-r-----. 1 root ssh_keys 387 5月 24 00:44 ssh_host_ed25519_key
-rw-r--r--. 1 root root 82 5月 24 00:44 ssh_host_ed25519_key.pub
-rw-r-----. 1 root ssh_keys 1675 5月 24 00:44 ssh_host_rsa_key
-rw-r--r--. 1 root root 382 5月 24 00:44 ssh_host_rsa_key.pub
[root@localhost ssh]# mkdir ./backup #当前文件夹下创建一个空文件夹用来备份
[root@localhost ssh]# cp ./ssh_host_* ./backup #备份所有带key的文件
[root@localhost ssh]# rm -rf ./ssh_host_* #删除所有带key的文件
[root@localhost ssh]# service sshd restart #重启ssh服务
这时再使用putty即可登录成功