CVS and SSH2, not so easy
Yesterday, I was granted commit rights on the Groovy source tree, at Codehaus. Of special interest for me :
- I developed a utility class which helps Groovy create new Readers for text files with the correct encoding already set (I’m really keen on charset/encodings issues),
- Adding some new Groovy methods to the core JDK classes,
- Working on an automatic documentation generation engine “a la” Javadoc, so that it may be possible to browse all the methods that have been added to the core JDK classes.
James asked me if I wanted a CVS access to deal with those matters of interest instead of tunneling through him, and I gladfully accepted. But, alas, here starts the nightmare…
So far, I was a happy Windows user, and a happy IntelliJ user, but I’m starting to change my mind. It seems that IntelliJ does not speak SSH2. It’s clever enough to deal with SSH1, but not SSH2 so far (as far as I know, it that’s not the case, please, please tell me how that works!) Thus, I’ve had to do everything through the good ol’command line. I’ve set up a page on Codehaus about that. Read on the steps to follow that I have reproduced here…
- First of all, you have to install CYGWIN on your platform: download it here and don’t forget to check the options OpenSSH (will be needed for key pair generation) and CVS (you know how useful it may be), let’s assume you’ve installed it in c:\cygwin which is the default installation directory
- Add c:\cygwin\bin to your system path
- Open up a bash terminal and type ssh-keygen -t dsa to create an SSH key pair with the default name id_dsa and id_dsa.pub, and don’t forget your pass phrase, otherwise your keys will be useless, (put both keys in c:\cygwin\home\jsmith\.ssh)
- Give Bob the despot (or the person responsible for the task) your public key (id_dsa.pub) so that he installs it on the CVS server
- Once Bob tells you your account is created and your key installed, type eval `ssh-agent` in a terminal (it will tell you it’s running in background with pid xxx)
- Type ssh-add to add your SSH key to the ssh-agent you’ve just launched to take care of the SSH connection and authentication
- In order to test your connection, you can follow this optional step : type ssh jsmith@cvs.codehaus.org to test if the connection succeeds then logout. If it fails, you’re in trouble! Review all the steps carefully! eventually, export CVS_RSH=ssh to tell CVS that you’re using CVS through SSH
- You’re done, now use cvs commands like cvs -d :ext:jsmith@cvs.codehaus.org:/scm/cvs -co groovy to checkout the latest flavour of groovy (or whatever other project)
So now, you can call yourself a Codehaus commiter