GIT push 遇到 access denied问题
2015-09-01 12:25
316 查看
在Win7 x64上,
执行git push 遇到 access denied
排查时,发现git pull也一样遇到access denied
原因:
之前,~/.ssh/id_rsa.pub(git bash路径,此例为 C:\Users\Administrator\.ssh目录,)
存放了注册于另一个git仓库(gitlab srv A)的另一个email (email A)的SSH pub key
而注册于当前git仓库(gitlab srv B)的当前email(email B) 生成的SSH pub key放到了~/.ssh/id_rsa_new.pub。
而其余设置已经按照服务器上的指南设好。
备份~/.ssh/id_rsa.pub后,
试图执行 cat ~/.ssh/id_rsa_new.pub > ~/.ssh/id_rsa.pub,似乎没有生效。
所以手动进入 ~/.ssh,
手动重命名了这两个.pub文件及其对应无后缀文件
~/.ssh/id_rsa.pub改为~/.ssh/id_rsa_old.pub
~/.ssh/id_rsa改为~/.ssh/id_rsa_old
~/.ssh/id_rsa_new.pub改为~/.ssh/id_rsa.pub
~/.ssh/id_rsa_new改为~/.ssh/id_rsa
之后OK。
执行git push 遇到 access denied
排查时,发现git pull也一样遇到access denied
原因:
之前,~/.ssh/id_rsa.pub(git bash路径,此例为 C:\Users\Administrator\.ssh目录,)
存放了注册于另一个git仓库(gitlab srv A)的另一个email (email A)的SSH pub key
而注册于当前git仓库(gitlab srv B)的当前email(email B) 生成的SSH pub key放到了~/.ssh/id_rsa_new.pub。
而其余设置已经按照服务器上的指南设好。
备份~/.ssh/id_rsa.pub后,
试图执行 cat ~/.ssh/id_rsa_new.pub > ~/.ssh/id_rsa.pub,似乎没有生效。
所以手动进入 ~/.ssh,
手动重命名了这两个.pub文件及其对应无后缀文件
~/.ssh/id_rsa.pub改为~/.ssh/id_rsa_old.pub
~/.ssh/id_rsa改为~/.ssh/id_rsa_old
~/.ssh/id_rsa_new.pub改为~/.ssh/id_rsa.pub
~/.ssh/id_rsa_new改为~/.ssh/id_rsa
之后OK。
相关文章推荐
- 数据结构学习之路-第二章:带头结点的线性链表
- PHP 数组转字符串后仍保留数组格式
- 使用eclipse+tomcat+maven插件创建web项目
- Spring笔记――4.创建Bean的三种方式
- 【转载】CSS clear 清除浮动
- 遇见,就是最好的
- Lua和C++交互详细总结
- 1051. Pop Sequence (25)
- DataGridView DataSource 如何实现排序
- 【HELLO WAKA】WAKA iOS客户端 之一 APP分析篇
- java配置自动任务,定期执行代码
- IOS8下的数据搜索
- string和char数组
- 编程判断两个链表是否相交
- 做人要有乐趣2
- Python--迭代器
- ERROR ITMS-90032: "Invalid Image Path - No image found at the path referenced under key 'CFBundkeIco
- 旋转进度条 WaitView
- 流媒体分发方式比较
- mysql可有类似oracle的nvl的函数