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