2025-03-14 21:59:59 -06:00
|
|
|
# doas
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
> Execute a command as another user.
|
|
|
|
|
> See also: `sudo`, `pkexec`, `run0`.
|
2025-03-14 21:59:59 -06:00
|
|
|
> More information: <https://man.openbsd.org/doas>.
|
|
|
|
|
|
|
|
|
|
- Run a command as root:
|
|
|
|
|
|
|
|
|
|
`doas {{command}}`
|
|
|
|
|
|
|
|
|
|
- Run a command as another user:
|
|
|
|
|
|
|
|
|
|
`doas -u {{user}} {{command}}`
|
|
|
|
|
|
|
|
|
|
- Launch the default shell as root:
|
|
|
|
|
|
|
|
|
|
`doas -s`
|
|
|
|
|
|
|
|
|
|
- Parse a configuration file and check if the execution of a command as another user is allowed:
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`doas -C {{path/to/config_file}} {{command}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Make `doas` request a password even after it was supplied earlier:
|
|
|
|
|
|
|
|
|
|
`doas -L`
|