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 :    sudo vi /etc/hosts  (添加下面第三行)

127.0.0.1  localhost  localhost.localdomain  VM-0-6-ubuntu
127.0.1.1       TENCENT
192.30.255.113  github.com # 添加ip

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
192.30.255.113 github.com
~                         

2.如果不行的话看看自己有没有输入错误的创库地址

查看配置

cat .git/config

[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
[remote "origin"]
        url = [email protected]:cuzz1/flask.git   # 错误的
        url = [email protected]:cuzz1/flask.git
        fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
        remote = origin
        merge = refs/heads/master

3. 现在提交还出现

那就是github 上的ssh key 添加错了,我们用ssh-keygen -t rsa -C "[email protected]" 会生成在很多目录下,比如root/.ssh、 /home/ubuntu/.ssh 都有ras_id.pub

所以我们不能添加错了。必须在 ~/.ssh目录下  才有用,要是当前目录,把  ~/.ssh/ras_id.pub 拷到github上就可以了。

现在提交就可以了。

感谢军哥的帮忙 ,微信公众号 Python之禅

原文地址:https://www.cnblogs.com/cuzz/p/8214712.html

时间: 2024-10-05 06:52:21

Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights的相关文章

【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.223)' can't be established. RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8. Are you sure you want to continue connecting (yes

git pull 出错 fatal: 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 rights and the repositor

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

安装了TortoiseGit之后,Eclipse能够克隆提交操作,但是通过文件夹的方式clone却总是报Permission denied (publickey)错误 ,网上找各种资料都没有解决. 报错信息如下图: 后面发现TortoiseGit Git clone时 "Load Putty Key"为灰色,并且里面的内容也是空的.(当时load Putty Key复选框也是灰色的) 也就怀疑可能是这个原因导致 Permission denied (publickey)错误,通过网上查

git克隆出错 github clone Permission denied (publickey) fatal Could not read from remote repo

原文网址:http://blog.csdn.net/feeling450/article/details/53067563 github clone "Permission denied (publickey). fatal: Could not read from remote repository." LZ用git不久,第一次从github clone项目遇见一下问题 $ git clone [email protected]:xiaolongzuo/niubi-job.gitCl

My solution for Git Client Error: Permission denied (publickey)

在使用Git客户端的过程中遇到的问题以及解决方案分享. 我之前已经安装Git客户端并且使用Git开发过公司项目,也已经正确生成PublicKey并且添加到SSH keys on github of my account,但是当我想从github上克隆另一个客户端push的代码的时候一直报错: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have

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

今天在公司上传了代码,回到家pull,结果竟然出现了“Permission denied (publickey)“这种东西.第一反应是key不对,可是上次明明用key登录过,不可能不对啊,难道是文件被删除或覆盖?赶紧ls .ssh瞅一眼,发现上次生成的git.git.pub文件好好的在那呢.再想想,我也没动过github上的key设置啊,在公司都是https方式push的呢.确认不是key的设置问题,在http://henzil.easymorse.com/?p=508找到了解决方案. 下面记录

git clone gi[email protected]:xxx.git Permission denied (publickey) 问题解决办法

本文主要解决一个问题 git clone 出现公共密钥的权限问题.症状如下: CasondeMacBook-Pro:devops cason$ git clone [email protected]:360yyou/yyou.gitCloning into 'yyou'...Permission denied (publickey).fatal: Could not read from remote repository. Please make sure you have the correc

git push是报Permission denied (publickey)错误解决

今天晕了半天了,搞了个git工程到github上,以为很简单,因为之前也弄过,那知道搞了大半天都搞不好,一直报如下错误 D:\javawork\ee-0.0.1-SNAPSHOT>git push -u origin masterWarning: Permanently added the RSA host key for IP address '192.30.252.130' to the list of known hosts.Permission denied (publickey).fa

[email protected]: Permission denied (publickey).报错解决

windows 系统电脑,再一次更新git客户端后提交报错 [email protected]: Permission denied (publickey).fatal: Could not read from remote repository. Please make sure you have the correct access rightsand the repository exists. 解决方案 先运行 eval `ssh-agent -s` 再输入 ssh-add ~/.ssh