Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##### attempt number one (simple)
- [root@localhost ~]# groupadd sales
- [root@localhost ~]# groupadd account
- [root@localhost ~]# useradd -G sales lisa
- [root@localhost ~]# useradd -G sales linda
- [root@localhost ~]# useradd -G account anna
- [root@localhost ~]# useradd -G account anouk
- [root@localhost ~]# mkdir -p /data/sales
- [root@localhost ~]# mkdir -p /data/account
- [root@localhost ~]# cd /data
- [root@localhost data]# chmod 3770 *
- [root@localhost data]# setfacl -m d:g:account:rx /data/sales
- [root@localhost data]# setfacl -m g:account:rX /data/sales
- [root@localhost data]# su - lisa
- [lisa@localhost ~]$ cd /data/sales
- -bash: cd: /data/sales: Permission denied
- [lisa@localhost ~]$ exit
- logout
- [root@localhost data]# chgrp sales sales
- [root@localhost data]# chgrp account account
- [root@localhost data]# su - lisa
- [lisa@localhost ~]$ cd /data/sales
- [lisa@localhost sales]$ echo lisa > lisa1
- [lisa@localhost sales]$ echo lisa > lisa2
- [lisa@localhost sales]$ exit
- logout
- [root@localhost data]# su - anna
- [anna@localhost ~]$ cd /data/sales
- [anna@localhost sales]$ cat lisa1
- lisa
- ##### attempt number two (according to lab instructions) - root commands
- [root@localhost data]# history
- 1 groupadd sales
- 2 groupadd account
- 3 useradd -G sales lisa
- 4 useradd -G sales linda
- 5 useradd -G account anna
- 6 useradd -G account anouk
- 7 mkdir -p /data/sales
- 8 mkdir -p /data/account
- 9 cd /data
- 10 chmod 3770 *
- 11 setfacl -m d:g:account:rx /data/sales
- 12 setfacl -m g:account:rX /data/sales
- 13 su - lisa
- 14 chgrp sales sales
- 15 chgrp account account
- 16 su - lisa
- 17 su - anna
- 18 mkdir profs
- 19 mkdir students
- 20 su - linda
- 21 mkdir /data/profs
- 22 mkdir /data/students
- 23 chmod 3770 profs
- 24 chmod 3770 students/
- 25 chown anna:profs profs
- 26 groupadd profs
- 27 groupadd students
- 28 chown anna:profs profs
- 29 chown anna:students students
- 30 usermod -aG profs anna
- 31 useradd -G profs anouk
- 32 usermod -aG profs anouk
- 33 setfacl -m d:g:profs:tx /data/students
- 34 setfacl -m d:g:profs:rx /data/students
- 35 usermod -aG students lisa
- 36 usermod -aG students linda
- 37 su - linda
- 38 su - anouk
- 39 setfacl -m g:profs:rX /data/students
- 40 su - anouk
- 41 history
- #### testing as user Anouk
- 1 cd /data/students
- 2 exit
- 3 cd /data/students/
- 4 cat linda
- 5 cat linda1
- 6 history
- 7 exit
- 8 history
- [anouk@localhost ~]$ !3
- cd /data/students/
- [anouk@localhost students]$ !5
- cat linda1
- linda
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement