You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register
Note!! Please register for a free account to access the full content and also to participate in Q&A in the community

SSH Login Reports Error “Could not load host key: /etc/ssh/ssh_host_dsa_key”

in Linux 1 comment

Applies To:

Oracle Cloud Infrastructure - Version N/A and later

Linux x86-64

Symptoms:

Below messages written into /var/log/secure log file frequently:

...
May 8 07:44:56 localhost sshd[50028]: error: Could not load host key: /etc/ssh/ssh_host_dsa_key
May 8 07:48:21 localhost sshd[61114]: error: Could not load host key: /etc/ssh/ssh_host_dsa_key
May 8 07:53:21 localhost sshd[92100]: error: Could not load host key: /etc/ssh/ssh_host_dsa_key
...

Cause:

SSH host key file referred in “/etc/ssh/sshd_config” file does not exist:

# /usr/sbin/sshd -T |grep hostkey
 Could not load host key: /etc/ssh/ssh_host_dsa_key 
 hostkeyagent none
 hostkeyalgorithms ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa,ssh-dss
 hostkey /etc/ssh/ssh_host_rsa_key
 hostkey /etc/ssh/ssh_host_dsa_key

 # ls -al /etc/ssh/ssh*key
 -rw-r----- 1 root ssh_keys 227 Mar 1 2022 /etc/ssh/ssh_host_ecdsa_key
 -rw-r----- 1 root ssh_keys 387 Mar 1 2022 /etc/ssh/ssh_host_ed25519_key
 -rw-r----- 1 root ssh_keys 1679 Mar 1 2022 /etc/ssh/ssh_host_rsa_key
Tagged:

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!