mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-02-03 02:43:18 +00:00
23 lines
419 B
Plaintext
23 lines
419 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.
|
|
> 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}}`
|