1、yum -y install samba
2、添加系统用户
useradd smbuser
3、系统用户加入到smb数据中
pdbedit -a smbuser
4、会提示设置密码,输入一个密码
5、查看创建的用户
pdbedit -L
6、配置smb.conf
[global]
workgroup = SAMBA
security = user

    passdb backend = tdbsam

    printing = cups
    printcap name = cups
    load printers = yes
    cups options = raw

[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = No
read only = No
inherit acls = Yes

[printers]
comment = All Printers
path = /var/tmp
printable = Yes
create mask = 0600
browseable = No

[print$]
comment = Printer Drivers
path = /var/lib/samba/drivers
write list = @printadmin root
force group = @printadmin
create mask = 0664
directory mask = 0775
[data]
path=/data/
; public=yes
; browseable=yes|no
; read only=yes|no
; writeable = yes|no
write list = smbuser
valid users = smbuser
; host allow =
; host deny =
; comment = 'share file'

7、创建目录/data
mkdir /data
8、目录赋予用户权限
setfacl -m u:smbuser:rwx /data
9、chown -Rv smbuser:smbuser data/
10、chmod -Rv 755 data
11、重启smb
systemctl restart smb

linux客户端设置
1、安装cifs
yum -y install cifs-utils
2、创建/data目录
mkdir /data
3、挂载目录
mount -t cifs //172.16.1xx.xxxx/data /data -o username=smbxxx,password=smbxxxxx