Jun 17 2007
SVN repositories can be remotely accessed via http, https, svn, svn+ssh protocols. The secure approach is to use https or svn+ssh. Most of the times, accessing via https is not feasible because of the additional requirement of the SSL certificate to be installed on your server where the repository is. But it is easy to access via SVN+SSH protocol. The reason being that all you need is SSH server in the remote machine and SSH and SVN client on your local machine. If you are repository server is Linux, then SSH comes by default.
Here are the Assumptions:
On the Remote machine where your repository is present:
- ssh server is up and running
- you have a ssh login account
- the user who logs into the machine via ssh has sufficient permission to read/write the “db” directory in the svn repository.
On the Local machine, ( Assume windows )
- SVN client is installed. If not download it from here and just do a normal install.
- SSH client is installed. If not install putty. You can download from here and do a normal install
Now follow the procedure to checkout a project from a remote SVN repository
- Open the windows explorer
- navigate to the directory where you want the local store to be
- right click the mouse, and select “SVN Checkout”. If you have installed SVN, this option will show up when you do a right click in the explorer.
- A window as shown below opens up.
- enter the svn checkout command. svn+ssh://ssh_username@ssh_remote.machine.name/path/to/repository
- For example, if theusername is ben and the remote machine name is example.com and path to repository is /home/ben/source, then the above command will look like
- Once you enter this, the local machine will ask for the SSH password. Enter the password. It may ask for more than one time. Just reenter.
- Now you should see the code checked out into your local machine.
If you dont want to use a graphical SVN client but a command line svn client, then do the following
svn co svn+ssh://ssh_username@ssh_remote.machine.name/path/to/repository