macOS ssh error: unable to negotiate with IP: no matching cipher
环境:macOS Mojava version 10.14
在更新了Mac OS以后用ssh push 代码到服务器出现了下面这个错误。
ssh error: unable to negotiate with IP: no matching cipher found.Their offer: aes256-cbc,aes192-cbc,aes128-cbc...
Unable to negotiate with XX.X.X.XXX port XX: no matching cipher found. Their offer: aes256-cbc,aes192-cbc,aes128-cbc
fatal: Could not read from remote repository.Please make sure you have the correct access rights
and the repository exists.
出现错误的原因是要连接的代码仓库服务端的ssh版本过低,客户端与服务端的 cipher 没有匹配上,我们需要在自己的客户端(升级OS后的Mac)重新启用老的 cipher ,这样就能重新建立起连接了。
具体步骤如下: 第一步:terminal 输入 sudo nano /etc/ssh/ssh_config
atcs-air:~ XXX$ sudo nano /etc/ssh/ssh_config
第二步:找到 Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc,删除这行前面的#号。
# Host *
#ForwardAgent no
#ForwardX11 no
#PasswordAuthentication yes
#HostbasedAuthentication no
#GSSAPIAuthentication no
#GSSAPIDelegateCredentials no
#BatchMode no
#CheckHostIP yes
#AddressFamily any
#ConnectTimeout 0
#StrictHostKeyChecking ask
#IdentityFile ~/.ssh/id_rsa
#IdentityFile ~/.ssh/id_dsa
#IdentityFile ~/.ssh/id_ecdsa
#IdentityFile ~/.ssh/id_ed25519
#Port 22
#Protocol 2
Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc
#MACs hmac-md5,hmac-sha1,umac-64@openssh.com
#EscapeChar ~
#Tunnel no
#TunnelDevice any:any
#PermitLocalCommand no
#VisualHostKey no
#ProxyCommand ssh -q -W %h:%p gateway.example.com
#RekeyLimit 1G 1hHost *
SendEnv LANG LC_*
第三步:保存 ssh_config 这个文件,退出。然后就可以和以前一样通过ssh连接代码仓库服务器了。
参考链接:
https://www.itechlounge.net/2...
【macOS ssh error: unable to negotiate with IP: no matching cipher】https://discussions.apple.com...
推荐阅读
- gitlab|gitlab 通过备份还原 admin/runner 500 Internal Server Error
- SSH|SSH 免密
- ssh生成公钥秘钥
- 解决SyntaxError:|解决SyntaxError: invalid syntax
- MagicaVoxel-0.99.6-macos-10.7|MagicaVoxel-0.99.6-macos-10.7 网盘下载
- 为Google|为Google Cloud配置深度学习环境(CUDA、cuDNN、Tensorflow2、VScode远程ssh等)
- 运维|如何限制IP 通过 SSH连接服务器
- 运维|Linux 禁止用户或 IP通过 SSH 登录
- 由Uncaught|由Uncaught TypeError: this.player.startMoveAt is not a function引申
- 打开Anaconda|打开Anaconda Navigator 时报错 error 5 拒绝访问