参考 http://chaishiwei.com/blog/1340.html
# yum -y install samba samba-client
# vim /etc/samba/smb.conf ==最终配置文件
[global]
workgroup = WORKGROUP
server string = Samba Server %v
netbios name = CentOS_7_SMB
map to guest = bad user
log file = /var/log/samba/log.%m
max log size = 512
security = user
passdb backend = tdbsam
load printers = no
[smb]
comment = CentOS Share
path = /var/share
public = no
writable = yes
create mask = 0755
directory mask = 0755
# yum -y install tdb-tools ==好像没用到
# useradd -s /sbin/nologin smbuser01
# useradd -s /sbin/nologin smbuser02
# pdbedit -a smbuser01 (密码:smbpass01)
# pdbedit -a smbuser02 (密码:smbpass02)
# setenforce 0
# systemctl start smb.service
# systemctl start nmb.service
# systemctl enable smb.service
# systemctl enable nmb.service
# firewall-cmd --add-port=137/udp --permanent
# firewall-cmd --add-port=138/udp --permanent
# firewall-cmd --add-port=139/tcp --permanent
# firewall-cmd --add-port=445/tcp --permanent
# firewall-cmd --zone=public --add-service=samba --permanent
# firewall-cmd --reload
# chown smbuser01:smbuser01 /var/share
# set samba_export_all_ro=on
# set samba_export_all_rw=on
# setenforce 1
用户smbuser01可以写,smbuser02只能读
===win7如何删除已记住的访问共享的帐户与密码
运行命令: net use * /del /y
删除已保存的共享帐户和密码: 运行->control userpasswords2->高级->管理密码->点击相应网络展开->从保管库中删除