简体   繁体   English

由于publickey推送到github时拒绝权限

[英]permission denied when pushing to github because of publickey

I am trying to push a repository to github. 我正在尝试将存储库推送到github。 I have already succesfully pushed it to heroku. 我已经成功地将它推到了heroku。 When I type git push origin master I get the following: 当我输入git push origin master我得到以下信息:

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

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

I am pushing code to many other github repositories so I know it is not a general issue with my computer and I don't want to change default settings on my computer. 我正在将代码推送到其他许多github存储库中,因此我知道这不是计算机的普遍问题,我也不想更改计算机的默认设置。 When I type git remote -v I get the following: 当我输入git remote -v我得到以下信息:

heroku  https://git.heroku.com/marketvault.git (fetch)
heroku  https://git.heroku.com/marketvault.git (push)
origin  git@github.com:codeundercoverdev/marketlaunch.git (fetch)
origin  git@github.com:codeundercoverdev/marketlaunch.git (push)

How do I fix this? 我该如何解决? I've already tried this article: 我已经尝试过这篇文章:

GitHub Error Message - Permission denied (publickey) GitHub错误消息-权限被拒绝(公钥)

but everything they mention involves changing settings on my entire computer, whereas my computer works fine for the atleast 20 other applications I currently have on GitHub. 但是他们提到的所有内容都涉及更改整个计算机上的设置,而我的计算机可以很好地用于我目前在GitHub上拥有的其他至少20个应用程序。

UPDATE: 更新:

The results of running ssh -Tvvv git@github.com verify : 运行ssh -Tvvv git@github.com verify的结果ssh -Tvvv git@github.com verify

OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to github.com [192.30.252.128] port 22.
debug1: Connection established.
debug3: Incorrect RSA1 identifier
debug3: Could not load "/Users/davidm/.ssh/id_rsa" as a RSA1 public key
debug1: identity file /Users/davidm/.ssh/id_rsa type 1
debug1: identity file /Users/davidm/.ssh/id_rsa-cert type -1
debug1: identity file /Users/davidm/.ssh/id_dsa type -1
debug1: identity file /Users/davidm/.ssh/id_dsa-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 libssh-0.7.0
debug1: no match: libssh-0.7.0
debug2: fd 3 setting O_NONBLOCK
debug3: load_hostkeys: loading entries for host "github.com" from file "/Users/davidm/.ssh/known_hosts"
debug3: load_hostkeys: found key type RSA in file /Users/davidm/.ssh/known_hosts:4
debug3: load_hostkeys: loaded 1 keys
debug3: order_hostkeyalgs: prefer hostkeyalgs: ssh-rsa-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-rsa
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-rsa,ssh-dss-cert-v01@openssh.com,ssh-dss-cert-v00@openssh.com,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: kex_parse_kexinit: ecdh-sha2-nistp256,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-dss,ssh-rsa
debug2: kex_parse_kexinit: chacha20-poly1305@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,blowfish-cbc
debug2: kex_parse_kexinit: chacha20-poly1305@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,blowfish-cbc
debug2: kex_parse_kexinit: hmac-sha1,hmac-sha2-256,hmac-sha2-512
debug2: kex_parse_kexinit: hmac-sha1,hmac-sha2-256,hmac-sha2-512
debug2: kex_parse_kexinit: none,zlib,zlib@openssh.com
debug2: kex_parse_kexinit: none,zlib,zlib@openssh.com
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: mac_setup: found hmac-sha1
debug1: kex: server->client aes128-ctr hmac-sha1 none
debug2: mac_setup: found hmac-sha1
debug1: kex: client->server aes128-ctr hmac-sha1 none
debug2: dh_gen_key: priv key bits set: 159/320
debug2: bits set: 1048/2048
debug1: sending SSH2_MSG_KEXDH_INIT
debug1: expecting SSH2_MSG_KEXDH_REPLY
debug1: Server host key: RSA 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48
debug3: load_hostkeys: loading entries for host "github.com" from file "/Users/davidm/.ssh/known_hosts"
debug3: load_hostkeys: found key type RSA in file /Users/davidm/.ssh/known_hosts:4
debug3: load_hostkeys: loaded 1 keys
debug3: load_hostkeys: loading entries for host "192.30.252.128" from file "/Users/davidm/.ssh/known_hosts"
debug3: load_hostkeys: found key type RSA in file /Users/davidm/.ssh/known_hosts:4
debug3: load_hostkeys: loaded 1 keys
debug1: Host 'github.com' is known and matches the RSA host key.
debug1: Found key in /Users/davidm/.ssh/known_hosts:4
debug2: bits set: 1020/2048
debug1: ssh_rsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /Users/davidm/.ssh/id_rsa (0x7fb6fb416190),
debug2: key: /Users/davidm/.ssh/id_dsa (0x0),
debug1: Authentications that can continue: publickey
debug3: start over, passed a different list publickey
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/davidm/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey
debug1: Trying private key: /Users/davidm/.ssh/id_dsa
debug3: no such identity: /Users/davidm/.ssh/id_dsa: No such file or directory
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (publickey).

Make sure your private key generates the same public key as is assigned to your account on github: 确保您的私钥生成与在github上分配给您的帐户相同的公钥:

ssh-keygen -yf ~/.ssh/id_rsa

should print the same thing that is available in your ~/.ssh/id_rsa.pub and the same content should be in your github account . 应该打印~/.ssh/id_rsa.pub可用的相同内容,并且相同的内容应该在github帐户中

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Capistrano 和 GitHub Private Repo – 权限被拒绝(公钥) - Capistrano and GitHub Private Repo – Permission denied (publickey) Capistrano bitbucket - 权限被拒绝(publickey) - Capistrano bitbucket - Permission denied (publickey) heroku - rails - 权限被拒绝(publickey) - heroku - rails - Permission denied (publickey) Capistrano rails 应用程序部署失败。 服务器无法向 Github 识别自我。 权限被拒绝(公钥) - Capistrano rails app deploying fails. Server can't identificate self to Github. Permission denied (publickey) git@github.com:权限被拒绝(公钥)。 致命:无法从远程存储库读取。 在云上 9 - git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. on cloud 9 使用Capistrano部署Rails应用-权限被拒绝(公钥) - Deploying Rails app with Capistrano - Permission denied (publickey) 权限被拒绝(publickey),当通过ruby-script克隆bitbucket存储库时 - Permission denied (publickey), when cloning bitbucket repository via ruby-script Heroku:权限被拒绝(公钥)。 致命的:执行git push时无法从远程存储库读取 - Heroku: Permission denied (publickey). fatal: Could not read from remote repository when doing git push 尝试在 docker(github 代码空间)上安装 asdf 插件时权限被拒绝 - Permission denied when trying to install asdf plugin on docker (github codespace) Capistrano 在 git:check 上部署失败 - 权限被拒绝(公钥) - Capistrano Deploy Failing on git:check - Permission denied (publickey)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM