Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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*

Then:

ssh-add ~/.ssh/newHeroku.pub

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

 ssh-add /Users/sam/.ssh/newHeroku.pub

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
add comment

3 Answers 3

The command

ssh-add ~/.ssh/newHeroku.pub

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
add comment
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
add comment

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 http://www.funtoo.org/wiki/Keychain 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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.