selinux

man semanage-fcontext

除了fcontext

还有端口也要开通,比如

semanage port -a -t http_port_t -p tcp 8309

方法1:chcon -R -t httpd_sys_rw_content_t /var/www/qin/

方法2:chcon --reference=/etc /local  -R

方法3(推荐,写到系统内核):

EXAMPLE
       remember to run restorecon after you set the file context
       Add file-context for everything under /web
       # semanage fcontext -a -t httpd_sys_content_t "/web(/.*)?"
       # restorecon -R -v /web

       Substitute /home1 with /home when setting file context
       # semanage fcontext -a -e /home /home1
       # restorecon -R -v /home1

       For home directories under top level directory, for example /disk6/home,
       execute the following commands.
       # semanage fcontext -a -t home_root_t "/disk6"
       # semanage fcontext -a -e /home /disk6/home
       # restorecon -R -v /disk6

 

布尔值

 getsebool -a

setsebool samba_export_all_rw on  #临时打开

setsebool -P samba_export_all_rw on  #永久打开

 

两个selinux排查方法(参考,无法百分百准确)

sealert -b

audit2allow  < /var/log/audit/audit.log

转载于:https://www.cnblogs.com/smlie/p/11386445.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值