只需要关闭selinux,或者对selinux控制的上下文进行统一便可以正常访问,下面给一种关闭selinux的方法;
vi /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
#SELINUX=enforcing
SELINUX=disabled
# SELINUXTYPE= can take one of three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
只需要把SELINUX=enforcing改成SELINUX=disabled,保存退出,重启系统即可生效
4、使用本地用户需要注意的权限问题
1、目录的所属权限
drwxrwxr-x. 9 admin admin 151 Aug 16 07:47 data
需要使用chown改变目录所属
2、目录的读写权限
一般默认会给755的权限,这个按照自己所需给出相应权限,比如只读为‘x’,读写为‘rwx’
使用命令chmod更改自己所需权限