3
0
热心网友
在一台电脑上,添加多个Git的ssh key
1) 输入 ssh-keygen -t rsa -C "git@gitee.com" -f ~/.ssh/id_rsa_aysee 三次回车之后就可以生成密钥对
在 SSH 用户配置文件 ~/.ssh/config 中指定对应服务所使用的公秘钥名称,如果没有 config 文件的话就新建一个 touch ~/.ssh/config,并输入以下内容:
# id_rsa Host gitee.com HostName gitee.com User git IdentityFile ~/.ssh/id_rsa # aysee Host gitee-aysee HostName gitee.com User git IdentityFile ~/.ssh/id_rsa_aysee
2)测试是否配置成功
ssh -T git@gitee-aysee
3)使用方法 原来的git的ssh地址:git@gitee.com:yn-ce/xy_xiaobai.git git init git remote add origin git@gitee-aysee:yn-ce/xy_xiaobai.git git clone git@gitee-aysee:yn-ce/xy_xiaobai.git
使用道具 舉報
本版積分規則 發表回覆 回帖並轉播 回帖後跳轉到最後一頁
相关侵权、举报、投诉及建议等,请发 E-mail:qiongdian@foxmail.com
Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.