Could not load host key: /etc/ssh/ssh_host_rsaxxx

发布时间 2023-10-30 10:31:24作者: 独上兰舟1

/usr/sbin/sshd

错误提示:

Could not  load host key: /etc/ssh/ssh_host_rsa_key

Could not  load host key: /etc/ssh/ssh_host_ecdsa_key

Could not  load host key: /etc/ssh/ssh_host_ed25519_key

sshd: no hostkeys available  -- exiting.

 

解决方法:

  1.  
    ssh-keygen -q -t rsa -b 2048 -f /etc/ssh/ssh_host_rsa_key -N ''
  2.  
    ssh-keygen -q -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -N ''
  3.  
    ssh-keygen -t dsa -f /etc/ssh/ssh_host_ed25519_key -N ''

再执行

/usr/sbin/sshd