首页 > 系统服务 > 详细

selinux

时间:2019-08-21 01:35:52      阅读:82      评论:0      收藏:0      [点我收藏+]

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

selinux

原文:https://www.cnblogs.com/smlie/p/11386445.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!