1、出現突然連接不上並報Connection closed by foreign host
2、網上查了一下是ssh服務問題,也有可能是遠程服務器端出現問題
所以可以重啓一下遠程服務器
3、重啓ssh服務:
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/ssh restart