OS Manuals

/usr/bin/setpriv

Run a program with different Linux privilege settings

From setpriv 2.42.4-r2 (os), captured 2026-11-05 by running setpriv --help (exit 0). permalink

Usage:
 setpriv [options] <program> [<argument>...]

Run a program with different privilege settings.

Options:
 -d, --dump                  show current state (and do not exec)
 --nnp, --no-new-privs       disallow granting new privileges
 --ambient-caps <caps>       set ambient capabilities
 --inh-caps <caps>           set inheritable capabilities
 --bounding-set <caps>       set capability bounding set
 --ruid <uid|user>           set real uid
 --euid <uid|user>           set effective uid
 --rgid <gid|group>          set real gid
 --egid <gid|group>          set effective gid
 --reuid <uid|user>          set real and effective uid
 --regid <gid|group>         set real and effective gid
 --clear-groups              clear supplementary groups
 --keep-groups               keep supplementary groups
 --init-groups               initialize supplementary groups
 --list-caps                 list all known capabilities
 --groups <group>[,...]      set supplementary group(s) by GID or name
 --securebits <bits>         set securebits
 --pdeathsig keep|clear|<signame>
                             set or clear parent death signal
 --ptracer <pid>|any|none    allow ptracing from the given process
 --selinux-label <label>     set SELinux label
 --apparmor-profile <pr>     set AppArmor profile
 --landlock-access <access>  add Landlock access
 --landlock-rule <rule>      add Landlock rule
 --seccomp-filter <file>     load seccomp filter from file
 --reset-env                 clear all environment and initialize
                               HOME, SHELL, USER, LOGNAME and PATH

 -h, --help                  display this help
 -V, --version               display version

Arguments:
 <access> is a landlock access; syntax is fs[:<right>, ...>]
 <rule> is a landlock rule; syntax is <type>:<right>:<argument>

 available landlock rule types are:
  path-beneath - filesystem based rule; <argument> is a path

 available landlock filesystems rights are:
       execute - execute a file
    write-file - open a file with write access
     read-file - open a file with read access
      read-dir - open a directory or list its content
    remove-dir - remove an empty directory or rename one
   remove-file - unlink (or rename) a file
     make-char - create (or rename or link) a character device
      make-dir - create (or rename) a directory
      make-reg - create (or rename or link) a regular file
     make-sock - create (or rename or link) a UNIX domain socket
     make-fifo - create (or rename or link) a named pipe
    make-block - create (or rename or link) a block device
      make-sym - create (or rename or link) a symbolic link
         refer - link or rename a file from or to a different directory
      truncate - truncate a file with truncate(2)
     ioctl-dev - invoke ioctl(2) on an opened character or block device

This tool can be dangerous.  Read the manpage, and be careful.
For more details see setpriv(1).
Options (27)
OptionDescriptionSource
-d, --dumpshow current state (and do not exec)help + man
--nnp, --no-new-privsdisallow granting new privilegeshelp + man
--ambient-caps capsset ambient capabilitieshelp
--inh-caps capsSet the inheritable capabilities, ambient capabilities or the capability bounding set.help + man
--bounding-set capsset capability bounding sethelp
--ruid uid|userSet the real, effective, or both UIDs.help + man
--euid uid|userset effective uidhelp
--rgid gid|groupSet the real, effective, or both GIDs.help + man
--egid gid|groupset effective gidhelp
--reuid uid|userset real and effective uidhelp
--regid gid|groupset real and effective gidhelp
--clear-groupsClear supplementary groups.help + man
--keep-groupsPreserve supplementary groups.help + man
--init-groupsInitialize supplementary groups using initgroups3.help + man
--list-capsList all known capabilities.help + man
--groups groupset supplementary group(s) by GID or namehelp + man
--securebits bitsSet or clear securebits.help + man
--pdeathsig keep|clear|<signameKeep, clear or set the parent death signal.help + man
--ptracer pid>|any|noneWhen Yama’s restricted ptrace mode is in effect (that is, when /proc/sys/kernel/yama/ptrace_scope is set to 1), allow being traced via ptrace(2) by the process with the specified PID, or any…help + man
--selinux-label labelRequest a particular SELinux transition (using a transition on exec, not dyntrans).help + man
--apparmor-profile prRequest a particular AppArmor profile (using a transition on exec).help + man
--landlock-access accessEnable landlock restrictions for a specific set of system accesses.help + man
--landlock-rule ruleAllow one specific access from the categories blocked by --landlock-access.help + man
--seccomp-filter fileLoad raw BPF seccomp filter code from a file.help + man
--reset-envclear all environment and initialize HOME, SHELL, USER, LOGNAME and PATHhelp + man
-h, --helpDisplay help text and exit.help + man
-V, --versionDisplay version and exit.help + man

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.