今天在 git clone 倉庫時(shí)發(fā)生了如下問題:
Agent admitted failure to sign using the key.
...
Permission denied (publickey)
...
導(dǎo)致怎么也無法完成 clone,我以為是我的 public-key 的問題,于是查看 user.name 和 user.email 是否正確,以及嘗試了幾次重新生成和添加公鑰,依舊不管用。
最后沒辦法在 Google 輸入關(guān)鍵字 “Agent admitted failure to sign using the key” 還正找到了一個(gè)方法: 解決 Agent admitted failure to sign using the key 問題 with ssh
解決方法一
使用 ssh-add 指令將私鑰加進(jìn)來 (注意:根據(jù)個(gè)人的密匙命名不同更改 id_rsa)
ssh-add ~/.ssh/id_rsa
解決方法二
注銷再登陸系統(tǒng)
===========================================================
我使用的是第一個(gè)方法,解決了我的問題,在此記錄一下這個(gè)問題,以便下次遇到時(shí)能夠快速解決。
參考文章1:解決 Agent admitted failure to sign using the key 問題 with ssh
參考文章2:變更ssh key后git連接失敗