I used this to root then install a custom rom (CM7 via ROM Manager) without unlocking the bootloader.
[GUIDE] Simple, Non-Destructive Root for Nexus S i9023, i9020A and 4G Gingerbread - xda-developers
[GUIDE] Simple, Non-Destructive Root for Nexus S i9023, i9020A and 4G Gingerbread - xda-developers