2016-01-04 02:17:33 +00:00
|
|
|
# su
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
> Switch shell to another user.
|
2016-01-04 02:17:33 +00:00
|
|
|
|
2019-12-30 17:30:30 +00:00
|
|
|
- Switch to superuser (requires the root password):
|
2016-01-04 02:17:33 +00:00
|
|
|
|
|
|
|
`su`
|
2016-01-08 03:47:16 +00:00
|
|
|
|
2019-12-30 17:30:30 +00:00
|
|
|
- Switch to a given user (requires the user's password):
|
2019-01-26 19:33:57 +00:00
|
|
|
|
|
|
|
`su {{username}}`
|
|
|
|
|
2019-12-30 17:30:30 +00:00
|
|
|
- Switch to a given user and simulate a full login shell:
|
2016-01-08 03:47:16 +00:00
|
|
|
|
|
|
|
`su - {{username}}`
|
2019-12-30 17:30:30 +00:00
|
|
|
|
|
|
|
- Execute a command as another user:
|
|
|
|
|
|
|
|
`su - {{username}} -c "{{command}}"`
|