Thursday, June 18, 2020

OpenSSH cannot be started: sshd: no hostkeys available -- exiting.

The error snapshot from /var/log/syslog:


From the line 7177, we notice an error saying that 'sshd: no hostkeys available -- exiting'

To fix such an error, the below steps are followed:
  1. To edit /etc/ssh/sshd_config, and configure the HostKey parameter as /etc/ssh/ssh_host_rsa_key:
  2. To generate the ssh key file ssh_host_rsa_key and store it under /etc/ssh:
  3. To start ssh daemon using systemctl:
  4. To check the ssh daemon status: