Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6588255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:01:31+00:00 2026-05-25T17:01:31+00:00

When $ git clone -v git@heroku.com:testabcde.git Cloning into testabcde… Heroku returns Permission denied (publickey).

  • 0

When

$ git clone -v git@heroku.com:testabcde.git Cloning into testabcde...

Heroku returns

Permission denied (publickey).
fatal: The remote end hung up unexpectedly

When

$ heroku keys

returns

=== 1 key for ohho@gmail.com
ssh-rsa AAAAB3NzaC...lXLyj9YQ== ohho@gmail.com

now

$ ssh -v git@heroku.com -T

OpenSSH_5.2p1, OpenSSL 0.9.8r 8 Feb 2011
debug1: Reading configuration data /etc/ssh_config
debug1: Connecting to heroku.com [50.19.85.154] port 22.
debug1: Connection established.
debug1: identity file /Users/ohho/.ssh/identity type -1
debug1: identity file /Users/ohho/.ssh/id_rsa type 1
debug1: identity file /Users/ohho/.ssh/id_dsa type 2
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1p1 Debian-5pgsql1
debug1: match: OpenSSH_5.1p1 Debian-5pgsql1 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.2
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: Host 'heroku.com' is known and matches the RSA host key.
debug1: Found key in /Users/ohho/.ssh/known_hosts:5
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: /Users/ohho/.ssh/identity
debug1: Offering public key: /Users/ohho/.ssh/id_rsa
debug1: Remote: Forced command: /home/git/bin/git_proxy ohho@gmail.com
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: Pty allocation disabled.
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
debug1: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
debug1: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
debug1: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
debug1: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
debug1: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
debug1: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
debug1: Offering public key: /Users/ohho/.ssh/id_dsa
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).

How to fix the Permission denied (publickey) error?

UPDATE (file permission info):

drwxr-xr-x  11 ohho    staff    374 Sep 16 09:37 .
drwxr-xr-x+ 50 ohho    staff   1700 Sep 15 10:34 ..
-rw-------   1 ohho    staff   1743 Sep 16 09:37 github_rsa
-rw-r--r--   1 ohho    staff    390 Sep 16 09:37 github_rsa.pub
-rw-r--r--   1 ohho    staff    390 Sep  9 09:47 github_rsa.pub_bak-github
-rw-------   1 ohho    staff   1743 Sep  9 09:47 github_rsa_bak-github
-rw-------   1 ohho    staff    736 Dec  2  2010 id_dsa
-rw-r--r--   1 ohho    staff    606 Dec  2  2010 id_dsa.pub
-rw-------   1 ohho    staff   1743 Jan 28  2011 id_rsa
-rw-r--r--   1 ohho    staff    399 Jan 28  2011 id_rsa.pub
-rw-r--r--@  1 ohho    staff  10752 Sep 16 11:47 known_hosts
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T17:01:32+00:00Added an answer on May 25, 2026 at 5:01 pm

    With msysgit, check the permissions on your .ssh directory from a bash session (they should be 700), and the files in it (600).
    Check out the issue 261 and see if one of the workaround works, like (if everything else fails) replacing the ssh.exe by one from cygwin.

    The OP ohho mentions the SO question “git clone fails for Heroku project“, which recommends to load the heroku key (when it has a different name than the default id_rsa):

    ssh-add ~/.ssh/heroku_rsa
    

    That is a solution especially if you have already an id_rsa private key (for other purposes than heroku)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Git clone will clone remote branch into local. Is there any way to clone
After git clone, the config in the new repo looks like: remote.origin.url=<some url> remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
I started cloning an SVN repository using the git-svn's clone operation. After about 6
git clone git@github.com:foo/bar.git bar-master git branch release git push origin release git clone -b
i have create clone of project on local machine with git clone git@github.com:test/abc.git Now
I added some Haml templates to my Rails 3 project with git clone git://github.com/psynix/rails3_haml_scaffold_generator.git
I feel like I tried everything to clone http://thechaw.com/source from git with no success.
A colleague of mine has a remote git repo that I wanted to clone
I did: git clone git://github.com/xyz/xyz.git git tag -l release-1.0.0 release-1.0.1 release-1.0.2 git checkout release-1.0.2
I've done something like following: (1) clone a remote git repository to local host

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.