Github public key authentication rejected

So you just added another public key to your github account so you can deploy your app on your new server.

You jump down into a folder you want to put it into (/var/rails) in my case.

You notice you need to add sudo to the front so that git can create the folder it needs, you do that.  All goes well until github rejects your public key.

You go back and delete the key from github, add it again.  No luck, you delete the key from the server and create a new one, add it, no luck.  What’s going on?!

Well this happened to me, because you are using ‘sudo‘ you are also using ‘sudo’s public key, which isn’t on the account.  Opps, change the file permissions and dont use sudo.  Fixed.

For those that don’t know how to even get to the above stage

[email protected]:/var/rails$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/jordan/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/jordan/.ssh/id_rsa.
Your public key has been saved in /home/jordan/.ssh/
The key fingerprint is:
18:74:60:db:5d:5b:85:23:f9:7e:96:fc:a3:7f:e9:14 [email protected]
The key’s randomart image is:
+–[ RSA 2048]—-+
|            o .-=|
|           . +-.+|
|            =.oo.|
|         . . .  .|
|        S . . E..|
|           .   ++|
|               .=|
|               +o|
|             .o.=|

Posted on June 2, 2009 at 12:41 pm by Jordan Carter · Permalink
In: Server Config · Tagged with: ,

Leave a Reply