問題描述:
Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of known hosts.
sign_and_send_pubkey: signing failed: agent refused operation Permission denied (publickey).
有時(shí)用github從本地添加到遠(yuǎn)程庫的時(shí)候,會出現(xiàn)上述問題,下面是解決辦法:
首先,清除所有的key-pair
ssh-add -D
rm -r ~/.ssh
刪除你在github中的public-key
重新生成ssh密鑰對
ssh-keygen -t rsa -C "xxx@xxx.com"
接下來正常操作
在github上添加公鑰public-key:
1、首先在你的終端運(yùn)行 xclip -sel c ~/.ssh/id_rsa.pub將公鑰內(nèi)容復(fù)制到剪切板
2、在github上添加公鑰時(shí),直接復(fù)制即可
3、保存
但是!有時(shí)候這方法不靈,教你一個(gè)新方法,保你藥到病除。
!!!通過加載你的鑰匙到您的SSH代理修復(fù)這個(gè)錯誤,具體操作:
eval "$(ssh-agent -s)"
ssh-add
提交到github庫
git push origin master

圖片.png
又報(bào)錯了?。。?!不過看見最后有強(qiáng)制推送,
git push origin +master
成功啦!