Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a new ssh key problem. I have successfully used them for years with Heroku, Git and other servers so I can login without having to issue a passphrase.

A few weeks ago, I was unable to push a git repository on my machine to my Heroku and it responded with Permission denied (publickey).

Hmm. Everything else but this Heroku function still works. So I

 ssh-keygen -t rsa -C "newHeroku"

with no passphrase (hit return so it would be empty). So I enter:

 sudo chmod 600 ~/.ssh/newHeroku*


ssh-add ~/.ssh/

Returning return for the passphrase asked it exits without error. The next step is to:

 ssh-add /Users/sam/.ssh/

To verify that it's "live" I enter:

 ssh-add -l

To which the output is still The agent has no identities. Okay, to eliminate variables, I repeat the key generation process but entering in a passphrase for a new key. I ssh-add the new key and get the "Enter passphrase" as expected. Now this is why I'm posting here and not on a Heroku blog because ssh-add fails because the passphrase I used keeps getting rejected. It appears, even though I have no problem with my keys elsewhere, that something is wrong with passphrase because even though I get no errors, I get errors when on the one that expects a passphrase. One question, should I expect the Passphrase request for ssh-add when I have not generated a passphrase? It's been suggested that this is a clue and I offer it.

Or maybe I have a poor understanding of what ssh-add is doing. Wouldn't be the first time I asked a stupid Q. Also, I'm on Lion and have updated no system updates in the few weeks of this period except application updates.

share|improve this question

The command

ssh-add ~/.ssh/

seems wrong to me. You're trying to unlock your public key, whereas you should unlock your private (protected) key. So, try

ssh-add ~/.ssh/newHeroku

if that's indeed the filename of your private key.

share|improve this answer
up vote 1 down vote accepted

Yes, a fellow user was able to look at this and share that using the -K option to ssh-add added my key to the OS X keychain. After that, heroku performs as before and like other keys.

share|improve this answer

Make sure that ssh-agent is actually running. ssh-add only adds your key to the agent, if the agent is not running it will not work.

You can also checkout which is rather nice tool that adds your ssh and gpg keys to the respective agents upon first launching a shell.

share|improve this answer
This seems to back up the answer in that it appears to link the SSH keys with the OS X keychain. – Sam Walton Nov 23 '12 at 14:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .