Using svn over ssh
I was delighted to find that connecting to a subversion repository on a remote server over SSH was quite easy on my Mac (windows may be another story).
All you really need to do is install subversion on the remote server, the subversion install contains something called svnserve that handles all the tunneling magic for you when you connect over SSH.
Now create a repository:
svnadmin create /home/svn/test
Now install the svn client tools on your box. Now you can checkout the repository:
svn co svn+ssh://your.remote-server.com/home/svn/test
That was much easier than I thought it was going to be!
I did run into a few permission issues but its pretty easy to fix those, you just need to make sure the user your connecting with over SSH has permission to read and write to the repository.
As I said connecting with windows may be another story, because windows doesn't come with a ssh command.
Tweet
Related Entries
- Moving a Subversion Repository to Another Server - February 13, 2008
- Ignore Files and Directories in Subversion - December 14, 2007
- Subversion Book for $2.99 - October 28, 2006
Trackbacks
Comments
http://www.logemann.org/day/archives/000099.html
svnserve operates directly on the repository files (using file:/// urls), which means if you ever have two svnserve processes running at the same time, you can get contention, which usually results in a locked repository that has to be taken offline, repaired, and reenabled.
You'll run into the same issue if you combine svnserve and webdav access at the same time.
Bottom line, webdav is the best bet, since it uses a multithreaded server that can handle concurrency without corrupting your database. Apache also supports authentication with client certificates, if you're concerned about security.
I would have preferred connecting over Apache2 and webdav with HTTPS, but in this case I already have Apache 1.3 running, and can't use Apache 2 due to some other requirements, thus the SSH tunnel.
Luckily I don't think I will need to worry much about contention in this case since I will mainly be the only one using it for now.
You can still run Apache2 on a non-standard port. So Apache 1.3 on :80 for your web work, and then Apache2 on :81 (or whatever) for your SVN repositories. Not that it matters a whole lot if none of the SSH downsides are relevant, but for others who might come across this post looking for insight.
In my case its not worth the overhead of running another server, but it might be for some.
svn co svn+ssh://username@your.remote-server.com/home/svn/test
Same syntax as SSH uses. It's actually probably not a mistake because from the command line it will prompt you for the username, but if you want to use it with a tool like TortoiseSVN, you need to pass it all in at once.
Brian
From the shell it will use your local username by default, in my case it was the same as the remote username so I omitted it. But thanks for pointing that out.
There is absolutely no technical reason that you should be concerned about multiple processes accessing the directory. There is no reason the you should not use svnserve, nor is there any reason not to use ssh access. svn was designed for concurrency, and many people use the cli tools on mulituser servers locally operating on the repository.
I was just concerned that people might take away from this discussion that svn+ssh is somehow bad and that apache is the only way to go. In my opionion, the apache+dav solution is for apache folks, and the svn+ssh solution is for ssh folks and it has more to do with your environment and expertise/preference than with any specific technical deficiencies in either approach.
- Darrin
http://svnbook.red-bean.com/en/1.0/ch06s05.html
google putty download
If you want to get really carried away, the best tool out there for easy SVN is TortoiseSVN.
google TortoiseSVN download
Its pretty simple to use and saves a great deal of time which would be spent messing around with SSH clients and typing commands over and over... ;)
ssh2222 = /usr/bin/ssh -p 2222 -l georgexsh
Instead of using "svn+ssh" you can now use "svn+ssh2222" instead (just change "2222" and "georgexsh" to your SSH port and username, respectively).
Why do I have a timeout problem, and is there some other way to access the repository that isn't subject to timeouts? With CVS, you could use ssh directly, and there was never a problem with timeouts.
In case you're not following what I mean with timeouts, if I do an svn diff or svn log or other command with lots of output, *and redirect (or pipe) the output*, then I (often) don't get it all. It's silently truncated.
As a work-around, I'm using script(1) and then doing the command without redirection. But that's terrible.
Permission denied (publickey,password).
but this works
svn co svn://xyz.com/trunk mysvn --username X --password passwd
any pointers pls?
It was working fine using the svn co svn+ssh://user@localhost/project
I was away for a month and the system went down due to power cuts and something seems to have changed (the system was updated)
Now it only works if I do
svn co svn+ssh://localhost/<path to repo>/ --username user --password <path to private key>
Anyone know whats going wrong?
It was working fine using the svn co svn+ssh://user@localhost/project
I was away for a month and the system went down due to power cuts and something seems to have changed (the system was updated)
Now it only works if I do
svn co svn+ssh://localhost/<path to repo>/ --username user --password <path to private key>
Anyone know whats going wrong?
Can i still make use tortoise svn client on windows.I mean mounting my remote work directory and then making use svn.
I did svn co from the svn server system, then I am getting the following error
svn: Can't open file 'flse/.svn/tmp/text-base/pgms.tar.bz2.svn-base': Permission denied.
But svn co is working for the same tree from a different machine.
Please help me to solve this
Post a Comment
Recent Entries
- Writing Secure CFML cfObjective 2013 Slides
- Upgrading to Java 7 on Linux
- J2EE Sessions in CF10 Uses Secure Cookies
- Learn about ColdFusion Security at cfObjective 2013
- Session Loss and Session Fixation in ColdFusion
- FuseGuard 2.3 Released
- CKEditor Spell Checker Plugin
- Adobe Says Go Ahead and Upgrade your ColdFusion JVM


add to del.icio.us


