Fork me on GitHub

Centos给文件设置了777权限仍不能访问解决方案

Centos给文件设置了777权限仍不能访问:

开启了SELinux导致

1.查看SELinux状态:
/usr/sbin/sestatus -v ##如果SELinux status参数为enabled即为开启状态
  SELinux status: enabled
    ##也可以用这个命令检查getenforce

2.关闭SELinux:
a.临时关闭(不用重启机器):
 setenforce 0 ##设置SELinux 成为permissive模式
b.临时开启(不用重启机器):
 setenforce 1 ##设置SELinux 成为enforcing模式
c.修改配置文件需要重启机器:
  修改/etc/selinux/config 文件
  将SELINUX=enforcing改为SELINUX=disabled
  reboot重启机器即可

posted @ 2019-04-09 15:00  流柯  阅读(3833)  评论(0编辑  收藏  举报
访客: 浏览: