The SSHD service while restarting, looks for the “/var/empty/sshd/etc” directory which contains a symlink to the ‘localtime’ file. If the file doesn’t exist, it results in a “cannot create symbolic link `/var/empty/sshd/etc’: No such file or directory” error message.
The complete error message is as follows:
-bash-3.2# service sshd restart
cp: cannot create symbolic link `/var/empty/sshd/etc':
No such file or directory
Starting sshd: Missing privilege separation: /var/empty/sshd [FAILED]
The solution is to create the “/var/empty/sshd/etc” directory and then create a symlink for localtime file.
# mkdir /var/empty/sshd/etc
# cd /var/empty/sshd/etc
# ln -s /etc/localtime localtime
Once done, you should be able to restart the sshd service.
January 6th, 2011 at 3:55 am
Thanks man,
But where does this problem come from? One day sshd was working, the other found this error.
Also, UsePAM was set to yes. I had to disable this in order to start sshd.
January 6th, 2011 at 11:04 am
It happens when the SSH package is updated, really shouldn’t be disturbing the previous configuration but it does it sometimes.
September 26th, 2011 at 2:46 pm
I know I’m very late with the comment but I found it just now and really can’t help it (and I know that that’s not the point). Anyway, you wrote:
“SSH to your server and execute:”
If sshd isn’t working, how do you propose to ssh to the server? 😛
September 27th, 2011 at 9:25 am
This issue does let you SSH in until you restart the SSHD service which fails (then you can’t ssh in) due to the issue mentioned in the post. And this solution is also helpful for those working on the host servers (which hosts vps’s) to fix such issues on VPS’s.