Unable to connect to a Linux server via SSH. When attempting to start or restart the SSH service, the following error appears:

Starting sshd: Missing privilege separation directory: /var/empty/sshd

This error appears when the SSH daemon (sshd) tries to start, but it can't find the required directory /var/empty/sshd.

That directory is used for a security feature called privilege separation, where part of the SSH process runs in a restricted (limited-privilege) environment before authentication is complete. This helps prevent exploits from gaining root access.

Follow these steps to resolve the issue from the console access of your VPS:

Step 1: Create the Required Directory

# sudo mkdir -p /var/empty/sshd/etc

Step 2: Navigate to the Directory

# cd /var/empty/sshd/etc

Step 3: Create a Symlink to localtime

# sudo ln -s /etc/localtime localtime

This symlink ensures that the chrooted SSHD environment has access to system timezone data.

Step 4: Restart the SSH Service

# sudo systemctl restart sshd
For older systems:
# sudo service sshd restart

Conclusion: 

You’ve successfully resolved the SSHD privilege separation error by creating the necessary directory structure and adding a symbolic link to the localtime file. Your SSH service should now start without issues.

Was this answer helpful? 15 Users Found This Useful (17 Votes)