Back to the nautical motif for a moment; just as one ship generally doesn't
have two captains, it is rare that a small organization would have two systems
administrators. There's usually not too much benefit in delegating authority
in this setting. People are prone to making mistakes. Even a seasoned systems
administrator has sometimes deleted files that he/she shouldn't have or messes
up the configuration of something. If two heads think better than one, then
four hands also might make more mistakes than two.
The use of sudo as alternative
If you're the head systems administrator (or the only one) you can
"deputize" your co-workers by installing and configuring the program
sudo. In Unix/Linux speak, the term 'su' means
superuser - that is, root. Only root has true
administration rights and privileges, so this program allows others to
"do" su, hence the name, sudo. Ok,
Sheriff, time to fight the bad guys. Let's see what your deputies can
do.
 | su can also stand for switch user.
For example, if you had two accounts on a machine - let's say bob and harry -
you could log on as 'bob' and do: su harry
and then work as harry. |
Your distribution should have this very popular program among its packages. If
it doesn't, you can go to:http://www.courtesan.com/sudo and get Todd
Miller's great application. After you've installed it, you have to create
what's called a sudoers file. You do this by typing:
as root.
This is essentially a special version of the text editor
vi just for
creating and editing the
sudoers file.
 | Basic Vi commands |
|---|
| | ESC + : + wq = save and quit |
|
Here is an example sudoers file I have for my home network. It is not really
as complicated as most are, but it gives a good basic idea of what you need to
do to let other users help you out with some administration tasks.
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the sudoers man page for the details on how to write a sudoers file.
#
# Host alias specification
# User alias specification
User_Alias TRUSTED = mike, maria
# Cmnd alias specification
Cmnd_Alias INTERNET = /usr/sbin/traceroute, /usr/sbin/ntpdate
Cmnd_Alias KILL = /bin/kill, /usr/bin/killall
Cmnd_Alias TOOLS = /bin/mount, /bin/umount
# User privilege specification
root ALL=(ALL) ALL
TRUSTED ALL=INTERNET, KILL, TOOLS
|
Let's break this down. First of all, we add the line
User_Alias TRUSTED = mike, maria |
. That means
that the users
mike and
maria become the "trusted" users. And what are they trusted
with? Jump down to the last line for a second. They are trusted with
commands in the group INTERNET, KILL and TOOLS. What are those
commands? Jump back up to the section
#Cmnd alias
specification |
. These trusted users can use
ntpdate, for example, to keep the computer's
time correct. More information on that command later.
[1]
I've created a KILL group (sounds
like Mafia hit men!) so other users can kill runaway process that can
only be shut off by root normally. Some server process may have a
problem and you might have to shut down that process. Starting it
again is something that's not included here however. It might be best
for these deputized users to call the "real" system administrator and if
that's you, for example, you may want to check out the configuration
files for certain servers before you start them again. You may have to
mount floppies or other partitions to get data from them, and that's
where the TOOLS section comes in handy.
When the user executes a command that's authorized in the sudoers file, he/she
first needs to type
and the command. For example, if you wanted to update
the machines clock to the exact time, you would type:
sudo ntpdate atimeserver.nearyou.gov/edu |
Then you need to type your user password. If you
make a mistake, sudo will hurl insults at you (no kidding). Todd
Miller has a good sense of humor and the results of botching a
keystroke are sometimes hilarious!
You can add more commands and users to your own sudoers file. Whatever you
think is prudent in your situation. There is some possibility for abuse. Use
your best judgment.