Sunday, March 27, 2011

Can't push on Github

When I tried to git push new commits into github, it asks:

Enter password to unlock the private key
An application wants access to the private key
'[my email]' but it is locked.

I tried all my passwords but it didn't work. Google didn't help much either.

Victor is here to help:

It means you password-protected your SSH keys, despite all the advice
against doing so.

The easiest fix is to blow up and re-generate your keys.

cd ~/.ssh
rm id_*
ssh-keygen
# Do NOT enter a password; just press Enter every time it asks a question
cat id_rsa.pub
# Go to GitHub -> account settings -> ssh public keys -> add another public key

Now I can finally navigate to my project directory and do
git push

2 comments:

  1. had the same issue and after reading this post i realised i had entered a passphrase ....which upon inputting was the password to unlock the private key it was asking about.

    (1) .Just enter the passphrase you entered as the password

    ReplyDelete
  2. GitHub "strongly recommend a very good, secure passphrase"

    Also the rm command you use wouldn't work for me, my key was in a subdirectory "key_backup", rm -r id* would have done the trick (the space in the command shouldn't be there either I don't think)

    ReplyDelete