Switch to the directory where you downloaded the SDK (In my case it was Media/Downloads)

cd Media/Downloads

Extract the SDK Zip and switch to the new directory

unzip sdk-tools.zip
cd sdk-tools

Make the applications executable

chmod a+x fastboot-linux adb-linux

Now, Boot your phone into fastboot mode by pressing and holding the volume-up AND volume-down AND the power buttons UNTIL you see the little green Android laying on his back with door on his chest open

Verify that fastboot can “see” your device

./fastboot-linux devices

You should see something similar to this:

0146B5030B02100E fastboot

If you don’t see anything, try running the command as root.

Next we start the unlock process for the bootloader by issuing the following command. Keep in mind that this will completely wipe out all data from the phone so make sure you backup before running the command.

./fastboot-linux oem unlock

Confirm that you want the bootloader to be unlocked by acknowledging the warning message on the phone. (Please note that this will void your warranty). Use your volume rocker/keys to select the confirmation and press the power button to actually confirm.

At this point you have an unlocked bootloader and now we will start the rooting process.

I had to manually copy the su.zip to the Phone because for some reason I kept getting an ‘error: insufficient permissions for device’ when I tried copying the file using adb. I used FTP (as I have SwiFTP on the phone, but you can use any method that you are comfortable with)

Soft boot the ClockworkMod custom recovery by issuing the following command. This method will not replace the currently installed recovery partition on your phone, so you can still receive updates from Google.

./fastboot-linux boot recovery-clockwork-5.5.0.2-maguro.img

Your phone should now boot into ClockworkMod custom recovery. The next few steps are done on the phone. You shold use the volume key / rocker to navigate and the power button to select an entry.

From the main ClockworkMod Recovery screen / menu, select ‘install zip from sdcard‘

Select ‘choose zip from sdcard‘

Select ‘su.zip’

Confirm that you want do this.

Select ‘*****Go Back*****”

Select the ‘reboot system now‘

That’s it. 🙂 Once your phone finishes rebooting, you should now have root. If you hit issues, try reaching out to the folks in the Android Forums for help.

Hope this helps.

Update (14th Feb 2012): As you all know links/stuff tends to disappear over time on the internet so I have updated the post with links to my mirror of the software required to root the Nexus. Original links are still listed below.