Current location: Oslo, Norway

Subversion on OS X with SCPlugin (without ssh-askpass)

Posted on Thursday, February 28, 2008 @ 14:39 CET

So I'm slowly re-building my dev environment on my laptop and realized that I hadn't set up Subversion yet. I still love the way SCPlugin integrates with the Finder on OS X and it has just gotten better and better, the installer sure helps.

However when I tried to checkout from the repository I kept getting connection closed errors which aren't very helpful so I fired up the Console.app and saw the problem:

org.tigris.scplugin.SCPluginUIDaemon[1245]: ssh_askpass: exec(/usr/libexec/ssh-askpass): No such file or directory

Sure enough its missing, though macosxhints.com has a way of rolling out your own, though its really long and I'm lazy so no. Instead, its much easier to simply set up key-pairs that will allow you to login without a password saving you from years of unnecessary typing.

So first of all jump into the Terminal and create your local key like so (make sure the username is right) and enter your password when prompted:

$ ssh-keygen -t rsa -f ~/.ssh/id_rsa -C "username@server"

This created a private and public key pair, so the next step is to copy the public key (id_rsa.pub) to the server. You can do this via FTP or SCP, its really up to you. In any case, in your home directory create a .ssh folder if it doesn't already exist.

Within the .ssh folder, if there is an authorized_keys file there already, simply open up id_rsa.pub in a text editor, copy the contents and then paste them on a new line in the authorized_keys file.

So to do it via SCP and stay in the Terminal, first we SSH in to the server and create the .ssh directory like so:

$ ssh username@server

Create the directory and fix the permissions:

$ mkdir ~/.ssh
$ chmod 700 ~/.ssh

Now close the SSH session, then copy the file over and rename it:

$ scp ~/.ssh/id_rsa.pub username@server:~/.ssh/authorized_keys

Finally we just need to fix the permissions on the authorized_keys file:

$ ssh username@server
$ chmod 600 ~/.ssh/authorized_keys

That's it! Now you can SSH in to the server without needing the password, so SCPlugin won't need a password either and thus we dont't need ssh-askpass at all.

- paulo

Post a comment:

You must have Flash and JavaScript enabled to post a comment.