centos7上显示的问题:
Initialized empty Git repository in /data1/mouxuan/fastsocket-private/.git/
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
解决步骤:
1、cd ~/.ssh
2、ssh-keygen -t rsa -C you@Email.com (列如:centos@qq.com)
遇到 提示一路 回车
遇到有Y 输入Y
3、ssh-add id_rsa
(若出现: Could not open a connection to your authenticationagent.
先输入:ssh-agent bash 在执行 3 步骤)
4、登录github.com --AccountSetting–ssh 点击Add(有翻译的则在设置内 ssh那个选项点击添加)
将id_rsa.pub 文件中的 内容添加进去
最后git clone 成功 (with ssh)
git clone git地址
可以成功拉取
Lewis

本文介绍在CentOS7系统中使用Git通过SSH方式克隆远程仓库时遇到权限拒绝错误的解决步骤。从创建SSH密钥、添加密钥到SSH代理,再到在GitHub上添加SSH公钥,最后实现成功克隆仓库。

1143

被折叠的 条评论
为什么被折叠?



