两个错误
连接SSH,本地报错
ssh_exchange_identification: Connection closed by remote host
我用的阿里云,只能登陆阿里云,在控制台用网页连接服务器~~
排错:
1、查看sshd的状态, service sshd status
, 感觉不太对劲,重启一下,起不来。 用 journalctl -xe
查一下日志,发现以下报错:
/var/empty/sshd must be owned by root and not group or world-writable
这个意思是,/var/empty/sshd 必须是 所属 root
,并且不可写
。
2、这下好办了,如下
chmod -R 111 /var/empty/sshd
chown -R root:root /var/empty/sshd
3、解决。
4、ssh运行的权限管的很严,不要把什么文件都一股脑都设为 777。