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


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

本文作者:
« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3