close
LAB

1.create accounts
for user in joshua alex dax
do
useradd $user
echo 'passowrd' |passwd --stdin $user
done

2. create groups
#groupadd -g 2000 sales
#groupadd -g 2001 hr
#groupadd -g 2002 web


3. set user to group
#usermod -G sales joshua
#usermod -G hr alex
#usermod -G web dax

(#vi /etc/group, 也可以加入groups)

4. create a directory /depts/{hr,web,sales}
#mkdir -p /depts/{sales,hr,web}

for group in sales hr web
do
chgrp $group /depts/$group
done

5 set Sgid fro /depts
#chmod 770 /depts/*
#chmod g+s /detps/*
arrow
arrow
    全站熱搜

    aquatower 發表在 痞客邦 留言(0) 人氣()