sandervanvugt

RHCSA day2 july23

Jul 19th, 2023
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.45 KB | None | 0 0
  1. [root@rhcsa ~]# history
  2. 1 ls
  3. 2 exit
  4. 3 tar cvzf archive.tgz /etc
  5. 4 tar tvf archive.tgz
  6. 5 history
  7. 6 grep -v '^$' /etc/dnsmasq.conf
  8. 7 grep -v '^$' /etc/dnsmasq.conf | sort
  9. 8 grep -v '^$' /etc/dnsmasq.conf | sort > /var/tmp/dnslines.txt
  10. 9 useradd bob
  11. 10 find / -user bob
  12. 11 find / -user bob -type f
  13. 12 mkdir /root/userfiles; find / -user bob -type f -exec cp {} /root/userfiles/ \;
  14. 13 ls -al /root/userfiles/
  15. 14 history
  16. 15 ls -ld /etc/sudo*
  17. 16 visudo
  18. 17 vim /etc/sudoers.d/bob
  19. 18 tail -1 /etc/passwd
  20. 19 su - bob
  21. 20 passwd bob
  22. 21 su - bob
  23. 22 cat /etc/sudoers.d/bob
  24. 23 id student
  25. 24 history
  26. 25 visudo
  27. 26 exit
  28. 27 history
  29. 28 su - lisa
  30. 29 grep lisa /etc/sudoers
  31. 30 cat /etc/passwd
  32. 31 head /etc/passwd
  33. 32 useradd --help | less
  34. 33 useradd bill -p password
  35. 34 tail -1 /etc/shadow
  36. 35 tail -5 /etc/shadow
  37. 36 echo password | passwd --stdin bill
  38. 37 tail -5 /etc/shadow
  39. 38 vim /etc/login.defs
  40. 39 useradd -p password peter
  41. 40 su - student
  42. 41 cd /etc/skel/
  43. 42 ls -a
  44. 43 touch hellefile
  45. 44 useradd bea
  46. 45 ls -l /home/bea
  47. 46 ls -al /home/bea
  48. 47 id lisa
  49. 48 id student
  50. 49 groupadd sales
  51. 50 usermod -aG sales lisa
  52. 51 usermod --help
  53. 52 usermod -G wheel lisa
  54. 53 id lisa
  55. 54 usermod -aG sales lisa
  56. 55 id lisa
  57. 56 exit
  58. 57 chage --help
  59. 58 chage -l lisa
  60. 59 chage -M 99 lisa
  61. 60 chage -l lisa
  62. 61 chage lisa
  63. 62 /home/student/countdown 15
  64. 63 vim /etc/login.defs
  65. 64 cd /etc/skel/
  66. 65 touch newfile
  67. 66 vim /etc/default/useradd
  68. 67 for i in anna anouk lisa linda; do useradd $i; done
  69. 68 for i in anna anouk lisa linda; do echo password | passwd --stdin $i; done
  70. 69 groupadd profs
  71. 70 groupadd students
  72. 71 usermod -aG profs anouk
  73. 72 usermod -aG profs anna
  74. 73 usermod -aG students linda
  75. 74 usermod -aG students lisa
  76. 75 ls -l /etc/hosts
  77. 76 cd /tmp
  78. 77 echo hello > hellofile
  79. 78 chown linda hellofile
  80. 79 chmod 077 hellofile
  81. 80 ls -l hellofile
  82. 81 su - linda
  83. 82 cd
  84. 83 cd /home/linda
  85. 84 touch lindafile
  86. 85 ls -l lindafile
  87. 86 echo linda > lindafile
  88. 87 su - linda
  89. 88 ls -l
  90. 89 chmod 640 lindafile
  91. 90 su - linda
  92. 91 cd
  93. 92 cd /tmp
  94. 93 mkdir testdir
  95. 94 touch testdir/file{1..10}
  96. 95 ls -l testdir/
  97. 96 chmod --helo
  98. 97 chmod --hel
  99. 98 chmod -R +x testdir/
  100. 99 ls -l testdir/
  101. 100 chmod -R -x testdir/
  102. 101 mkdir testdir/subdir
  103. 102 chmod -R +X testdir/
  104. 103 ls -ld testdir/
  105. 104 ls -l testdir/
  106. 105 cd
  107. 106 mkdir -p /data/profs /data/students
  108. 107 ls -l /data
  109. 108 chown :profs /data/profs
  110. 109 ls -l /data
  111. 110 chgrp students /data/students
  112. 111 ls -l /data
  113. 112 chmod 770 /data/students
  114. 113 ls -l /data
  115. 114 chmod g+w,o-rx /data/profs
  116. 115 ls -l /data
  117. 116 su - anna
  118. 117 chmod g+s /data/profs
  119. 118 ls -l /data
  120. 119 su - anna
  121. 120 su - anouk
  122. 121 chmod +t /data/profs
  123. 122 ls -l /data
  124. 123 su - anouk
  125. 124 umask
  126. 125 /home/student/countdown 15
  127. 126 mkdir -p /data/students /data/profs
  128. 127 ls /data
  129. 128 cd /data
  130. 129 chmod 770 *
  131. 130 ls -l
  132. 131 umask
  133. 132 cd profs
  134. 133 umask 002
  135. 134 touch rootfile
  136. 135 ls -l rootfile
  137. 136 lsblk
  138. 137 poweroff
  139. 138 vim /etc/fstab
  140. 139 fdisk -l
  141. 140 touch ff
  142. 141 mount -o remount,rw /
  143. 142 touch ff
  144. 143 vim /etc/fstab
  145. 144 blkid
  146. 145 blkid | grep sda5 | awk '{ print $2 '}
  147. 146 blkid | awk '/sda5/ { print $2 '}
  148. 147 blkid | awk '/sda5/ { print $2 '} >> /etc/fstab
  149. 148 vim /etc/fstab
  150. 149 reboot
  151. 150 blkid
  152. 151 history
  153. 152 xxd -l 512 /dev/sda
  154. 153 cat /etc/fstab
  155. 154 blkid
  156. 155 df -h
  157. 156 xfs_admin -L kona /dev/sda5
  158. 157 umount /dev/sda5
  159. 158 xfs_admin -L kona /dev/sda5
  160. 159 vim /etc/fstab
  161. 160 ln /home/student/countdown /usr/local/bin/countdown
  162. 161 ln /home/student/countdown /usr/local/sbin/countdown
  163. 162 history
  164. 163 free -m
  165. 164 fdisk /dev/sda
  166. 165 lsblk
  167. 166 mkswap /dev/sda6
  168. 167 vim /etc/fstab
  169. 168 swapon -a
  170. 169 free -m
  171. 170 dd if=/dev/zero of=/swapfile bs=1M count=1024
  172. 171 mkswap /swapfile
  173. 172 chmod 600 /swapfile
  174. 173 swapon /swapfile
  175. 174 free -m
  176. 175 history
  177. 176 df -h
  178. 177 dd if=/dev/sr0 of=/rhel9.iso bs=1M
  179. 178 mkdir /repo
  180. 179 vim /etc/fstab
  181. 180 mount -a
  182. 181 mount
  183. 182 ls /repo
  184. 183 ls /repo/BaseOS
  185. 184 history
  186. 185 tail -1 /etc/fstab
  187. 186 df -h
  188. 187 countdown 1
  189. 188 dd if=/dev/sr0 of=/dummy
  190. 189 history
  191. 190 ls /repo
  192. 191 dnf config-manager --add-repo="file:///repo/BaseOS"
  193. 192 dnf config-manager --add-repo="file:///repo/AppStream"
  194. 193 cd /etc/yum.repos.d/
  195. 194 ls
  196. 195 vim repo_BaseOS.repo
  197. 196 cd
  198. 197 dnf repolist
  199. 198 dnf search nmap
  200. 199 dnf install nmap
  201. 200 vim /etc/yum.repos.d/repo_BaseOS.repo
  202. 201 vim /etc/yum.repos.d/repo_AppStream.repo
  203. 202 dnf install nmap
  204. 203 history
  205. 204 cat /etc/yum.repos.d/repo_BaseOS.repo
  206. 205 ls /repo
  207. 206 cd /etc/yum.repos.d/
  208. 207 vim repo_BaseOS.repo
  209. 208 dnf list 'selinux*'
  210. 209 dnf provides */seinfo
  211. 210 seinfo
  212. 211 dnf provides */Containerfile
  213. 212 dnf group list
  214. 213 dnf module list
  215. 214 dnf module info nginx
  216. 215 cd
  217. 216 top
  218. 217 dd if=/dev/zero of=/dev/null &
  219. 218 top
  220. 219 echo 0 > /sys/bus/cpu/devices/cpu1/online
  221. 220 top
  222. 221 echo 1 > /sys/bus/cpu/devices/cpu1/online
  223. 222 top
  224. 223 killall dd
  225. 224 cat /proc/sys/vm/swappiness
  226. 225 echo 40 > /proc/sys/vm/swappiness
  227. 226 cat /proc/sys/vm/swappiness
  228. 227 sysctl -a | grep swapp
  229. 228 vim /etc/sysctl.d/swappi.conf
  230. 229 tuned-adm list
  231. 230 ls /usr/lib/tuned/
  232. 231 ls /usr/lib/tuned/virtual-guest/tuned.conf
  233. 232 cat /usr/lib/tuned/virtual-guest/tuned.conf
  234. 233 tuned-adm profile powersav e
  235. 234 tuned-adm profile powersave
  236. 235 tuned-adm list
  237. 236 countdown 13
  238. 237 systemctl status NetworkManager
  239. 238 ip addr show
  240. 239 nmtui
  241. 240 ip a
  242. 241 nmtui
  243. 242 exit
  244. 243 hostnamectl status
  245. 244 reboot
  246. 245 exit
  247. 246 timedatectl status
  248. 247 timedatectl set-time 17:48
  249. 248 date -s 17:48
  250. 249 systemctl status chronyd
  251. 250 vim /etc/chrony.conf
  252. 251 systemctl restart chronyd
  253. 252 chronyc sources
  254. 253 history
  255.  
Add Comment
Please, Sign In to add comment