码云添加SSH公钥 fatal: Could not read
2020-04-04 本文已影响0人
Gavin_盖文
码云生成ssh公钥
1.生成ssh的指令
ssh-keygen -t rsa -C "此处是你登录码云的账号"
2.输入密码生成公钥
按照提示输入三次密码(登录码云的密码)。输入正确后ssh公钥生成已经完成。生成的公钥会存在~/.ssh/id_rsa.pub
文件中
3.添加公钥到码云后台
- 3.1用cat命令查看文件~/.ssh/id_rsa.pub:
cat ~/.ssh/id_rsa.pub

- 3.2 打开码云后台。找到图中位置粘贴确定即可

- 3.3 验证
命令:
ssh -T git@gitee.com
看到如下输出就完成所有操作了,可以正常使用码云gitee管理工程了~

4.提示:
如果没有设置公钥或者公钥错误会报错:
git@gitee.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.