Host *
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedAlgorithms +ssh-rsa
If for some reason you must use RSA/SHA1 (for example, the server only accepts RSA/SHA1, and you can't change it), add this snippet to the top of the ~/.ssh/config(我的文件路径是 /private/etc/ssh/ssh_config)
.
It enables RSA/SHA1 in the host key and public key, which should fix this and the related "no matching host key type found" issue.
Attach the external network answer
Git SSH "permission denied" in macOS 13 Ventura - Super User