CAPSHSection: User Commands (1)
Index Return to Main Contents
NAMEcapsh - capability shell wrapper
DESCRIPTIONLinux capability support and use can be explored and constrained with this tool. This tool provides a handy wrapper for certain types of capability testing and environment creation. It also provides some debugging features useful for summarizing capability state.
OPTIONSThe tool takes a number of optional arguments, acting on them in the order they are provided. They are as follows:
- Display prevailing capability and related state.
- -- [args]
- Execute /bin/bash with trailing arguments.
- Execute capsh again with remaining arguments. Useful for testing exec() behavior.
- Set the prevailing process capabilities to those specified by cap-set. Where cap-set is a text-representation of capability state as per cap_from_text(3).
- Remove the listed capabilities from the prevailing bounding set. The capabilites are a comma separated list of capabilities as recognized by the cap_from_name(3) function. Use of this feature requires that the capsh program is operating with CAP_SETPCAP in its effective set.
- Set the inheritable set of capabilities for the current process to equal those provided in the comma separated list. For this action to succeed, the prevailing process should already have each of these capabilities in the union of the current inheritable and permitted capability sets, or the capsh program is operating with CAP_SETPCAP in its effective set.
- Force all uid values to equal id using the setuid(2) system call.
- In a non-pure capability mode, the kernel provides liberal privilege to the super-user. However, it is normally the case that when the super-user changes uid to some lesser user, then capabilities are dropped. For these situations, the kernel can permit the process to retain its capabilities after a setuid(2) system call. This feature is known as keep-caps support. The way to activate it using this script is with this argument. Setting the value to 1 will cause keep-caps to be active. Setting it to 0 will cause keep-caps to deactivate for the current process. In all cases, keep-caps is deactivated when an exec() is performed. See --secbits for ways to disable this feature.
- XXX - need to document this feature.
- Execute the chroot(2) system call with the new root-directory (/) equal to path. This operation requires CAP_SYS_CHROOT to be in effect.
This is a convenience feature. If you look at
there are some capability related fields of the following form:
This option provides a quick way to decode a capability vector represented in this form. For example, the missing capability from this effective set is 0x0100. By running:
we observe that the missing capability is: cap_setpcap.
AUTHORWritten by Andrew G. Morgan <[email protected]>.
REPORTING BUGSPlease report bugs to the author.
SEE ALSOlibcap(3), getcap(8),setcap(8) and capabilities(7).
This document was created by man2html, using the manual pages.
Time: 05:29:02 GMT, December 24, 2015