由于/var/lib目录权限导致SSH不能用
上午一同事说一台服务器SSH登录不了了。
一开始以为是ssh服务没启动,执行service sshd status.
linux-34:/var/lib # service sshd status Checking for service sshd running
显示是启动的,那就重启下,执行service sshd restart. 问题出来了,报错
linux-34:/var/lib # service sshd restart Shutting down SSH daemon done Starting SSH daemon/var/lib/empty must be owned by root and not group or world-writable. startproc: exit status of parent of /usr/sbin/sshd: 255
后来上网查了发现可能是文件权限设置问题。
linux-34:/var/lib # ls -ld /var/lib/empty drwxrwxrwx 2 root root 4096 Jun 16 2006 /var/lib/empty
于是将权限修改为755
chmod 755 /var/lib/empty
然后再重启下,这下重启成功了。
linux-34:/var/lib # service sshd restart Shutting down SSH daemon done Starting SSH daemon done linux-34:/var/lib # service sshd status Checking for service sshd running
最后用SecureCRT登录,OK,问题解决!