合 Linux上的SSH无法启动,报错/var/empty/sshd must be owned by root and not group or world-writable
现象
首先通过物理终端进入到linux上,手工检查ssh发现没运行
1 2 | # /etc/init.d/sshd status sshd is stopped12 |
手工启动服务,发现报告权限错误。
1 2 | # /etc/init.d/sshd start Starting sshd:/var/empty/sshd must be owned by root and not group or world-writable. [FAILED]12 |
使用rpm -V 命令可检查到ssh的软件包正常,但某个目录的属主错误。
1 2 3 | # rpm -V openssh-server S.5..... c /etc/ssh/sshd_config .....U.. /var/empty/sshd123 |
经查看发现这个目录的属主不是root,所以启动ssh报错
1 2 | # ls -ld /var/empty/sshd/ d--x--x--x 2 vu00106 root 1024 Feb 2 2005 /var/empty/sshd/12 |
修改为root属主,启动成功
1 2 3 | # chown root /var/empty/sshd/ /etc/init.d/sshd start Starting sshd: [ OK ] |