sandervanvugt

RHCSA day4 march22

Mar 4th, 2022
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.09 KB | None | 0 0
  1. [root@localhost new]# history
  2. 1 mkdir /sda6
  3. 2 vim /etc/fstab
  4. 3 mount -a
  5. 4 cp /etc/passwd /sda5
  6. 5 cp /etc/motd /sda6
  7. 6 history
  8. 7 lsblk
  9. 8 umount /dev/sda5
  10. 9 vim /etc/fstab
  11. 10 fdisk /dev/sda
  12. 11 reboot
  13. 12 journalctl -xb
  14. 13 touch bb
  15. 14 lsblk
  16. 15 vim /etc/fstab
  17. 16 blkid
  18. 17 blkid | awk '/sda5/ { print $2 }'
  19. 18 blkid | awk '/sda5/ { print $2 }' >> /etc/fstab
  20. 19 vim /etc/fstab
  21. 20 mount -a
  22. 21 reboot
  23. 22 blkid
  24. 23 tune2fs --help
  25. 24 tune2fs -L cow /dev/sda5
  26. 25 blkid
  27. 26 xfs_admin --help
  28. 27 xfs_admin -L goat /dev/sda3
  29. 28 umount /dev/sda3
  30. 29 xfs_admin -L goat /dev/sda3
  31. 30 mount -a
  32. 31 blkid
  33. 32 groupadd student
  34. 33 groupadd students
  35. 34 groupadd profs
  36. 35 vim /etc/login.defs
  37. 36 usermod -aG students lisa
  38. 37 usermod -aG students linda
  39. 38 id lisa
  40. 39 usermod -aG profs anna
  41. 40 usermod -aG profs anouk
  42. 41 mkdir -p /data/profs /data/students
  43. 42 cd /data
  44. 43 ls -l
  45. 44 usermod --help
  46. 45 mkdir --help
  47. 46 chown anna:students students/
  48. 47 chown anna:profs profs/
  49. 48 ls -l
  50. 49 chmod 3770 *
  51. 50 ls -l
  52. 51 cd
  53. 52 df -h
  54. 53 dd if=/dev/zero of=/diskfile.img bs=1 count=2048
  55. 54 dd if=/dev/zero of=/diskfile.img bs=1M count=2048
  56. 55 ls -l /diskfile.img
  57. 56 losetup -fP /diskfile.img
  58. 57 losetup -a
  59. 58 lsblk
  60. 59 reboot
  61. 60 lsblk
  62. 61 losetup -a
  63. 62 lsblk
  64. 63 losetup -fP /diskfile.img
  65. 64 lsblk
  66. 66 cd /data
  67. 67 getfacl sales
  68. 68 cd sales
  69. 69 ls
  70. 70 ls -l
  71. 71 cd ..
  72. 72 setfacl -m -R g:sales:rx /data/sales
  73. 73 setfacl -R -m g:sales:rx /data/sales
  74. 74 ls -l sales/
  75. 75 getfacl sales/lisa1
  76. 76 man setfacl
  77. 77 setfacl -R -x g:sales /data/sales
  78. 78 ls -l sales
  79. 79 setfacl -R -m g:account:rx /data/sales
  80. 80 ls -l sales/
  81. 81 getfacl sales/lisa1
  82. 82 setfacl -R -x g:account /data/sales
  83. 83 setfacl -R -m g:account:rX /data/sales
  84. 84 ls -l sales/
  85. 85 getfacl sales
  86. 86 getfacl sales/lisa1
  87. 87 setfacl -m d:g:account:rx /data/sales
  88. 88 getfacl sales
  89. 89 touch sales/root1
  90. 90 getfacl sales/root1
  91. 91 countdown 16
  92. 92 df -h
  93. 93 lsblk
  94. 94 dd if=/dev/sr0 of=/rhel85.iso bs=1M
  95. 95 df -h
  96. 96 mkdir /repo
  97. 97 vim /etc/fstab
  98. 98 mount -a
  99. 99 cd /repo
  100. 100 ls
  101. 101 cd BaseOS/
  102. 102 ls
  103. 103 ls Packages/
  104. 104 ls repodata/
  105. 105 cd ..
  106. 106 cd
  107. 107 yum repolist
  108. 108 cd /etc/yum.repos.d/
  109. 109 vim base.repo
  110. 110 vim appstream.repo
  111. 111 vim base.repo
  112. 112 yum repolist
  113. 113 vim appstream.repo
  114. 114 yum repolist
  115. 115 yum search btrfs
  116. 116 yum search zsh
  117. 117 yum install zsh
  118. 118 seinfo
  119. 119 yum provides */seinfo
  120. 120 history
  121. 121 cd
  122. 122 yum module list
  123. 123 yum module provides httpd
  124. 124 yum module info postgresql
  125. 125 yum module info postgresql | less
  126. 126 yum module info --profile postgresql
  127. 127 yum module list postgresql
  128. 128 yum module install posgresql:9.6
  129. 129 yum module install postgresql:9.6
  130. 130 yum module install postgresql:9.6/server
  131. 131 yum module enable postgresql:9.6
  132. 132 man ifconfig
  133. 133 ip a
  134. 134 ip addr add dev ens160 10.0.0.10/24
  135. 135 ip a
  136. 136 ping 10.0.0.10
  137. 137 ifconfig
  138. 138 cat /etc/resolv.conf
  139. 139 ip route show
  140. 140 ip
  141. 141 countdown 12
  142. 142 df -h
  143. 143 cd /repo
  144. 144 ls
  145. 145 ls BaseOS/Packages/
  146. 146 ls BaseOS/repodata/
  147. 147 cd /etc/yum.repos.d/
  148. 148 cat base.repo
  149. 149 cat appstream.repo
  150. 150 yum repolist
  151. 151 cd
  152. 152 history
  153. 153 systemctl status NetworkManager
  154. 154 nmtui
  155. 155 ip a
  156. 156 fdisk /dev/sda
  157. 157 lsblk
  158. 158 pvcreate /dev/sda6
  159. 159 xxd /dev/sda6 | less
  160. 160 pvs
  161. 161 vgcreate vgdata /dev/sda6
  162. 162 vgs
  163. 163 pvs
  164. 164 vgremove vgdata
  165. 165 vgs
  166. 166 vgcreate --help | less
  167. 167 vgcreate -s 8m vgdata /dev/sda6
  168. 168 vgdisplay vgdata
  169. 169 lvcreate -L 2G -n lvdata vgdata
  170. 170 echo $(( 256 * 8 ))
  171. 171 vgs
  172. 172 echo $(( 255 * 8 ))
  173. 173 lvcreate -l 255 -n lvdata vgdata
  174. 174 lvs
  175. 175 mkfs.xfs /dev/vgdata/lvdata
  176. 176 mkdir /lvdata
  177. 177 vim /etc/fstab
  178. 178 mount -a
  179. 179 mount | tail -1
  180. 180 ls -l /dev/mapper/vgdata-lvdata /dev/vgdata/lvdata
  181. 181 xxd /dev/sda6 | less
  182. 182 history
  183. 183 tail -1 /etc/fstab
  184. 184 df -h
  185. 185 vgs
  186. 186 pvs
  187. 187 gdisk /dev/nvme0n1
  188. 188 lsblk
  189. 189 vgextend rhel /dev/nvme0n1p1
  190. 190 vgs
  191. 191 lvextend -r -l +100%FREE /dev/rhel/root
  192. 192 df -h
  193. 193 xfs_growfs /dev/rhel/root
  194. 194 countdown 12
  195. 195 yum install -y httpd
  196. 196 systemctl status httpd
  197. 197 systemctl enable --now httpd
  198. 198 systemctl status httpd
  199. 199 systemctl stop httpd
  200. 200 systemctl get-default
  201. 201 systemctl set-default multi-user.target
  202. 202 systemctl get-default
  203. 203 reboot
  204. 204 touch ccc
  205. 205 mount
  206. 206 mount -o remount,rw /
  207. 207 touch hhh
  208. 208 systemctl list-units
  209. 209 systemctl list-units
  210. 210 systemctl isolate rescue.target
  211. 211 systemctl list-units
  212. 212 systemctl reboot
  213. 213 systemctl set-default graphical.target
  214. 214 reboot
  215. 215 journalctl
  216. 216 cd /var/log
  217. 217 ls
  218. 218 mkdir journal
  219. 219 ls journal/
  220. 220 systemctl daemon-reload
  221. 221 ls journal/
  222. 222 vim /etc/systemd/journald.conf
  223. 223 journalctl
  224. 224 sysctl -a
  225. 225 sysctl -a | wc
  226. 226 systemctl status tuned
  227. 227 tuned-adm --help
  228. 228 tuned-adm list
  229. 229 tuned-adm profile_info desktop
  230. 230 tuned-adm profile desktop
  231. 231 tuned-adm list
  232. 232 cd /usr/lib/tuned/
  233. 233 ls
  234. 234 cd desktop/
  235. 235 ls
  236. 236 vim tuned.conf
  237. 237 cd
  238. 238 free -m
  239. 239 tuned-adm list
  240. 240 reboot
  241. 241 free -m
  242. 242 vmstat 2 5
  243. 243 gdisk /dev/nvme0n1
  244. 244 lsblk
  245. 245 partprobe
  246. 246 lsblk
  247. 247 free -m
  248. 248 mkswap /dev/nvme0p2
  249. 249 mkswap /dev/nvme0n1p2
  250. 250 free -m
  251. 251 swapon /dev/nvme0n1p2
  252. 252 free -m
  253. 253 vim /etc/fstab
  254. 254 history
  255. 255 reboot
  256. 256 history
  257. 257 yum install stratis-cli stratisd
  258. 258 systemctl enable --now stratisd
  259. 259 systemctl status stratisd
  260. 260 lsblk
  261. 261 fdisk /dev/sdb
  262. 262 fdisk /dev/sdc
  263. 263 lsblk
  264. 264 stratis pool create mypool /dev/sdb1
  265. 265 stratis pool list
  266. 266 stratis fs create mypool myfs1
  267. 267 stratis fs create mypool myfs2
  268. 268 stratis fs list mypool
  269. 269 stratis fs list mypool | awk '/myfs1/ { print $10 }'
  270. 270 stratis fs list mypool | awk '/myfs1/ { print $10 }' >> /etc/fstab
  271. 271 stratis fs list mypool | awk '/myfs2/ { print $10 }' >> /etc/fstab
  272. 272 mkdir /myfs1 /myfs2
  273. 273 vim /etc/fstab
  274. 274 mount -a
  275. 275 man 5 fstab
  276. 276 man -k stratis
  277. 277 mount
  278. 278 df -h
  279. 279 stratis pool list
  280. 280 stratis fs list mypool
  281. 281 cd /run/systemd/system/
  282. 282 ls
  283. 283 cd ../generator/
  284. 284 ls
  285. 285 lsblk
  286. 286 cd
  287. 287 yum install vdo kmod-kvdo
  288. 288 man vdo
  289. 289 #vdo create --name=vdo0 --device=/dev/sdb1 --vdoLogicalSize=10T
  290. 290 vdo create --name=vdo1 --device=/dev/sdb2 --vdoLogicalSize=1T
  291. 291 mkfs.xfs -K /dev/mapper/vdo1
  292. 292 ls -l /dev/mapper/vdo1
  293. 293 cd /usr/share/doc/vdo/examples/
  294. 294 ls
  295. 295 cd systemd/
  296. 296 ls
  297. 297 pwd
  298. 298 vim VDO.mount.example
  299. 299 mkdir /vdo1
  300. 300 cp VDO.mount.example /etc/systemd/system/vdo1.mount
  301. 301 cd /etc/systemd/system/
  302. 302 vim vdo1.mount
  303. 303 systemctl enable --now vdo1.mount
  304. 304 systemctl status vdo1.mount
  305. 305 mount
  306. 306 reboot
  307. 307 mount
  308. 308 cd /run/systemd/generator/
  309. 309 ls
  310. 310 vim myfs1.mount
  311. 311 cd /dev/disk
  312. 312 ls
  313. 313 ls -l by-uuid/
  314. 314 blkid
  315. 315 cd
  316. 316 cd /run/systemd/generator/
  317. 317 ls
  318. 318 vim sda3.mount
  319. 319 cd
  320. 320 systemctl daemon-reload
  321. 321 showmount -e 192.168.29.241
  322. 322 mount 192.168.29.241:/myshare /mnt
  323. 323 cd /mnt
  324. 324 ls
  325. 325 touch file100000
  326. 326 cd
  327. 327 ls -Z
  328. 328 ps Zaux | grep http
  329. 329 cd /var/www/
  330. 330 ls -Z
  331. 331 getenforce
  332. 332 vim /etc/sysconfig/selinux
  333. 333 cd
  334. 334 mkdir /web
  335. 335 vim /web/index.html
  336. 336 vim /etc/httpd/conf/httpd.conf
  337. 337 systemctl restart httpd
  338. 338 curl localhost
  339. 339 q!
  340. 340 getenforce
  341. 341 setenforce permissive
  342. 342 curl localhost
  343. 343 vim /etc/httpd/conf/httpd.conf
  344. 344 systemctl restart httpd
  345. 345 curl localhost
  346. 346 getenforce
  347. 347 setenforce enforcing
  348. 348 curl localhost
  349. 349 less /var/log/audit/audit.log
  350. 350 grep AVC /var/log/audit/audit.log
  351. 351 grep http /var/log/audit/audit.log
  352. 352 reboot
  353. 353 systemctl status auditd
  354. 354 systemctl status auditd.service
  355. 355 systemctl start auditd
  356. 356 systemctl status auditd.service
  357. 357 systemctl status httpd
  358. 358 getenforce
  359. 359 curl localhost
  360. 360 grep AVC /var/log/audit/audit.log
  361. 361 ls -ldZ /var/www/html
  362. 362 ls -Z /web
  363. 363 man semanage
  364. 364 man semanage-fcontext
  365. 365 # semanage fcontext -a -t httpd_sys_content_t "/web(/.*)?"
  366. 366 # restorecon -R -v /web
  367. 367 semanage fcontext -a -t httpd_sys_content_t "/web(/.*)?"
  368. 368 ls -Zd /web
  369. 369 restorecon -Rv /web
  370. 370 curl localhost
  371. 371 history
  372. 372 ls -dZ /var/www/html/
  373. 373 countdown 13
  374. 374 history
  375. 375 cd /etc/selinux/
  376. 376 ls
  377. 377 cd targeted/
  378. 378 ls
  379. 379 cd contexts/
  380. 380 ls
  381. 381 cd files
  382. 382 pwd
  383. 383 ls
  384. 384 cat file_contexts.local
  385. 385 cd
  386. 386 man -k _selinux
  387. 387 yum search selinux
  388. 388 yum install -y selinux-policy-doc
  389. 389 man -k _selinux
  390. 390 man -k _selinux | wc
  391. 391 man -k _selinux | grep http
  392. 392 man apache_selinux
  393. 393 journalctl | grep sealert
  394. 394 sealert -l ceecd0da-9ddd-4c47-988e-c643a601d77b | less
  395. 395 grep AVC /var/log/audit/audit.log
  396. 396 getsebool -a | grep http
  397. 397 setsebool -P httpd_use_nfs on
  398. 398 ls -Z /etc/hosts
  399. 399 cp /etc/hosts .
  400. 400 rm /etc/hosts
  401. 401 ls -Z hosts
  402. 402 cp hosts /etc/hosts
  403. 403 ls -Z /etc/hosts
  404. 404 rm /etc/hosts
  405. 405 mv hosts /etc/hosts
  406. 406 ls -Z /etc/hosts
  407. 407 restorecon /etc/hosts -v
  408. 408 vim /etc/httpd/conf/httpd.conf
  409. 409 systemctl restart httpd
  410. 410 systemctl status httpd
  411. 411 getenforce
  412. 412 setenforce permissive
  413. 413 systemctl restart httpd
  414. 414 setenforce enforcing
  415. 415 journalctl | grep sealert
  416. 416 sealert -l 70cc8934-3dab-47b0-a2bb-f64630549047 | less
  417. 417 semanage port -a -t http_port_t -p tcp 82
  418. 418 getenforce
  419. 419 systemctl restart httpd
  420. 420 systemctl status httpd
  421. 421 ss -Ztuna
  422. 422 systemctl status firewalld
  423. 423 firewall-cmd --list-all
  424. 424 firewall-cmd --get-services
  425. 425 firewall-cmd --add-service http
  426. 426 firewall-cmd --add-service https
  427. 427 firewall-cmd --list-all
  428. 428 systemctl restart firewalld
  429. 429 firewall-cmd --list-all
  430. 430 firewall-cmd --add-service https --permanent
  431. 431 firewall-cmd --add-service http --permanent
  432. 432 firewall-cmd --list-all
  433. 433 systemctl restart firewalld
  434. 434 firewall-cmd --list-all
  435. 435 cd /usr/lib/firewalld
  436. 436 ls
  437. 437 cd services/
  438. 438 ls
  439. 439 vim http.xml
  440. 440 cp http.xml /etc/firewalld/services/sander.xml
  441. 441 vim /etc/firewalld/services/sander.xml
  442. 442 systemctl restart firewalld
  443. 443 firewall-cmd --get-services
  444. 444 cd ..
  445. 445 ls
  446. 446 cd zones/
  447. 447 pwd
  448. 448 ls
  449. 449 cat work.xml
  450. 450 cat public.xml
  451. 451 cd
  452. 452 vim /etc/default/grub
  453. 453 grub2-mkconfig -o /boot/grub2/grub.cfg
  454. 454 reboot
  455. 455 history
  456. 456 sleep 120; countdown 11
  457. 457 systemctl status autofs
  458. 458 yum install -y autofs
  459. 459 systemctl enable --now autofs
  460. 460 vim /etc/auto.master
  461. 461 ls /
  462. 462 vim /etc/auto.misc
  463. 463 showmount -e 192.168.29.141
  464. 464 showmount -e 192.168.29.241
  465. 465 vim /etc/auto.master
  466. 466 vim /etc/auto.nfsfiles
  467. 467 systemctl restart autofs
  468. 468 ls /
  469. 469 cd /nfsfiles/
  470. 470 mount
  471. 471 ls -a
  472. 472 cd data
  473. 473 cat /etc/auto.nfsfiles
  474. 474 showmount -e 192.168.29.241
  475. 475 vim /etc/auto.nfsfiles
  476. 476 systemctl restart autofs
  477. 477 cd data
  478. 478 ls
  479. 479 pwd\
  480. 480 pwd
  481. 481 mount
  482. 482 cd
  483. 483 showmount -e 192.168.29.241
  484. 484 vim /etc/auto.master
  485. 485 vim auto.ldap
  486. 486 vim /etc/auto.ldap
  487. 487 systemctl restart autofs
  488. 488 cd /home
  489. 489 ls
  490. 490 cd ldap
  491. 491 ls
  492. 492 cd ldapuser1
  493. 493 pwd
  494. 494 reboot
  495. 495 mount -o remount,rw /
  496. 496 cd /
  497. 497 ls
  498. 498 ls -a
  499. 499 rm .autorelabel
  500. 500 reboot
  501. 501 history
  502. 502 yum module install container-tools
  503. 503 podman run -d nginx
  504. 504 podman ps
  505. 505 podman run registry.access.redhat.com/ubi8/ubi:latest
  506. 506 podman login registry.access.redhat.com
  507. 507 podman ps
  508. 508 podman ps -a
  509. 509 podman run -it registry.access.redhat.com/ubi8/ubi:latest
  510. 510 podman ps
  511. 511 podman ps -a
  512. 512 history
  513. 513 podman run -it registry.access.redhat.com/ubi8/ubi:latest
  514. 514 podman ps
  515. 515 exit
  516. 516 vim /etc/containers/registries.conf
  517. 517 podman info
  518. 518 docker pull quay.io/bitnami/nginx
  519. 519 podman pull quay.io/bitnami/nginx
  520. 520 podman search nginx
  521. 521 podman search nginx | wc
  522. 522 podman search --no-trunc registry.redhat.io/nginx
  523. 523 podman images
  524. 524 podman inspect quay.io/bitnami/nginx | less
  525. 525 podman run -d registry.access.redhat.com/rhscl/httpd-24-rhel7
  526. 526 lsblk
  527. 527 vgextend rhel /dev/sdc1
  528. 528 lvextend -r /dev/rhel/root -l +100%FREE
  529. 529 df -h
  530. 530 history
  531. 531 podman run -d nginx -p 8000:80
  532. 532 podman ps
  533. 533 podman ps -a
  534. 534 podman run -d -p 8000:80 nginx
  535. 535 podman logs wizardly_lehmann
  536. 536 podman ps
  537. 537 curl localhost:8000
  538. 538 countdown 12
  539. 539 podman run -d mariadb
  540. 540 podman ps -a
  541. 541 podman logs goofy_shannon
  542. 542 podman run -d --name mydb -e MYSQL_ROOT_PASSWORD=password -e MYSQL_USER=bob -p 3306:3306 mariadb
  543. 543 podman pd
  544. 544 podman ps
  545. 545 podman ps -a
  546. 546 podman rm fervent_volhard
  547. 547 podman images
  548. 548 podman exec -l uname -r
  549. 549 uname -r
  550. 550 podman ps
  551. 551 podman exec -it unruffled_galois sh
  552. 552 podman ps
  553. 553 podman inspect blissful_chatterjee | less
  554. 554 exit
  555. 555 ps fax | less
  556. 556 ps faux | less
  557. 557 history
  558. 558 ssh linda@localhost
  559. 559 countdown 30
  560. 560 ln -s /etc/hosts /tmp/myhosts
  561. 561 ls -l /tmp/myhosts
  562. 562 vim /etc/login.defs
  563. 563 touch /etc/skel/myfile
  564. 564 find / -size +100M -type f
  565. 565 find / -size +100M -type f > /tmp/bigfiles
  566. 566 mkdir /myvol
  567. 567 vgs
  568. 568 vgextend vgdata /dev/sdc2
  569. 569 vgs
  570. 570 lvcreate -n lv500 vgdata -L 500M
  571. 571 mkfs.ext3 -L myvolume /dev/vgdata/lv500
  572. 572 vim /etc/fstab
  573. 573 mount -a
  574. 574 yum search seinfo
  575. 575 yum provides */seinfo
  576. 576 yum install -y setools-console
  577. 577 groupadd profs
  578. 578 usermod -aG profs anna
  579. 579 id anna
  580. 580 mkdir -p / new/profs
  581. 581 cd /new
  582. 582 mkdir -p /new/profs
  583. 583 cd /new
  584. 584 ls -l
  585. 585 chmod 1770 profs
  586. 586 chgrp profs
  587. 587 chgrp profs profs/
  588. 588 chown anna profs
  589. 589 ls -l
  590. 590 crontab -e
  591. 591 tail -f /var/log/messages
  592. 592 countdown 2
  593. 593 history
  594.  
  595.  
  596. #### USER LINDA
  597. [linda@localhost ~]$ history
  598. 1 cd /data/sales
  599. 2 touch linda1
  600. 3 ls -l
  601. 4 exit
  602. 5 cd /data/sales
  603. 6 touch linda2
  604. 7 ls -l
  605. 8 exit
  606. 9 cd /data/sales
  607. 10 ls
  608. 11 rm lisa*
  609. 12 exit
  610. 13 ls -l
  611. 14 rm -f rootfile1
  612. 15 ls -ld .
  613. 16 rm -f rootfile2
  614. 17 exit
  615. 18 touch lindafile
  616. 19 chattr +i lindafile
  617. 20 exit
  618. 21 mkdir -p .config/systemd/user
  619. 22 cd .config/systemd/user/
  620. 23 podman run -d --name mynginx -p 8081:80 nginx
  621. 24 podman ps
  622. 25 podman generate systemd --name mynginx --files
  623. 26 vim container-mynginx.service
  624. 27 systemctl --user daemon-reload
  625. 28 systemctl --user enable container-mynginx.service
  626. 29 systemctl --user status container-mynginx.service
  627. 30 exit
  628. 31 history
  629. 32 exit
  630. 33 history
  631.  
Advertisement
Add Comment
Please, Sign In to add comment