SSH_Unable to negotiate with 192.168.1.152 port 22: nomatching host host key type found. Their offer:ssh-dss


操作環境:Kali Linux 

終端遠程登錄ssh時,提示如下錯誤:

Unable to negotiate with 192.168.1.152 port 22: nomatching host host key type found. Their offer:ssh-dss

由提示得知,ssh不能遠程登錄的原因為:沒有找到相關的主機密鑰類型。

1、確實是主機密鑰類型不符合

2、不存在相關主機密鑰類型

 

生成ssh_key

ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key

重啟ssh之后遠程,問題依然存在

確認密鑰已存在......

網絡搜索中......

 

  指定主機key算法(最后解決方案):

1、命令中加參數

ssh -o HostKeyAlgorithms=+ssh-dss user@host

2、在~/.ssh目錄下添加config  

vi config

  在config中寫入以下code:

Host *
    HostKeyAlgorithms +ssh-dss

3、重啟ssh

service ssh restart

  

Login success !!!


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM