Forums

Using deploy keys with private GitHub repos

I'd like to deploy my code from a private GitHub repo onto PythonAnywhere, but can't get the deploy key working. I've followed all the guides I can find on the matter, but I'm still being prompted for a GitHub username & password when I attempt to clone the repo.

Here are my steps (on PythonAnywhere):

ssh-keygen # no password set, keys saved to default location: ~/.ssh/id_rsa and ~/.ssh/id_rsa.pub

eval` ssh-agent -s` # agent PID confirmed

ssh-add # confirm correct private key added

ssh -T git@github.com # confirm successful authentication and host added to known hosts

git clone ....

In GitHub, I've copied the contents of the public key file (id_rsa.pub) into the 'Deploy Key' section for the repo, and confirmed that the repo I'm trying to clone is the same one that contains the deploy key.

Can anyone tell me why this isn't working??

Thanks!

That all sounds just fine to me. There's a -v option to git clone for "verbose" that might help debug? Otherwise you'll probably have to ask github themselves for help...

D'oh! I didn't realise I had to use the SSH link (rather than the HTTPS one) to clone the repo. Fixed!

Thanks for your help.

Great! Glad you worked it out.