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