当前位置:首页 > 服务器类 > Linux服务器 > > RHEL5中不用关闭SELinux而成功启动Samba

RHEL5中不用关闭SELinux而成功启动Samba

点击次数:30 次 发布日期:2008-11-21 22:59:58 作者:源代码网
源代码网推荐

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命令找不到,加入上述路径即可

源代码网供稿.
网友评论 (0)
会员中心
服务器类
本站推荐
服务器类之精华