目的是将一台CentOS6的服务器做成一个文件共享服务器,可以让Windows用户去访问

安装过程很简单:

yum install samba
chkconfig smb on
useradd smb
smbpasswd -a smb
service smb restart

配置如下,修改/etc/samba/smb.conf文件:

[share]
    comment = Share Directories
    path = /opt/data/share
    browseable = yes
    writable = no
    valid users = smb
[upload]
    comment = Share Directories
    path = /opt/data/upload
    browseable = yes
    writable = yes
    valid users = smb

对于可写的文件夹upload,需要注意两点:

  • 将upload目录的权限置成smb用户可写
  • 将selinux关闭,不重启系统关闭:setenforce 0