Windows, Eclipse, SSH, SourceForge, and CVS
You may be confused and disheartened by the seemingly complicated process of using the CVS server running on sf0.cise.ufl.edu.
I have been able to get SourceForge CVS access working from within Eclipse running on Windows, a setup that you may also desire.
Download the PuTTY tools
- Download PuTTYgen, Pageant, and Plink to a permanent folder somewhere on your computer. For the purposes of this guide, I will use "C:\Program Files\PuTTY".
Generate your RSA key pair
- Run PuTTYgen. Click the Generate button and move your mouse around like it says.
- Enter a decently long passphrase in "Key passphrase" and again in "Confirm passphrase".
- Click "Save public key" and save the file somewhere on your computer. I will use "C:\Documents and Settings\Matt Whitlock\sf0.pub". You don't really need this file, but it's good to keep around if you should ever need it.
- Click "Save private key" and save the file somewhere on your computer. I will use "C:\Documents and Settings\Matt Whitlock\ssh\sf0.ppk". The file will be encrypted with your passphrase.
- Highlight the entire "Public key for pasting into OpenSSH authorized_keys file" and copy it to the clipboard.
Store your public key in SourceForge
- Log in to CISE SourceForge.
- Click "My Settings" from the toolbar.
- Click the "Authorized Keys" tab.
- Paste your public key into the box. The new key should replace any key that is already there.
- Click "Update" to save your public key in SourceForge.
Use Pageant to provide authentication for SSH
- Start Pageant. It will put an icon in your taskbar notification area.
- Right-click the Pageant notification icon and choose "Add Key".
- Browse to open "C:\Documents and Settings\Matt Whitlock\ssh\sf0.ppk".
- Pageant will ask for your passphrase so it can decrypt your private key. Enter it and click "OK".
Caching the SSH server's host key
Before you can connect to the CVS server with Eclipse, you will have to add sf0.cise.ufl.edu's SSH host key to your local cache.
Method 1 (if you have the full PuTTY client)
- Just try to connect PuTTY to sf0.cise.ufl.edu and when it asks you if you want to trust the host and add its key to your cache, say yes. Then it doesn't matter whether you actually want to log in.
Method 2 (if you have Plink, but not PuTTY)
- Open a Command Prompt and execute:
"C:\Program Files\PuTTY\plink.exe" sf0.cise.ufl.edu -l username
where username is your SourceForge user name. (Note that's a lowercase L before username.)
- You might get a message saying "the server's host key is not cached in the registry." You should answer 'y' to the prompt.
- If you get a message saying "This is a restricted shell account. You cannot execute anything here", your SSH client is correctly set up.
Configure Eclipse to use PuTTY's Plink for SSH
- Start Eclipse. I am using version 3.1M5a as of this writing. These instructions are probably also correct for 3.0.1, but I do not know that for certain.
- Choose "Preferences" from the "Window" menu. Navigate to "Team/CVS/Ext Connection Method".
- Click "Browse" and browse for "C:\Program Files\PuTTY\plink.exe".
- Click "OK" to save your preferences.
Configure Eclipse for sharing JSP files as ASCII text
By default, Eclipse does not treat .jsp files as ASCII text. You should tell it that .jsp files are ASCII or you will run into problems when trying to merge changes to your JSP files later on.
- Choose "Preferences" from the "Window" menu. Navigator to "Team/File Content".
- Click "Add Extension" and type "jsp" and click "OK".
- Select "*.jsp" in the list and click "Change" so its "Content" shows as "ASCII Text".
- You may also wish to add the "css" extension as ASCII text if your project is using external Cascading Style Sheets.
- Click "OK" to save your preferences.
Add your CVS repository to Eclipse
- Choose "Window", "Open Perspective", "Other", "CVS Repository Exploring", and click "OK".
- Right-click in the "CVS Repositories" pane (normally the big empty area on the left side of your screen) and choose "New", "Repository Location".
- Enter "sf0.cise.ufl.edu" for "Host".
- Enter your CVS repository path in "Repository path". You can find this on the "Source code" page of your project on SourceForge. It should look like "/private/cvs/cvsroot/example". Of course, when you enter it into Eclipse, it should not be enclosed in quotation marks.
- Enter your SourceForge user name in "User".
- Password should be left blank. We are not using a password for authentication. Instead, we are using the SSH2-RSA key provided by Pageant. The passphrase you entered before was only so Pageant could decrypt your private key file.
- Choose "ext" for "Connection type".
- Click "Finish". Eclipse should connect to the CVS server and, if all goes well, add the repository location to your list of CVS Repositories.
Check out a project into Eclipse
- Choose "New", "Project" from Eclipse's "File" menu. Choose "CVS/Checkout Projects from CVS". Click "Next".
- Choose "Use existing repository location" and select your SourceForge repository from the list.
- Either type the name of your project folder in "Use specified module name", or better, choose "Use an existing module" and select the project folder from the list. Don't choose "CVSROOT"; it only contains meta-information needed by CVS. If there are other folders shown, then your repository is empty and you should skip to "Check in a project from Eclipse" below.
- Click "Next" and choose how you want to create the project.
- When you get to the "Select Tag" page, you will probably want to choose "HEAD". The "HEAD" tag refers to the most recent revisions of all the files in your repository's "MAIN" branch.
- Click "Finish".
Check in a project from Eclipse
Follow these instructions only if your project has not already been checked in (your repository was empty). Once your project has been checked in by someone, you should use the "Commit" function to upload your changes and "Update" to download changes others have made.
- Switch to either the "Java" or "Resource" perspective and find your project's main folder.
- Right-click on it and choose "Team", "Share Project".
- Select "CVS" as the repository type if you are given an option.
- Choose "Use existing repository location" and select your SourceForge repository from the list.
- You will probably want to "Use project name as module name" but you can also enter a different one. I wouldn't recommend checking into an existing module. Click "Next".
- When I did this, I got some kind of error about a file not being created properly. I just dismissed the error message and then tried again and it worked.
- You should check in your project on the "HEAD" tag, so select it and click "Next".
- Click "Finish".
Configure your CISE Unix account
Follow these instructions if you want to replace your RSA signature on the CISE Unix system with the key you generated with PuTTYgen.
- Start PuTTYgen.
- Click "Load" and browse to open "C:\Document and Settings\Matt Whitlock\ssh\sf0.ppk".
- Enter your passphrase so PuTTYgen can decrypt the file.
- Copy the contents of "Public key for pasting into OpenSSH authorized_keys file" to the file "~/.ssh/id_rsa.pub" on your CISE account.
- Choose "Export OpenSSH key" from the "Conversions" menu.
- Save the file somewhere. You won't need it for long.
- Open the file in a text editor and copy its contents to the file "~/.ssh/id_rsa" on your CISE account.
- That's it!