linux的的可写不可删除(SAMBA+POSIX ACL)
时间:2006-11-15 来源:szxsztszk
linux的的可写不可删除(SAMBA+POSIX ACL)
---szx20061026
平台:
CentOS4.3
测试组 测试SAMBA用户
test1 test11、test12
test2 test21
共享目录/yewu
只有test11这个用户对此目录拥有完全权限。
其它用户在此共享目录下对自己创建的文件和文件夹有绝对的权力,对别人的文件和文件夹只能读和复制,不能删不能改名不能改内容 。
步骤:
1.
#groupadd test1
#groupadd test2
#useradd -G test1 -s /bin/false -m test11
#useradd -G test1 -s /bin/false -m test12
#useradd -G test2 -s /bin/false -m test21
#smbpasswd -a test11
#smbpasswd -a test12
#smbpasswd -a test21 2.
修改/etc/fstab里的设置。
比如: /dev/hda1 / ext3 acl 1 1
3.
#mount
如果出现如下提示则表明指定的分区的ACL运行了.
/dev/hda1 on / type ext3 (rw,acl)
4.
#mkdir /yewu
#chmod 777 /yewu
#chown test11:test1 /yewu
#chmod o+t /yewu
#setfacl -m d:u:test11:rwx /yewu
5.
更改smb.conf 如下
[yewu]
comment=test11
path=/yewu
public = no
writable=yes
create mask =1604
directory mask= 1705
6.
#service smb restart
7.分别用test12 ,test21,test11进行登陆测试.
---------END------------
---szx20061026
平台:
CentOS4.3
测试组 测试SAMBA用户
test1 test11、test12
test2 test21
共享目录/yewu
只有test11这个用户对此目录拥有完全权限。
其它用户在此共享目录下对自己创建的文件和文件夹有绝对的权力,对别人的文件和文件夹只能读和复制,不能删不能改名不能改内容 。
步骤:
1.
#groupadd test1
#groupadd test2
#useradd -G test1 -s /bin/false -m test11
#useradd -G test1 -s /bin/false -m test12
#useradd -G test2 -s /bin/false -m test21
#smbpasswd -a test11
#smbpasswd -a test12
#smbpasswd -a test21 2.
修改/etc/fstab里的设置。
比如: /dev/hda1 / ext3 acl 1 1
3.
#mount
如果出现如下提示则表明指定的分区的ACL运行了.
/dev/hda1 on / type ext3 (rw,acl)
4.
#mkdir /yewu
#chmod 777 /yewu
#chown test11:test1 /yewu
#chmod o+t /yewu
#setfacl -m d:u:test11:rwx /yewu
5.
更改smb.conf 如下
[yewu]
comment=test11
path=/yewu
public = no
writable=yes
create mask =1604
directory mask= 1705
6.
#service smb restart
7.分别用test12 ,test21,test11进行登陆测试.
---------END------------
相关阅读 更多 +