File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ # setfiles
2
+
3
+ > Set SELinux file security contexts based on policy rules.
4
+ > Similar to ` restorecon ` but reads contexts from a file_contexts file.
5
+ > See also: ` restorecon ` , ` semanage-fcontext ` , ` fixfiles ` .
6
+ > More information: < https://manned.org/setfiles > .
7
+
8
+ - Set file contexts according to the default policy file:
9
+
10
+ ` sudo setfiles /etc/selinux/targeted/contexts/files/file_contexts {{path/to/directory}} `
11
+
12
+ - Set file contexts recursively and show changes:
13
+
14
+ ` sudo setfiles /etc/selinux/targeted/contexts/files/file_contexts {{path/to/directory}} {{[-v|--verbose]}} `
15
+
16
+ - Preview what would be changed without actually modifying contexts:
17
+
18
+ ` sudo setfiles /etc/selinux/targeted/contexts/files/file_contexts {{path/to/directory}} {{[-n|--nochange]}} `
19
+
20
+ - Set file contexts and verify them:
21
+
22
+ ` sudo setfiles /etc/selinux/targeted/contexts/files/file_contexts {{path/to/directory}} {{[-v|--verbose]}} {{[-F|--force]}} `
23
+
24
+ - Use a specific root path for context matching:
25
+
26
+ ` sudo setfiles /etc/selinux/targeted/contexts/files/file_contexts {{path/to/new_directory}} {{[-r|--rootpath]}} {{path/to/old_directory}} `
You can’t perform that action at this time.
0 commit comments