Git push without a password
I have a Linux server with git server installed for hosting my Git repositories. I have a couple different computers I use, a laptop and a desktop, and I either use Git bash or invoke git through windows command prompt, but I get tired of entering my password every time I need to push my project to the server.
To setup the environment to be able to push/pull without a password do the following:
- Open Git Bash on windows client type: ssh-keygen -t rsa
(Don't enter a password here, if you do, you will be prompted for this password every time you push or pull, which defeats the purpose)
- Save the file, but be sure to note location it is saved in
- Using text editor, open id_rsa.pub from location noted in the previous step
- Copy the entire key (looks like giant garbled mess of text)
- Log in to your linux server via ssh
- Edit the file "~/.ssh/authorized_keys"
if the containing folder does not exist (~/.ssh/), create it: sudo makdir ~/.ssh/
- Add or append (if it contains keys already) your public key to this file, save and exit
That's it! Now when you go to push/pull your project next, enter the password for the git repository once and enjoy password free push/pulls from now on.
For more information see: