Ssh – Setting up an SVN Server using SVNServe in Amazon ec2 Ubuntu Linux

amazon ec2sshssh-tunnelsvn

This has been a headache. Where to begin? So far, I've followed this article, along with its follow-up tutorial and my output when I try to do

svn+engine_ssh://[insert-elastic-ip-here]/var/svn/test

I get the following output:

Permission denied (publickey).
svn: To better debug SSH connection problems, remove the -q option from 'ssh' in the [tunnels] section of your Subversion configuration file.
svn: Network connection closed unexpectedly

My config file looks like the following in the tunnels section (on ec2 server):

[tunnels]

engine_ssh = /usr/bin/ssh -l username

I have the same listing in tunnels on my local machine, only using my local username as opposed to my remote username.

I'm guessing the issue is that I need to generate an ssh key and somehow set it up on my server? The issue is that ec2 the file used is called hosts.pem as the IdentityFile for my ssh config file.

Thus, what am I doing wrong here? What can I do? Are there alternatives to using SSH + svn for my server?

If anyone needs more info I'd be glad to post it.

Best Answer

Yeah, you'll need for your server to allow login over SSH in one way or another - be it via allowing password login in your sshd_config or using key logins - see this question for some details on getting key login working.

You're overcomplicating the checkout process a bit; your username spec can be included in the checkout URL, no tunnel config needed. This'll work just fine:

svn+ssh://remoteusername@[insert-elastic-ip-here]/var/svn/test

Are there alternatives to using SSH + svn for my server?

Yes, absolutely. Your question's title references svnserve, but that's not accurate, since you aren't using it - that's method 1, and is pretty basic. You don't want to use it over the internet, as there's no encryption - of data or credentials.

Method 2 is the SSH method that you're presently working with.

Method 3 is a web server using WebDAV to serve the repository; the typical go-to option is Apache and the mod_dav_svn module. You can definitely take a look at it if you don't like the SSH option; it's a little more flexible.