SSH failed to start on Linux. When trying to start sshd on the server, it threw an error with the following message:
/var/empty/sshd must be owned by root and not group or world-writable.
According to the prompt, it should be a permissions issue, so I checked the sshd status and permissions.
# /etc/init.d/sshd statusThe following prompt appeared:sshd is stopped
Starting the service manually revealed a permissions error.
# service sshd startStarting sshd:/var/empty/sshd must be owned by root and not group or world-writable.[FAILED]
Upon inspection, it was found that the owner of this directory was not root, which caused ssh to fail on startup.
# ls -ld /var/empty/sshd/d–x–x–x 2 vu00106 root 1024 Feb 2 2005 /var/empty/sshd/
Changed the owner to root, and it started successfully.
# chown root /var/empty/sshd/# /etc/init.d/sshd startStarting sshd: [ OK ]
The issue is now fixed.
Alternatively, you can try the following two steps to resolve it:
chown -R root.root /var/empty/sshdchmod 744 /var/empty/sshdservice sshd restart
This should basically fix the problem described above.