2025-03-14 21:59:59 -06:00
|
|
|
# su
|
|
|
|
|
|
|
|
|
|
> Switch shell to another user.
|
|
|
|
|
> More information: <https://manned.org/su>.
|
|
|
|
|
|
|
|
|
|
- Switch to superuser (requires the root password):
|
|
|
|
|
|
|
|
|
|
`su`
|
|
|
|
|
|
|
|
|
|
- Switch to a given user (requires the user's password):
|
|
|
|
|
|
|
|
|
|
`su {{username}}`
|
|
|
|
|
|
|
|
|
|
- Switch to a given user and simulate a full login shell:
|
|
|
|
|
|
|
|
|
|
`su - {{username}}`
|
|
|
|
|
|
|
|
|
|
- Execute a command as another user:
|
|
|
|
|
|
2025-03-19 19:23:44 -06:00
|
|
|
`su - {{username}} {{[-c|--command]}} "{{command}}"`
|