1 .TH RUNUSER 1 "July 2014" "util-linux" "User Commands"
3 runuser \- run a command with substitute user and group ID
5 .BR runuser " [options] " \-u
7 .RI "[[\-\-] " command " ["argument "...]]"
9 .BR runuser " [options] [" \- ]
10 .RI [ user " [" argument "...]]"
13 allows to run commands with a substitute user and group ID.
14 If the option \fB\-u\fR is not given, it falls back to
16 semantics and a shell is executed.
17 The difference between the commands
23 does not ask for a password (because it may be executed by the root user only) and
24 it uses a different PAM configuration.
27 does not have to be installed with set-user-ID permissions.
29 If the PAM session is not required then recommended solution is to use
33 When called without arguments,
35 defaults to running an interactive shell as
38 For backward compatibility,
40 defaults to not change the current directory and to only set the
54 uses PAM for session management.
57 .BR \-c , " \-\-command" = \fIcommand
67 to the shell, which may or may not be useful depending on the
70 .BR \-g , " \-\-group" = \fIgroup
71 The primary group to be used. This option is allowed for the root user only.
73 .BR \-G , " \-\-supp\-group" = \fIgroup
74 Specify a supplemental group. This option is available to the root user only. The first specified
75 supplementary group is also used as a primary group if the option \fB\-\-group\fR is unspecified.
77 .BR \- , " \-l" , " \-\-login"
78 Start the shell as a login shell with an environment similar to a real
83 clears all the environment variables except for
87 initializes the environment variables
95 changes to the target user's home directory
98 sets argv[0] of the shell to
100 in order to make the shell a login shell
103 .BR \-m , " \-p" , " \-\-preserve\-environment"
104 Preserve the entire environment, i.e. it does not set
110 The option is ignored if the option \fB\-\-login\fR is specified.
112 .BR \-s , " \-\-shell" = \fIshell
113 Run the specified \fIshell\fR instead of the default. The shell to run is
114 selected according to the following rules, in order:
118 the shell specified with
122 the shell specified in the environment variable
125 .B \-\-preserve\-environment
129 the shell listed in the passwd entry of the target user
135 If the target user has a restricted shell (i.e. not listed in
140 environment variables are ignored unless the calling user is root.
142 .BI \-\-session\-command= command
145 but do not create a new session. (Discouraged.)
147 .BR \-V , " \-\-version"
148 Display version information and exit.
150 .BR \-h , " \-\-help"
151 Display help text and exit.
155 .I /etc/default/runuser
158 configuration files. The following configuration items are relevant
165 Defines the PATH environment variable for a regular user. The
167 .IR /usr/local/bin:\:/bin:\:/usr/bin .
176 Defines the PATH environment variable for root. The default value is
177 .IR /usr/local/sbin:\:/usr/local/bin:\:/sbin:\:/bin:\:/usr/sbin:\:/usr/bin .
185 and \-\-login and \-\-preserve\-environment were not specified
192 normally returns the exit status of the command it executed. If the
193 command was killed by a signal,
195 returns the number of the signal plus 128.
197 Exit status generated by
203 Generic error before executing the requested command
206 The requested command could not be executed
209 The requested command was not found
215 default PAM configuration file
218 PAM configuration file if \-\-login is specified
221 runuser specific logindef config file
224 global logindef config file
233 This \fB runuser\fR command was
234 derived from coreutils' \fBsu\fR, which was based on an implementation by
235 David MacKenzie, and the Fedora \fBrunuser\fR command by Dan Walsh.
237 The runuser command is part of the util-linux package and is
239 .UR https://\:www.kernel.org\:/pub\:/linux\:/utils\:/util-linux/