今天ssh远程的时候发现无法远程,登录主机查看ssh服务状态,报错如下
去查看秘钥
发现文件大小为0,看起来是生成秘钥失败了才导致的故障,解决方法简单,删除原有的秘钥,重新生成秘钥就OK了
然后重启ssh服务,自动生成新的秘钥就可以了
或者也可以通过命令行重新生成相应秘钥
ssh-keygen -t ras -b 2048 -f /etc/ssh/ssh_root_rsa_key
ssh-keygen -t ecdsa -b 256 -f /etc/ssh/ssh_host_ecdsa_key
ssh-keygen -t ed25519 -b 256 -f /etc/ssh/ssh_host_ed25519_key
ssh报错:Could not load host key:/etc/ssh/ssh_host_rsa_key&ssh_host_ecdsa_key&ssh_host_ed25519_key
时间: 2024-08-09 22:02:13