OS Manuals

/usr/bin/capsh

various utilities included with libcap

From libcap-utils 2.78-r4 (os), captured 2026-11-05 by running capsh --help (exit 0). permalink

usage: /usr/bin/capsh [args ...]
  --addamb=xxx   add xxx,... capabilities to ambient set
  --cap-uid=<n>  use libcap cap_setuid() to change uid
  --caps=xxx     set caps as per cap_from_text()
  --chroot=path  chroot(2) to this path
  --current      show current caps and IAB vectors
  --decode=xxx   decode a hex string to a list of caps
  --delamb=xxx   remove xxx,... capabilities from ambient
  --drop=xxx     drop xxx,... caps from bounding set
  --explain=xxx  explain what capability xxx permits
  --forkfor=<n>  fork and make child sleep for <n> sec
  --gid=<n>      set gid to <n> (hint: id <username>)
  --groups=g,... set the supplemental groups
  --has-a=xxx    exit 1 if capability xxx not ambient
  --has-b=xxx    exit 1 if capability xxx not dropped
  --has-ambient  exit 1 unless ambient vector supported
  --has-i=xxx    exit 1 if capability xxx not inheritable
  --has-p=xxx    exit 1 if capability xxx not permitted
  --has-no-new-privs  exit 1 if privs not limited
  --help, -h     this message (or try 'man capsh')
  --iab=...      use cap_iab_from_text() to set iab
  --inh=xxx      set xxx,.. inheritable set
  --inmode=<xxx> exit 1 if current mode is not <xxx>
  --is-uid=<n>   exit 1 if uid != <n>
  --is-gid=<n>   exit 1 if gid != <n>
  --keep=<n>     set keep-capability bit to <n>
  --killit=<n>   send signal(n) to child
  --license      display license info
  --mode         display current libcap mode
  --mode=<xxx>   set libcap mode to <xxx>
  --modes        list libcap named modes
  --no-new-privs set sticky process privilege limiter
  --noamb        reset (drop) all ambient capabilities
  --noenv        no fixup of env vars (for --user)
  --print        display capability relevant state
  --quiet        if first argument skip max cap check
  --secbits=<n>  write a new value for securebits
  --shell=/xx/yy use /xx/yy instead of /bin/bash for --
  --strict       toggle --caps, --drop and --inh fixups
  --suggest=text search cap descriptions for text
  --supports=xxx exit 1 if capability xxx unsupported
  --uid=<n>      set uid to <n> (hint: id <username>)
  --user=<name>  set uid,gid and groups to that of user
  ==             re-exec(capsh) with args as for --
  =+             cap_launch capsh with args as for -+
  --             remaining arguments are for /bin/bash
  -+             cap_launch /bin/bash with remaining args
                 (without -- [/usr/bin/capsh] will simply exit(0))
Options (40)
OptionDescriptionSource
--addamb xxxAdds the specified ambient capability to the running process.help + man
--cap-uid nuse the cap_setuid(3) function to set the UID of the current process.help + man
--caps xxxSet the prevailing process capabilities to those specified by cap-set.help + man
--chroot pathExecute the chroot(2) system call with the new root-directory (/) equal to path.help + man
--currentDisplay prevailing capability state, 1e capabilities and IAB vector.help + man
--decode xxxdecode a hex string to a list of capshelp + man
--delamb xxxRemoves the specified ambient capability from the running process.help + man
--drop xxxRemove the listed capabilities from the prevailing bounding set.help + man
--explain xxxGive a brief textual description of what privileges the specified capability makes available to a running program.help + man
--forkfor nThis command causes the program to fork a child process for so many seconds.help + man
--gid nForce all GID values to equal id using the setgid(2) system call.help + man
--has-a xxxExit with status 1 unless the ambient vector has capability xxx raised.help + man
--has-b xxxExit with status 1 unless the bounding vector has capability xxx in its (default) non-blocked state.help + man
--has-ambientPerforms a check to see if the running kernel supports ambient capabilities.help + man
--has-i xxxexit 1 if capability xxx not inheritablehelp
--has-p xxxExit with status 1 unless the permitted vector has capability xxx raised.help + man
--has-no-new-privsexit 1 if privs not limitedhelp
--help, -hDisplay the list of commands supported by capsh.help + man
--iab ...Attempts to set the IAB tuple of inheritable capability vectors.help + man
--inh xxxSet the inheritable set of capabilities for the current process to equal those provided in the comma separated list.help + man
--is-uid nExit with status 1 unless the current UID equals <id>.help + man
--is-gid nExit with status 1 unless the current GIQ equals <id>.help + man
--keep nIn a non-pure capability mode, the kernel provides liberal privilege to the super-user.help + man
--killit nThis commands causes a --forkfor child to be kill(2)d with the specified signal.help + man
--licensedisplay license infohelp
--modeDisplay the prevailing libcap mode as guessed by the cap_get_mode(3) function.help + man
--modesLists all of the libcap modes supported by --mode=<mode>.help + man
--noambDrops all ambient capabilities from the running process.help + man
--noenvSuppresses overriding of the HOME and USER environment variables when a subsequent --user argument is processed.help + man
--printDisplay prevailing capability and related state.help + man
--quietThis argument is ignored unless it is the first one.help + man
--secbits nSet the security-bits for the program.help + man
--strictThis option toggles the suppression of subsequent attempts to fixup --caps= and --inh= arguments.help + man
--uid nForce all UID values to equal id using the setuid(2) system call.help + man
--user nameset uid,gid and groups to that of userhelp + man
--inmode modeConfirm that the prevailing mode is that specified in <mode>, or exit with a status 1. (in the manual page but not in --help)man
--groups gid-listSet the supplementary groups to the numerical list provided. (in the manual page but not in --help)man
--shell /full/pathThis option changes the shell that is invoked when the argument == is encountered. (in the manual page but not in --help)man
--suggest phraseScan each of the textual descriptions of capabilities, known to capsh, and display all descriptions that include phrase. (in the manual page but not in --help)man
--supports xxxAs the kernel evolves, more capabilities are added. (in the manual page but not in --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.