linux/sudo

Execute as Another User

Execute commands as another user

user
privileges
security

Command

sudo

Explanation

sudo allows running commands with the privileges of another user, typically root.

Examples

Run command as root

sudo apt update

Run command as specific user

sudo -u username command

Start interactive root shell

sudo -i