How can I do git pull without retyping my SSH password?

Is it possible to configure git/ssh , so I don’t need to enter a passphrase every time I want to do git pull ? Please note that the repo is closed to github.

Or, alternatively, what would be the best practice for automating code deployment from a private Github repository?

Additional Information: An EC2 instance running a public Fedora-based AMI.

+84
git linux github ssh
Jun 07 2018-11-11T00:
source share
5 answers

Have a look at this link https://help.github.com/articles/working-with-ssh-key-passphrases/

But I do not want to enter a long passphrase every time I use the key!

I, too! Fortunately, theres a great tool called ssh-agent that can safely save your passphrase so you don't have to re-enter. If you are on OSX Leopard or later, your keys can be stored in system keychains to make your life even easier. Most linux installations will automatically run ssh-agent for you when you log in.

+60
Jun 07 '11 at 13:10
source share

I turned on password caching as described here:

https://help.github.com/articles/caching-your-github-password-in-git/#platform-linux

To cache a password for a month:

 git config --global credential.helper 'cache --timeout=2628000' 
+24
Feb 14 '14 at 17:10
source share

Now your situation is fixed, but for me it was a fact that I had more than one key in ~/.ssh/

To solve the problem, I had to create a file called ~/.ssh/config and add the line:

 IdentityFile ~/.ssh/my_key2_rsa 

where ~/.ssh/my_key2_rsa is my key.

+8
Oct 15 '13 at 21:23
source share

Try it:

git config credential.helper store

You will need to enter the password once, after which it will be saved in a folder inside root.

As noted in the comments, this does NOT work for SSH passwords, only for HTTPS passwords.

+6
Sep 16 '18 at 17:18
source share

I do not know why no one has reported this yet. But the simplest approach would be to simply add one line of AddKeysToAgent yes at the top of the .ssh / config file. Of course, ssh-agent must be started in advance. If it does not work (check with the ssh-agent command on the terminal), just run it eval $(ssh-agent)

I can confirm that this works because in my project with a lot of submodules and for each cloned submodule I had to enter my ssh passphrase. After the trick described, I no longer need to do this.

Solution source https://askubuntu.com/questions/362280/enter-ssh-passphrase-once/853578#853578

+3
Aug 23 '17 at 8:52 on
source share



All Articles