Github“权限被拒绝(公钥)”,尽管添加了公钥并重新生成密钥

时间:2014-07-14 17:34:53

标签: ruby-on-rails git github ssh

我首先使用配置文件使用多个ssh密钥。现在需要多个密钥消失了,我删除了那些密钥+配置文件。

在尝试推送之后,这个github给了我许可被拒绝(publickey)错误。

我认为这可能是一个关键问题所以我删除了〜/ .ssh /文件夹中的ssh密钥,然后按照Github手册再次生成它们。我还将公钥再次添加到github帐户设置中的ssh-keys。

这不能解决问题。

接下来我做的是:

eval $(ssh-agent) > /dev/null
ssh-add ~/.ssh/id_rsa

这样做后我可以做一个git push。他们确实要求我输入我认为很奇怪的密码,因为我通常不必这样做。

关闭cmd窗口后,当他们再次尝试推送时,他们会继续询问我的密码。 重新启动后,我必须再次执行整个ssh代理程序,因为我再次遇到公共错误。

有人可以帮我解决这个问题吗?

我正在运行Windows 8.1并使用railsinstaller安装Ruby on Rails。这也包括Github。

我收到的完整错误:

$ git push
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

$ssh -vT git@github.com
OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007
debug1: Connecting to github.com [192.30.252.130] port 22.
debug1: Connection established.
debug1: identity file /.ssh/identity type -1
debug1: identity file /.ssh/id_rsa type -1
debug1: identity file /.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version libssh
debug1: no match: libssh-0.6.0
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.6
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-sha1 none
debug1: kex: client->server aes128-cbc hmac-sha1 none
debug1: sending SSH2_MSG_KEXDH_INIT
debug1: expecting SSH2_MSG_KEXDH_REPLY
debug1: Host 'github.com' is known and matches the RSA host key.
debug1: Found key in /.ssh/known_hosts:2
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
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: /.ssh/identity
debug1: Trying private key: /.ssh/id_rsa
debug1: Trying private key: /.ssh/id_dsa
debug1: No more authentication methods to try.
Permission denied (publickey).

我认为问题在于ssh管理器不记得密钥。我该如何设置? Railsinstaller在第一次安装时为我做了这个。我把它搞砸了,我需要让它像以前一样再次运作。

0 个答案:

没有答案