RUNUSER(1) RUNUSER(1) runuser - runuser [] -u [[--] [...]] runuser [] [-] [ [...]] runuser . -u, runuser su . runuser su , runuser ( root) PAM. runuser set-user-ID. PAM ', setpriv(1). , , runuser root. runuser, , HOME SHELL ( USER LOGNAME, root). runuser PAM. Note that runuser in all cases use PAM (pam_getenvlist(3)) to do the final environment modification. Command-line options such as --login and --preserve-environment affect the environment before it is modified by PAM. 2.38, runuser RLIMIT_NICE, RLIMIT_RTPRIO, RLIMIT_FSIZE, RLIMIT_AS RLIMIT_NOFILE. -c, --command= Pass command to the shell with the -c option. Creates a new session via setsid(2). Refer to --session-command to keep the same session. -f, --fast -f, , , . -g, --group= , . root. -G, --supp-group= . root. , --group. -, -l, --login , : o clears all the environment variables except for TERM, COLORTERM, NO_COLOR and variables specified by --whitelist-environment o HOME, SHELL, USER, LOGNAME PATH o o argv[0] <<->> -m, -p, --preserve-environment , HOME, SHELL, USER LOGNAME. , --login. -P, --pty Create a pseudo-terminal for the session. The independent terminal provides better security as the user does not share a terminal with the original session. Please note security advice about TIOCSTI vulnerability below. The entire session can also be moved to the background (e.g., runuser --pty -u user -- command &). If the pseudo-terminal is enabled, then runuser works as a proxy between the sessions (sync stdin and stdout). , , . , , , (: echo "date" | runuser --pty -u ), ECHO , . -s, --shell= . , : o , --shell. o , SHELL, --preserve-environment o passwd o /bin/sh ( /etc/shells), --shell SHELL , , , root. --session-command= Same as -c, but do not create a new session. (Discouraged.) Please note security advice about TIOCSTI vulnerability below. -T, --no-pty Do not create a pseudo-terminal, opposite of --pty and -P. Please note security advice about TIOCSTI vulnerability below. -u, --user= Run command with the effective user ID and group ID of the user name user. -w, --whitelist-environment=_> , --login. <<>> HOME, SHELL, USER, LOGNAME PATH. -h, --help . -V, --version . runuser /etc/default/runuser /etc/login.defs. runuser : ENV_PATH () PATH /usr/local/bin:/bin:/usr/bin. ENV_ROOTPATH (), ENV_SUPATH () PATH root. ENV_SUPATH . /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin. ALWAYS_SET_PATH ( ) yes --login --preserve-environment, runuser PATH. PATH , /bin /sbin ' /usr. --login PAM (, pam_env(8)). runuser, , . , runuser 128. , runuser: 1 126 127 /etc/pam.d/runuser PAM /etc/pam.d/runuser-l PAM, --login /etc/default/runuser runuser logindef /etc/login.defs logindef SECURITY NOTES If runuser shares a terminal with the original session, it is potentially vulnerable to privilege escalation through TIOCSTI/TIOCLINUX ioctl command injection. There are two built-in ways to prevent this: Either you can use runuser with the -c option, which starts a new session via setsid(2) without a controlling terminal. Or, if your use case requires a controlling terminal, for example an interactive session, you can instruct runuser to use a pseudo terminal with the --pty or -P option. runuser su coreutils, David MacKenzie, Fedora runuser, Dan Walsh. setpriv(1), su(1), login.defs(5), shells(5), pam(8) runuser util-linux, Linux . util-linux 2.42.3 2026-09-02 RUNUSER(1)