Sudo

From Mandrivausers Wiki

Jump to: navigation, search

Sudo (superuser do) is a program in Unix, Linux, and similar operating systems such as Mac OS X that allows users to run programs in the guise of another user (normally in the guise of the system's superuser).

In systems like Mandriva, this is just one option for allowing users to execute commands requiring extra privileges. However some systems like Ubuntu require the use of sudo because they do not have a traditional root user and root password.

[edit] Usage

The normal way to use sudo is from the command line, prefixing the command you want to run with sudo, for example:

sudo mkdir /mnt/newmountpoint

By default and as a security measure, users who invoke sudo must supply their own password before running the target program. sudo authenticates users against their own password rather than that of the target user so that not everybody needs to know the root password and the privileges can be controlled more finely. Once authentication has taken place, the system updates a timestamp and the user may then use sudo without a password for a short period of time (five minutes unless overridden in /etc/sudoers).

[edit] Configuration

Access to sudo is configured with the configuration file /etc/sudoers which lists each user who can run sudo, along with the programs they can run. Configurable defaults and options for the program also appear in /etc/sudoers. Be aware that sudo is very picky about correct syntax in its configuration file and will refuse to work if you make the slightest mistake. (Considering that sudo can grant root privileges, this is not an entirely bad idea, as user-unfriendly as it seem.) Therefore, you should use visudo tool to edit the file, rather than opening it directly. Visudo will check your changes for correctness after saving them, and will inform you of any errors, in which case it will offer to reject the changes or re-edit the file.

Personal tools