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重啟機器即可