I am having difficulty SSH'ing git commands (e.g. git pull) without having to GitHub enter username and passcode.
I can SSH into my Dreamhost server and manually run git pull
. I then have to enter my GitHub username and passcode. This is fine and dandy but I'd like to run git pull
WITHOUT having to enter my GitHub credentials every time.
Found out that I needed to add SSH keys but the server still asks for GitHub credentials.
I did the following:
SSH'd into Dreamhost shared server using PuTTy
Did the following:
$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/funkyserver/.ssh/id_rsa):
Enter passphrase (empty for no passphrase): <-- I left this empty
Enter same passphrase again: <-- I left this empty
Your identification has been saved in /home/funkyserver/.ssh/id_rsa.
Your public key has been saved in /home/funkyserver/.ssh/id_rsa.pub.
The key fingerprint is:
12:c3:12d:88:01:pp:12:b5:ca:33:8g:1q:64:ce:4a:81 funkyserver@wonkyninja <-- wonkyninja is Dreamhost's server name and this fingerprint is fake
The key's randomart image is: <-- I left this part out on purpose
- Copied the /.ssh/id_rsa.pub key and added it under the 'Deploy Keys' section @ GitHub.com
- Back on the Dreamhost server, I SSH'd into the directory with the git repo (e.g. /home/funkyserver/mysite)
- Ran
git pull
and it still asks me to enter GitHub credentials
What am I doing wrong with the SSH keys? Did I not generate them correctly? Did I not add them to GitHub properly?
Please help.
Try doing
git remote -v
.If your remotes are prefixed with
https://
a password will be asked.You can change over to the
ssh
protocol withgit remote set-url origin [email protected]:username/repo.git
There is more information in this question and on Github