sandervanvugt

RHCSA day2 march23

Mar 14th, 2023
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.58 KB | None | 0 0
  1. root@server1 log]# history
  2. 1 dnf install git -y
  3. 2 vim countdown
  4. 3 chmod +x countdown
  5. 4 ./countdown 16
  6. 5 ./countdown 16 lab
  7. 7 ip a
  8. 8 tar czvf /root/archive.tgx /etc
  9. 9 ls -l
  10. 10 mv archive.tgx archive.tgz
  11. 11 ls
  12. 12 grep -v '^$' /etc/dnsmasq.conf
  13. 13 grep -v '^$' /etc/dnsmasq.conf | sort
  14. 14 grep -v '^$' /etc/dnsmasq.conf
  15. 15 grep -v '^$' /etc/dnsmasq.conf | sort
  16. 16 grep -v '^$' /etc/dnsmasq.conf | sort > /var/tmp/dnslines.txt
  17. 17 useradd bob
  18. 18 mkdir userfiles
  19. 19 find / -user bob -type f
  20. 20 find / -user bob -type f -exec cp -a {} userfiles/ \;
  21. 21 man sort
  22. 22 grep -v '^$' /etc/dnsmasq.conf | sort -d
  23. 23 history
  24. 24 ./countdown 13 break
  25. 25 history
  26. 26 exit
  27. 27 su - bob
  28. 28 passwd bob
  29. 29 su - bob
  30. 30 id student
  31. 31 id bob
  32. 32 visudo
  33. 33 su - bob
  34. 34 visudo
  35. 35 su - bob
  36. 36 visudo
  37. 37 ./countdown 1
  38. 38 ls -l /etc/skel
  39. 39 ls -a /etc/skel
  40. 40 ls -a /home/linda
  41. 41 vim /etc/login.defs
  42. 42 useradd --help | less
  43. 43 cat /etc/passwd
  44. 44 cat /etc/shadow
  45. 45 vim /etc/shadow
  46. 46 su - linda
  47. 47 ssh linda@localhost
  48. 48 vim /etc/shadow
  49. 49 less /etc/passwd
  50. 50 lid -g wheel
  51. 51 groupadd sales
  52. 52 id bob
  53. 53 usermod -aG sales bob
  54. 54 id bob
  55. 55 usermod -G wheel bob
  56. 56 id bob
  57. 57 usermod --help | less
  58. 58 usermod -G sales bob
  59. 59 ./countdown 16 lab and break
  60. 60 ./countdown 16 "lab and break"
  61. 61 vim /etc/login.defs
  62. 62 touch /etc/skel/newfile
  63. 63 groupadd profs
  64. 64 groupadd student
  65. 65 groupadd students
  66. 66 useradd anna -G profs
  67. 67 useradd anouk -G profs
  68. 68 useradd lisa -G students
  69. 69 useradd linda -G students
  70. 70 for i in linda lisa anna anouk; do echo password | passwd --stdin $i; done
  71. 71 tail -4 /etc/shadow
  72. 72 history
  73. 73 ls -l /etc/hosts
  74. 74 touch testfile
  75. 75 ls -l
  76. 76 chown linda testfile
  77. 77 ls -l
  78. 78 chown linda:profs testfile
  79. 79 ls -l
  80. 80 chgrp students testfile
  81. 81 ls -l
  82. 82 mkdir -p /data/profs /data/students
  83. 83 ls -l /data
  84. 84 chown :profs /data/profs
  85. 85 chgrp students /data/students
  86. 86 ls -l
  87. 87 ls -l /data
  88. 88 chmod 770 /data/students
  89. 89 chmod g+w,o-rx /data/profs
  90. 90 ls -l /data
  91. 91 history
  92. 92 cd /home/linda
  93. 93 touch rootfile
  94. 94 su - linda
  95. 95 touch rootfile2
  96. 96 su - linda
  97. 97 su - anna
  98. 98 chmod g+s /data/profs
  99. 99 ls -l /data/
  100. 100 su - anna
  101. 101 su - anouk
  102. 102 chmod +t /data/profs
  103. 103 ls -ld /data/profs
  104. 104 su - anouk
  105. 105 cd
  106. 106 ./countdown 1 questions
  107. 107 cd /home/linda
  108. 108 touch roofile
  109. 109 ls -l rootfile2
  110. 110 ls -l rootfile
  111. 111 ls -l rootfile2
  112. 112 rm rootfile2
  113. 113 touch newfile
  114. 114 ls -l newfile
  115. 115 su - linda
  116. 116 history
  117. 117 mkdir -p /files/profs /files/students
  118. 118 cd /files
  119. 119 ls -l
  120. 120 chgrp profs profs
  121. 121 chgrp students students
  122. 122 chmod 770 *
  123. 123 ls -l
  124. 124 umask
  125. 125 umask 002
  126. 126 umask
  127. 127 umask 022
  128. 128 exit
  129. 129 ./countdown 15 "lab and break"
  130. 130 lsblk
  131. 131 poweroff
  132. 132 fdisk /dev/nvme0n1
  133. 133 lsblk
  134. 134 mkfs.xfs /dev/nvme0n1p3
  135. 135 mount /dev/nvme0n1p3 /mnt
  136. 136 lsblk
  137. 137 mount
  138. 138 lsblk
  139. 139 findmnt
  140. 140 vim /etc/fstab
  141. 141 mount -a
  142. 142 reboot
  143. 143 fdisk /dev/nvme0n1
  144. 144 vim /etc/fstab
  145. 145 mkfs.xfs /dev/nvme0n1p5
  146. 146 mkfs.ext4 /dev/nvme0n1p6
  147. 147 mkdir /part5 /part6
  148. 148 mount -a
  149. 149 touch /part5/part_5_file
  150. 150 touch /part6/part6_file
  151. 151 vim /etc/fstab
  152. 152 fdisk /dev/nvme0n1
  153. 153 history
  154. 154 reboot
  155. 155 journalctl -xb
  156. 156 vim /etc/fstab
  157. 157 lsblk
  158. 158 blkid
  159. 159 blkid | grep p5
  160. 160 blkid | grep p5 | awk '{ print $2 }'
  161. 161 blkid | grep p5 | awk '{ print $2 }' >> /etc/fstab
  162. 162 vim /etc/fstab
  163. 163 mount -a
  164. 164 ls /part6
  165. 165 top
  166. 166 ps aux | grep zombie
  167. 167 kill -9 38339
  168. 168 ps aux | grep zombie
  169. 169 kill -SIGCHLD 38338
  170. 170 kill -9 38338
  171. 171 ps aux | grep zombie
  172. 172 dd if=/dev/zero of=/dev/null &
  173. 173 top
  174. 174 echo 0 > /sys/bus/cpu/devices/cpu1/online
  175. 175 top
  176. 176 nice --help | less
  177. 177 nice -20 sleep 100
  178. 178 echo 1 > /sys/bus/cpu/devices/cpu1/online
  179. 179 history
  180. 180 mount | grep proc
  181. 181 cd proc
  182. 182 cd /proc
  183. 183 ls
  184. 184 cd sys
  185. 185 ls
  186. 186 cd vm/
  187. 187 ls
  188. 188 sysctl -a
  189. 189 sysctl -a | wc
  190. 190 tuned-adm list
  191. 191 dnf install -y tuned
  192. 192 dnf install -y tuned-adm
  193. 193 tuned-adm --list
  194. 194 tuned-adm list
  195. 195 tuned-amd profile virtual-guest
  196. 196 tuned-adm profile virtual-guest
  197. 197 tuned-adm list
  198. 198 systemctl status tuned
  199. 199 cd /usr/lib/tuned/
  200. 200 ls
  201. 201 cd virtual-
  202. 202 cd virtual-guest/
  203. 203 ls
  204. 204 vim tuned.conf
  205. 205 pwd
  206. 206 ls -ld /etc/tuned
  207. 207 cd /etc/tuned
  208. 208 ls
  209. 209 mkdir sander
  210. 210 cp /usr/lib/tuned/latency-performance/tuned.conf sander/
  211. 211 tuned-adm list
  212. 212 tuned-adm profile sander
  213. 213 tuned-adm recommend
  214. 214 history
  215. 215 cd
  216. 216 history
  217. 217 ip link show
  218. 218 ip addr show
  219. 219 hostnamectl status
  220. 220 hostnamectl hostname server1.example.local
  221. 221 hostnamectl status
  222. 222 cat /etc/hostname
  223. 223 exit
  224. 224 vim /etc/hosts
  225. 225 ping google.com
  226. 226 vim /etc/nsswitch.conf
  227. 227 ping google.com
  228. 228 cat /etc/resolv.conf
  229. 229 nmtui
  230. 230 cd /etc/NetworkManager/
  231. 231 ls
  232. 232 cd system-connections/
  233. 233 ls
  234. 234 vim ens160.nmconnection
  235. 235 ip a
  236. 236 cd
  237. 237 systemctl -t help
  238. 238 systemctl list-unit-files
  239. 239 systemctl list-units
  240. 240 systemctl list-units -t timer
  241. 241 systemctl cat logrotate.timer
  242. 242 systemctl cat logrotate.service
  243. 243 systemctl cat logrotate.timer
  244. 244 systemctl status logrotate.timer
  245. 245 systemctl cat sshd.service
  246. 246 systemctl status sshd.service
  247. 247 kill -9 4660
  248. 248 systemctl status sshd.service
  249. 249 systemctl status sshd
  250. 250 dnf install -y httpd
  251. 251 service sshd status
  252. 252 systemctl status httpd
  253. 253 systemctl enable --now httpd
  254. 254 exit
  255. 255 history
  256. 256 fdisk /dev/nvme0n1
  257. 257 lslbk
  258. 258 lsblk
  259. 259 cat /proc/partitions
  260. 260 fdisk -l /dev/nvme0n1
  261. 261 mkfs.xfs /dev/nvme0n1p4
  262. 262 cd /boot
  263. 263 umount /dev/sda1
  264. 264 umount /boot
  265. 265 lsof /boot
  266. 266 findmnt
  267. 267 lsblk
  268. 268 blkid
  269. 269 mount | grep part6
  270. 270 tune2fs -L cow /dev/nvme0n1p5
  271. 271 mount LABEL=cow /mnt
  272. 272 vim /etc/fstab
  273. 273 fdisk /dev/nvme0n1
  274. 274 mkswap /dev/nvme0n1p6
  275. 275 free -m
  276. 276 vim /etc/fstab
  277. 277 swapon -a
  278. 278 free -m
  279. 279 history
  280. 280 dd if=/dev/zero of=/swapfile bs=1M count=1024
  281. 281 mkswap /swapfile
  282. 282 chmod 0600 /swapfile
  283. 283 vim /etc/fstab
  284. 284 swapon -a
  285. 285 free -m
  286. 286 cd
  287. 287 ./countdown 1
  288. 288 df -h
  289. 289 dd if=/dev/sr0 of=/rhel9.iso bs=1M
  290. 290 mkdir /repo
  291. 291 vim /etc/fstab
  292. 292 mount -a
  293. 293 ls /rhel9
  294. 294 ls /repo/
  295. 295 dnf install nmap
  296. 296 dnf config-manager -h | less
  297. 297 dnf config-manager --add-repo="file:///repo/BaseOS"
  298. 298 dnf config-manager --add-repo="file:///repo/AppStream"
  299. 299 dnf install nmap -y
  300. 300 cd /etc/yum.repos.d/
  301. 301 ls
  302. 302 vim repo_BaseOS.repo
  303. 303 vim repo_AppStream.repo
  304. 304 dnf install nmap -y
  305. 306 history
  306. 307 cat repo_BaseOS.repo
  307. 308 cd
  308. 309 cat /etc/fstab
  309. 310 dnf list 'selinux*'
  310. 311 dnf search selinux
  311. 312 dnf provides */Containerfile
  312. 313 ls -l $(which dnf) $(which yum)
  313. 314 dnf groups list
  314. 315 dnf groups install "Virtualization Host"
  315. 316 dnf groups list hidden
  316. 317 history
  317. 318 dd if=/dev/nvme0n1 of=/dev/zero &
  318. 319 kill -USR1 37341
  319. 320 fg
  320. 321 dnf install -y git
  321. 322 git clone https://github.com/sandervanvugt/rhcsa
  322. 323 cd rhcsa/
  323. 324 ls
  324. 325 ./zombie
  325. 326 systemctl status httpd
  326. 327 exit
  327. 328 systemctl cat httpd.service
  328. 329 systemctl show httpd.service
  329. 330 systemctl edit httpd.service
  330. 331 export EDITOR=/usr/bin/vim
  331. 332 systemctl edit httpd.service
  332. 333 systemctl cat httpd.service
  333. 334 systemctl daemon-reload
  334. 335 systemctl status httpd
  335. 336 kill -9 40478
  336. 337 systemctl status httpd
  337. 338 man -k systemd | less
  338. 339 man systemd.directives
  339. 340 man systemd.unit
  340. 341 ./countdown 13 "break and practice"
  341. 342 history
  342. 343 top
  343. 344 killall dd
  344. 345 top
  345. 346 dnf install nginx -y
  346. 347 systemctl mask httpd
  347. 348 systemctl unmask httpd
  348. 349 systemctl mask nginx
  349. 350 systemctl start nginx
  350. 351 systemctl status sshd
  351. 352 journalctl
  352. 353 journalctl -p err
  353. 354 journalctl -f
  354. 355 journalctl -u sshd.service
  355. 356 cd /var/log
  356. 357 ls
  357. 358 ls -l
  358. 359 grep 'Storage' /etc/systemd/journald.conf
  359. 360 ls -l /var/log/journal
  360. 361 mkdir /var/log/journal
  361. 362 ls /var/log/journal/
  362. 363 systemctl restart systemd-journal-flush.service
  363. 364 ls
  364. 365 ls journal/
  365. 366 lsblk
  366. 367 gdisk /dev/nvme0n2
  367. 368 pvcreate /dev/nvme0n2p1
  368. 369 pvs
  369. 370 vgcreate vgdata /dev/nvme0n2p1
  370. 371 pvs
  371. 372 vgs
  372. 373 vgdisplay
  373. 374 lvcreate -n lvdata -L 2G vgdata
  374. 375 lvcreate -n lvdata -l 100%FREE vgdata
  375. 376 lvs
  376. 377 mkfs.ext4 /dev/vgdata/lvdata
  377. 378 mkdir /lvdata
  378. 379 vim /etc/fstab
  379. 380 mount -a
  380. 381 mount
  381. 382 ls -l /dev/mapper/vgdata-lvdata /dev/vgdata/lvdata
  382. 383 history
  383.  
Advertisement
Add Comment
Please, Sign In to add comment