git 无法使用ssh协议连接
来源:互联网 发布:知乎 复制 编辑:程序博客网 时间:2024/06/06 01:27
一. 发现问题:
使用 git clone 命令时出现Permission denied (public key) 。
二. 解决问题:
1、首先尝试重新添加以前生成的key,添加多次,仍然不起作用。
2、使用命令 ssh -v git@yourserver 测试,最后几行结果如下:
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /home/gr/.ssh/id_rsa
debug1: Trying private key: /home/gr/.ssh/id_dsa
debug1: Trying private key: /home/gr/.ssh/id_ecdsa
debug1: No more authentication methods to try.
Permission denied (publickey).
3、分析:尝试了3个private key,但都没有成功,最后是导致Permission denied.
4、查看我的密钥, ls ~/.ssh/ :
id_rsa id_rsa.pub known_hosts
5、
执行ssh-add ~/.ssh/rsa
报错(Could not open a connection to your authentication agent)
先执行 eval `ssh-agent` (是~键上的那个`) 再执行 ssh-add ~/.ssh/rsa成功
ssh-add -l 就有新加的rsa了
2048 63:c5:d8:6c:a0:0c:a8:9c:26:d8:f8:95:de:29:04:eb /home/gr/.ssh/bajie (RSA)
6、再使用ssh -v git@github.com测试连接,可以看到验证通过:
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/gr/.ssh/bajie
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: Authentication succeeded (publickey).
Authenticated to github.com ([192.30.252.129]:22).
注释:如果是gitlab,提示不一样,但是可以明显看出连接成功
7、最后git clone项目成功。
参考博客:
https://my.oschina.net/grnick/blog/201155
http://blog.csdn.net/roserose0002/article/details/40078577
http://blog.csdn.net/sunnypotter/article/details/18948053/
- git 无法使用ssh协议连接
- Visual Studio 2015 Git无法使用SSH协议的解决方法
- git使用SSH连接oschina
- git使用ssh协议克隆库
- git学习笔记之使用ssh连接
- linux 下 使用 ssh 连接git库
- ubuntu下git使用ssh连接github
- Linux上使用SSH连接Git
- 使用ssh无法连接虚拟机linux系统
- 使用ssh无法连接虚拟机linux系统
- Git : SSH 协议服务器
- git ssh协议支持
- 架设git服务器,和使用ssh连接git服务
- Git:ssh无法推送
- Git ssh 连接
- ssh无法连接
- ssh无法连接linux
- ssh无法连接
- 版本更新简要
- Google Developers 认证团队推出 Mobile Web Specialist 认证
- 安装grunt-contrib-qunit报错,报错信息:! phantomjs-prebuilt@2.1.15 install: `node install.js`
- koa-router介绍
- source insight 4常用设置
- git 无法使用ssh协议连接
- 自定义属性使用
- 欧拉回路--输出欧拉回路的路径
- Jquery_Dom操作
- AS格式化代码时注解不换行
- 欢聚时代2017校招笔试题目(JAVA基础类)A卷--9
- JVM内存管理机制
- 达内云笔记(六) 文件上传下载
- Android使用ViewDragHelper实现侧滑菜单(一)