1SETCAP(8) System Manager's Manual SETCAP(8)
2
3
4
6 setcap - set file capabilities
7
9 setcap [-q] [-n <rootuid>] [-v] {capabilities|-|-r} filename [ ...
10 capabilitiesN fileN ]
11
13 In the absence of the -v (verify) option setcap sets the capabilities
14 of each specified filename to the capabilities specified. The optional
15 -n <rootuid> argument can be used to set the file capability for use
16 only in a user namespace with this root user ID owner. The -v option is
17 used to verify that the specified capabilities are currently associated
18 with the file. If -v and -n are supplied, the -n <rootuid> argument is
19 also verified.
20
21 The capabilities are specified in the form described in
22 cap_from_text(3).
23
24 The special capability string, '-', can be used to indicate that capa‐
25 bilities are read from the standard input. In such cases, the capabil‐
26 ity set is terminated with a blank line.
27
28 The special capability string, '-r', is used to remove a capability set
29 from a file. Note, setting an empty capability set is not the same as
30 removing it. An empty set can be used to guarantee a file is not exe‐
31 cuted with privilege in spite of the fact that the prevailing ambi‐
32 ent+inheritable sets would otherwise bestow capabilities on executed
33 binaries.
34
35 The -q flag is used to make the program less verbose in its output.
36
38 The setcap program will exit with a 0 exit code if successful. On fail‐
39 ure, the exit code is 1.
40
42 Please report bugs via:
43
44 https://bugzilla.kernel.org/buglist.cgi?component=lib‐
45 cap&list_id=1047723&product=Tools&resolution=---
46
48 cap_from_text(3), cap_get_file(3), capabilities(7), user_namespaces(7),
49 getcap(8)
50
51
52
53 2020-01-07 SETCAP(8)