git clone
和 git push origin master
錯誤
錯誤訊息:
black-hole@IMP:~/test$ git clone git@github.com:BlackHole1/WebRtcXSS.git正克隆到 'WebRtcXSS'...
Agent admitted failure to sign using the key.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
black-hole@IMP:~/test$ sudo git push origin master[sudo] password for black-hole:
ssh: connect to host github.com port 22: Connection refused
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
black-hole@IMP:~/test$
嘗試的解決方案:sudo vim ~/.ssh/config
:
Host github.com
User 158099591@qq.com
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443
已經在github上添加了ssh
卸載重裝了ssh
重新編譯了git最新版本(今天早上2點down的)
系統資訊:
Linux version 3.16.0-4-686-pae (debian-kernel@lists.debian.org) (gcc version 4.8.4 (Debian 4.8.4-1) ) #1 SMP Debian 3.16.36-1 -07-04)
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 8.5 (jessie)
Release: 8.5
Codename: jessie
其他資訊
black-hole@IMP:~/deb$ git --version
git version 2.9.0.GIT
black-hole@IMP:~/deb$ ssh -V
OpenSSH_6.7p1 Debian-5+deb8u2, OpenSSL 1.0.1t 3 May 2016
是系統問題麼? Email:158blackhole@gmail.com
問題已解決:
我刪除github上面的ssh key。重新在debian裡產生一個key,覆寫先前的key文件,然後再修改~/.ssh/config。就行了。參考連結:
https://www.chenyudong.com/archives/ssh-using-private-public-key-no-password.html http://www.01happy.com/ssh-unprotected-private-key-file / http://blog.sina.com.cn/s/blog_6e3583590101dvlx.html
你 github 上的 ssh public key 可能不對應,檢查下
回答一下 @hsfzxjy 提出的ssh -vT git@github.com