Operating System - HP-UX
1834508 Members
2603 Online
110068 Solutions
New Discussion

ssh2: Unable to load hostkeys

 
Tonya Underwood
Regular Advisor

ssh2: Unable to load hostkeys

Apr 25 16:40:41 temp17 sshd2[27502]: FATAL ERROR: Unable to load any hostkeys
Apr 25 16:40:45 temp17 sshd2[27505]: FATAL ERROR: Unable to load any hostkeys
Apr 25 16:41:51 temp17 sshd2[27654]: FATAL ERROR: Unable to load any hostkeys
Apr 25 17:53:47 temp17 sshd2[652]: FATAL ERROR: Unable to load any hostkeys
Apr 25 23:27:22 temp17 sshd2[14322]: FATAL ERROR: Unable to load any hostkeys
Apr 26 07:01:26 temp17 sshd2[11901]: FATAL ERROR: Unable to load any hostkeys
Apr 26 07:01:26 temp17 sshd2[11904]: FATAL ERROR: Unable to load any hostkeys

Why am I having this issue?
3 REPLIES 3
Marco A.
Esteemed Contributor

Re: ssh2: Unable to load hostkeys

How is your ssh directory !!!?

#ls -al /etc/ssh
Just unplug and plug in again ....
Ralph Grothe
Honored Contributor

Re: ssh2: Unable to load hostkeys

Do they exists in the places where your sshd_config is telling they should be?

Check

# grep HostKey /opt/ssh/etc/sshd_config
# HostKey for protocol version 1
#HostKey /opt/ssh/etc/ssh_host_key
# HostKeys for protocol version 2
#HostKey /opt/ssh/etc/ssh_host_rsa_key
#HostKey /opt/ssh/etc/ssh_host_dsa_key


If the HostKey directives are commented
they are expected in these default place.

Also check if they have restricted perms like

# ll /opt/ssh/etc/ssh_host_{rsa,dsa}_key
-rw------- 1 root sys 672 Oct 1 2002 /opt/ssh/etc/ssh_host_dsa_key
-rw------- 1 root sys 883 Oct 1 2002 /opt/ssh/etc/ssh_host_rsa_key


If you cannot find any host keys then you must generate them as root.

e.g.

# for c in rsa dsa;do ssh-keygen -t $c -b 1024 -N "" -f /etc/opt/ssh/ssh_host_${c}_key; done

Then try starting sshd again

# /sbin/init.d/secsh start


Madness, thy name is system administration
Tonya Underwood
Regular Advisor

Re: ssh2: Unable to load hostkeys

I rebooted and that seemed to have fixed the issue although I'm not sure why.

Thanks!