在centos8上配了个SAMBA与windows共享文件。
访问共享目录出现”NT_STATUS_ACCESS_DENIED listing \*“
,
smb: \> !ls
ls: cannot open directory '.': Permission denied
smb: \> ls
NT_STATUS_ACCESS_DENIED listing \*
解决方法一:
关闭SELIUNX
[root@localhost smb1]# getenforce #查看当前状态
Enforcing
vim /etc/selinux/config
重启:reboot
SELINUX几种状态表示:
- enforcing:强制模式,代表 SELinux 运行中,且已经正确的开始限制 domain/type 了;
- permissive:宽容模式:代表 SELinux 运行中,不过仅会有警告信息并不会实际限制 domain/type 的存取。这种模式可以运来作为 SELinux 的 debug 之用;
- disabled:关闭,SELinux 并没有实际运行。
解决方法二:
将共享目录
权限设置为777
权限
chmod 777 /home/smb1
解决方法三:
更改selinux
的策略
chcon -t samba_share_t 共享目录(/var/www/html)