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
- http://unix.stackexchange.com/questions/8581/which-is-the-safest-way-to-get-root-privileges-sudo-su-or-login
- http://unix.stackexchange.com/questions/1416/redirecting-stdout-to-a-file-you-dont-have-write-permission-on
- http://unix.stackexchange.com/questions/18830/how-to-run-a-specific-program-as-root-without-a-password-prompt