设置Selinux模式

setenforce 0 0表示警告模式 1表示强制模式
关闭要设置/etc/sysconfig/selinux下将"SELINUX=enforcing"改为"SELINUX=disabled",然后重启即可!

安装semanage命令

yum install policycoreutils-python

SElinux管理服务功能

getsebool -a | grep httpd查看httpd服务的功能
setsebool -P 功能 on设置相关的功能打开

查看目录是否有上下文标识

  1. 使用命令semanage fcontext -l | grep /westos查看该目录是否有上下文规则。
  2. semanage fcontext -a -t public_content_t '/westos(/.*)?'设置/westos添加上下文规则,并通过a步骤命令查看
  3. 查看到上下文规则后,输入命令restorecon -RvvF /westos将规则同步至目录及其子目录。

相关文章:

  • 2021-07-02
  • 2021-10-16
  • 2021-09-20
  • 2021-10-18
  • 2021-11-15
  • 2021-10-15
  • 2021-05-19
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-04
  • 2021-10-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-24
相关资源
相似解决方案