OpenStudio desktop

sudo

sudo (Super User DO...) is used to temporarily gain full or partial root permissions for a normal user.

It adds unwanted complexity to the administration of Linux systems (more complex is always less stable and secure because more can go wrong), but also comes with some benefits:

On complex server systems with several administrators and different admin roles it can be used to allow each admin to gain just the permissions they need.

On personal computers it can be used to allow normal users to get some extended permissions, for example to shutdown the computer, without the use of (very complex) abstraction layers like ConsoleKit.

Usage

Use sudo like this:
$ sudo nano /etc/fstab to edit the file system tab with root permissions without being logged in as root.

The file /etc/sudoers specifies who can use sudo for what commands and if a user password must be provided or not.

Any file put in the directory /etc/sudoers.d will be included as an extension of the sudoers file. This way rules can be added to sudo without editing the sudoers file.

Usually permissions are granted for members of groups. sudo, admin and wheel are common administration groups. Members will be allowed to run any command as long as the user provides its own password (not the root password). This way members of the group sudo can be administrators without having the root password.

Edit the sudoers file like this: # EDITOR=nano visudo /etc/sudoers

Change nano to any editor you prefer, but sudoers or any extension of it must always be edited with the visudo command. It is a safety precaution.

GUI version of sudo

gksudo is a GUI version of sudo, just like gksu is the GUI version of su. A popup will be launched to input the password if needed. Useful to do things with root permissions from a GUI.