The sudo Command

The sudo command offers another approach to giving users administrative access.

When trusted users precede an administrative command with sudo, they are prompted for their own password.

Then, once authenticated and assuming that the command is permitted, the administrative command is executed as if by the root user.

The basic format of the sudo command is as follows:

sudo command

In the above example, command would be replaced by a command normally reserved for the root user, such as mount.

The sudo command allows for a high degree of flexibility. For instance, only users listed in the /etc/sudoers configuration file are allowed to use the

sudo command and the command is executed in the user’s shell, not a root shell.

Example from /etc/sudoers

# User privilege specification
root ALL=(ALL) ALL

# Uncomment to allow members of group sudo to not need a password
# (Note that later entries override this, so you might need to move
# it further down)
# %sudo ALL=NOPASSWD: ALL

# Members of the admin group may gain root privileges

%admin ALL=(ALL) ALL
%eeeuser ALL=NOPASSWD: /etc/acpi/eeepc/eeepc-actions.sh, /etc/acpi/eeepc/eeepc-lvds-toggle.sh

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.