rhel5中的samba服务器启动后,能看到共享目录,但是不能访问共享目录,告知权限不够。此时可以通过如下命令:
tail /var/log/message看到如此提示:
'/home/lyy' does not exist or permission denied when connecting to [lyy] Error was 权限不够
SELinux is preventing the samba daemon from reading users home directories.For complete SELinux messages. run sealert -l a0c1c154-bc37-44f5-a6eb-cfc88fed18b9
根据提示运行:
sealert -l a0c1c154-bc37-44f5-a6eb-cfc88fed18b9
可看到另外更详细的提示,再根据提示
Allowing Access
If you want samba to share home directories you need to turn on the
samba_enable_home_dirs boolean: "setsebool -P samba_enable_home_dirs=1"
The following command will allow this access:
setsebool -P samba_enable_home_dirs=1
运行:
setsebool -P samba_enable_home_dirs=1
等运行成功后,就能正常访问目录了。-P参数是永久有效的意思。
注意setsebool放在/usr/sbin中,如果系统提示setsebool命令找不到,加入上述路径即可。
newa 于 2010-09-15 16:24:18发表:
应该也可以用到fedora上吧。
wyqlwz 于 2010-08-29 08:03:40发表:
不仅会出现这样的错误,同时还要更改共享目录的context值
chcon -R -t samba_share_t /test(你所要共享的目录,也就是写在/etc/samba/smb.conf下的path = 之后的那个目录)
yanlong938 于 2010-08-21 00:15:54发表:
受教了。。。
gdh7201 于 2010-08-20 12:28:30发表:
thanks
chen163 于 2010-01-09 21:05:20发表:
支持楼主!
bobo504 于 2010-01-07 23:40:48发表:
在samba配置文件最开头就有关于selinux的设置方法,不同情况下命令不同,很好理解,可以看看
王鹏军 于 2010-01-07 10:51:20发表:
虽然能进入目录 但是不能删除文件 不能在服务器上打开文件 只是提供下载。
dearsnow 于 2008-06-09 04:39:05发表:
太感谢你了啊。 大哥。 这个可弄得我好苦啊。 setsebool -P samba_enable_home_dirs=1 这个home是不是/home目录吧。