VPS侦探论坛

 找回密码
 注册
查看: 5247|回复: 0

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

[复制链接]
发表于 2016-4-25 11:57:59 | 显示全部楼层 |阅读模式

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
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-5-19 02:34 , Processed in 0.025562 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表