`sudo` is a command that allows a user to use commands with the privileges of another user, usually the root user.
sudo
is a command that allows a user to use commands with the privileges of another user, usually the root user.
The difference with su
is that su
allows a user to become another user, and remain that user until they log out. sudo
, by contrast, allows a user to execute one commend with another users privileges.
To use sudo
, a user needs to enter their password, to once again verify that they are who they claim to be. Note that it is the user's own password, not the root password, that is required to use sudo
.
On some systems, like Ubuntu, the root user is disabled by default, to prevent people from gaining root access by guessing the password. A user with the appropriate sudo privileges can then perform commands with root privileges by prefixing their command with sudo
.