Home directory stuff

From MyWiki
Jump to: navigation, search
#This sets /home2’s labels to be same as /home
 
semanage fcontext -a -e /home /home2
 
#This updates the labels of /home2, with the –R option doing it recursively for existing subdirectories.
 
restorecon –R /home2
 
Afterwards, existing and newly created user home directories will be labeled correctly.  If you’re interested in seeing how semanage correctly labels contents of home directories, check out /etc/selinux/targeted/modules/active/homedir_template.