2012-02-15

Workaround for SVN+SSH password hell

How to avoid repeating password input in a SVN+SSH session:

(open console)

C:\> SET SVN_SSH=plink.exe -pw xpto
(define password as plink command option;
if you want to set the SSH command using the full path, you have to use either / or \\ to separate folders in path - unlike most path settings in Windows e.g. C:\\PuTTY\\plink.exe)

C:\> svn co svn+ssh://username@server/repo
(svn will execute the command defined in SVN_SSH environment variable, and plink will not prompt for password because it is provided in the command option)

C:\> SET SVN_SSH=
(clear the environment variable that is exposing the password;
you can also just close the console using the 'exit' command)

These commands assume that you have SVN and PuTTY folders in the PATH environment variable.

1 comment:

Sparrow said...

You can use a similar technique for TortoiseSVN. Go to 'settings', 'network' and set the password on the SSH executable input box. Do not forget to unset it afterwards.