启动SSH服务提示Could not load host key: /etc/ssh/ssh_host_rsa_key...的解决方法
在使用服务器的过程中遇到启动了SSH服务也无法远程连接的问题,通过systemctl status sshd
查看提示Could not load host key: /etc/ssh/ssh_host_rsa_key...等一系列报错信息,在此记录一下解决方案。
Could not load host key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_dsa_key
Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Could not load host key: /etc/ssh/ssh_host_ed25519_key
需要重新生成主机密钥文件!
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key
ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key
重启SSH服务systemctl restart sshd
问题解决!