SSH登录失败常见问题


ssh 用户名@IP

Unable to negotiate with … port 22: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1

添加秘钥交换算法支持

ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 用户名@IP

Unable to negotiate with … port 22: no matching host key type found. Their offer: ssh-dss

报错是因为OpenSSH 7.0以后的版本不再支持ssh-dss (DSA)算法

ssh -oHostKeyAlgorithms=+ssh-dss 用户名@IP

Unable to negotiate with … port 22: no matching cipher found. Their offer: aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc

添加密码加密方法支持

ssh -v aes128-cbc 用户名@IP

ssh_dispatch_run_fatal: Connection to … port 22: Invalid key length

OpenSSH版本升级到了7.6之后,小于1024bits的RSA keys已经不被支持了。

参考链接:https://www.openssh.com/releasenotes.html

解决方法

重新生成了一个长度为2048bit的新ssh keypair,并将公钥添加到服务器端,就可以解决该问题。

这个Invalid key length的错误,只是ssh客户端的行为,如果不换key,而使用一个允许小于1024bit的ssh客户端,原有的key仍然是可以登陆服务器的。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM