How to Fix SSH Not Starting on Linux — “/var/empty/sshd must be” Error

      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 status
The following prompt appeared:
sshd is stopped
 
Starting the service manually revealed a permissions error.
 
# service sshd start
Starting 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 start
Starting sshd: [ OK ]
 
The issue is now fixed.
Alternatively, you can try the following two steps to resolve it:
 
chown -R root.root /var/empty/sshd
chmod 744 /var/empty/sshd
service sshd restart
 
This should basically fix the problem described above.

Leave a Comment

Your email address will not be published.