天天看点

samba

一 、建立cover组,成员有cover01, cover02

建立team组,成员有team 01, team02

建立user组,成员有user01, user02

二 、共享目录cover,隐含共享,只有cover组成员可读写,其他人无法访问

三 共享目录team,team组用户可读写, cover组 成员可读,user01可读

四 共享目录user , user组可读写, cover可读

五 共享目录public, cover, team, user组均可读写,但不能删除别人的文

一.vim add.sh

#!/bin/bash

groupadd cover

for a in cover01 cover02

do

useradd -g cover $a

echo "123456" | passwd --stdin $a

done

groupadd team

for b in team01 team02

useradd -g team $b

echo "123456" | passwd --stdin $b

groupadd user

for c in user01 user02

useradd -g user $c

echo "123456" | passwd --stdin $c

sh add.sh执行成功

[root@localhost ~]# ls /home

cover01 cover02 team01 team02 user01 user02

二.

创建文件夹

cd /var

mkdir samba

cd samba

mkdir cover team user

vim /etc/samba/smb.conf

[cover]

path = /var/samba/cover

browseable = no

writeable = yes

write list = @cover

valid users = @cover

invalid users = @team @user

[team]

path = /var/samba/team

browseable = yes

write list = @team

read list = @cover user01

valid users = @team @cover user01

invalid users = user02

[user]

path = /var/samba/user

read list = @cover

write list = @user

valid users = @user @cover

invalid users = @team

service smb start

登录smbclient -l 192.168.18.67

继续阅读