# 如果出现如下内容,说明没有开启成功,需要生成相应的密钥 $ sudo /etc/init.d/ssh restart 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 * Restarting 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
# 查看/etc/ssh目录下文件名,发现真的确实相应的密钥 $ ls -l /etc/ssh total 552 -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 Mar 5 00:01 ssh_import_id -rw-r--r-- 1 root root 3261 Jul 24 16:57 sshd_config