Xshle連接SSH報(bào)錯(cuò)Read from socket failed: Connection reset by peer 或者 Connection closed by foreign host
Posted on 2013-08-22 10:26 H2O 閱讀(4639) 評(píng)論(0) 編輯 收藏xshell鏈接報(bào):Read from socket failed: Connection reset by peer 或者 Connection closed by foreign host.錯(cuò)誤解決辦法:
該問題出現(xiàn)的原因是/etc/ssh目錄下的文件的熟悉被修改了,從新修改回原始狀態(tài)即可:
cd /etc/ssh
sudo chmod 644 ./*
sudo chmod 600 ssh_host_dsa_key
sudo chmod 600 ssh_host_rsa_key
sudo chmod 755
原來是權(quán)限問題啊 其實(shí)可以偷懶點(diǎn) 直接對(duì)整個(gè)目錄賦予權(quán)限 chmod -R 755 /etc/ssh
參考了原文http://blog.csdn.net/cywosp/article/details/7920174 感謝作者。
執(zhí)行以下命令:
# /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: