SSH 报错 Could not load host key 的解决办法
一、问题现象 ubuntu 上启动 ssh 时,报错:
|
1 2 3 |
* Starting OpenBSD Secure Shell server 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 |
截图信息: 错误信息是说密钥不存在,查看目录确实是不存在:
|
1 2 3 4 5 6 7 8 |
root@maqianos:~# ll /etc/ssh/ total 552 drwxr-xr-x 1 root root 4096 May 21 22:41 ./ drwxr-xr-x 1 root root 4096 Sep 16 12:26 ../ -rw-r--r-- 1 root root 553122 Mar 4 2019 moduli -rw-r--r-- 1 root root 1580 Mar 4 2019 ssh_config -rw-r--r-- 1 root root 338 May 21 22:41 ssh_import_id -rw-r--r-- 1 root root 3262 May 21 22:41 sshd_config |
虽然有错误信息,但是从提示上看 ssh 服务是启动成功了,ps ... 阅读更多