|
If you want to use the svn+ssh protocol (svn over an ssh connection) with ZigVersion, then you'll need to use ssh keys and an ssh agent, like SSHKeychain. The url for your connection will look like: svn+ssh://servername/absolute/path/to/repository. If you get an error like the following, then you need to setup SSHKeychain.
Before we configure SSHKeychain, we'll need to start in the shell. Open up a shell, and create the .ssh directory and correct it's permissions:
mkdir ~/.ssh
chmod 700 ~/.ssh
The first time you run SSHKeychain, you'll need to modify a bunch of preferences. Go ahead and open the preferences dialog and follow through.
I prefer having SSHKeychain only display in the status bar instead of always being on the dock, so I modify the display preferences to look like this:

Next we go to SSH Keys. By default, it points to a couple keys that it thinks might be there. I'll assume you don't have any keys made yet, so go ahead and delete all key locations listed. Now click the 'New...' button to create a new key. Click the 'Select...' button to find a path for your key. Since your .ssh directory already exists, it chooses that as a default location. Type a name for your key. I'll use 'erik-key' for mine. The defaults for type and number of bits for your key should be fine. You'll want to type a super secret passphrase into the passphrase box. Don't forget it ;) When you're all done, click the Generate button. (It may take a couple seconds to generate the key). This is what my screen looked like before I clicked the generate button:

After you've generated a new key, your list of keys should look something like this:

We'll now move on to the Security settings. If you leave the default security settings, every time you come out of screen saver your keychain will have to be re-authenticated and you'll find yourself typing your password a lot. If you're paranoid, leave it like this. If this irritates you, change the settings to something like this:

Now on to Environment settings. Click the 'manage (and modify) global environment variables' box. You can go ahead and remove the CVS_RSH key, since we aren't using cvs. (The display may not reflect clicking the minus button right away. Try clicking on the ssh_auth_sock variable and it should update the display properly). When done, your Environment settings should look like this (the number in the path may be different for you.):

Now that SSHKeychain is configured, we want to make sure it starts when we login. Right click on the SSHKeychain icon in the dock and select "Open at login". Now that SSHKeychain is ready, we'll need to logout and log back in again so that we get our environment variables setup for all running applications.
After logging back in...
Ok, logged back in now? It's time to open up your shell and get your public key on the remote system. If you now type:
ls ~/.ssh
You'll see that SSHKeychain made two files for us, our private key "erik-key", and our public key "erik-key.pub". The private key is your super secret key that you must never share. The public key is the one you copy on to any computer you would like to login to. So now, to get the public key onto the server, we'll scp it over there.
scp ~/.ssh/erik-key.pub etest@dev-server.local:
where 'etest@dev-server.local' is your username@servername of your Subversion server. Make sure you have the ":" at the end, that puts the file into your home directory. Answer yes to any questions about unkown fingerprints and whatnot that come up.
You'll notice when you try to scp the file over that SSHKeychain is already asking us for our password! How nice of it! After you tell it your password, you'll still have to type your password at the command line, because the server doesn't know about our key yet.
Now we want to ssh into the server and put our public key in the right place.
ssh etest@dev-server.local
So up until now I've been able to assume what your client looked like, because it's going to be a Mac. The server could be anything and configured in any way, so hopefully the following works for you.
Now that we're logged in, let's see if we have a .ssh directory:
ls -d ~/.ssh
If you get "No such file or directory", then we'll need to make it.
mkdir ~/.ssh
chmod 700 ~/.ssh
Go ahead and move your key file in there for safe keeping.
mv ~/erik-key.pub ~/.ssh
Now we'll need to add the contents of your public key to the list of authorized keys. Depending on your server configuration, this could mean the authorized_keys file or the authorized_keys2 file. We'll do both :)
ls -l ~ # verify that no one else can write to your home directory.
# If in doubt, chmod 700 ~
chmod 700 .ssh # mkdir .ssh first if necessary
cd ~/.ssh
cat erik-key.pub >> authorized_keys
cat erik-key.pub >> authorized_keys2
chmod 600 authorized_keys*
Now it's time to test it! Log out and try to ssh in again:
ssh etest@dev-server.local
If it doesn't ask you for a password, it's all setup!
Make sure svnserve is in your path - type "which svnserve", and it should say something like /usr/local/bin/svnserve. If it says "no svnserve in .....", then it's not in your PATH. You'll need to find out where it is (probably /usr/local/bin), and make sure that is added to your path in your startup script. This is probably done by adding the line "export PATH=$PATH:/usr/local/bin" to .bashrc like so:
echo 'export PATH=$PATH:/usr/local/bin' >>.bashrc
At this point, connecting to the subversion server from ZigVersion should just work. The first time you do it after logging in, SSHKeychain will prompt you for your key passphrase, and that'll be it. Have fun!
If you're still having problems connecting to your server with ZigVersion (or you haven't been able to get SSHKeychain to play nicely), email us at support@zigzig.com or post a question in the forums.
|