Is it possible to configure git/ssh
so I don't have to enter my passphrase every time I want to perform a git pull
? Note that the repo is a private one on github.
Or, alternatively, what would be the best practice to automate code deployment from a private Github repo?
Additional details: EC2 instance running a public AMI based on Fedora.
Your situation is now fixed, however for me it was the fact that I had more than one key in
~/.ssh/
To resolve the problem I had to create a file called
~/.ssh/config
and add the line:where
~/.ssh/my_key2_rsa
is my key.I enabled the password caching as described here:
https://help.github.com/articles/caching-your-github-password-in-git/#platform-linux
To cache the password for a month:
I dont know why hasnt anyone reported this yet. But the simplest approach would be to simply add a single line
AddKeysToAgent yes
on the top of the .ssh/config file. Ofcoursessh-agent
must be running beforehand. If its not running ( check by the commandssh-agent
on the terminal ) , then simply run iteval $(ssh-agent)
I can confirm that this works, because in my project with lots of submodules and for each submodule being cloned, I had to type in my ssh passphrase. After the above trick, I dont need to do it anymore.
The source of the solution is https://askubuntu.com/questions/362280/enter-ssh-passphrase-once/853578#853578
Have a look at this link https://help.github.com/articles/working-with-ssh-key-passphrases/
Try this:
git config credential.helper store
You'll have to enter your password once, after that it is stored in a folder inside root.