OpenSSH: sshd won’t start !

Have a problem with sshd ? your sshd daemon won’t start ? oke gonna fix now !

when I run sshd, a message appears:

bash-4.1# sshd
sshd re-exec requires execution with an absolute path

Try this:

bash-4.1# whereis sshd
sshd: /usr/sbin/sshd /usr/man/man8/sshd.8.gz /usr/share/man/man8/sshd.8.gz /usr/X11/man/man8/sshd.8.gz

Your sshd path at “/usr/sbin/sshd”, so type:

bash-4.1# /usr/sbin/sshd 

if when running /usr/sbin/sshd appears a message like this:

bash-4.1# /usr/sbin/sshd 
Could not load host key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_dsa_key
Disabling protocol version 2. Could not load host key
sshd: no hostkeys available -- exiting.

The problem because the host key doesn’t exist, you must re-generate, do the following ways:

bash-4.1# ssh-keygen -b 1024 -f /etc/ssh/ssh_host_key -N ""
bash-4.1# ssh-keygen -f /etc/ssh/ssh_host_dsa_key -N  "" 
bash-4.1# ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N ""

NB: You must have root privileges to perform a step above

Good Luck 😀 !

This entry was posted in Linux, Networking. Bookmark the permalink.