Tag Archives: SSH Connection closed by foreign host

Solve the problem of SSH Connection closed by foreign host

1. It is possible that the IP conflicts with others, just change the IP

2. There may also be file permissions. Change it:

cd /etc/ssh/ 
 chmod 600 ssh_host_* 
 chmod 644 *.pub

3. It may also be a firewall problem

/etc/init.d/iptables status     // Look at the firewall status first 
chkconfig iptables off        // Command to close

or:

#Stop firewall
systemctl stop firewalld.service

#Prohibit firewall startup
systemctl disable firewalld.service