Tuesday, September 24, 2013

Using svn+ssh with RapidSVN, do not need to type passwd in every step

Re-posted according to this blog (many thanks to the author):
http://www.wandisco.com/svnforum/threads/31014-Passwordless-ssh-(Rapidsvn-over-ssh)

My experience on using RapidSVN over ssh. I made it using private/public keys authentication and creating a specific tunnel in rapidsvn configuration.

Steps:
1) in your /home/username create a dir for storing ssh keys, let's say "keydir"
[/home/username]$ mkdir keydir
[/home/username]$ cd keydir 

2) create private and public key WITHOUT password
[/home/username/keydir]$ ssh-keygen -f key_name -t rsa 

3) Login on the remote server and create the .ssh dir in the remote home 
...

4) copy the public key in the authorized_keys file in .ssh on the remote server
[/home/username]$ scp keydir/key_name.pub username@server.url:.ssh/authorized_keys

5) check if passwordless login works:
ssh username@server.url -i /home/username/keydir/key_name
(may have to chmod the key file on the server, with some ssh configuration)

6) now create the tunnel. add to /home/username/.subversion/config:
[tunnels]
ssh = $SVN_SSH ssh -i /home/username/keydir/key_name