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 感谢作者。
执行以下命令:
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
# /etc/init.d/sshd start
starting sshd: