打印

[总结] sshd error: Could not load host key 解决方法

sshd error: Could not load host key 解决方法

ssh客户端上连接时可能会SSH连接被直接关闭,并提示”Connection closed by foreign host.“、“Connection closed by X.X.X.X”等类似的错误信息

通过console登陆后发现
引用:
Apr 25 11:28:06 vpser sshd[22960]: error: Could not load host key: /etc/ssh/ssh_host_rsa_key
Apr 25 11:28:10 vpser sshd[22962]: error: Could not load host key: /etc/ssh/ssh_host_dsa_key
Apr 25 11:28:13 vpser sshd[22963]: error: Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Apr 25 11:28:16 vpser sshd[22964]: error: Could not load host key: /etc/ssh/ssh_host_ecdsa_key
一般可能是主机密钥出现问题,一般重新生成一些就可以

Debian/Ubunt可以执行:
rm -r /etc/ssh/ssh*key
dpkg-reconfigure openssh-server


CentOS/Fedora/RHEL可以执行:
rm -r /etc/ssh/ssh*key
systemctl restart sshd

LNMP付费问题排查/LNMP技术支持/Paypal信用卡代付/代购VPS,域名,软件等 QQ 503228080 旺旺 lzhenbao
军哥淘宝店铺
QQ/旺旺仅提供代购及付费代维/问题解决等服务,其他不回复!LNMP相关问题请在本论坛发帖,提问前先搜索,按https://bbs.vpser.net/thread-2555-1-1.html 要求反馈问题!

TOP