我有一个新的应用程序我试图承诺我的git帐户。我似乎无法承诺:
$ git push origin master
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
$ ssh -T git@github.com
Permission denied (publickey).
$ ssh-add -1
Could not open a connection to your authentication agent.
检查我的SSH时,出现此错误:
$ ssh -vT git@github.com
OpenSSH_6.2p2, OpenSSL 1.0.1e 11 Feb 2013
debug1: Connecting to github.com [204.232.175.90] port 22.
debug1: Connection established.
debug1: identity file /home/Fletch/.ssh/id_rsa type -1
debug1: identity file /home/Fletch/.ssh/id_rsa-cert type -1
debug1: identity file /home/Fletch/.ssh/id_dsa type -1
debug1: identity file /home/Fletch/.ssh/id_dsa-cert type -1
debug1: identity file /home/Fletch/.ssh/id_ecdsa type -1
debug1: identity file /home/Fletch/.ssh/id_ecdsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.5p1 Debian- 6+squeeze1+github12
debug1: match: OpenSSH_5.5p1 Debian-6+squeeze1+github12 pat OpenSSH_5*
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: RSA 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48
debug1: Host 'github.com' is known and matches the RSA host key.
debug1: Found key in /home/Fletch/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /home/Fletch/.ssh/id_rsa
debug1: Trying private key: /home/Fletch/.ssh/id_dsa
debug1: Trying private key: /home/Fletch/.ssh/id_ecdsa
debug1: No more authentication methods to try.
Permission denied (publickey).
我有一个GIT帐户,我有他们的本机客户端我有一个额外的SSH密钥,创建了id_rsa.pub文件,我创建了我的全局用户设置,我有一个在GitHub中创建的存储库,我有所有相关的SSH安装了Cygwin中的代理,我在安装Cygwin并使用终端时禁用了所有防火墙产品。
我唯一能解决的问题是:
$ ssh-keygen -lf ~/.ssh/id_rsa.pub
/home/Fletch/.ssh/id_rsa.pub: No such file or directory
但是,我创建了这个文件,并在我的帐户中查看了SSH密钥。我搜索了所有相似的帖子,似乎无法找到问题。
答案 0 :(得分:0)
我使用cygwin同时使用github和bitbucket,并且在我阅读Set up SSH for Git
之前有类似的问题它显示了如何设置ssh密钥以及如何在第一次启动bash(或Git Bash)时自动运行ssh-agent。
答案 1 :(得分:0)
在另一篇文章中找到答案:GitHub: Permission denied (publickey). fatal: The remote end hung up unexpectedly
我遇到了这个问题,但上述解决方案都没有奏效。我可以克隆和获取但无法推送。最后,我发现问题出在我的.git / config的url中,它应该是: git@github.com:/ (不是ssh://github.com//.git或https://github.com/ / .git)。