0
点赞
收藏
分享

微信扫一扫

配置多个SSH,同时绑定Gitee和Codeup(解决问题:/.ssh/id_ already exists. Overwrite (y/n)?)

幸甚至哉歌以咏志 2022-03-19 阅读 130
gitgithub

配置多个SSH,同时绑定Gitee和Codeup

创建codeup公钥

打开Git Bash,桌面右键【git bash here】,进入~/.ssh目录,输入以下命令

cd ~/.ssh

生成codeup_rsa

$ ssh-keygen -t rsa -C "xxxxxxxx@qq.com" -f "codeup_id_rsa"

得到如下文件:
在这里插入图片描述

把pub文件里的内容复制到codeup里

打开codeup_id_rsa.pub文件,将内容复制到gitee的ssh中保存:https://account-devops.aliyun.com/settings/ssh

添加config文件

添加text文件修改名为config,在里面添加如下内容

#aliyun
Host codeup.aliyun.com
HostName codeup.aliyun.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/codeup_id_rsa

在这里插入图片描述

测试公钥

测试gitee命令:ssh -T git@gitee.com
测试codeup命令:ssh -T git@codeup.aliyun.com
在这里插入图片描述

举报

相关推荐

0 条评论