Symptoms
Can't access your server through SSH and running sshd -T
returns the following:
/var/empty/sshd must be owned by root and not group or world-writable.
When performing a safe restart of SSH (https://10.10.10.10:2087/scripts2/doautofixer?autofix=safesshrestart), the output is the following:
Attempting to locate sshd binaries installed on the system ...
Located /usr/sbin/sshd
Done.
Killing existing sshd processes...
Done.
configuring sshd to run on port 22
Could not load host key: /etc/ssh/ssh_host_dsa_key
/var/empty/sshd must be owned by root and not group or world-writable.
failed to start /usr/sbin/sshd ...
Description
This occurs because either the permissions or ownership of the directory /var/empty/sshd
is incorrect such as the following:
[root@cpanel ~]# ls -lha /var/empty/sshd
total 0
drwxrwxr-x. 2 root root 6 Aug 9 11:40 .
drwxrwxr-x. 3 root root 18 Dec 23 19:52 ..
[root@cpanel ~]# namei -mo /var/empty/sshd
f: /var/empty/sshd
dr-xr-xr-x root root /
drwxr-xr-x root root var
drwxrwxr-x root root empty
drwxrwxr-x root root sshd
[root@cpanel ~]#
The permissions are incorrect in the example above.
Workaround
The ownership of /var/empty/sshd
needs to be root:root
. If you're unaware, how to change ownership of the directory, please read the following article: How to change ownership of a file or directory.
The permissions of /var/empty/sshd
needs to be 0711
. If you're unaware of how to change the directory's permissions, please read the following article: How do I change permissions on a file or folder?
Comments
0 comments
Article is closed for comments.