版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/li_haijiang/article/details/84834197
我的mac里iterm的ssh坏了,连谁都连不上
Unable to negotiate with x.x.x.x port 22: no matching key exchange found. Their offer diffie-hellman-group1-sha1
解决方案
这不是苹果的错,这是OpenSSH版本7。SHA1很弱,所以对它的支持已经被移除。这很好,但是我所有的客户Cisco防火墙/路由器/交换机可能都使用RSA/SHA1。所以在它们全部更新之前,我需要重新启用SHA1。
打开终端窗口,执行以下操作;
sudo nano /etc/ssh/ssh_config
ENTER YOUR PASSWORD
把这两行的注释打开
# MACs hmac-md5,hmac-sha1,[email protected],hmac-ripemd160
# Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc
然后粘贴下面的放在最后
HostkeyAlgorithms ssh-dss,ssh-rsa
KexAlgorithms +diffie-hellman-group1-sha1
像这样
不需要重启