zoukankan      html  css  js  c++  java
  • 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.

  • 相关阅读:
    (转)viso 形状搜索 无法使用 的解决办法
    Visio 2003 直线需要相交时的设置方法
    C# Serialport执行close()方法时,程序卡死的解决办法
    RabbitMQ核心技术总结
    kafka核心原理总结
    hadoop的价值在哪里
    从程序员小仙飞升上神,java技术开发要如何实现?
    明年大数据行业的趋势会是哪些?
    2016年末程序员应该知道的基本架构思想
    2016年末程序员突破自我的绝密方法分享
  • 原文地址:https://www.cnblogs.com/liang715200/p/15087942.html
Copyright © 2011-2022 走看看