当我把mac升级到Sierra时,用git拉代码时报错:
Unable to negotiate with <ip> port <port>: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1
原因如下:
Because of the latest OpenSSH version, some older (legacy) encryption algorithm have been removed from the default and therefore removed by default.
发现牛逼的google已经把sha1攻下了,sha1已经不安全了,google建议使用ssh-256.here
解决:
vim /etc/ssh/ssh_config
添加
HostkeyAlgorithms ssh-dss,ssh-rsa
KexAlgorithms diffie-hellman-group1-sha1
到文件末尾
这样就好了。