當我把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.
發(fā)現(xiàn)牛逼的google已經(jīng)把sha1攻下了毛萌,sha1已經(jīng)不安全了苟弛,google建議使用ssh-256.here
解決:
vim /etc/ssh/ssh_config
添加
HostkeyAlgorithms ssh-dss,ssh-rsa
KexAlgorithms diffie-hellman-group1-sha1
到文件末尾
這樣就好了。