really - gain privilege or run commands a different user
[command args... ]
checks whether the caller is allowed, and if it is it changes its uids
and gids according to the command line options and executes the
If no options are specified, the uid will be set to 0 and the gids
will be left unchanged.
If no command is specified,
A caller is allowed if it has write access to
This is most easily achieved by creating or using a suitable group,
containing all the appropriate users, and making
group-owned by that group and group-writeable.
-uusername | --userusername
Sets the uid, gid, and supplementary group list, according to
entry in the password and group databases.
-iusername | --useronlyusername
Sets only the uid according to
entry in the password database.
-Iuid | --uidonlyuid
Sets the uid to the numeric value
(which need not correspond to any existing user in the password
-ggroupname | --groupgroupname
is looked up in the group database and its gid is appended to the
process's supplementary groups list. If this is the first gid
specified it will also be set as the primary gid.
-Ggid | --gidgid
is appended to the process's supplementary groups list.
need not correspond to any existing group in the group database.) If
this is the first gid specified it will also be set as the primary
-z | --groupsclear
Clears the process's supplementary groups list. When using this
option you must also specify
The process's groups will then be exactly those specified. The
relative position of
in the argument list is not relevant.
Indicates the end of the options. The next argument (if present) will
be interpreted as the command name, even if it starts with a hyphen.
is designed so that installing it setuid root is extremely unlikely to
compromise the security of any system. It will check using
whether the real user is allowed to write to
and if this check fails
will exit without even attempting to parse its command line.
designed to be resistant to malicious command line arguments. Do not
allow untrusted processes to pass options to really, or to specify the
command to be run. Whether it is safe to allow relatively untrusted
processes to pass options to the command which is to be run depends on
the behaviour of that command and its security status.
Attempting to use
to drop privilege is dangerous unless the calling environment is very
well understood. There are many inherited process properties and
resources which might be used by the callee to escalate its privilege
to that of the (root-equivalent) caller. For this function, it is
usually better to use
does not manipulate the environment at all. The calling program is
run in exactly the same environment as the caller passes to
will not add
accounts will usually need to have these directories on their
to start with.
is used to find the default shell to use in interactive mode (ie, when
no command is specified).
is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 3,
or (at your option) any later version.
is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public
License along with this file; if not, consult the Free Software
Foundation's website at www.fsf.org, or the GNU Project website at
is currently part of
and is available for download from
ftp.chiark.greenend.org.uk in /users/ian/chiark-utils/,
in source and pre-compiled binary form, and also from Ian Jackson's