美文网首页
github ssh key 添加成功但是无法clone项目

github ssh key 添加成功但是无法clone项目

作者: wylb868 | 来源:发表于2020-11-06 15:05 被阅读0次

    $ ssh -T git@github.com
    测试连接成功,但是clone时出现

    git@github.com: Permission denied (publickey).
    fatal: Could not read from remote repository.
    Please make sure you have the correct access rights
    and the repository exists.

    $ ssh -Tv git@github.com
    测试连接github发现他用的是默认的id-rsa,而我添加的key是自己重新命名的xx-rsa

    出现这种情况我们可以在.ssh添加一个config文件写入

    Host github.com
    HostName github.com
    User 你的用户名
    IdentityFile 你的rsa秘钥地址
    IdentitiesOnly yes
    

    此时就可以成功clone了

    相关文章

      网友评论

          本文标题:github ssh key 添加成功但是无法clone项目

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