Subversion over SSH Access in NetBeans on Windows
The other week I described some general instructions on How to set up Subversion over SSH on Solaris. That's all well and good but to make it useful, you need to configure your clients to access your repository. In another case of "before I forget how I did it", here's some instructions on how to set up access through NetBeans running on Windows.
If you've read any of my previous entries, you'll know that I advocate adding pass-phrases to your SSH keys. This renders them more or less useless if they fall into someone else's hands. Adding pass-phrases, however, generally presents wrinkles here and there. But, so far, they are not unsurmountable. And this case is no different.
First off, you need something that will tunnel your Subversion access through SSH, for this, the best choice is PuTTY. You can grab an entire dist to download but all you will really need is Plink, Pagent, and PuTTYgen. So grab and install a dist that includes those.
Now you need some SSH keys (If you remember from my last post, this whole scheme relies on SSH public-key authentication.) In my case, I already had some SSH keys in my Solaris and OS X environments, and I just wanted to migrate those keys over to PuTTY. So I grabbed the ~/.ssh/id_dsa and ~/.ssh/id_rsa files from my Solaris account. Then fired up PuTTYgen.
The thing here is that PuTTY keeps its key files in a different format than SSH/OpenSSH. So you need to convert them with PuTTYgen. This is pretty easy though. Just use the Conversions->Import Key menu option in PuTTYgen to import your SSH/OpenSSH key, then save the converted private key with the Save private key option in PuTTYgen. Do this for all your private keys. Note that if you have pass-phrase on your private keys, you will be prompted for the password when you import them.
Ok, with the keys converted, quit PuTTYgen, and fire up Pagent. The Pagent daemon is similar to the ssh-agent utility in OpenSSH. It makes your private keys available to requestors without having to re-authorize them by entering the pass-phrases.
When you fire up Pagent, it'll put itself in the System Tray. Double click on the icon to open it up. Simply click on the Add Key button and select each of your keys one at a time to load. Now, just click on the Close button, to put it back in the System Tray.
Oh yeah, in case you haven't already downloaded a Subversion client. Do it now. I just grabbed one of the Windows installers from the Subversion Downloads Page.
Now, another key step, make sure both Subversion and PuTTY are in your PATH. Start up Control Panel -> System, then click on the Advanced tab, and then on Environment Variables. Find the Path variable in the System Variables section and add PuTTY and Subversion, in my case, "C:\Program Files\Subversion\bin;C:\Program Files\PuTTY".
Now, Finally, NetBeans (in my case NetBeans 6.0 Beta 1) enters the picture. Fire up NetBeans, then, the easiest thing to do is to click on Versioning -> Subversion -> Checkout. Enter your "svn+ssh" Subversion Repository URL in the appropriate field, and you will notice NetBeans will give you a hint as to what you need to enter in the Tunnel Command field. If you have done everything correctly, you should simply enter plink, then click on Next. In my case (and how I outlined in my previous entry), I need to login to the Subversion repository as the src user so I had to add an additional "-l src" option to the plink command.
If all has gone well, when you click on Next, you will see NetBeans connecting to the Repository then bring you to a Folders to Checkout screen. Try clicking Browse there, and you should be able to navigate to your trunk and eventually download a working copy for your development work.
If something has gone wrong, it can be a little tricky to figure out what the problem is. I ran the plink utility by had in a cmd window several times during initial setup to solve a few issues.

Hey Joe,
I have a problem working with the Tunnel Command in Netbeans 6 Beta 1. I'm using an Apple and a Windows PC. On my Apple I use the ssh command and on my Win PC I use the Plink.exe for tunneling with a private and public key file without a passphrase. The first checkout and working with the project is no problem, but when I close the IDE and restart it later any update, commit, etc. is not working anymore. Netbeans tells me it cannot find the file specified, although everything worked perfectly well the first time. This problem exists on OSX and on Windows. I even downloaded a NB6 nightly build today, but that didn't fix my problem. Do you have any idea? Thanks a lot and Greets, Daniel
Posted by Daniel on October 18, 2007 at 12:54 PM PDT #
I have svn working over an SVN+SSH connection to my school server, problem:
I am using NetBeans 6.0 and I have correctly setup ssh and svn, the problem is when I initially import the project to the svn, none of my source files are committed to the remote server. (when I use the import function within netbeans, none of my source folders show up in the choose folder to place project into window) what can I do to ensure that these folders are also uploaded to the remote server?
Posted by dr4c4n on February 04, 2008 at 12:07 PM PST #