github clone "Permission denied (publickey). fatal: Could not read from remote repository."
 
LZ用git不久,第一次从github clone项目遇见一下问题
$ git clone git@github.com:xiaolongzuo/niubi-job.gitCloning into 'niubi-job'...Permission denied (publickey).fatal: Could not read from remote repository.
解决办法:
1.ssh -v git@github.com
   测试ssh连接是否成功,如LZ显示如下:
$ ssh -v git@github.com
OpenSSH_7.3p1, OpenSSL 1.0.2j 26 Sep 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to github.com [192.30.253.113] port 22.
debug1: Connection established.
debug1: identity file /c/Users/Administrator/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/Administrator/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/Administrator/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/Administrator/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/Administrator/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/Administrator/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/Administrator/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/Administrator/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.3
debug1: Remote protocol version 2.0, remote software version libssh-0.7.0
debug1: no match: libssh-0.7.0
debug1: Authenticating to github.com:22 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256@libssh.org
debug1: kex: host key algorithm: ssh-rsa
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ssh-rsa SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8
debug1: Host 'github.com' is known and matches the RSA host key.
debug1: Found key in /c/Users/Administrator/.ssh/known_hosts:1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /c/Users/Administrator/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key: /c/Users/Administrator/.ssh/id_dsa
debug1: Trying private key: /c/Users/Administrator/.ssh/id_ecdsa
debug1: Trying private key: /c/Users/Administrator/.ssh/id_ed25519
debug1: No more authentication methods to try.
Permission denied (publickey).
 
2. ssh-agent -s
     
$ 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;
 
 
3. ssh-add ~/.ssh/id_rsa
    
$ ssh-add ~/.ssh/id_rsa
Could not open a connection to your authentication agent.
 LZ这一步报错了,继续执行:eval `ssh-agent -s`
 无错请忽略以下步骤
$ eval `ssh-agent -s`
Agent pid 24460
   再次执行ssh-add ~/.ssh/id_rsa
$ ssh-add ~/.ssh/id_rsa
Identity added: /c/Users/Administrator/.ssh/id_rsa (/c/Users/Administrator/.ssh/id_rsa)
 
 
4.将客户端生成的key添加到github账户
 
   首先使用 clip < ~/.ssh/id_rsa.pub  或者文本编辑拷贝id_rsa.pub文本内容
    到github右上角账户管理-Setting下面找到左侧“SSH and
GPG keys”菜单,接着点击“Add SSH key”,在"title"栏输入一个自己喜欢的标题,“key”栏中粘贴刚刚复制的公钥内容,最后点击“Add key”按钮。
 
5.最后一步,验证key
$ ssh -T git@github.com
Hi JsonJu! You've successfully authenticated, but GitHub does not provide shell  access.
 
接下来就可以愉快的去clone github上优秀的项目了。

git克隆出错 github clone Permission denied (publickey) fatal Could not read from remote repo的更多相关文章

  1. github下载报错:Permission denied (publickey). fatal: Could not read from remote repository.

    Permission denied (publickey). fatal: Could not read from remote repository. 博主在github上下载tiny face的的 ...

  2. github Permission denied (publickey). fatal: Could not read from remote repository.

    github Permission denied (publickey).fatal: Could not read from remote repository. ----------------- ...

  3. 【git基础】Permission denied (publickey). fatal: Could not read from remote repository

    运行以下git命令的时候出现错误 git push -u origin master error The authenticity of host 'github.com (13.250.177.22 ...

  4. Permission denied (publickey). fatal: Could not read from remote repository.

    博主在github上下载tiny face的的源代码的时候,遇到git clone命令为:git clone --recursive git@github.com:peiyunh/tiny.git 而 ...

  5. Warning: Permanently added the RSA host key for IP address '192.30.253.113' to the list of known hosts. Permission denied (publickey). fatal: Could not read from remote repository. Please make sure y

    这个应该是很多github新手经常出错的问题,这个就是没有在你github上添加一个公钥. 下面就直接说步骤: 1 可以用 ssh -T git@github.com去测试一下 图上可以明显看出缺少了 ...

  6. Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights

    第一次提交遇到这样的情况,怎么回事呢,我在github上提交了ssh key 的啊. 排查先看看能不能解析, 1.先 ping https://github.com 把ip添加到 host :    ...

  7. 使用Git出现以下错误"Git@github.com: Permission denied (publickey). Could not read from remote repository."解决方案

    转载于:https://blog.csdn.net/dotphoenix/article/details/100130424 git@github.com: Permission denied (pu ...

  8. Git push提交时报错Permission denied(publickey)...Please make sure you have the correct access rights and the repository exists.

    一.git push origin master 时出错 错误信息为: Permission denied(publickey). fatal: Could not read from remote ...

  9. SSH方式登录github出现Permission denied (publickey)

    今天在公司上传了代码,回到家pull,结果竟然出现了“Permission denied (publickey)“这种东西.第一反应是key不对,可是上次明明用key登录过,不可能不对啊,难道是文件被 ...

随机推荐

  1. libcurl 中使用curl_multi_perform()函数执行订阅类型url的问题

    前提概要 当需要同时处理多个url时,可采用curl_multi_perform方式执行,如下代码1: //初始化一个multi curl 对象 CURLM * curl_m = curl_multi ...

  2. mac 上配置 maven

    1. 将maven压缩包解压至/Users/suqiuhui/Applications目录下的新建文件夹dev下 2. 打开终端(系统根目录,~/下) 3. 如果没有 .bash_profile 文件 ...

  3. ASP.NET MVC4 with MySQL: Configuration Error (MySql.Web.v20)

    今天在浏览ASP.NET项目时,提示如下错误: Could not load file or assembly ‘MySql.Web.v20, Version=6.9.4.0, Culture=neu ...

  4. Id_Name

    <bean name="u" class="com.bjsxt.dao.impl.UserDAOImpl"></bean> <be ...

  5. hadoop使用

    hadoop@ubuntu:~$ cd hadoop-2.0.5-alpha/ hadoop@ubuntu:~/hadoop-2.0.5-alpha$ ls hadoop@ubuntu:~/hadoo ...

  6. 【Leetcode】【Easy】Climbing Stairs

    You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb ...

  7. Scrapy研究探索(三)——Scrapy核心架构与代码执行分析

    学习曲线总是这样,简单样例"浅尝".在从理论+实践慢慢攻破.理论永远是基础,切记"勿在浮沙筑高台". 一. 核心架构 关于核心架构.在官方文档中阐述的非常清晰, ...

  8. Uva 11396 爪分解

    题目链接:https://vjudge.net/contest/166461#problem/A 题意: 给定一个图,特点是每个点的度都是3,求是不是原图可以分解为全部鸡爪:每条边只属于一个鸡爪: 分 ...

  9. 【Elasticsearch】搜索小记之 match VS match_phrase

    最近稍微研究了一下ElasticSearch(下文简称ES),所谓可扩展的开源弹性搜索解决方案,跟同事笑称,如果它作为SQL SERVER的话,我的了解还在基本的select语句上,当然学习它也是一个 ...

  10. SpringBoot Docs

    http://docs.spring.io/spring-boot/docs/1.2.3.RELEASE/reference/html/boot-features-external-config.ht ...