Debian Codegraph @

python/semanage/semanage-fcontext.8

raw
1 .TH "semanage-fcontext" "8" "20130617" "" ""
2 .SH "NAME"
3 semanage\-fcontext \- SELinux Policy Management file context tool
4
5 .SH "SYNOPSIS"
6 .B semanage fcontext [\-h] [\-n] [\-N] [\-S STORE] [ \-\-add ( \-t TYPE \-f FTYPE \-r RANGE \-s SEUSER | \-e EQUAL ) FILE_SPEC ) | \-\-delete ( \-t TYPE \-f FTYPE | \-e EQUAL ) FILE_SPEC ) | \-\-deleteall | \-\-extract | \-\-list [\-C] | \-\-modify ( \-t TYPE \-f FTYPE \-r RANGE \-s SEUSER | \-e EQUAL ) FILE_SPEC ) ]
7
8 .SH "DESCRIPTION"
9 semanage is used to configure certain elements of
10 SELinux policy without requiring modification to or recompilation
11 from policy sources. semanage fcontext is used to manage the default
12 file system labeling on an SELinux system. This command maps file paths using regular expressions to SELinux labels.
13
14 .SH "OPTIONS"
15 .TP
16 .I \-h, \-\-help
17 show this help message and exit
18 .TP
19 .I \-n, \-\-noheading
20 Do not print heading when listing the specified object type
21 .TP
22 .I \-N, \-\-noreload
23 Do not reload policy after commit
24 .TP
25 .I \-C, \-\-locallist
26 List local customizations
27 .TP
28 .I \-S STORE, \-\-store STORE
29 Select an alternate SELinux Policy Store to manage
30 .TP
31 .I \-a, \-\-add
32 Add a record of the specified object type
33 .TP
34 .I \-d, \-\-delete
35 Delete a record of the specified object type
36 .TP
37 .I \-m, \-\-modify
38 Modify a record of the specified object type
39 .TP
40 .I \-l, \-\-list
41 List records of the specified object type
42 .TP
43 .I \-E, \-\-extract
44 Extract customizable commands, for use within a transaction
45 .TP
46 .I \-D, \-\-deleteall
47 Remove all local customizations
48 .TP
49 .I \-e EQUAL, \-\-equal EQUAL
50 Substitute target path with sourcepath when generating default label. This is used with fcontext. Requires source and target path arguments. The context labeling for the target subtree is made equivalent to that defined for the source.
51 .TP
52 .I \-f [{a,f,d,c,b,s,l,p}], \-\-ftype [{a,f,d,c,b,s,l,p}]
53 File Type. This is used with fcontext. Requires a file type as shown in the mode field by ls, e.g. use 'd' to match only directories or 'f' to match only regular files. The following file type options can be passed: f (regular file),d (directory),c (character device), b (block device),s (socket),l (symbolic link),p (named pipe). If you do not specify a file type, the file type will default to "all files".
54
55 .TP
56 .I \-s SEUSER, \-\-seuser SEUSER
57 SELinux user name
58 .TP
59 .I \-t TYPE, \-\-type TYPE
60 SELinux Type for the object
61 .TP
62 .I \-r RANGE, \-\-range RANGE
63 MLS/MCS Security Range (MLS/MCS Systems only) SELinux Range for SELinux login mapping defaults to the SELinux user record range. SELinux Range for SELinux user defaults to s0.
64
65 .SH EXAMPLE
66 .nf
67 .I remember to run restorecon after you set the file context
68 Add file-context for everything under /web
69 # semanage fcontext \-a \-t httpd_sys_content_t "/web(/.*)?"
70 # restorecon \-R \-v /web
71
72 Substitute /home1 with /home when setting file context
73 # semanage fcontext \-a \-e /home /home1
74 # restorecon \-R \-v /home1
75
76 For home directories under top level directory, for example /disk6/home,
77 execute the following commands.
78 # semanage fcontext \-a \-t home_root_t "/disk6"
79 # semanage fcontext \-a \-e /home /disk6/home
80 # restorecon \-R \-v /disk6
81
82 .SH "SEE ALSO"
83 .BR selinux (8),
84 .BR semanage (8)
85
86 .SH "AUTHOR"
87 This man page was written by Daniel Walsh <[email protected]>