Assuming you know the file context you want to specify, you can specify it
using the chcon
command. The following example sets the file “/tmp/myfile”
to user_home_t.
$ touch /tmp/myfile
$ ls -Z /tmp/myfile
unconfined_u:object_r:user_tmp_t:s0 /tmp/myfile
$ chcon -t user_home_t /tmp/myfile
$ ls -Z /tmp/myfile
unconfined_u:object_r:user_home_t:s0 /tmp/myfile
chcon
changes the file SELinux
security context.
vagrant up tutorial
vagrant ssh tutorial
Portions of this page's content are copied from this page for non-commercial, education purposes.