1.创建读写帐号
- useradd writer # 生成口令是空的一个账户
- passwd writer# 为新用户设置口令
- cd /usr/local/samba/bin
- ./smbpasswd -a writer# 赋予webmaster用户Samba服务器的验证密码
- ./smbpasswd -a reader
2.修改/etc下的samba配置文件
3.重新启动samba服务即可
- security = user
- encrypt passwords = yes
- smb passwd file = /usr/local/samba/lib/smbpasswd
- [writerShare]
- comment = Shared Folder with username and password
- path = /data/share
- public = yes
- writable = yes
- valid users = writer
- create mask = 0664
- directory mask = 0775
- available = yes
- browseable = yes
- [readerShare]
- comment = Shared Folder with username and password
- path = /data/share
- public = yes
- writable = no
- valid users = reader
- create mask = 0700
- directory mask = 0700
- available = yes
- browseable = yes