1 .TH really 8 2001-10-21 chiark-backup
3 really \- gain privilege or run commands a different user
7 .RI [ "command args... " ]
10 checks whether the caller is allowed, and if it is it changes its uids
11 and gids according to the command line options and executes the
14 If no options are specified, the uid will be set to 0 and the gids
15 will be left unchanged.
17 If no command is specified,
22 A caller is allowed if it has write access to
24 This is most easily achieved by creating or using a suitable group,
25 containing all the appropriate users, and making
27 group-owned by that group and group-writeable.
30 \fB-u\fR \fIusername\fR | \fB--user\fR \fIusername\fR
31 Sets the uid, gid, and supplementary group list, according to
33 entry in the password and group databases.
35 \fB-i\fR \fIusername\fR | \fB--useronly\fR \fIusername\fR
36 Sets only the uid according to
38 entry in the password database.
40 \fB-I\fR \fIuid\fR | \fB--uidonly\fR \fIuid\fR
41 Sets the uid to the numeric value
43 (which need not correspond to any existing user in the password
46 \fB-g\fR \fIgroupname\fR | \fB--group\fR \fIgroupname\fR
48 is looked up in the group database and its gid is appended to the
49 process's supplementary groups list. If this is the first gid
50 specified it will also be set as the primary gid.
52 \fB-G\fR \fIgid\fR | \fB--gid\fR \fIgid\fR
54 is appended to the process's supplementary groups list.
56 need not correspond to any existing group in the group database.) If
57 this is the first gid specified it will also be set as the primary
60 \fB-z\fR | \fB--groupsclear\fR
61 Clears the process's supplementary groups list. When using this
62 option you must also specify
66 The process's groups will then be exactly those specified. The
69 in the argument list is not relevant.
72 Indicates the end of the options. The next argument (if present) will
73 be interpreted as the command name, even if it starts with a hyphen.
74 .SH SECURITY CONSIDERATIONS
76 is designed so that installing it setuid root is extremely unlikely to
77 compromise the security of any system. It will check using
79 whether the real user is allowed to write to
81 and if this check fails
83 will exit without even attempting to parse its command line.
88 designed to be resistant to malicious command line arguments. Do not
89 allow untrusted processes to pass options to really, or to specify the
90 command to be run. Whether it is safe to allow relatively untrusted
91 processes to pass options to the command which is to be run depends on
92 the behaviour of that command and its security status.
96 to drop privilege is dangerous unless the calling environment is very
97 well understood. There are many inherited process properties and
98 resources which might be used by the callee to escalate its privilege
99 to that of the (root-equivalent) caller. For this function, it is
100 usually better to use
105 does not manipulate the environment at all. The calling program is
106 run in exactly the same environment as the caller passes to
116 accounts will usually need to have these directories on their
122 is used to find the default shell to use in interactive mode (ie, when
123 no command is specified).
127 was written by Ian Jackson <ian@chiark.greenend.org.uk>.
129 It and this manpage are Copyright (C) 1992-5,2003 Ian Jackson
130 <ian@chiark.greenend.org.uk>.
133 is free software; you can redistribute it and/or modify
134 it under the terms of the GNU General Public License as
135 published by the Free Software Foundation; either version 3,
136 or (at your option) any later version.
139 is distributed in the hope that it will be useful, but
140 WITHOUT ANY WARRANTY; without even the implied warranty of
141 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
142 GNU General Public License for more details.
144 You should have received a copy of the GNU General Public
145 License along with this file; if not, consult the Free Software
146 Foundation's website at www.fsf.org, or the GNU Project website at
152 and is available for download from
153 ftp.chiark.greenend.org.uk in /users/ian/chiark-utils/,
154 in source and pre-compiled binary form, and also from Ian Jackson's