Standard incantation when you screw something up and can't log in as root (this assumes you are "local" and have physical access to the machine, of course, if it's a remote system, you'll need someone on hand to do it for you):
Reboot, at the lilo/grub boot screen, append 'init=/bin/sh' to the command line. This will boot you straight into a shell (at this point, you are, by definition, root, since the shell is running as init (process 1)). Then, remount / read-write:
mount -o remount,rw /
Fix whatever it is you screwed up (details vary...
Now, remount ro:
mount -o remount,ro /
Finally, exec init to continue booting normally:
(No need to reboot.)