SSH_Unable to negotiate with 192.168.1.152 port 22: nomatching host host key type found. Their offer:ssh-dss
阿新 • • 發佈:2018-11-18
終端 iat 參數 tar type ssh-key 寫入 linux inux
操作環境: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 !!!
SSH_Unable to negotiate with 192.168.1.152 port 22: nomatching host host key type found. Their offer:ssh-dss