第一步
创建~/.ssh/conf
文件,添加如下配置
Host gitee.com
HostName gitee.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa_me
Host gitlab.com
HostName gitee.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa_work
Host
声明域名IdentityFile
指定秘钥文件- 如果没有指定域名则读取默认秘钥文件
id_rsa