1. yum install samba*

  2. vim /etc/samba/smb.conf

    [tools]   unc windows访问\\ip\tools

    comment = share test

    path = /share/test

    guest ok = no    #--->public=no

    read only = no   #--->writable=yes

    上述用 testparm /etc/samba/smb.conf 可以查看详细的配置信息

  3. 设置好后有linux问题

    setsebool -P samba_domain_controller on

    setsebool -P samba_enable_home_dirs on

    setsebool -P samba_export_all_rw on

    上述开启家目录和homes目录的访问权限

  4. 如果要访问自身定义的目录,需要使用

    chcon -R -t samba_share_t /share

    chcon  -R -t public_content_rw_t /share