4.2 The “sudo” command

The sudo (switch user and do) command allows a normal user to elevate to root on a command-by-command basis. If there are ten commands to execute as root, then all ten commands must be preceded by sudo. The first time sudo is used, the system asks for the password of the regular user, not that of the root account. After the first authentication, subsequent sudo uses do not require authentication.

Furthermore, sudo also has a timeout feature. root access 15 minutes from the last sudo will require authentication again. This means that if a user uses sudo to perform administrative work, the system automatically locks out root access after 15 minutes.

Not everyone can use sudo to gain root access. A special file /etc/sudoers keeps track of who can sudo as whom for what.