RHEL7 Connection closed by foreign host.
今天連接linux時居然連不上,報錯信息是:
Connecting to 10.10.10.116:22...
Connection established.
To escape to local shell, press ‘Ctrl+Alt+]‘.
Connection closed by foreign host.
Type `help‘ to learn how to use Xshell prompt.
[C:\Users\huazhixu]$
查了一下終於找到了解決辦法,只需要一些命令就可以了:
[[email protected] network-scripts]# cd /etc/ssh
[[email protected] ssh]# ll
總用量 268
-rwxrwxr-x. 1 root root 242153 3月 20 2014 moduli
-rwxrwxr-x. 1 root root 2123 3月 20 2014 ssh_config
-rwxrwxr-x. 1 root root 4432 10月 11 15:56 sshd_config
-rwxrwxr-x. 1 root ssh_keys 227 10月 11 13:10 ssh_host_ecdsa_key
-rwxrwxr-x. 1 root root 162 10月 11 13:10 ssh_host_ecdsa_key.pub
-rwxrwxr-x. 1 root ssh_keys 1679 10月 11 13:10 ssh_host_rsa_key
-rwxrwxr-x. 1 root root 382 10月 11 13:10 ssh_host_rsa_key.pub
[[email protected] ssh]# chmod 644 ./*
[[email protected] ssh]# chmod 600 ssh_host_rsa_key
[[email protected] ssh]# chmod 755 .
[[email protected] ssh]# systemctl restart sshd.service
[[email protected] ssh]#
完成後在重新連接就行了。
本文出自 “花之旭的博客” 博客,請務必保留此出處http://huazhixu123.blog.51cto.com/1591874/1971465
RHEL7 Connection closed by foreign host.