Advertisement
sandervanvugt

RHCSA lab 7 commands (uncleaned)

Apr 6th, 2021
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.59 KB | None | 0 0
  1. ##### attempt number one (simple)
  2. [root@localhost ~]# groupadd sales
  3. [root@localhost ~]# groupadd account
  4. [root@localhost ~]# useradd -G sales lisa
  5. [root@localhost ~]# useradd -G sales linda
  6. [root@localhost ~]# useradd -G account anna
  7. [root@localhost ~]# useradd -G account anouk
  8. [root@localhost ~]# mkdir -p /data/sales
  9. [root@localhost ~]# mkdir -p /data/account
  10. [root@localhost ~]# cd /data
  11. [root@localhost data]# chmod 3770 *
  12. [root@localhost data]# setfacl -m d:g:account:rx /data/sales
  13. [root@localhost data]# setfacl -m g:account:rX /data/sales
  14. [root@localhost data]# su - lisa
  15. [lisa@localhost ~]$ cd /data/sales
  16. -bash: cd: /data/sales: Permission denied
  17. [lisa@localhost ~]$ exit
  18. logout
  19. [root@localhost data]# chgrp sales sales
  20. [root@localhost data]# chgrp account account
  21. [root@localhost data]# su - lisa
  22. [lisa@localhost ~]$ cd /data/sales
  23. [lisa@localhost sales]$ echo lisa > lisa1
  24. [lisa@localhost sales]$ echo lisa > lisa2
  25. [lisa@localhost sales]$ exit
  26. logout
  27. [root@localhost data]# su - anna
  28. [anna@localhost ~]$ cd /data/sales
  29. [anna@localhost sales]$ cat lisa1
  30. lisa
  31.  
  32. ##### attempt number two (according to lab instructions) - root commands
  33. [root@localhost data]# history
  34. 1 groupadd sales
  35. 2 groupadd account
  36. 3 useradd -G sales lisa
  37. 4 useradd -G sales linda
  38. 5 useradd -G account anna
  39. 6 useradd -G account anouk
  40. 7 mkdir -p /data/sales
  41. 8 mkdir -p /data/account
  42. 9 cd /data
  43. 10 chmod 3770 *
  44. 11 setfacl -m d:g:account:rx /data/sales
  45. 12 setfacl -m g:account:rX /data/sales
  46. 13 su - lisa
  47. 14 chgrp sales sales
  48. 15 chgrp account account
  49. 16 su - lisa
  50. 17 su - anna
  51. 18 mkdir profs
  52. 19 mkdir students
  53. 20 su - linda
  54. 21 mkdir /data/profs
  55. 22 mkdir /data/students
  56. 23 chmod 3770 profs
  57. 24 chmod 3770 students/
  58. 25 chown anna:profs profs
  59. 26 groupadd profs
  60. 27 groupadd students
  61. 28 chown anna:profs profs
  62. 29 chown anna:students students
  63. 30 usermod -aG profs anna
  64. 31 useradd -G profs anouk
  65. 32 usermod -aG profs anouk
  66. 33 setfacl -m d:g:profs:tx /data/students
  67. 34 setfacl -m d:g:profs:rx /data/students
  68. 35 usermod -aG students lisa
  69. 36 usermod -aG students linda
  70. 37 su - linda
  71. 38 su - anouk
  72. 39 setfacl -m g:profs:rX /data/students
  73. 40 su - anouk
  74. 41 history
  75.  
  76. #### testing as user Anouk
  77. 1 cd /data/students
  78. 2 exit
  79. 3 cd /data/students/
  80. 4 cat linda
  81. 5 cat linda1
  82. 6 history
  83. 7 exit
  84. 8 history
  85. [anouk@localhost ~]$ !3
  86. cd /data/students/
  87. [anouk@localhost students]$ !5
  88. cat linda1
  89. linda
  90.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement