tldr/pages/common/su.md

21 lines
375 B
Markdown
Raw Normal View History

2016-01-04 02:17:33 +00:00
# su
> Switch shell to another user.
2022-01-25 15:50:37 +00:00
> More information: <https://manned.org/su>.
2016-01-04 02:17:33 +00:00
- Switch to superuser (requires the root password):
2016-01-04 02:17:33 +00:00
`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:
`su - {{username}} -c "{{command}}"`