# Sudo
A user generally needs to enter their password to use sudo, and they must be permitted access via rule(s) in the /etc/sudoers file.
Rules can be used to limit users to certain programs, and forgo the password entry requirement.
Run a program as a specific user:
```bash
$ sudo -u <username> <program>
```
List programs a user is allowed (and disallowed) to run with sudo:
```bash
$ sudo -l
```
If the user is allowed to run sudo command unrestricted, privilege escalation is easy, by using the "switch user" (su) command to spawn a root shell:
```bash
$ sudo su
```
If for some reason the su program is not allowed, there are may other ways to escalate privileges:
```bash
$ sudo -s
$ sudo -i
$ sudo /bin/bash
$ sudo passwd
```