Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

sudo - Execute a command with superuser privileges.

Sudo (superuser do) allows a system administrator to delegate authority to give certain users (or groups of users) the ability to run some (or all) commands as root or another user while providing an audit trail of the commands and their arguments.

The configuration file for sudo is /etc/sudoers (as well as /etc/sudoers.d/* in recent versions). Best practice is to use the visudo command to edit /etc/sudoers. This utility safeguards the user by locking the file (preventing simultaneous edits) and checking for syntax errors before saving the file. It can also be used to edit files in the /etc/sudoers.d directory, by using its -f, --file= option e.g.,

sudo visudo -f /etc/sudoers.d/customisations

Further reading

history | excerpt history