sandervanvugt

RHCSA march22 day1

Mar 1st, 2022
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.42 KB | None | 0 0
  1. [root@localhost ~]# history
  2. 1 tar cvzf /root/archive.tgz /etc
  3. 2 ls -l archive.tgz
  4. 3 file archive.tgz
  5. 4 tar tvf archive.tgz
  6. 5 history
  7. 6 tar -tvf archive.tgz
  8. 7 ps aux
  9. 8 ps -aux
  10. 9 grep -v -e "^$" /etc/dnsmasq.conf |sort
  11. 10 grep -v '^$' /etc/dnsmasq.conf |sort
  12. 11 grep -v '^$' /etc/dnsmasq.conf | sort >/var/tmp/dnslines.txt
  13. 12 vim countdown
  14. 13 chmod +x countdown
  15. 14 ./countdown 12
  16. 15 sort -b -d /etc/dnsmasq.conf > /var/tmp/dnslines.txt
  17. 16 man sort
  18. 17 vim dummy.txt
  19. 18 sort -bd dummy.txt
  20. 19 useradd anna
  21. 20 mkdir /root/userfiles/; find / -user anna -exec cp -r {} /root/userfiles/ \;
  22. 21 history
  23. 22 mkdir /root/annafiles; find / -user anna >> /root/annafiles
  24. 23 mkdir /root/annafiles; find / -user anna >> /root/annafilesz
  25. 24 cat /root/annafilesz
  26. 25 cat /etc/os-release
  27. 26 cat /etc/os-release | head -1
  28. 27 cat /etc/os-release | head -2
  29. 28 ps aux | less
  30. 29 id
  31. 30 id anna
  32. 31 id student
  33. 32 grep student /etc/passwd
  34. 33 grep student /etc/shadow
  35. 34 vim /etc/login.defs
  36. 35 cd /etc/skel/
  37. 36 ls -a
  38. 37 history
  39. 38 touch mynewfile
  40. 39 useradd lisa
  41. 40 ls -l /home/lisa/
  42. 41 id student
  43. 42 grep student /etc/passwd
  44. 43 grep student /etc/group
  45. 44 exit
  46. 45 exit
  47. 46 exit
  48. 47 man -k sudo
  49. 48 mandb
  50. 49 man -k sudo
  51. 50 man sudo
  52. 51 grep anna /etc/shadow
  53. 52 passwd --help
  54. 53 passwd -l anna
  55. 54 grep anna /etc/shadow
  56. 55 passwd -u anna
  57. 56 grep anna /etc/shadow
  58. 57 chage linda
  59. 58 chage anna
  60. 59 change --help
  61. 60 chage --help
  62. 61 chage -l anna
  63. 62 vim countdown
  64. 63 chmod +x countdown
  65. 64 ls -l countdown
  66. 65 countdown
  67. 66 echo $PATH
  68. 67 ln countdown /usr/bin/countdown
  69. 68 ls -il countdown /usr/bin/countdown
  70. 69 vim countdown
  71. 70 ls -il countdown /usr/bin/countdown
  72. 71 countdown 12
  73. 72 which su
  74. 73 visudo
  75. 74 su - anna
  76. 75 cd /
  77. 76 groupadd sales
  78. 77 groupadd account
  79. 78 useradd -G sales linda
  80. 79 id linda
  81. 80 useradd -G sales lisa
  82. 81 id lisa
  83. 82 usermod -aG sales lisa
  84. 83 usermod -aG account anna
  85. 84 useradd -G account anouk
  86. 85 for i in anna anouk lisa linda; do is $i; done
  87. 86 for i in anna anouk lisa linda; do id $i; done
  88. 87 mkdir -p /data/sales
  89. 88 mkdir -p /data/account
  90. 89 mkdir /blah/yes
  91. 90 cd /data
  92. 91 ls -l
  93. 92 chgrp account account
  94. 93 chgrp sales sales
  95. 94 ls -l
  96. 95 chmod 770 account/
  97. 96 ls -l
  98. 97 chmod g+w,o-rx sales
  99. 98 ls -l
  100. 99 chown root:sales account
  101. 100 ls -ld account/
  102. 101 chown root.account account
  103. 102 chown .account account
  104. 103 history
  105. 104 su - anna
  106. 105 su - anouk
  107. 106 cd /home/linda/
  108. 107 vim playme
  109. 108 chmod +x playme
  110. 109 ls -l
  111. 110 chmod u+s playme
  112. 111 ls -l playme
  113. 112 id linda
  114. 113 visudo
  115. 114 cd
  116. 115 find / -perm /4000 2>/dev/null
  117. 116 find / -perm /4000 -exec ls -l {} \; 2>/dev/null
  118. 117 ls -l /etc/shadow
  119. 118 exit
  120. 119 su - linda
  121. 120 cd /data
  122. 121 chmod g+s *
  123. 122 ls -l
  124. 123 su - linda
  125. 124 su - lisa
  126. 125 chmod +t *
  127. 126 ls -l
  128. 127 su - lisa
  129. 128 su - linda
  130. 129 cd
  131. 130 cd /home/linda
  132. 131 touch rootfile1
  133. 132 touch rootfile2
  134. 133 ls -l rootfile*
  135. 134 chmod 000 rootfile2
  136. 135 ls -l
  137. 136 su - linda
  138. 137 ls -ld /tmp
  139. 138 touch removeme
  140. 139 ls -l removeme
  141. 140 chattr +i removeme
  142. 141 rm -f removeme
  143. 142 lsattr removeme
  144. 143 ls -l removeme
  145. 144 chattr -i removeme
  146. 145 su - linda
  147. 146 countdown 12
  148. 147 poweroff
  149. 148 lsblk
  150. 149 fdisk /dev/sda
  151. 150 lsblk
  152. 151 mkfs.xfs /dev/sda3
  153. 152 mount /dev/sda3 /mnt
  154. 153 cd /mnt
  155. 154 cp /etc/hosts .
  156. 155 ls
  157. 156 cd
  158. 157 umount /mnt
  159. 158 ls /mnt
  160. 159 vim /etc/fstab
  161. 160 mount -a
  162. 161 mkdir /sda3
  163. 162 mount -a
  164. 163 lsblk
  165. 164 df -h
  166. 165 mount
  167. 166 mount | grep '^/'
  168. 167 history
  169. 168 fdisk /dev/sda
  170. 169 lsblk
  171. 170 fdisk -l /dev/sda
  172. 171 mkfs.xfs /dev/sda4
  173. 172 fdisk /dev/sda
  174. 173 reboot
  175. 174 lsblk
  176. 175 cat /proc/partitions
  177. 176 mkfs.xfs /dev/sda5
  178. 177 mkfs.ext4 /dev/sda6
  179. 178 mkdir /sda5
  180. 179 mkdir /sda6
  181. 180 vim /etc/fstab
  182. 181 mount -a
  183. 182 cp /etc/passwd /sda5
  184. 183 cp /etc/motd /sda6
  185. 184 history
  186.  
Advertisement
Add Comment
Please, Sign In to add comment