SSH远程LINUX时Connection refused

SSH远程LINUX时

ssh: connect to host 121.43.XXX.XXX port 22: Connection refused

查看了服务器端SSHD状态

#/etc/init.d/sshd status

为停止状态

然后使用启动命令

#/etc/init.d/sshd start

报错,错误信息:

/var/empty/sshd must be owned by root and not group or world-writable.

查看目录不为root所有

查看命令# ls -ld /var/empty/sshd/

权限问题,使用下列命令修复权限

chown -R root.root /var/empty/sshd

 

 

chmod 744 /var/empty/sshd

 

 

service sshd restart

chown -R root.root /var/empty/sshd

 

 

chmod 744 /var/empty/sshd

 

 

service sshd restart

chown -R root.root /var/empty/sshd

 

 

chmod 744 /var/empty/sshd

 

 

service sshd restart
chown -R root.root /var/empty/sshd   

chmod 744 /var/empty/sshd   

service sshd restart


---------------------

来源:CSDN
原文:https://blog.csdn.net/anan890624/article/details/52194647
 

你可能感兴趣的:(linux)