2016-01-03 21:17:33 -05:00
|
|
|
# su
|
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
> Switch shell to another user.
|
2022-01-25 22:50:37 +07:00
|
|
|
> More information: <https://manned.org/su>.
|
2016-01-03 21:17:33 -05:00
|
|
|
|
2019-12-30 17:30:30 +00:00
|
|
|
- Switch to superuser (requires the root password):
|
2016-01-03 21:17:33 -05:00
|
|
|
|
|
|
|
`su`
|
2016-01-07 19:47:16 -08:00
|
|
|
|
2019-12-30 17:30:30 +00:00
|
|
|
- Switch to a given user (requires the user's password):
|
2019-01-26 20:33:57 +01:00
|
|
|
|
|
|
|
`su {{username}}`
|
|
|
|
|
2019-12-30 17:30:30 +00:00
|
|
|
- Switch to a given user and simulate a full login shell:
|
2016-01-07 19:47:16 -08:00
|
|
|
|
|
|
|
`su - {{username}}`
|
2019-12-30 17:30:30 +00:00
|
|
|
|
|
|
|
- Execute a command as another user:
|
|
|
|
|
2025-03-13 04:41:47 +02:00
|
|
|
`su - {{username}} {{[-c|--command]}} "{{command}}"`
|