相关的几个配置参数如下:
readonly 是否只读
writable 是否可写
read list 只读用户的列表
write list 可写用户的列表
优先级:
write list优先级别最高,所列的用户肯定有写的权限
read list其次,其中的用户具有只读的权限,例外:如果某个用户同时在write list和read list中,则该用户具有可写的权限
writable和readonly权限等同,谁放在后面就覆盖前面的
yum -y install samba
groupadd security
mkdir -p /data/security /data/public
chgrp security /data/security
chmod 2770 /data/security
chmod 777 /data/public
vi /etc/samba/smb.conf
[global]
unix charset = UTF-8
security = user
passdb backend = tdbsam
# comment out all other lines
[security]
path = /data/security
create mode = 0770
force create mode = 0770
directory mode = 0770
force directory mode = 0770
guest ok = no
valid users = @security
writable = yes
[public]
path = /data/public
guest ok = yes
writeable = yes
useradd -M -s /bin/false username-name; usermod -G security user-name
smbpasswd -a user-name
service smb start; chkconfig smb on
service nmb start; chkconfig nmb on