• Could not read from remote repository.Please make sure you have the correct access rights.and the repository exists.


    Warning: Permanently added the RSA host key for IP address '192.30.252.131' to the list of known hosts.Permission denied (publickey).fatal: Could not read from remote repository.Please make sure you have the correct access rightsand the repository exists.

    出现这个问题是因为,没有在github账号添加SSH key

     解决方法如下

    在终端输入。

      1.首先,如果你没有ssh key的话,在ternimal下输入命令:ssh-keygen -t rsa -C "youremail@example.com", youremail@example.com改为自己的邮箱即可,途中会让你输入密码啥的,不需要管,一路回车即可,会生成你的ssh key。(如果重新生成的话会覆盖之前的ssh key。)

      

      2.然后再ternimal下执行命令:

      ssh -v git@github.com

      最后两句会出现:

      No more authentication methods to try.  

      Permission denied (publickey).

      3.这时候再在ternimal下输入:

      ssh-agent -s

      然后会提示类似的信息:

      SSH_AUTH_SOCK=/tmp/ssh-GTpABX1a05qH/agent.404; export SSH_AUTH_SOCK;  

      SSH_AGENT_PID=13144; export SSH_AGENT_PID;  

      echo Agent pid 13144;

      4.接着再输入:

      ssh-add ~/.ssh/id_rsa

      这时候应该会提示:

      Identity added: ...(这里是一些ssh key文件路径的信息)

      (注意)如果出现错误提示:

      Could not open a connection to your authentication agent.

      请执行命令:eval `ssh-agent -s`后继续执行命令 ssh-add ~/.ssh/id_rsa,这时候一般没问题啦。

      5.打开你刚刚生成的id_rsa.pub,将里面的内容复制,进入你的github账号,在settings下,SSH and GPG keys下new SSH key,title随便取一个名字,然后将id_rsa.pub里的内容复制到Key中,完成后Add SSH Key。

      6.最后一步,验证Key

      在ternimal下输入命令:

      ssh -T git@github.com

      提示:Hi xxx! You've successfully authenticated, but GitHub does not provide shell  access.

  • 相关阅读:
    MySQL数据丢失讨论
    分布式系统之Quorum (NRW)算法
    阿里巴巴-OS事业群-OS手机事业部-系统服务部门招聘Java开发工程师,有意者请进来
    EQueue
    ENode 2.0
    关于MySQL的在线扩容
    我收藏的技术知识图(每张都是大图)
    关于实现一个基于文件持久化的EventStore的核心构思
    Actor的原理
    OAuth 2.0 授权原理
  • 原文地址:https://www.cnblogs.com/liang715200/p/15087942.html
Copyright © 2020-2023  润新知