Options (5)
-c, --commandbooleanRun command as a different user
Example:
sudo runuser {{user}} {{[-c|--command]}} '{{command}}'-g, --groupbooleanRun command as a different user and group
Example:
sudo runuser {{user}} {{[-g|--group]}} {{group}} {{[-c|--command]}} '{{command}}'-l, --loginbooleanStart a login shell as a specific user
Example:
sudo runuser {{user}} {{[-l|--login]}}-s, --shellbooleanSpecify a shell for running instead of the default shell (also works for login)
Example:
sudo runuser {{user}} {{[-s|--shell]}} {{/bin/sh}}-p, --preserve-environmentbooleanPreserve the entire environment of root (only if `--login` is not specified)
Example:
sudo runuser {{user}} {{[-p|--preserve-environment]}} {{[-c|--command]}} '{{command}}'Examples (5)
Run command as a different user and group
Specify a shell for running instead of the default shell (also works for login)
made by @shridhargupta | data from tldr-pages