使用上次的密钥对key10和key10.pub
参考Github官方教程
https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
后台启动ssh-agent
eval "$(ssh-agent -s)"
在服务器添加私钥
ssh-add ~/.ssh/key10
网页登录Github
右上角- Settings - SSH and GPG keys - New SSH key
将key10.pub的内容粘贴到Key栏内,Title随意设置,可辨识即可
之后需要输入密码,邮箱也会收到添加ssh-key确认邮件
在cluster10 创建/编辑 .ssh/config,加入以下内容
Host github.com HostName github.com IdentityFile ~/.ssh/key10 IdentitiesOnly yes
测试:
在远程创建testcluster10的仓库
在本地创建testcluster10仓库,使用链接时切换成SSH,不能使用HTTP
成功!
原创300字紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁紫薯布丁