Using svn over ssh

misc

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.



Related Entries

23 people found this page useful, what do you think?

Trackbacks

Trackback Address: 531/5966F28C6C9D5FFA6B5B882D429A06F5

Comments

On 01/18/2006 at 12:28:20 PM EST Richard Leggett wrote:
1
With Windows just install the free Tortoise SVN and that will give you context menus and icon overlays allowing you to perform checkouts, updates, commits and revision graphing etc. Installing Subversion without RPM, now that was the tricky bit :)

On 01/18/2006 at 12:38:59 PM EST Pete Freitag wrote:
2
Richard, I've used SVN on windows (and Tortoise SVN), but I connected to my repository over webdav, not SSH. Are you saying that Tortoise SVN has a builtin ssh client?

On 01/18/2006 at 12:55:00 PM EST Richard Leggett wrote:
3
Hi Pete, I think so, I didn't get time to set up WebDav so I'm just using svnserve. Just found this article which relates to the topic:

http://www.logemann.org/day/archives/000099.html

On 01/18/2006 at 1:52:32 PM EST Barney wrote:
4
HTTPS (via Apache2) is a better way to do secure remote access over SSH. As you've seen, SSH requires careful permission manipulation, but that's not the most troubling problem.

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.

On 01/18/2006 at 2:18:47 PM EST Pete Freitag wrote:
5
Barney, I think you mean SSL not SSH.

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.

On 01/18/2006 at 2:47:32 PM EST Barney wrote:
6
I did mean SSH, but did a horrible job wording it. "HTTPS is a better alternative than SSH" is what I should have said. I failed in my conveyance of "prefer HTTPS over SSH".

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.

On 01/18/2006 at 3:48:42 PM EST Pete Freitag wrote:
7
Thanks for your insight barney.

In my case its not worth the overhead of running another server, but it might be for some.

On 01/20/2006 at 5:28:24 PM EST Brian wrote:
8
There's a slight mistake in the syntax for the ssh connection string. You need to add in your username like so:

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

On 01/20/2006 at 5:43:07 PM EST Pete Freitag wrote:
9
Hi 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.

On 02/27/2006 at 8:31:40 PM EST Tom wrote:
10
Install cygwin, you'll then have ssh and more on windows.

On 06/23/2006 at 4:44:48 PM EDT Vivek wrote:
11
I have an svn repository running on a hosted server. I would like to administrator that repository using svnadmin tool. I have the information how to ssh to the server. What i am not understanding is after establishing the ssh connection how would i use svnadmin tool. For example I want to export the whole repository to my local hard so that I can import it into a local svn server. Any Help is appreciated. Vivek

On 10/05/2006 at 12:53:31 PM EDT Darrin Gorski wrote:
12
This is a great thread and has been extremely helpful to me getting TortoiseSVN working. However, in the interest of others viewing this thread, I feel the need to address some misinformation in Barney's initial post.

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

On 11/30/2006 at 3:45:17 PM EST Tom wrote:
13
I've heard it mentioned that when you use the Berkeley DB as the backend for SVN, there is a chance of locking problems. However, the FSFS backend (the current default) is more robust.

On 03/19/2007 at 6:19:52 PM EDT hungrytom wrote:
14
If you are using windows, just download yourself a copy of putty.exe for free and use that to ssh into your server..

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... ;)

On 09/17/2008 at 2:44:54 AM EDT georgexsh wrote:
15
Hi, Pete, svn+ssh:// works fine while opensshd listen on the default port 22, but how to make svn+ssh works while changed opensshd listen on port other than 22? svn+ssh://host:port/path dont work

On 10/05/2008 at 1:16:21 PM EDT Gigs wrote:
16
This was SO MUCH FASTER than DAV. We are talking 5 minutes vs 60 minutes for large operations. Thanks!

On 12/21/2008 at 2:09:36 AM EST christefano wrote:
17
georgexsh, add this line to the "tunnels" section of your config file in ~/.subversion/config

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).

On 03/04/2009 at 1:31:51 AM EST faisal wrote:
18
How can i restrict the access permissions of the svn clients in the following way 1. Can create new folders in the repository 2. Update the files created by themselves 3. Can not delete a delete even if they themselves created it

On 10/16/2009 at 9:25:12 AM EDT cts wrote:
19
We use svn+ssh but have a big problem with the server timing out. I thought I'd googled that the timeout problem was the apache server, but if we're using svn+ssn, apparently apache isn't used...

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.

On 11/11/2009 at 12:56:14 PM EST svnuser wrote:
20
I get this error when i do svn co svn+ssh://xyz.com/trunk mysvn --username X --password passwd

Permission denied (publickey,password).

but this works

svn co svn://xyz.com/trunk mysvn --username X --password passwd

any pointers pls?

On 11/24/2009 at 1:32:05 AM EST Daywraith wrote:
21
I have the same problem as svnuser above.

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?

On 11/24/2009 at 1:32:23 AM EST Daywraith wrote:
22
I have the same problem as svnuser above.

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?

On 03/03/2010 at 5:58:35 AM EST Jyotir wrote:
23
I want to know, if there is a svn co (checkout), from which user, it has been done and when?

On 03/05/2010 at 7:18:36 AM EST Navneet wrote:
24
how can i checkout from linux server to windows through svn.. please help me..

On 03/05/2010 at 7:19:04 AM EST Navneet wrote:
25
how can i checkout from linux server to windows through svn.. please help me..

On 04/09/2010 at 5:37:25 AM EDT Roger wrote:
26
ok my working directory and the repository are both located on a remote server.

Can i still make use tortoise svn client on windows.I mean mounting my remote work directory and then making use svn.

On 04/15/2010 at 11:39:55 AM EDT John Wooten wrote:
27
Want to add a user that has full access without delete to a project in a repository called YYY in the repository XXX. I am admin of svn site (remote). How do I add the user permission and limit them from other projects in XXX?

On 12/15/2010 at 2:58:04 AM EST Santhosh wrote:
28
Hi Greetings of the day.

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

On 12/17/2010 at 10:49:38 PM EST Roger wrote:
29
For those with problems, take a look here: http://penguinapple.blogspot.com/2010/11/installing-svn-over-ssh-on-debian-and.html. One thing that I found is not mentionned over there but is here is that your users need to have r/w access on the repository

On 12/20/2012 at 8:24:19 PM EST cctvsupplier wrote:
30
A satellite digital video recorder, or DVR, captures a satellite TV signal for storage on the internal hard drive and playback to a connected television. The signal passes through a coaxial cable connection to the DVR. Hooking up a security camera enables you to record an area under surveillance to the DVR, or simply monitor an area on a TV connected to the DVR without recording. Use a pair of coaxial cables with threaded RF couplers on the ends. Items you will need 2 coaxial cables TV or video monitor Sponsored Link Security Camera SupplierMade-in-China.com China Supplier of Security Camera. High Quality, Competitive Price! Step 1 Switch off the security camera, DVR and TV or monitor. Step 2 Push on the connector at one end of a cable onto the camera's output port, which is usually on the back edge. Twist the metal ring on the cable clockwise to hold it on the camera. Step 3 Attach the other end to the input on the rear panel of your DVR. Step 4 Connect the second cable from the DVR's output to the RF input on the television set or monitor. Step 5 Turn on the power for the three components and tune the DVR to channel three or four, depending on the camera model. Step 6 Watch the monitor or TV to view the area under surveillance from the camera, or record video by pressing the DVR's record button.

Post a Comment




  



Spell Checker by Foundeo

Recent Entries



foundeo


did you hack my cf?