美文网首页
git SSH操作

git SSH操作

作者: SeanLink | 来源:发表于2023-04-05 10:06 被阅读0次

    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

    相关文章

      网友评论

          本文标题:git SSH操作

          本文链接:https://www.haomeiwen.com/subject/aeswcdtx.html