View Single Post
Posts: 134 | Thanked: 91 times | Joined on Nov 2009 @ Imperial College London
#12
Originally Posted by daperl View Post
I'm not sure if this is the best advice, but if, as root, you add the following line to

/etc/sudoers

Code:
user ALL = NOPASSWD: ALL
you should be able to run anything as root by putting

sudo

in front of it. For instance,

Code:
sudo whoami
should output "root" and not "user."
You should be careful when editing the sudoers file. If you make a mistake with the syntax sudo will stop working entirely.

You can protect against this somewhat be using the "visudo" command. This will test for parse errors when you try to save and potentially save some pain.

Though I guess it should be obvious, it might be worth noting that the above edit is probably not a good idea on a proper multi-user system!

Cheers,
Jan
 

The Following User Says Thank You to Big Phat Jan For This Useful Post: