Category Archives: Windows System

SVN: How do you use svn command line on Windows with ssh tunneling?

If you ever used svn command line, you know it is not optimal to type in your password every time you do checkout, checkin, info, etc.  In linux world, it is very easy to setup keys to get around this.  Of course in the world of Windows it is not as easy.  Here are the steps you need to follow to get private/public keys working with your SVN under Windows using ssh tunneling.

Assumptions:  you will be connecting as user “root” to svn server located at “”.  All your files will be saved at c:\ including your svn command line utility

First we will have to generate a key.  We can accomplish this by using a free utility called puttygen.  Run puttygen and click on “Generate” button.  You will have a key similar to below example:

Example of a key generated by puttygen

Example of a key generated by puttygen

Copy this, you will need it in few mins.  At this point, go ahead and create a private key by clicking on:  “Save private key”.  Save this as private.ppk on your C:\. 

Now let us log in to the svn server and add this public key to the authorized_keys2 (see setting up keys for step by step instructions).  I will assume you are using “root” as login.

vi /root/.ssh/authorized_keys2

Make sure when you paste, it is not broken into different lines.  All of the key should be one line.

Ok now back to your Windows machine.  Now we need to set up ssh tunnel to our server.  There are few ways of doing this but for our purpose, we will use another free program provided by the same developers as puttygen: download plink to C:\.  If you do not do this step, you will get following error:

svn: Can't create tunnel: The system cannot find the file specified.

Ok let us set the variables for svn.  Go to command prompt and type (you can also set this in your scripts and inside windows environment.  But since this post is to show you an example, we will just do this):

set SVN_SSH="/plink.exe" -i /private.ppk -l root

Now let’s run this one time manually to cache key:

/plink.exe -i /private.ppk -l root

Press “y” when it asks you to save.  Type exit and get back to your prompt.

Ok now we can test our svn utility.

/svn info svn+ssh://

This should display output similar to:

Path: trunk
URL: svn+ssh://
Repository Root: svn+ssh://
Repository UUID: b9143312-b1a1-11ba-a111-11cdcd1d2222
Revision: 10
Node Kind: directory
Last Changed Author: root
Last Changed Rev: 4
Last Changed Date: 2008-11-18 15:18:47 -0800 (Tue, 18 Nov 2008)

Now you are ready to script your checkouts, do checkin’s with out having to type in your password, etc.

DISCLAIMER: Please be smart and use code found on internet carefully. Make backups often. And yeah.. last but not least.. I am not responsible for any damage caused by this posting. Use at your own risk.

Rsync: Using rsync to backup data from one server to another over SSH. Quick rsync tutorial.

Rsync is a great tool which can be used to do many tasks which involved copying/moving data. If privacy/security is of concern, which it always should be, you can use rsync to do all the copying/moving of data over SSH. Read through “man rsync” to get deeper understanding of rsync. Here is my attempt to a short tutorial on rsync. Let us start with most simple example of using rsync over ssh.

rsync -ae ssh server1:/home /home/backups/server1_home_backup/

This command will download all the files/directories from /home on server1 and copies them to /home/backups/server1_home_backup/
-a = archive mode. This will preserve permissions, timestamps, etc.
-e = specify which remote shell to use. In our case, we want to use ssh which follow right after “e”

Let us improve on this and add couple more parameters:

rsync -zave ssh --progress server1:/home /home/backups/server1_home_backup/
-z = adds zip compression.
-v = verbose
–progress = my favorite parameter when I am doing rsync manually, not so good when you have it in cron. This show progress (how_many_files_left/how_many_files_total) and speed along with some other useful data.

Great.. we are moving along pretty good. Let us add some security to make sure things work the way we want to.

rsync --delete-after -zave ssh --progress server1:/home /home/backups/server1_home_backup/

–delete-after = this will delete files on backup server which are missing from source after ALL syncing is done. If you don’t care of having extra files on your backup server and have plenty of disk space to spare, do not use this parameter.

Lastly, one of the VERY handy parameters,

rsync --delete-after -zave ssh --progress server1:/home /home/backups/server1_home_backup/ -n

The -n (or –dry-run) parameter is great to use for testing. It will not transfer or delete any files, rather will report to you what it would have done if it was ran with out -n parameter. This way you can test it with out destroying or transfering data just to find out that is not what you wanted.

For further reading: man rsync

Windows Vista Ultimate installation (update 2)

Now since I reinstalled Vista 32bit version and its up and running, lets go through what works what don’t.

  1. Daemon Tools (check)
  2. Microsoft Office (check)
  3. Trillian (check)
  4. VMWare Server (CHECK!)
  5. Diskeeper 10 (Nope, apparently I have to go download an update for Vista, postponed)

Ok now the fun part starts. How to get everything working the way I want to.

I need to start my Fedora virtual machine so I can get some development/testing done. And a wall I hit. It says that I don’t have permissions to open the file. I am logged in as a user which belongs to Administrators group. So why do I not have permission? Well let me copy it to desktop and see if that works. Voila! it does! Ok.. I will let this one go since I have already wasted my whole weekend getting Vista going.

OK.. so lets change my hosts file so I can point some domain names to my virtual machine. As always, I open it, make the change, and hit save. BOING! Permission denied! ok.. so apparently I lack lots of permissions to do things. Of course its good for me! uh.. NOT! It might be good for some normal user but its not good for power users like myself. So to my dear friend google I go. ahha! I can edit it by running notepad as Administrator and opening the file from within. Ok.. no problem. Done.

oh.. I need to map my Samba drive so I can access my files directly on my virtual machine. so I type my usually net use command and no go. Looked in the logs and found:

Feb 04 10:34:13 localhost smbd[3454]: [2007/02/04 10:34:13, 0] smbd/password.c:authorise_login(795)
Feb 04 10:34:13 localhost smbd[3454]: authorise_login: rejected invalid user nobody

sigh.. ok now what?! I look up that error on google and got bunch of run arounds. It has to be something to do with how Vista accesses network drive. So I typed gpedit.msc and started looking at security options. I tried one of the options and it seem to work. But it just seemed like it wouldn’t be wise to downgrade security. So I specifically started looking at google results for that particular item related to samba. Sure enough that was the solution few of the results I found said I should use.

Start --> run --> gpedit.msc --> Computer Configuration --> Windows Settings --> Security Settings --> Local Policies --> Security Options --> "Network security: LAN Manager authentication level" --> choose "Send LM & NTLM - use NTLMv2 session security if negotiated" from drop down

Great! 3 days later I have everything working as they should.. or atleast as much as they could. I was once again happy and glad that I don’t have to go thru this for few years until they release another great, overrated, overpriced – operating system.

oh.. before I stop this, don’t delete your user account if you want to use administrator account. By default, administrator account is disabled (for security reasons ofcourse). I am sure using an administrator account as your primary account is full of security risks so be smart about making decision either way 🙂

Second in series:

First in series:

Windows Vista Ultimate installation (update 1)

While looking through my new Vista, I found out that my cpu is 64bit capable! I was like.. OMFG hell yeah! I whipped out the 64bit Vista DVD and nuked all my hard work of setting up software without even giving it a second thought… About 20 mins later, I was back in my new found love, except this time I dove right into installing software. One by one, I get basic stuff installed in following order:

  1. daemon tools (went out and got the upgraded vista version) no problems
  2. Microsoft Office 2007 ultimate, uh.. thank god no problems there
  3. McAfee VirusScan, ofcourse problems.. knew that from 32 bit version but what the hell.. was worth a try
  4. Trillian – another no problem
  5. VMWare Server………………………………………….PROBLEMS! Sigh.. they don’t support 64bit Vista. Who would’ve known? They support installing 64bit version as virtual machines but then why they don’t support 64bit Vista installation is beyond me… ok now this is a BLOCKER. I need my virtual machines to test all the software I install on servers.

Oh well its too late in the morning so time for me to goto sleep and deal with this later.

Next in series:

First in series:

Windows Vista Ultimate installation

There I was sitting and working and minding my own business when I heard bunch of noise outside of my office. So I took my headphones off to tune in to the conversation. One of the developers has gone out and bought Windows Vista Ultimate edition and was talking about installing it and trying it out. I have always tried out all of the Windows flavors since 3.1 as soon as they came out and even did beta runs for NT 4, XP, 2000, 2003 and even Vista. But for some reason after installing and running beta 2 of Windows Vista, I wasn’t very impressed. But when they were talking about installing Vista, I myself got curious to find out how good/bad is the released version. So I went and got myself a copy of Vista Ultimate as well.

I didn’t want to destroy my laptop so I decided to install it on my old computer. The specs of that computer are:

Intel Pentium 3.2 with hyperthreading, 2 gig ram, Nvidia GeForce Ultra with Dual DVI

First thing I noticed was that just starting the installation was REAL slow. I had blank screen for a minute or so. And right after the installtion was done, it was little laggy. That was very disappointing for me so I just didn’t want to deal with lag and decided I am just going to forget about it and get back to working on my laptop. Before I went to sleep, I switched my monitor to my desktop with Vista to shut down the computer. I noticed there was a notice saying that it just did updates. OK so maybe thats why there was the lag but still I didn’t feel like messing with it so I shut it down and went to sleep.

Then comes the weekend and my laptop was acting up. It would lag at boot up and my virtual machines won’t run. So I decided to install it on my laptop and see what happens. Specs: Dual core 2.13 cpu/2gig ram/7200rpm hard drive.

Surpirsingly install went really smooth. The part where it took more than a minute to start on my desktop, tooks less than 10 secs. I just let it finish doing updates after the boot up just to make sure there is no lag caused by that. Once it was done updating, I started to use it as I would. All my hardware was detected and was functioning after first bootup. Things seems to be faster as well. I \\’ed into one of my other machines and there was no lag whatsoever. Generally I notice couple secs lag when I do that. I hit a brickwall right when I tried to install McAfee Virusscan. Sigh… incompatible version.. and another.. diskeeper, incompatible. big sigh… at that point I decided to stop and continue this on later and see if I can get Vista compatible software.

Next in series:

Third/Final in series: