Here’s an updated guide on how to root your Nexus S and Nexus S 4G on Jelly Bean, ICS, Gingerbread. This new method also installs TWRP recovery instead of ClockworkMod Recovery.
Warning: Unlocking your Nexus S/Nexus S 4G will wipe your personal settings/data/internal storage!
Step 1. Power off your Nexus S or Nexus S 4G.
Step 2. Boot into fastboot mode by holding down both Volume Down and Power buttons together.
Step 3. Once in fastboot mode, connect your Nexus S/Nexus S 4G to your computer via micro-USB cable.