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. ArcGIS Enterprise 10.5.1 静默安装部署记录(Centos 7.2 minimal)- 6、总结

    安装小结 安装完成后,首先我们需要将Datastore托管给Server,再将Server托管给Portal以此来完成整个单机版Enterprise 部署流程.为了测试流程是否正确,我们可以采用上传一 ...

  2. 任务四:CSS定位和居中问题

    任务目标 实践HTML/CSS布局方式 深入了解position等CSS属性 任务描述 实现如 示例图(点击打开) 的效果 灰色元素水平垂直居中,有两个四分之一圆位于其左上角和右下角. 任务注意事项 ...

  3. python str、int、dict

    一.str print(dir(int))#['__add__', '__class__', '__contains__', '__delattr__', '__dir__', '__doc__', ...

  4. Id_Name

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

  5. 记录项目代码迁移后,UI测试框架的搭建(配置文件的修改、测试脚本试运行)

    前文:记录一次项目代码迁移过程 上文代码迁移的目的就是为了新增vue脚手架自带的UI测试框架,工具有了,就需要实践运行在项目中了(修改配置文件.编写测试脚本等). 一.单元测试 测试框架 karma ...

  6. 【Spring实战】—— 7 复杂集合类型的注入

    之前讲解了Spring的基本类型和bean引用的注入,接下来学习一下复杂集合类型的注入,例如:List.Set.Map等. 对于程序员来说,掌握多种语言是基本的技能. 我们这里做了一个小例子,程序员们 ...

  7. @Modules( ... ) 多个包路径问题

    如何支持多个包路径,modules不在同一个报名下 @Modules(scanPackage = true, packages = "cn.wizzer.modules, com.xxx.m ...

  8. vue.js--基础 事件结合双向数据绑定实现todolist 待办事项 已经完成 和进行中,键盘事件

    <template> <div id="app"> <h1>{{ msg }}</h1> <input type=" ...

  9. MariaDB修改端口号

    修改端口号 打开my.ini文件

  10. 远程桌面连接(连接服务器)报错Oracle修正

    解决方案: 开始——运行——gpedit.msc——计算机配置——管理模版——系统——凭据分配——加密oracle修正——易受攻击 ok