Advertisement
sandervanvugt

RHCSA day3 sept21

Sep 9th, 2021
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.97 KB | None | 0 0
  1. [root@rhcsa ~]# history
  2. 1 vim countdown
  3. 2 chmod +x countdown
  4. 3 ./countdown 9
  5. 4 tar cvzf /root/archive.tgz /etc
  6. 5 file archive.tgz
  7. 6 tar tvf archive.tgz
  8. 7 tar xvf archive.tgz -C /tmp
  9. 8 grep -v "^$" /etc/dnsmasq.conf | sort > /var/tmp/dnslines.txt
  10. 9 history
  11. 10 useradd linda
  12. 11 find / -user linda -type f -exec cp -pr {} /root/userfiles \;
  13. 12 ls -l /root/userfiles
  14. 13 less /root/userfiles
  15. 14 rm /root/userfiles ; mkdir /root/userfiles ; find / -user linda -type f -exec cp -pr {} /root/userfiles/ \;
  16. 15 ls /root/userfiles/
  17. 16 ls /root/userfiles/ -l
  18. 17 rm /root/userfiles/linda
  19. 18 find / -user linda -exec cp -pr {} /root/userfiles/ \;
  20. 19 ls -l /root/userfiles/
  21. 20 ls -l /root/userfiles/ -a
  22. 21 ls -la /home/linda
  23. 22 ls -l /var/spool/
  24. 23 find / -user linda
  25. 24 exit
  26. 25 usermod -aG wheel student
  27. 26 id student
  28. 27 visudo
  29. 28 vim countdown
  30. 29 chmod +x countdown
  31. 30 ./countdown 12
  32. 31 less /etc/passwd
  33. 32 su - linda
  34. 33 vim /etc/login.defs
  35. 34 vim /etc/skel/
  36. 35 cd /etc/skel/
  37. 36 ls
  38. 37 ls -a
  39. 38 touch myfile
  40. 39 cd
  41. 40 groupadd sales
  42. 41 useradd --help | less
  43. 42 useradd -G sales bob
  44. 43 id bob
  45. 44 passwd --help
  46. 45 useradd kees -x 9090
  47. 46 useradd kees
  48. 47 passwd -x 9090 kees
  49. 48 passwd --help
  50. 49 passwd -S kees
  51. 50 vim /etc/shadow
  52. 51 useradd -u 1234 whoever
  53. 52 grep whoever /etc/passwd
  54. 53 cat /etc/shadow
  55. 54 passwd whoever
  56. 55 cat /etc/shadow
  57. 56 passwd -l whoever
  58. 57 cat /etc/shadow
  59. 58 echo password | passwd --stdin whoever
  60. 59 for i in bob linda whoever student; do echo password | passwd --stdin $i; done
  61. 60 chage linda
  62. 61 ls -l
  63. 62 mkdir /data/sales
  64. 63 mkdir -p /data/sales
  65. 64 mkdir -p /data/account
  66. 65 cd /data
  67. 66 ls -l
  68. 67 chgrp account account
  69. 68 groupadd account
  70. 69 chgrp account account
  71. 70 chgrp sales sales
  72. 71 ls -l
  73. 72 chmod 770 *
  74. 73 ls -l
  75. 74 id linda
  76. 75 usermod -aG sales linda
  77. 76 grep sales /etc/group
  78. 77 id linda
  79. 78 grep linda /etc/passwd
  80. 79 grep sales /etc/passwd
  81. 80 grep sales /etc/group
  82. 81 grep wheel /etc/group
  83. 82 su - linda
  84. 83 su - bob
  85. 84 cd /home/linda
  86. 85 touch root1
  87. 86 touch root2
  88. 87 su - linda
  89. 88 pwd
  90. 89 touch root3
  91. 90 su - linda
  92. 91 cd
  93. 92 ./countdown 12
  94. 93 cd /home/linda
  95. 94 vim playme
  96. 95 chmod +x playme
  97. 96 su - linda
  98. 97 chmod u+s playme
  99. 98 ls -l
  100. 99 find / -perm /4000 2>/dev/null
  101. 100 ls -l /usr/bin/passwd
  102. 101 ls -l /etc/shadow
  103. 102 su - linda
  104. 103 chmod g+s /data/sales
  105. 104 ls -ld /data/sales/
  106. 105 cd /data/sales
  107. 106 touch wortel
  108. 107 ls -l
  109. 108 su - linda
  110. 109 chmod +t /data/sales
  111. 110 su - bob
  112. 111 ls -ld /tmp
  113. 112 cd
  114. 113 ./countdown 1
  115. 114 lsblk
  116. 115 ./countdown 12
  117. 116 lsblk
  118. 117 poweroff
  119. 118 lsblk
  120. 119 fdisk /dev/nvme0n1
  121. 120 gdisk /dev/nvme0n1
  122. 121 fdisk /dev/nvme0n1
  123. 122 lsblk
  124. 123 mkfs.xfs /dev/nvme0n1p3
  125. 124 mkdir /newfs
  126. 125 vim /etc/fstab
  127. 126 mount -a
  128. 127 mount
  129. 128 reboot
  130. 129 fdisk /dev/nvme0n1p1
  131. 130 fdisk /dev/nvme0n1
  132. 131 reboot
  133. 132 fdisk -l
  134. 133 lsblk
  135. 134 mkdir /xfs
  136. 135 mkdir /ext4
  137. 136 mkfs.xfs /dev/nvme0n1p5
  138. 137 mkfs.ext4 /dev/nvme0n1p6
  139. 138 vim /etc/fstab
  140. 139 mount -a
  141. 140 vim /etc/fstab
  142. 141 mount -a
  143. 142 cd /xfs
  144. 143 touch sda5file
  145. 144 cd /ext4
  146. 145 touch ext4file
  147. 146 cd /
  148. 147 vim /etc/fstab
  149. 148 umount /xfs
  150. 149 fdisk /dev/nvme0n1
  151. 150 reboot
  152. 151 vim /etc/fstab
  153. 152 reboot
  154. 153 history
  155. 154 vim /etc/fstab
  156. 155 reboot
  157. 156 journalctl -xb
  158. 157 lsblk
  159. 158 blkid
  160. 159 tune2fs --help
  161. 160 tune2fs -L cow /dev/nvme0n1p5
  162. 161 tune2fs -l /dev/nvwm0n1p5
  163. 162 tune2fs -l /dev/nvme0n1p5
  164. 163 tune2fs -l /dev/nvme0n1p5 | lss
  165. 164 tune2fs -l /dev/nvme0n1p5 | less
  166. 165 vim /etc/fstab
  167. 166 reboot
  168. 167 mount
  169. 168 mount | grep '^/'
  170. 169 df -h
  171. 170 man tune2fs
  172. 171 fdisk /dev/nvme0n1
  173. 172 lsblk
  174. 173 mount /dev/nvme0n1p6 /xfs
  175. 174 cd /xfs
  176. 175 ls
  177. 176 xfs_admin --help
  178. 177 xfs_admin -L goat /dev/nvme0n1p6
  179. 178 umount /xfs
  180. 179 cd /
  181. 180 umount /xfs
  182. 181 xfs_admin -L goat /dev/nvme0n1p6
  183. 182 blkid
  184. 183 blkid | grep n1p6
  185. 184 blkid | grep n1p6 | awk '{ print $3 }'
  186. 185 blkid | grep n1p6 | awk '{ print $3 }' >> /etc/fstab
  187. 186 vim /etc/fstab
  188. 187 mount -a
  189. 188 reboot
  190. 189 df
  191. 190 fdisk /dev/nvme0n1
  192. 191 vim /etc/default/grub
  193. 192 grub2-mkconfig -o /boot/grub2/grub.cfg
  194. 193 reboot
  195. 194 ./countdown 15
  196. 195 lsblk
  197. 196 history
  198. 197 groupadd students
  199. 198 groupadd profs
  200. 199 vim /etc/login.defs
  201. 200 usermod -aG students linda
  202. 201 id linda
  203. 202 useradd -G students lisa
  204. 203 useradd -G profs anna
  205. 204 useradd -G profs anouk
  206. 205 mkdir -p /data/profs /data/students
  207. 206 cd /data
  208. 207 ls -k
  209. 208 ls -l
  210. 209 chown anna:profs profs
  211. 210 chown anna:students students
  212. 211 chmod 3770 profs
  213. 212 chmod 3770 students
  214. 213 ls -l
  215. 214 vim /etc/fstab
  216. 215 cd
  217. 216 ./countdown 5
  218. 217 cd /data
  219. 218 ls -l
  220. 219 getfacl sales
  221. 220 ls -l sales/
  222. 221 setfacl -R -m g:account:rx sales/
  223. 222 ls -l sales/
  224. 223 man setfacl
  225. 224 setfacl -R -x g:account sales/
  226. 225 ls -l sales/
  227. 226 setfacl -R -m g:account:rX sales/
  228. 227 ls -l sales/
  229. 228 su - linda
  230. 229 setfacl -m d:g:account:rx sales
  231. 230 getfacl sales
  232. 231 su - linda
  233. 232 getfacl sales/default
  234. 233 history
  235. 234 getfacl students/
  236. 235 ls -l *
  237. 236 ls -ld *
  238. 237 setfacl -R -m:profs:rX students
  239. 238 setfacl -R -m g:profs:rX students
  240. 239 setfacl -R -m d:g:profs:rx students
  241. 240 getfacls students/
  242. 241 getfacl students/
  243. 242 df -h
  244. 243 cd
  245. 244 dd if=/dev/sr0 of=/rhel83.iso bs=1M
  246. 245 yum repolist
  247. 246 yum install -y nmap
  248. 247 mkdir /repo
  249. 248 vim /etc/fstab
  250. 249 ls /repo
  251. 250 mount -a
  252. 251 ls /repo
  253. 252 vim /etc/fstab
  254. 253 yum repolist
  255. 254 cd /etc/yum.repos.d/
  256. 255 ls
  257. 256 cat redhat.repo
  258. 257 cd /repo
  259. 258 ls
  260. 259 grep repo /etc/fstab
  261. 260 ls AppStream/
  262. 261 ls BaseOS/
  263. 262 ls BaseOS/Packages/
  264. 263 ls BaseOS/repodata/
  265. 264 cd -
  266. 265 vim appstream.repo
  267. 266 vim base.repo
  268. 267 yum repolist
  269. 268 yum install nmap
  270. 269 yum provides */seinfo
  271. 270 seinfo
  272. 271 cd
  273. 272 yum module list
  274. 273 yum module list | less
  275. 274 yum module provides httpd
  276. 275 yum module info postgresql
  277. 276 yum module info --profile postgresql
  278. 277 yum module list postgresql
  279. 278 yum module install postgresql:9.6
  280. 279 yum module install postgresql:9.6/devel
  281. 280 yum module enable postgresql:9.6
  282. 281 ./countdown 12
  283. 282 ip
  284. 283 ip addr
  285. 284 ip a
  286. 285 ip a a dev ens160 10.10.0.10/24
  287. 286 ip a
  288. 287 ping 10.10.0.10
  289. 288 ifconfig
  290. 289 ifconfig -a
  291. 290 ifconfig /all
  292. 291 man ifconfig
  293. 292 ip
  294. 293 ip route show
  295. 294 ip route add 1.0.0.0/8 via 192.168.29.100
  296. 295 systemctl status NetworkManager
  297. 296 nmtui
  298. 297 ip a
  299. 298 cd /etc/sysconfig/network-scripts/
  300. 299 ls
  301. 300 vim ifcfg-ens160
  302. 301 ip link show
  303. 302 man ifconfig
  304. 303 ip -s link show
  305. 304 systemctl status tuned
  306. 305 tuned-adm list
  307. 306 tuned-adm profile latency-performance
  308. 307 tuned-adm active
  309. 308 ls /usr/lib/tuned/
  310. 309 ls /etc/tuned/
  311. 310 mkdir /etc/tuned/sander
  312. 311 cp /usr/lib/tuned/latency-performance/* /etc/tuned/sander/
  313. 312 cd /etc/tuned/sander
  314. 313 ls
  315. 314 vim tuned.conf
  316. 315 sysctl -a
  317. 316 sysctl -a | wc
  318. 317 tuned-adm list
  319. 318 su - linda
  320. 319 cd
  321. 320 cp countdown /usr/bin
  322. 321 countdown 12
  323. 322 fdisk /dev/nvme0n1
  324. 323 cat /proc/partitions
  325. 324 lsblk
  326. 325 pvcreate --help
  327. 326 pvcreate /dev/nvme0n1p7
  328. 327 pvs
  329. 328 vgcreate --help | less
  330. 329 vgcreate vgdata -s 4m /dev/nvme0n1p7
  331. 330 vgs
  332. 331 vgdisplay rhel | less
  333. 332 echo $(( 4863 * 4 ))
  334. 333 echo $(( 19452 / 1024 ))
  335. 334 lvcreate --help | less
  336. 335 lvcreate -L 1G -n lvdata vgdata
  337. 336 lvcreate -l 255 -n lvdata vgdata
  338. 337 mkfs.ext4 /dev/vgdata/lvdata
  339. 338 mkdir /lvdata
  340. 339 vim /etc/fstab
  341. 340 mount -a
  342. 341 mount
  343. 342 ls -l /dev/vgdata/lvdata /dev/mapper/vgdata-lvdata
  344. 343 pvs
  345. 344 xxd /dev/nvme0n1p7 | less
  346. 345 xxd /dev/nvme0n1 | less
  347. 346 df -h
  348. 347 lvextend -r -l +50%FREE /dev/vgdata/lvdata
  349. 348 vgs
  350. 349 vgextend --help
  351. 350 vgextend vgdata /dev/nvme0n1p8
  352. 351 vgs
  353. 352 lvextend -r -l +50%FREE /dev/vgdata/lvdata
  354. 353 df -h
  355. 354 lvextend -l +100%FREE /dev/vgdata/lvdata
  356. 355 df -h
  357. 356 resize2fs --help
  358. 357 resize2fs /dev/vgdata/lvdata
  359. 358 lvreduce -r -l -1G /dev/vgdata/lvdata
  360. 359 lvreduce -r -L -1G /dev/vgdata/lvdata
  361. 360 history
  362. 361 poweroff
  363. 362 fdisk /dev/nvme0n1
  364. 363 mkswap --help
  365. 364 mkswap /dev/nvme0n1p9
  366. 365 free -m
  367. 366 swapon /dev/nvme0n1p9
  368. 367 free -m
  369. 368 vim /etc/fstab
  370. 369 free -m
  371. 370 reboot
  372. 371 top
  373. 372 vmstat 2 25
  374. 373 top
  375. 374 reboot
  376. 375 yum install stratis-cli stratisd
  377. 376 systemctl enable --now stratisd
  378. 377 stratis pool create mypool /dev/nvme0n2
  379. 378 stratis pool list
  380. 379 stratis fs create myfs1
  381. 380 stratis fs create mypool myfs1
  382. 381 stratis fs create mypool myfs2
  383. 382 stratis fs list
  384. 383 stratis pool list
  385. 384 blkid
  386. 385 blkid | grep 52fb
  387. 386 blkid | grep 52fb | awk '{ print $2 }'
  388. 387 blkid | grep 52fb | awk '{ print $2 }' >> /etc/fstab
  389. 388 blkid | grep 60d3 | awk '{ print $2 }' >> /etc/fstab
  390. 389 vim /etc/fstab
  391. 390 mkdir /stratis1 /stratis2
  392. 391 mount -a
  393. 392 reboot
  394. 393 df -h
  395. 394 cd /stratis1
  396. 395 dd if=/dev/zero of=bigfile bs=1M count=50000
  397. 396 df -h
  398. 397 stratis pool list
  399. 398 cat /etc/fstab
  400. 399 cd /run/systemd/generator/
  401. 400 ls
  402. 401 vim stratis1.mount
  403. 402 vim boot.mount
  404. 403 cat /etc/fstab
  405. 404 cp newfs.mount /etc/systemd/system/
  406. 405 vim /etc/fstab
  407. 406 cd /etc/systemd/system/
  408. 407 vim newfs.mount
  409. 408 systemctl cat sshd.service
  410. 409 vim newfs.mount
  411. 410 umount /newfs
  412. 411 mount | grep newfs
  413. 412 systemctl enable --now newfs.mount
  414. 413 mount | grep newfs
  415. 414 reboot
  416. 415 mount | grep new
  417. 416 cat /etc/fstab
  418. 417 systemctl status newfs
  419. 418 systemctl status newfs.mount
  420. 419 vim /etc/default/grub
  421. 420 ./countdown 15
  422. 421 yum install -y httpd
  423. 422 systemctl enable --now httpd
  424. 423 ps aux | grep httpd
  425. 424 ps Zaux | grep httpd
  426. 425 ps Zaux
  427. 426 ls -ldZ /var/tmp
  428. 427 ls -lZ /var/www
  429. 428 mkdir /web
  430. 429 cd /web
  431. 430 vim index.html
  432. 431 vim /etc/httpd/conf/httpd.conf
  433. 432 systemctl restart httpd
  434. 433 curl localhost
  435. 434 getenforce
  436. 435 setenforce permissive
  437. 436 getenforce
  438. 437 curl localhost
  439. 438 vim /etc/httpd/conf/httpd.conf
  440. 439 systemctl restart httpd
  441. 440 curl localhost
  442. 441 getenforce
  443. 442 setenforce enforcing
  444. 443 curl localhost
  445. 444 ps Zaux | grep httpd
  446. 445 ls -ldZ /web
  447. 446 grep AVC /var/log/audit/audit.log
  448. 447 ls -ld /web
  449. 448 ls -ldZ /web
  450. 449 ls -ldZ /var/www/html
  451. 450 man semanage
  452. 451 man semanage-fcontext
  453. 452 semanage fcontext -a -t httpd_sys_content_t "/web(/.*)?"
  454. 453 ls -ldZ /web
  455. 454 restorecon -Rv /web
  456. 455 getenforce
  457. 456 curl localhost
  458. 457 cd
  459. 458 ./countdown 1
  460. 459 history
  461. 460 man regex
  462. 461 man 7 regex
  463. 462 grep AVC /var/log/audit/audit.log
  464. 463 history | grep force
  465. 464 vim /etc/sysconfig/selinux
  466. 465 ./countdown 13
  467. 466 getsebool -a
  468. 467 getsebool -a | wc
  469. 468 getsebool -a |less
  470. 469 getsebool -a | grep http
  471. 470 getsebool -a | grep on
  472. 471 getsebool -a | grep http
  473. 472 setsebool -P httpd_use_cifs on
  474. 473 vim /etc/httpd/conf/httpd.conf
  475. 474 systemctl restart httpd
  476. 475 systemctl status httpd
  477. 476 grep AVC /var/log/audit/audit.log
  478. 477 man semanage-port
  479. 478 grep sealert /var/log/messages
  480. 479 sealert -l 881abaed-4218-4aba-8ddc-f4e0773e74e7 | less
  481. 480 #semanage port -a -t http_port_t
  482. 481 sealert -l 881abaed-4218-4aba-8ddc-f4e0773e74e7 | les
  483. 482 semanage port -a -t http_port_t -p tcp 82
  484. 483 systemctl restart httpd
  485. 484 sealert -l 1977d4aa-ae14-4130-b3c4-58c2d81b2466 | less
  486. 485 restorecon -Rv /var
  487. 486 yum install vdo kmod-kvdo
  488. 487 man vdo
  489. 488 vdo create --name=vdo1 --device=/dev/nvme0n3 --vdoLogicalSize=1E
  490. 489 vdo create --name=vdo1 --device=/dev/nvme0n3 --vdoLogicalSize=1P
  491. 490 mkfs.xfs -K /dev/mapper/vdo1
  492. 491 udevadm settle
  493. 492 cd /usr/share/doc/vdo/
  494. 493 ls
  495. 494 cd examples/
  496. 495 ls
  497. 496 cd systemd/
  498. 497 ls
  499. 498 cp VDO.mount.example /etc/systemd/systemd/myvdo.mount
  500. 499 cp VDO.mount.example /etc/systemd/system/myvdo.mount
  501. 500 mkdir /myvdo
  502. 501 pwd
  503. 502 cd /etc/systemd/system/
  504. 503 vim myvdo.mount
  505. 504 systemctl enable --now myvdo.mount
  506. 505 systemctl status myvdo.mount
  507. 506 reboot
  508. 507 showmount -e 192.168.29.2
  509. 508 mount 192.168.29.2:/ldap /mnt
  510. 509 ls /mnt
  511. 510 umount /mnt
  512. 511 countdown 13
  513. 512 systemctl status autofs
  514. 513 yum install -y autofs
  515. 514 systemctl status autofs
  516. 515 vim /etc/auto.master
  517. 516 vim /etc/auto.misc
  518. 517 ls /
  519. 518 vim /etc/auto.files
  520. 519 vim /etc/auto.master
  521. 520 vim /etc/auto.files
  522. 521 showmount -e 192.168.29.2
  523. 522 ls /
  524. 523 systemctl enable --now autofs
  525. 524 ls /
  526. 525 cd /files
  527. 526 ls -a
  528. 527 cd data
  529. 528 mount
  530. 529 vim /etc/auto.master
  531. 530 vim /etc/auto.ldap
  532. 531 systemctl restart autofs
  533. 532 cd /home/ldap
  534. 533 ls -a
  535. 534 cd user1
  536. 535 cd ../user2
  537. 536 cd ..
  538. 537 ls
  539. 538 countdown 1
  540. 539 reboot
  541. 540 mount | grep vdo
  542. 541 df -h
  543. 542 vdostats --human-readable
  544. 543 ssh 192.168.29.2
  545. 544 history
  546.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement