LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   SELINUX content on top level directory (https://www.linuxquestions.org/questions/linux-security-4/selinux-content-on-top-level-directory-4175572985/)

ZAMO 02-23-2016 01:24 AM

SELINUX content on top level directory
 
Hi ,

I have a RHEL 7 with selinux at enforcing mode.

when i create a new top level directory and run the semanage to set any content it is not working it . The content remains as default_t.

Code:

semanage fcontext -a -t samba_share_t "/mysamba(/.*)?"
restorecon -Rv mysamba

or
semanage fcontext -a -t public_content_t "/mysamba(/.*)?"

but the chcon -t works and on any new file created below it.. why ? any specific reasons or what I am missing when using semanage fcontext?

ZAMO 02-23-2016 01:35 AM

Missing

restorecon -RvvF /mysamba worked .

I was missing teh option -F .


All times are GMT -5. The time now is 03:36 AM.