Donnerstag, 30. Oktober 2008

Mercurial Eclipse over SSH

How to get Mercurial Eclipse running over SSH:

Mercurial Eclipse uses the command line SSH command. It cannot supply the password correctly, though. Apparently the plugin tries to start ssh and then times out when ssh asks for the password.

The way to get the whole thing running therefore is to generate a key pair with ssh-keygen and deposit it on the server. Then you can log in without using a password. (See instructions to get command line SSH on Windows bellow if you need it).

  • just type ssh-keygen and create a new key pair without pass phrase (i.e. empty pass phrase). You will end up with 2 files e.g. my_key and my_key.pub
  • my_key.pub contains exactly one line which you should copy into the ~/.ssh/authorized_keys file on your server (just create the file if it doesn't exist yet).
  • on your local machine rename the other file (my_key) to ~/.ssh/id_rsa
  • if all worked well you should be able to login to your server on the command line by typing 'ssh username@yourhost.net' without supplying a password
If that worked you should be able to clone your repositoty from within Mercurial Eclipse:

  • go to the Team Synchronization perspective
  • File -> New -> Project... -> Mercurial -> Clone Repository using Mercurial
  • in the URL field type ssh://username@yourhost.com
  • click Finish
  • thats it...
If your are running Windows you need to get OpenSSH running. You can do this by installing Cygwin:
  • Download and install Cygwin. Make sure to include the OpenSSH package
  • add C:\cygwin\bin (or wherever else you chose to install Cygwin) to your PATH variable (Control Panel -> System -> Advanced -> Environment Variables)
  • check if it worked by opening a new command prompt and typing ssh. If the command is found it worked