sudo is a command-line UNIX utility that allows you to execute a command as another user (most likely, the superuser). Usually you’ll use it to execute a single command:
or to start a shell:
sudo is similar to the
su command – the
su command also allows you to become another user (most likely root). The difference is that
su requires you to type the other user’s password.
sudo allows you to use your own password. The file
/etc/sudoers tells the system who is allowed to do what using the
sudo command. In a multiuser environment, this has the benefit of allowing multiple users to become root (or other users) without giving them the root password. Then you can easily revoke root privileges from a user if you need to without affecting the other people who may need to become root.