OS Manuals

/usr/bin/runuser

Run a program with substitute user and group ID

From runuser 2.42.4-r2 (os), captured 2026-11-05 by running runuser --help (exit 0). permalink

Usage:
 runuser [options] -u <user> [[--] <command>]
 runuser [options] [-] [<user> [<argument>...]]

Run <command> with the effective user ID and group ID of <user>.  If -u is
not given, fall back to su(1)-compatible semantics and execute standard shell.
The options -c, -f, -l, and -s are mutually exclusive with -u.

Options:
 -u, --user <user>               username
 -m, -p, --preserve-environment      do not reset environment variables
 -w, --whitelist-environment <list>  don't reset specified variables

 -g, --group <group>             specify the primary group
 -G, --supp-group <group>        specify a supplemental group

 -, -l, --login                  make the shell a login shell
 -c, --command <command>         pass a single command to the shell with -c
 --session-command <command>     pass a single command to the shell with -c
                                   and do not create a new session
 -f, --fast                      pass -f to the shell (for csh or tcsh)
 -s, --shell <shell>             run <shell> if /etc/shells allows it
 -P, --pty                       create a new pseudo-terminal
 -T, --no-pty                    do not create a new pseudo-terminal (bad security!)

 -h, --help                      display this help
 -V, --version                   display version


For more details see runuser(1).
Options (14)
OptionDescriptionSource
-u, --user userRun command with the effective user ID and group ID of the user name user.help + man
-m, -p, --preserve-environmentPreserve the entire environment, i.e., do not set HOME, SHELL, USER or LOGNAME.help + man
-w, --whitelist-environment listDon’t reset the environment variables specified in the comma-separated list when clearing the environment for --login.help + man
-g, --group groupThe primary group to be used.help + man
-G, --supp-group groupSpecify a supplementary group.help + man
-l, --loginStart the shell as a login shell with an environment similar to a real login:help + man
-c, --command commandPass command to the shell with the -c option.help + man
--session-command commandpass a single command to the shell with -c and do not create a new sessionhelp + man
-f, --fastPass -f to the shell, which may or may not be useful, depending on the shell.help + man
-s, --shell shellRun the specified shell instead of the default.help + man
-P, --ptyCreate a pseudo-terminal for the session.help + man
-T, --no-ptyDo not create a pseudo-terminal, opposite of --pty and -P.help + man
-h, --helpDisplay help text and exit.help + man
-V, --versionDisplay version and exit.help + man
Exit status (3) from the manual page
1Generic error before executing the requested command
126The requested command could not be executed
127The requested command was not found

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.