ssh key添加到ssh-agent测试连接报错
ssh -T git@github.com
如下报错,说明是~/.ssh/config文件问题
.ssh/config: line 5: Bad configuration option: usekeychain
修改配置文件解决问题,完整流程看这里
Mac系统如下
Host new
HostName github.com
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_rsa_new
User test
Host old
HostName github.com
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_rsa
User test
Win系统如下
Host new
HostName github.com
IdentityFile C:\\Users\Eric\.ssh\id_rsa_new
PreferredAuthentications publickey
User Eric
Host old
HostName github.com
IdentityFile C:\\Users\Eric\.ssh\id_rsa
PreferredAuthentications publickey
User Eric