Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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


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


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.

share|improve this question

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:


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.

share|improve this answer

I'm guessing from the error you're seeing that you haven't put your personal ssh key onto the remote machine.

A quick solution to your problem would probably be to just add your local to the server's authorized keys file.

First: cat ~/.ssh/

Second: copy that full string and then edit /home/USERNAME/.ssh/authorized_keys pasting the string there.

If you don't have a personal ssh key yet, just run ssh-keygen.

Optionally if you don't want to do that, you can just use the ssh key for the EC2 machine by specifying the SVN_SSH environment variable.

export SVN_SSH="ssh -i path_to_your/key/goes/here"

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.