本地 (Local)
1、使用命令生成公钥(pub文件)
bash
1. $ ssh-keygen -t rsa -C "xxxxxxx@email.com" -f "github_id_rsa"
2. $ ssh-keygen -t rsa -C "xxxxxxx@email.com" -f "gitee_id_rsa"
2、创建config文件,并配置
bash
# gitee
Host gitee.com
HostName gitee.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/gitee_id_rsa
# github
Host github.com
HostName github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/github_id_rsa