chcon: add page (#2895)

<!-- Thank you for sending a PR! -->
<!-- Please perform the following checks and mark all the boxes accordingly. -->
<!-- You can remove the checklist items that don't apply to your PR. -->

- [x] The page (if new), does not already exist in the repo.
- [x] The page is in the correct platform directory (`common/`, `linux/`, etc.)
- [x] The page has 8 or fewer examples.
- [x] The PR title conforms to the recommended [templates](/tldr-pages/tldr/blob/master/CONTRIBUTING.md#commit-message).
- [x] The page follows the [content guidelines](/tldr-pages/tldr/blob/master/CONTRIBUTING.md#guidelines).
italian
Andrik Albuquerque 2019-04-11 17:51:59 -03:00 committed by Lucas Gabriel Schneider
parent b839793471
commit f293d52ca5
1 changed files with 31 additions and 0 deletions

31
pages/common/chcon.md Normal file
View File

@ -0,0 +1,31 @@
# chcon
> Change SELinux security context of a file or files/directories.
- View security context of a file:
`ls -lZ {{path/to/file}}`
- Change the security context of a target file, using a reference file:
`chcon --reference={{reference_file}} {{target_file}}`
- Change the full SELinux security context of a file:
`chcon {{user}}:{{role}}:{{type}}:{{range/level}} {{filename}}`
- Change only the user part of SELinux security context:
`chcon -u {{user}} {{filename}}`
- Change only the role part of SELinux security context:
`chcon -r {{role}} {{filename}}`
- Change only the type part of SELinux security context:
`chcon -t {{type}} {{filename}}`
- Change only the range/level part of SELinux security context:
`chcon -l {{range/level}} {{filename}}`