Running 'git pull' from SSH in Dreamhost to GitHub without password

I'm having difficulty with SSH'ing git commands (e.g. git pull) without having to enter a username and password in GitHub.

I can use SSH on my Dreamhost server and manually run git pull . Then I have to enter the GitHub username and password. This is fine and dandy, but I would like to run git pull WITHOUT entering my GitHub credentials each time.

Found out that I need to add SSH keys, but the server is still requesting GitHub credentials.

I have done the following:

  • SSH'd to a shared Dreamhost 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 server name and this fingerprint is fake The key randomart image is: <-- I left this part out on purpose 
  • I copied the key /.ssh/id_rsa.pub and added it in the "Expand Keys" section @ GitHub.com
  • Return to the Dreamhost server, I SSH'd to the directory with the git repository (e.g. / home / funkyserver / mysite)
  • Ran git pull and it still asks me to enter GitHub credentials

What am I doing wrong with SSH keys? Didn't I create them correctly? Didn't I add them to GitHub properly?

Please, help.

+4
source share
1 answer

Try to do git remote -v .

If your remotes are sent with the https:// prefix, you will be given a password.

You can go to ssh protocol with git remote set-url origin git@github.com :username/repo.git

There is more info and github on this question

+9
source

Source: https://habr.com/ru/post/1499514/


All Articles