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]$ 

查了一下终于找到了解决办法,只需要一些命令就可以了:

[root@db1 network-scripts]# cd /etc/ssh

[root@db1 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

[root@db1 ssh]# chmod 644 ./*

[root@db1 ssh]# chmod 600 ssh_host_rsa_key

[root@db1 ssh]# chmod 755 .

[root@db1 ssh]# systemctl restart sshd.service

[root@db1 ssh]#

完成后在重新连接就行了。