今天重新做了试验,主要是samba的回收站功能和其它的一些功能,比如:共享一个临时目录,所有用户可以写文件,但是其它人不能删除别人的文件,系统平台为centos 4.7,samba的版本为3.0.33.
我的系统支持字符如下:cat /etc/sysconfig/i18n
LANG="zh_CN.GB18030"
LANGUAGE="zh_CN.GB18030:zh_CN.GB2312:zh_CN"
SUPPORTED="zh_CN.UTF-8:zh_CN:zh:en_US.UTF-8:en_US:en:zh_CN.GB18030:zh_CN.GB2312"
SYSFONT="latarcyrheb-sun16"
我的samba的主配置文件smb.conf文件如下:
[global]
unix charset = cp936
dos charset = cp936
display charset = cp936
workgroup = WORKGROUP
netbios name = Server
server string = Test File Server
guest account = nobody
log file = /var/log/samba/%m.log
max log size = 50
security = user
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
username map = /etc/samba/smbusers
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
os level = 33
#============================ Share Definitions ==============================
[homes]
comment = Home directories
valid users = %S
read only = No
create mask = 0664
browseable = No
vfs object = recycle
recycle:keeptree = yes
recycle:versions = yes
recycle:repository = /home/recycle/%u
recycle:exclude=*.tmp,*.TMP
[temp]
comment = the user groups work directory
path = /home/temp
read only = No
guest ok = Yes
[回收站]
comment = user recycle
path = /home/recycle
read only = No
注释:第一个问题回收站:
新建一个回收站目录recycle,权限是777.然后根据配置文件,就可以了,用户删除的文件,就会在/home/recycle里边看到。
第二个问题:
建立用户临时交换目录,用户可以写,但不可删除别人的文件,只需要把/home/temp目录的权限设置为"粘着位"就可以了.
当一个目录被设置为"粘着位"(用chmod a+t),则该目录下的文件只能由
一、超级管理员删除
二、该目录的所有者删除
三、该文件的所有者删除
也就是说,即便该目录是任何人都可以写,但也只有文件的属主才可以删除文件
samba也有回收站功能,它能把你在samba服务器中删除的文件移到回收站中,而不是真正的从磁盘删除掉。这大大提高了数据的安全性,更人性化一些。下面介绍如何设置。
[homes]
comment = Home Directories
browseable = no
# By default, the home directories are exported read-only. Change next
# parameter to 'yes' if you want to be able to write to them.
writable = yes
# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
create mask = 0700
# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
directory mask = 0700
vfs object = recycle #启用回收站功能
recycle:keeptree = yes #保持目录的树状结构
recycle:versions = yes #相同文档名时,有不同版本
recycle:repository = ../recycle/%u #回收站的位置,每个用户都有一个目录
recycle目录的访问权限是所有用户可写,自动生成的recycle/%u目录的访问权限是只能由用户可写。
阅读(1765) | 评论(0) | 转发(0) |