centos7下无法启动ssh服务

问题:

启动ssh服务时报如下错误:

job for sshd.service failed because the control process exited with error code. see systemctl status sshd.service and journalctl -xe for details

解决办法:

1、查看具体报错信息

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

查看应该和权限相关。

2、登录一台正常的机器查看/var/empty/sshd权限为711,而客户/var/empty/sshd 权限为777。

3、修改权限

chmod 711 /var/empty/sshd   #修改权限为711

相关教程推荐:centos教程