chcon
Change the SELinux security context of listed file[s]. toybox
On Linux
Linux
chcon [-hRv] CONTEXT FILE...
-hChange symlinks instead of what they point to-RRecurse into subdirectories-vVerboseLinux
Change SELinux security context of a file or files/directories.
View security context of a file
ls -l --context path/to/fileIdentify-llong (show full details) toyboxChange the security context of a target file, using a reference file
chcon --reference reference_file target_fileIdentifyChange the full SELinux security context of a file
chcon user:role:type:range/level filenameIdentifyChange only the user part of SELinux security context
chcon --user user filenameIdentifyChange only the role part of SELinux security context
chcon --role role filenameIdentifyChange only the type part of SELinux security context
chcon --type type filenameIdentifyChange only the range/level part of SELinux security context
chcon --range range/level filenameIdentify