天天看點

生成多個ssh key添加到ssh-agent測試連接配接報錯

ssh key添加到ssh-agent測試連接配接報錯

ssh -T [email protected]           

如下報錯,說明是~/.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           

繼續閱讀