Files
cheatsheet-tldr/tldr/linux/pkexec
2025-11-10 00:21:37 +00:00

24 lines
455 B
Plaintext

---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# pkexec
> Execute commands as another user.
> Asks for password in a GUI if available.
> See also: `sudo`, `run0`, `doas`.
> More information: <https://polkit.pages.freedesktop.org/polkit/pkexec.1.html>.
- Run command as root:
`pkexec {{command}}`
- Switch user to root:
`pkexec`
- Run command as a specific user:
`pkexec --user {{username}} {{command}}`