首页 / ACCESS / Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights
Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1146字,纯文字阅读大概需要2分钟。
内容图文
![Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights](/upload/InfoBanner/zyjiaocheng/1237/419154f92747446b9be8dd6253e8a9a1.jpg)
第一次提交遇到这样的情况,怎么回事呢,我在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 = git@github:cuzz1/flask.git # 错误的 url = git@github.com: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 "xxxx@163.com" 会生成在很多目录下,比如root/.ssh、 /home/ubuntu/.ssh 都有ras_id.pub
所以我们不能添加错了。必须在 ~/.ssh目录下 才有用,要是当前目录,把 ~/.ssh/ras_id.pub 拷到github上就可以了。
现在提交就可以了。
感谢军哥的帮忙 ,微信公众号 Python之禅
原文:https://www.cnblogs.com/cuzz/p/8214712.html
内容总结
以上是互联网集市为您收集整理的Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights全部内容,希望文章能够帮你解决Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。