Tips & Tricks
Windows
How to tunnel TortoiseSVN through putty without public keys?
How to enable focus-follow-mouse behavior in Windows?
TortoiseSVN in combination with SVN repository via ssh can be annoying when asking every other second for reentering your password. The normal approach to overcome this issue is to use public key authentication. Sometimes, either for security reasons on the client side or because the server hosting the repository does not support public key authentication, you have to find a different way. In the following I will describe how to setup a tunnel via putty. This approach requires just one time the entering of the password to login into the server machine. The following description describes how to setup such a tunnel.
The following example uses svn+ssh://foo.com/bar as the target SVN repository. The location of the configuration options is expressed [A/B], the sub element B in the top level category.
- Create a new putty profile
- Choose a random local port that is used as connection point for the local end of the tunnel. Keep in my that
certain OS dependent restrictions apply (e.g., port > 1023). For the sake of this example we choose 12345.
Then setup the remote server command by inserting
svnserve -d --foreground --listen-port 12345
in the Connection/SSH configuration page. - Add the port forwarding in [Connection/SSH/Tunnels]. Enter 3690 as the source port, enter localhost:12345 as Destination, select the local option and press the add button.
- Enter hostname/IP in [Session]
- Enter a name (e.g., 'foo.com [svnserve]') for the session in [Session] and save it for later reuse.
- Use the newly created connection to create the tunnel. Login as you would normally do. Unlike a normal ssh connection, this connection will not yield in a shell, because instead of lunching a shell at the remote end, this tunnel starts a svnserve command. If you logged in correctly and putty seems to 'hang', the tunnel and the svnserve command should be up and running. (Note some remote sides explicitly deactivate the support for port forwarding)
- Checkout the SVN repository via the tunnel:
- Remove the ssh part of the protocol specifier svn+ssh:// ==> svn://
- Replace foo.com with localhost
- Use the resulting URL svn://localhost/bar to checkout your repository.
- Some server configurations prohibit the forwarding of port. Sometimes you will see some warning message in the console. You check the correct functionality by simply trying to connect to the svn server via telnet. If the port forwarding is disable on the server side, there is currently no way to work around that problem.
-
Sometimes you can checkout the SVN repository but get an authentication error while trying to commit changes. This is comes
from the fact that by default, everybody is allowed to checkout the SVN repository, but not allowed to commit changed. One way
to solved this problem by either allowing write access by anonymous users (bad idea) or setting up user accounts for the repository
(better):
- Activate the password file in the /path/to/REPOSITORY/conf/svnserve.conf, by uncommenting the password-db entry.
- Add as much user/password pairs to the /path/to/REPOSITORY/conf/password file in the users section.
- Open regedit.
- Find the following key : HKEY_CURRENT_USER\Control Panel\Desktop\UserPreferencesMask
- Set the lowest bit of the associated value. Note that the entry is in little-endian. Therefore the lowest bit is in the left most byte i.e.: 9E 3E ... becomes 9F 3E ...
- Logout and login to activate the changes.
- NOTE:Windows was not designed for focus-follow-mouse and therefore some things might not work as expected (e.g. tooltips).