Resources‎ > ‎Standard Procedures‎ > ‎

SSH auto login for source control managment

Windows XP/7

The following should apply to Tortoise GIT but can also be used for Tortoise SVN

Set the configuration in Tortoise GIT settings after installing msysgit to use the installed location (typically "C:\Program Files (x86)\Git\bin")

You will need PuTTY, PuTTYgen for the following:

Step 1

Use puttygen.exe to create new public/private key pair
Copy paste text of key into a new file my_public_key.txt
click on save private key to your computer (in a secure, non-public, non-shared folder)

Step 2

Use a sftp client such as FileZilla, or ssh based program like PSFTP and:
send my_public_key.txt to home directory

Step 3

Start PuTTY.exe
connect to server
enter your username & password
if you have never setup SSH keys before then, at the command prompt type:
$ ssh-keygen -t dsa
press enter for all options as default (no passphrase, filenames, location of files)
If you have setup the server key pairs, then you need to add the public key of the windows computer as an authorized machine:
$ cd .ssh
$ cat ../my_public_key.txt >> authorized_keys
$ exit

Step 4

For a project that you have already cloned (e.g. folder called wogl)
Right click on this folder, in the context menu for "TortoiseGit" goto "Settings"
In the side panel it will show many options. Click under Git->Remote
Click on the remote configuration e.g. "origin"
Where the option for Putty key is shown, click the "..." button to locate the private key
Press OK

git config

Now you should be able to push and pull with this repos without a password prompt.

If you cannot automatically login, you can check to see if putty auto login works by starting new session and providing the private key in the option Connection->SSH->"Private key file for authentication". If you are still prompted for password, then there is a problem with the key construction, or registration of keys with the ssh server (protocols, permissions etc).