CentOS中samba配置上下文 提示 chcon: can't apply partial context to unlabeled file


之前在本地的CentOS虛擬機上配置 Samba 服務器沒有遇到過這種問題, 剛才在我的阿里雲服務器上配置Samba上下文時, 報出了這個錯誤

chcon -t samba_share_t /home/suozhiyuan/

chcon: can't apply partial context to unlabeled file '/home/suozhiyuan/'

 

找了很久的資料, 發現問題是出在 selinux 放火牆上, 這個防火牆的配置文件為 /etc/selinux/config 

配置內容:

原來是關閉: SELINUX=disabled
改成打開: 
SELINUX=enforcing
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
#改成
SELINUX=enforcing
# SELINUXTYPE= can take one of these three values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted

 

保存后重啟服務器

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM