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

/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

posted on 2023-10-30 10:21  独上兰舟1  阅读(36)  评论(0编辑  收藏  举报