Host *
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedAlgorithms +ssh-rsa
如果出于某种原因,您必须使用RSA/SHA1(例如,服务器只接受RSA/SHA1,并且您无法更改),请将此片段添加到~/.ssh/config(我的文件路径是 /private/etc/ssh/ssh_config)
的顶部。
它在主机密钥和公钥中启用RSA/SHA1,应该可以解决这个问题和相关“未找到匹配的主机密钥类型”问题。
附上外网解答
Git SSH "permission denied" in macOS 13 Ventura - Super User