(Modified 2005 Jan 17)
sudo
enabling root priviledges to other users
Suppose you want to install an RPM for PACKAGE_NAME.rpm. You'd have to log in as root, type
rpm -ivh PACKAGE_NAME.rpm
and log out.
sudo is an alternative to logging in as root. It's handy if you want to run a small number of root commands, e.g., one single command. You have to enable it explictly though. Below on my notes on how to enable sudo for a particular user and what various parameters mean. This information is summarized from A.P. Lawrence and Vintela, and man sudo will probably give you more information than you can handle.
To enable sudo, you'll need to edit the file /etc/sudoers
You'll need to do this as root. You might need to override that it's a read-only file; in the vi editor, you'd do this by exiting with wq! instead of wq
By default, there'll be a line that reads:
root ALL=(ALL) ALL
The first "ALL" refers to what machines on the network you're allowed access. The second "ALL" refers to what users you can act as. The third "ALL" refers to what commands you can run.
To give full access to another user, duplicate that line and change root to the respective username, e.g.:
usr2 ALL=(ALL) ALL
Now, if usr2 wants to install an RPM, he'll have to type
sudo rpm -ivh PACKAGE_NAME.rpm
and likely usr2's password.
There's a way to not require entering the user's password afterward. I haven't done this yet, so I'd recommend referring to the above links for this. Also, those links are useful if you want to limit users' access to particular machines, commands, etc.
This page is Lynx-enhanced