1. 程式人生 > >ssh連線報Connection closed by foreign host.

ssh連線報Connection closed by foreign host.

今天連線linux時居然連不上,報錯資訊是:

Connecting to 192.168.16.133:22...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.

Connection closed by foreign host.

Disconnected from remote host(hadoop3) at 10:56:11.

Type `help' to learn how to use Xshell prompt.

查了一下終於找到了解決辦法,只需要一些命令就可以了:
    cd /etc/ssh
    sudo chmod 644 ./*
    sudo chmod 600 ssh_host_dsa_key
    sudo chmod 600 ssh_host_rsa_key
    sudo chmod 755 .
    /etc/init.d/sshd restart
完成後在重新連線就行了。