Clear supplementary groups.
Dump the current privilege state. This option can be
specified more than once to show extra, mostly useless, information.
Incompatible with all other options.
Set supplementary groups. The argument is a
comma-separated list of GIDs or names.
Set the inheritable capabilities, ambient capabilities or
the capability bounding set. See capabilities(7)
. The argument is a
comma-separated list of +cap
which add or remove an entry respectively. cap
can either be a
human-readable name as seen in capabilities(7)
without the cap_
prefix or of the format cap_N
, where N
is the internal
capability index used by Linux. +all
can be used to add
or remove all caps.
The set of capabilities starts out as the current inheritable set
for --inh-caps, the current ambient set for --ambient-caps and
the current bounding set for --bounding-set.
Note the following restrictions (detailed in
capabilities(7)) regarding modifications to these capability
•A capability can be added to the inheritable set
only if it is currently present in the bounding set.
•A capability can be added to the ambient set only
if it is currently present in both the permitted and inheritable sets.
•Notwithstanding the syntax offered by
setpriv, the kernel does not permit capabilities to be added to the
If you drop a capability from the bounding set without also
dropping it from the inheritable set, you are likely to become confused. Do
not do that.
Preserve supplementary groups. Only useful in conjunction
with --rgid, --egid, or --regid.
Initialize supplementary groups using initgroups3. Only
useful in conjunction with --ruid or --reuid.
List all known capabilities. This option must be
Set the no_new_privs
bit. With this bit set,
will not grant new privileges. For example, the set-user-ID
and set-group-ID bits as well as file capabilities will be disabled.
(Executing binaries with these bits set will still work, but they will not
gain privileges. Certain LSMs, especially AppArmor, may result in failures to
execute certain programs.) This bit is inherited by child processes and cannot
be unset. See prctl(2)
in the Linux kernel source.
The no_new_privs bit is supported since Linux 3.5.
--rgid gid, --egid gid, --regid
Set the real, effective, or both GIDs. The gid
argument can be given as a textual group name.
For safety, you must specify one of --clear-groups,
--groups, --keep-groups, or --init-groups if you set
any primary gid.
--ruid uid, --euid uid, --reuid
Set the real, effective, or both UIDs. The uid
argument can be given as a textual login name.
Setting a uid or gid does not change capabilities,
although the exec call at the end might change capabilities. This means
that, if you are root, you probably want to do something like:
setpriv --reuid=1000 --regid=1000 --inh-caps=-all
Set or clear securebits. The argument is a
comma-separated list. The valid securebits are noroot
is cleared by execve(2)
and is therefore not allowed.
Keep, clear or set the parent death signal. Some LSMs,
most notably SELinux and AppArmor, clear the signal when the process'
credentials change. Using --pdeathsig keep will restore the parent
death signal after changing credentials to remedy that situation.
Request a particular SELinux transition (using a
transition on exec, not dyntrans). This will fail and cause setpriv
abort if SELinux is not in use, and the transition may be ignored or cause
to fail at SELinux’s whim. (In particular, this is
unlikely to work in conjunction with no_new_privs
.) This is similar to
Request a particular AppArmor profile (using a transition
on exec). This will fail and cause setpriv
to abort if AppArmor is not
in use, and the transition may be ignored or cause execve(2)
to fail at
Clears all the environment variables except TERM
initializes the environment variables HOME
according to the user’s passwd entry; sets PATH
for a regular user and to
The environment variable PATH may be different on systems
where /bin and /sbin are merged into /usr. The
environment variable SHELL defaults to /bin/sh if none is
given in the user’s passwd entry.
Display version information and exit.
Display help text and exit.