What does sudo do?
sudo runs a single command with administrator (root) rights, after checking that your user is allowed to in the sudoers rules.
sudo [options] command
Most useful options
| Option | What it does |
|---|---|
| -l | list what you may run with sudo |
| -u user | run as another user |
| -i | open a root login shell |
| -k | forget the cached password |
sudo examples
In security work
Give users sudo rights only for what they really need, and review the sudoers rules regularly.
Questions about sudo
What is the difference between sudo and su?
sudo runs one command as root with YOUR password; su switches to another user with THEIR password.