git SSH操作

2023-04-05  本文已影响0人  SeanLink

Unable to negotiate with xxx.xxx.xxx.xxx port 8080: no matching host key type found. Their offer: ssh-rsa
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

出现这个报错一般都是需要配置一下host和加密方式
具体配置如下:

Host xxxxxx
HostName xxxx
User  xxxx
Port xxx 
IdentityFile ~/.ssh/id_rsa   
HostKeyAlgorithms ssh-rsa
PubkeyAcceptedKeyTypes ssh-rsa

这个配置可以多个端口配置
也可以只配置 host *

MAC升级到 macOS Ventura后也会报这个错误
需要 touch一个config文件在~/.ssh目录下

cd ~/.ssh
touch config

然后进入目录,复制以下内容到文件中


git SSH 常规操作文档:
https://gitcode.net/gitcode/help-docs/-/wikis/docs/ssh#common-steps-for-generating-an-ssh-key-pair

上一篇下一篇

猜你喜欢

热点阅读