2016-01-03 21:17:33 -05:00
|
|
|
# su
|
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
> Switch shell to another user.
|
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:
|
|
|
|
|
|
|
|
`su - {{username}} -c "{{command}}"`
|