|
Packit Service |
9fb14c |
.TH "semanage-fcontext" "8" "20130617" "" ""
|
|
Packit Service |
9fb14c |
.SH "NAME"
|
|
Packit Service |
9fb14c |
semanage\-fcontext \- SELinux Policy Management file context tool
|
|
Packit Service |
9fb14c |
|
|
Packit Service |
9fb14c |
.SH "SYNOPSIS"
|
|
Packit Service |
9fb14c |
.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 ) ]
|
|
Packit Service |
9fb14c |
|
|
Packit Service |
9fb14c |
.SH "DESCRIPTION"
|
|
Packit Service |
9fb14c |
semanage is used to configure certain elements of
|
|
Packit Service |
9fb14c |
SELinux policy without requiring modification to or recompilation
|
|
Packit Service |
9fb14c |
from policy sources. semanage fcontext is used to manage the default
|
|
Packit Service |
9fb14c |
file system labeling on an SELinux system. This command maps file paths using regular expressions to SELinux labels.
|
|
Packit Service |
9fb14c |
|
|
Packit Service |
9fb14c |
.SH "OPTIONS"
|
|
Packit Service |
9fb14c |
.TP
|
|
Packit Service |
9fb14c |
.I \-h, \-\-help
|
|
Packit Service |
9fb14c |
show this help message and exit
|
|
Packit Service |
9fb14c |
.TP
|
|
Packit Service |
9fb14c |
.I \-n, \-\-noheading
|
|
Packit Service |
9fb14c |
Do not print heading when listing the specified object type
|
|
Packit Service |
9fb14c |
.TP
|
|
Packit Service |
9fb14c |
.I \-N, \-\-noreload
|
|
Packit Service |
9fb14c |
Do not reload policy after commit
|
|
Packit Service |
9fb14c |
.TP
|
|
Packit Service |
9fb14c |
.I \-C, \-\-locallist
|
|
Packit Service |
9fb14c |
List local customizations
|
|
Packit Service |
9fb14c |
.TP
|
|
Packit Service |
9fb14c |
.I \-S STORE, \-\-store STORE
|
|
Packit Service |
9fb14c |
Select an alternate SELinux Policy Store to manage
|
|
Packit Service |
9fb14c |
.TP
|
|
Packit Service |
9fb14c |
.I \-a, \-\-add
|
|
Packit Service |
9fb14c |
Add a record of the specified object type
|
|
Packit Service |
9fb14c |
.TP
|
|
Packit Service |
9fb14c |
.I \-d, \-\-delete
|
|
Packit Service |
9fb14c |
Delete a record of the specified object type
|
|
Packit Service |
9fb14c |
.TP
|
|
Packit Service |
9fb14c |
.I \-m, \-\-modify
|
|
Packit Service |
9fb14c |
Modify a record of the specified object type
|
|
Packit Service |
9fb14c |
.TP
|
|
Packit Service |
9fb14c |
.I \-l, \-\-list
|
|
Packit Service |
9fb14c |
List records of the specified object type
|
|
Packit Service |
9fb14c |
.TP
|
|
Packit Service |
9fb14c |
.I \-E, \-\-extract
|
|
Packit Service |
9fb14c |
Extract customizable commands, for use within a transaction
|
|
Packit Service |
9fb14c |
.TP
|
|
Packit Service |
9fb14c |
.I \-D, \-\-deleteall
|
|
Packit Service |
9fb14c |
Remove all local customizations
|
|
Packit Service |
9fb14c |
.TP
|
|
Packit Service |
9fb14c |
.I \-e EQUAL, \-\-equal EQUAL
|
|
Packit Service |
9fb14c |
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.
|
|
Packit Service |
9fb14c |
.TP
|
|
Packit Service |
9fb14c |
.I \-f [{a,f,d,c,b,s,l,p}], \-\-ftype [{a,f,d,c,b,s,l,p}]
|
|
Packit Service |
9fb14c |
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".
|
|
Packit Service |
9fb14c |
|
|
Packit Service |
9fb14c |
.TP
|
|
Packit Service |
9fb14c |
.I \-s SEUSER, \-\-seuser SEUSER
|
|
Packit Service |
9fb14c |
SELinux user name
|
|
Packit Service |
9fb14c |
.TP
|
|
Packit Service |
9fb14c |
.I \-t TYPE, \-\-type TYPE
|
|
Packit Service |
9fb14c |
SELinux Type for the object
|
|
Packit Service |
9fb14c |
.TP
|
|
Packit Service |
9fb14c |
.I \-r RANGE, \-\-range RANGE
|
|
Packit Service |
9fb14c |
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.
|
|
Packit Service |
9fb14c |
|
|
Packit Service |
9fb14c |
.SH EXAMPLE
|
|
Packit Service |
9fb14c |
.nf
|
|
Packit Service |
9fb14c |
.I remember to run restorecon after you set the file context
|
|
Packit Service |
9fb14c |
Add file-context for everything under /web
|
|
Packit Service |
9fb14c |
# semanage fcontext \-a \-t httpd_sys_content_t "/web(/.*)?"
|
|
Packit Service |
9fb14c |
# restorecon \-R \-v /web
|
|
Packit Service |
9fb14c |
|
|
Packit Service |
9fb14c |
Substitute /home1 with /home when setting file context
|
|
Packit Service |
9fb14c |
# semanage fcontext \-a \-e /home /home1
|
|
Packit Service |
9fb14c |
# restorecon \-R \-v /home1
|
|
Packit Service |
9fb14c |
|
|
Packit Service |
9fb14c |
For home directories under top level directory, for example /disk6/home,
|
|
Packit Service |
9fb14c |
execute the following commands.
|
|
Packit Service |
9fb14c |
# semanage fcontext \-a \-t home_root_t "/disk6"
|
|
Packit Service |
9fb14c |
# semanage fcontext \-a \-e /home /disk6/home
|
|
Packit Service |
9fb14c |
# restorecon \-R \-v /disk6
|
|
Packit Service |
9fb14c |
|
|
Packit Service |
9fb14c |
.SH "SEE ALSO"
|
|
Packit Service |
9fb14c |
.BR selinux (8),
|
|
Packit Service |
9fb14c |
.BR semanage (8)
|
|
Packit Service |
9fb14c |
|
|
Packit Service |
9fb14c |
.SH "AUTHOR"
|
|
Packit Service |
9fb14c |
This man page was written by Daniel Walsh <dwalsh@redhat.com>
|