FahamLah

Commands

sudo

sudo <command>

Risk: Careful

What it does

Runs one command as root, the user with every key. The server writes it down.

When to use it

Only when the job truly needs root: services, packages, system files.

Example

$ sudo systemctl restart nginx

Restart the web server as root.

$ sudo -u www-data touch uploads/a.jpg

Run as another user, here the web staff.

$ sudo -i

Open a root shell (# prompt). Type exit to leave.