码云SSH设置
- 登录https://gitee.com个人账号,进入个人信息下的SSH密钥。
- 生成用户密钥对
ssh-keygen -t rsa -C "username@gitee.com"
#可以生成时指定密钥文件名如:gitee_user
#显示密钥
cat gitee_user.pub
- 从屏幕复制密钥信息到gitee中
添加本地私钥 ssh-add gitee 如报错“Could not open a connection to your authentication agent.”,说明agent没有启动,先运行: ssh-agent bash 如报错“Permissions 0770 for '.ssh/gitee' are too open.”,说明私钥文件权限过高,需要修改,运行: chmod 600 gitee
-测试SSH,运行:
ssh -T git@gitee.com 显示“Welcome to Gitee.com, XXXXX!”表明成功