yeah you want to use sudo. sudo is like a one time su. for example if you want to do an ifdown and an ifup of eth1, you can go like this:
sudo ifdown eth1
{enter YOUR password}
{it does that command as root or whoever you are allowed to sudo as}
sudo ifup eth1
{it remembers you from before and continues}
as root, run
visudo /etc/sudoers
and look at whats in there. That is sudo's configuration file. Its pretty self explanatory. I dont even use su andymore on any of my boxes, since sudo is SOOO much safer (never need to back out of a sudo, where an accidental command in su, can make life hell if you think you are joe, but are really joe su'ed in as root).
sudo is the UNIX's anwer to "run as". You can set it up to do pretty much whatever. Plus if you are running a production server, it logs all of this. Never need to worry who really did what -- the logs say![]()


Reply With Quote

Bookmarks