10
Subversion on Mediatemple
Posted at 2:11 PM by Mitchell HashimotoI recently moved all my websites over from Dreamhost to Mediatemple because the performance of my sites at dreamhost has been rather poor. (And it is not my fault) On mediatemple they are flying!
But as I was transferring over my sites and data, I ran into a problem… subversion on mediatemple. Its not an easy on/off switch like dreamhost. This post will guide you to setting up an SVN repository on your (gs) gridserver at mediatemple, and also how to setup your Mac so you can get SVNx to work with it (its tricky!)
Click the read more link below to view the guide.
Setting up the Repository
First things first, we need to create a repository. Doing this is the simple part! (No, really.) Just follow the guide here:
http://kb.mediatemple.net/article.php?id=143
Mediatemple does a good job of documenting that part, but not so much how to setup SVNx (the only real SVN GUI for Mac OS X) to work with their subversion repositories.
Creating your SSH Key
Before SVNx can work with your svn+ssh:// url, you must create a public/private SSH key for your server. To do this, open up terminal and type up the following:
ssh-keygen -t dsa
You should get output like the following. Leave all the options (passphrase and directory) blank for their default values:
Generating public/private dsa key pair. Enter file in which to save the key (/home/mh/.ssh/id_dsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/mh/.ssh/id_dsa. Your public key has been saved in /home/mh/.ssh/id_dsa.pub. The key fingerprint is: 7c:ad:46:32:9e:b6:6c:4b:29:ab:2a:2b:8c:2f:4e:37
Now, your id_dsa file is your private passkey, and you should never ever ever under any circumstances give this to anyone. Your id_dsa.pub file is your public passkey, and this is what can be distributed.
Putting Your Public Key on Your Mediatemple Server
Now what I did here, because I’m honestly too lazy to type out the few basic commands to create chmod a directory, was use an FTP client to SFTP into my mediatemple server. Doing this is simple, you just FTP like normal, but you use your SSH login information and set the port to 22 (instead of FTP’s default 21), then connect.
Once you’re connected, make sure you’re in the “.home” directory. Here, create a folder “.ssh” and chmod to 700. Go into that directory and upload your id_dsa.pub file.
Now go into SSH and do the following:
cd ~/.ssh touch authorized_keys2 chmod 600 authorized_keys2 cat ./id_dsa.pub >> authorized_keys2 rm ./id_dsa.pub
This will put the public key into authorized_keys2 and remote the file, and also set the permissions correctly.
Initial Connection
Before SVNx can use your svn+ssh:// url, you must first log in using your key at least once via command line. Luckily, doing this is very simple:
ssh -2 -v serveradmin%yourdomain.com@yourdomain.com
A wall of text should scroll up and at the end you should see that you’re connected to SSH, passwordless! (seemingly)
Setting up SVNx
Setting up the repository in SVNx is like any other. Create a new repository and then enter the URL which should look like the following, except the domain, site number, and repository name should be different.
svn+ssh://serveradmin%yourdomain.com@yourdomain.com/home/12345/data/my_repo
There is no need to enter a username or password because it is included in the SVN url.
Double click to verify that your repository is working, which it should be. ![]()
12 comments made so far.
Mitchell Hashimoto Oct 22, 2007 at 4:50 pm
Hey Dave,
I did a little Google searching on that subject and the results it pulled up weren’t very promising. I was unable to learn more about that problem. I’ve never seen it myself.
Sorry, but maybe a little bit deeper searching on the issue will bring up the answer.
mitch
Irae Nov 05, 2007 at 7:04 am
This is most welcome help!
Thanks for the tip! I was almost there, using SVN via commandline without password, but missed the -2 -v configuration and svnX config also!
Now it works fine for me!
Dave Jan 06, 2008 at 5:11 pm
Thanks for publishing this. I’m having an issue when trying to do the initial login so that it can validate the key. The wall of text appears and the debug statements find the key. It prompts me for my password (my password to normally SSH in):
…
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: /Users/dmc/.ssh/id_rsa
debug1: Offering public key: /Users/dmc/.ssh/id_dsa
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: keyboard-interactive
Password:
Even if I enter it in, it doesn’t let me in. I’m so close!
Dave Jan 06, 2008 at 8:24 pm
Nevermind… user error on my part. Please disregard and sorry to waist your time.
Rory Mar 25, 2008 at 11:05 am
Dave!
Got the same issue, it all seems to connect but then SVNX wont let me in! Doh! What was your user error? Maybe ive done the same thing?
R
Setting up SVN on my MediaTemple Server at Logging Robby Abaya Sep 30, 2008 at 3:03 am
[...] the directions though, it still didn’t work with svnX. Some googling turned up an article, “Subversion on Mediatemple” by Mitchell Hashimoto, which explains the need for an ssh key. I know a little about those keys, and I’ve used them [...]
brian collette Feb 04, 2009 at 4:32 pm
does this method work for adding more then one user? I have my computer and my partners computer but I would like to add his mac too
Wise Finish Feb 26, 2009 at 4:13 pm
Media temple has some info in their knowledge base about this now: http://kb.mediatemple.net/questions/143/Using+Subversion
David R. May 12, 2009 at 7:26 am
Thanks for posting this information. It’s unbelievable to me that mediatemple leaves its helpdesk tasks to third parties, but I guess that’s how things are going. Thanks for explaining how the ssh key procedure works - mediatemple makes no mention of it.
bladamir » Blog Archive » SVN + MediaTemple Jun 02, 2009 at 12:02 pm
[...] http://mitchellhashimoto.com/subversion-on-mediatemple/ [...]
Jacob Jun 21, 2009 at 10:39 am
Thank you so much! worked like a charm, took me 15 minutes once I found this!
It would be very interesting to know how this would work with multiple users? Would they just create their own key and then their own authorized_keysX file ?
Well done!

Dave Oct 21, 2007 at 12:22 pm
Thanks so much for publishing this - I was completely stumped trying to get SVNx to play nice with Mediatemple. One issue, though: when I try to make the initial passwordless connection to ssh, I get the wall of text, but it then asks me for my password. Within the wall of text are two instances of
debug1: Miscellaneous failure
No credentials cache found
Any ideas how to fix that?
Thanks again,
– Dave