问题
mac电脑升级后,执行ssh操作时报错,报错信息如下:
Unable to negotiate with xxxxxxx port xxxx: no matching host key type found. Their offer: ssh-rsa
fatal: 远程终端登录
原因
新版mac升级后,ssh-rsa算法和之前不兼容
解决
在~/.ssh/目录下新增config文件,并加入配置项让其支持ssh-rsa:
Host *
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa