Xshle連接SSH報錯Read from socket failed: Connection reset by peer 或者 Connection closed by foreign host
Posted on 2013-08-22 10:26 H2O 閱讀(4634) 評論(0) 編輯 收藏xshell鏈接報:Read from socket failed: Connection reset by peer 或者 Connection closed by foreign host.錯誤解決辦法:
該問題出現的原因是/etc/ssh目錄下的文件的熟悉被修改了,從新修改回原始狀態即可:
cd /etc/ssh
sudo chmod 644 ./*
sudo chmod 600 ssh_host_dsa_key
sudo chmod 600 ssh_host_rsa_key
sudo chmod 755
原來是權限問題啊 其實可以偷懶點 直接對整個目錄賦予權限 chmod -R 755 /etc/ssh
參考了原文http://blog.csdn.net/cywosp/article/details/7920174 感謝作者。
執行以下命令:
# /etc/init.d/sshd start
starting sshd:
cd /etc/ssh
# chmod 0644 *
# chmod 0600 /etc/ssh/ssh_host_dsa_key
chmod 0600 /etc/ssh/ssh_host_key
chmod 0600 /etc/ssh/ssh_host_rsa_key
chmod -R 777 /etc/ssh
# chmod 0644 *
# chmod 0600 /etc/ssh/ssh_host_dsa_key
chmod 0600 /etc/ssh/ssh_host_key
chmod 0600 /etc/ssh/ssh_host_rsa_key
chmod -R 777 /etc/ssh
# /etc/init.d/sshd start
starting sshd: