sshd: no hostkeys available -- exiting.

 

1、问题, 在启动ssh服务是出现如下问题

 

 

2、解决方法

root@DESKTOP-1N42TVH:/home# ssh-keygen -A
ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519

 

3、测试

root@DESKTOP-1N42TVH:/home# service ssh start
 * Starting OpenBSD Secure Shell server sshd                                                                                                                                                [ OK ]
root@DESKTOP-1N42TVH:/home# /etc/init.d/ssh restart
 * Restarting OpenBSD Secure Shell server sshd                                                                                                                                              [ OK ]
root@DESKTOP-1N42TVH:/home# /etc/init.d/ssh status
 * sshd is running
root@DESKTOP-1N42TVH:/home# ps -e | grep sshd
 2494 ?        00:00:00 sshd

 

posted @ 2022-04-27 13:08  小鲨鱼2018  阅读(3761)  评论(0编辑  收藏  举报