我已有一個sshkey 了
widow,找到已有的.ssh文件夾打開,打開Git bash
再次執行:
ssh-keygen -t rsa -C [email protected] -f ~/.ssh/id_rsa_two
新建文件
touch config
配置
# 配置github.com
Host github.com
HostName github.com
IdentityFile C:\\Users\\popfisher\\.ssh\\id_rsa_github
PreferredAuthentications publickey
User username1
# 配置git.oschina.net
Host git.oschina.net
HostName git.oschina.net
IdentityFile C:\\Users\\popfisher\\.ssh\\id_rsa_oschina
PreferredAuthentications publickey
User username2
測試:
ssh -T [email protected] ssh -T [email protected]
參考鏈接:
https://www.cnblogs.com/godfeer/p/12214301.html
https://www.cnblogs.com/popfisher/p/5731232.html
https://jingyan.baidu.com/article/ab69b2708d09382ca7189f9b.html