Advertisement
sandervanvugt

RHCSA all days feb24

Feb 9th, 2024
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.67 KB | None | 0 0
  1. ### root commands
  2. 2 vim countdown.sh
  3. 3 chmod +x countdown.sh
  4. 4 ./countdown.sh 19
  5. 5 tar zcvf /root/archive.tgz /etc
  6. 6 ls -l
  7. 7 tar tvf archive.tgz
  8. 8 tar zcvf /root/archive.tgz -C /etc
  9. 9 tar zcvf /root/archive.tgz -C /etc .
  10. 10 tar tvf archive.tgz
  11. 11 cd /etc
  12. 12 tar -cvzf /root/archive.tgz .
  13. 13 history
  14. 14 cut -d : -f 1 /etc/passwd
  15. 15 cat /etc/passwd
  16. 16 cut -d : -f 1 /etc/passwd | sort
  17. 17 cut -d : -f 1 /etc/passwd | sort | grep -v '^$'
  18. 18 cut -d : -f 1 /etc/passwd | sort | grep -v '^$' >/var/tmp/users
  19. 19 cat /var/tmp/users
  20. 20 man cut
  21. 21 man sort
  22. 22 sort -b /etc/passwd
  23. 23 sort -b /etc/passwd | cut -d : -f 1
  24. 24 cd
  25. 25 useradd bob
  26. 26 mkdir userfiles
  27. 27 find / -user "bob" -type f
  28. 28 find / -user "bob" -type f -exec cp {} /root/userfiles \; 2>/dev/null
  29. 29 ls -al /root/userfiles/
  30. 30 history
  31. 31 ls -l $(which yum) $(which dnf)
  32. 32 DNF
  33. 33 dnf install nmap
  34. 34 df -h
  35. 35 dd if=/dev/sr0 of=/rhel9.iso bs=1M
  36. 36 mkdir /repo
  37. 37 vim /etc/fstab
  38. 38 mount -a
  39. 39 ls /repo
  40. 40 cd /repo
  41. 41 ls BaseOS/
  42. 42 ls BaseOS/Packages/
  43. 43 cd
  44. 44 history
  45. 45 lsblk
  46. 46 dnf config-manager --add-repo="file:///repo/AppStream"
  47. 47 dnf config-manager --add-repo="file:///repo/BaseOS"
  48. 48 dnf repolist
  49. 49 dnf search nmap
  50. 50 dnf install nmap
  51. 51 cd /etc/yum.repos.d/
  52. 52 ls
  53. 53 vim repo_BaseOS.repo
  54. 54 vim repo_AppStream.repo
  55. 55 history
  56. 56 dnf install nmap
  57. 57 history
  58. 58 tail -1 /etc/fstab
  59. 59 cd /repo/AppStream/Packages/
  60. 60 ls
  61. 61 cd
  62. 62 dnf install -y git
  63. 63 git clone https://github.com/sandervanvugt/rhcsa9
  64. 64 cd rhcsa9/
  65. 65 ls
  66. 66 cd labs/
  67. 67 ls
  68. 68 ./live-lab1-grade.sh
  69. 69 vim live-lab1-grade.sh
  70. 70 history
  71. 71 dnf groups list
  72. 72 dnf groups install "Development Tools"
  73. 73 history
  74. 74 cd
  75. 75 ./countdown.sh 13
  76. 76 history
  77. 77 lsblk
  78. 78 exit
  79. 79 ./countdown.sh 12
  80. 80 ./countdown.sh 1
  81. 81 ./countdown.sh 13
  82. 82 ./countdown.sh 15
  83. 83 visudo
  84. 84 tail -1 /etc/passwd
  85. 85 id bob
  86. 86 su - bob
  87. 87 passwd bob
  88. 88 su - bob
  89. 89 journalctl
  90. 90 usermod -aG wheel bob
  91. 91 su - bob
  92. 92 visudo
  93. 93 useradd linda
  94. 94 echo password | passwd --stdin linda
  95. 95 su - linda
  96. 96 visudo
  97. 97 su - linda
  98. 98 history
  99. 99 #find / -name ".bash_history" -type f -exec rm -f {} \;
  100. 100 dnf repolist
  101. 101 ps aux | less
  102. 102 less /etc/passwd
  103. 103 usermod --help
  104. 104 vim /etc/login.defs
  105. 105 cd /etc/skel
  106. 106 ls
  107. 107 ls -a
  108. 108 touch hello
  109. 109 ls -a
  110. 110 useradd sander
  111. 111 ls -al /home/sander
  112. 112 cd
  113. 113 less /etc/passwd
  114. 114 id bob
  115. 115 grep bob /etc/passwd
  116. 116 grep bob /etc/group
  117. 117 lid wheel
  118. 118 lid -g wheel
  119. 119 useradd -g wheel baduser
  120. 120 id baduser
  121. 121 grep wheel /etc/group
  122. 122 grep baduser /etc/passwd
  123. 123 lid -g wheel
  124. 124 chage bob
  125. 125 history
  126. 126 cd rhcsa9/labs/
  127. 127 ls
  128. 128 vim live-lab2-grade.sh
  129. 129 ./live-lab2-grade.sh
  130. 130 vim /etc/login.defs
  131. 131 touch /etc/skel/newfile
  132. 132 groupadd profs
  133. 133 groupadd students
  134. 134 useradd -G students linda
  135. 135 useradd -G students lisa
  136. 136 usermod -aG students linda
  137. 137 useradd -G profs anna
  138. 138 useradd -G profs anouk
  139. 139 history | grep git
  140. 140 ./live-lab2-grade.sh
  141. 141 ls -l
  142. 142 cd /home/linda
  143. 143 echo linda > lindafile
  144. 144 ls -l lindafile
  145. 145 chmod u-rw
  146. 146 chmod u-rw linda
  147. 147 chmod u-rw lindafile
  148. 148 chown linda lindafile
  149. 149 ls -l lindafile
  150. 150 su - linda
  151. 151 cd
  152. 152 cd /etc/skel
  153. 153 mkdir tryme
  154. 154 chmod 2770 tryme
  155. 155 useradd pablo
  156. 156 ls -l pabl
  157. 157 ls -l /home/pablo
  158. 158 mkdir -p /data/profs /data/students
  159. 159 cd /data
  160. 160 ls -l
  161. 161 id
  162. 162 chown :profs profs
  163. 163 ls -l
  164. 164 chgrp students students
  165. 165 ls -l
  166. 166 chmod 770 students
  167. 167 ls -l
  168. 168 chmod g+w,o-rx profs
  169. 169 ls -l
  170. 170 su - anna
  171. 171 chmod g+s /data/profs
  172. 172 ls -ld /data/profs
  173. 173 su - anna
  174. 174 su - anouk
  175. 175 chmod +t /data/profs
  176. 176 su - anouk
  177. 177 chmod g-x,o+x /data/profs
  178. 178 ls -ld /data/profs
  179. 179 chmod g+x,o-x /data/profs
  180. 180 cd /profs
  181. 181 cd profs
  182. 182 mkdir one two three
  183. 183 for i in one two three; do touch $i/four; done
  184. 184 for i in one two three; do touch $i/five; done
  185. 185 tree
  186. 186 ls -lR
  187. 187 chmod -R g+s .
  188. 188 ls -lR
  189. 189 chmod -R g-s .
  190. 190 find . -type d
  191. 191 find . -type d -exec chmod g+s {} \;
  192. 192 ls -lR
  193. 193 history
  194. 194 who; find . -exec ls -l {} \;
  195. 195 umask
  196. 196 touch '-'
  197. 197 ls -l
  198. 198 echo hello > \-
  199. 199 ls
  200. 200 rm \-
  201. 201 rm -- \-
  202. 202 cd
  203. 203 history
  204. 204 poweroff
  205. 205 echo h > /proc/sysrq-trigger
  206. 206 dmesg
  207. 207 ls -l /data
  208. 208 rm -rf /data
  209. 209 mkdir -p /data/profs /data/students
  210. 210 cd /data
  211. 211 chgrp students students
  212. 212 chgrp profs profs
  213. 213 ls -l
  214. 214 chmod 770 *
  215. 215 ls -l
  216. 216 umask
  217. 217 cd /etc/
  218. 218 vim bashrc
  219. 219 cd /etc/profile.d/
  220. 220 ls
  221. 221 echo $UID
  222. 222 exit
  223. 223 vim umask.sh
  224. 224 grep 1005 /etc/passwd
  225. 225 grep 1004 /etc/passwd
  226. 226 cat /etc/passwd
  227. 227 su - lisa
  228. 228 lsblk
  229. 229 cat /proc/partitions
  230. 230 df -h
  231. 231 lsblk
  232. 232 poweroff
  233. 233 lsblk
  234. 234 blkid
  235. 235 cat /etc/fstab
  236. 236 touch ff
  237. 237 mount -o remount,rw /
  238. 238 touch ff
  239. 239 blkid | awk '/sda5/ { print $2 }'
  240. 240 blkid | awk '/sda5/ { print $2 }' >> /etc/fstab
  241. 241 vim /etc/fstab
  242. 242 mount -a
  243. 243 lsblk
  244. 244 reboot
  245. 245 #systemd.unit=emergency.target
  246. 246 history
  247. 247 ls /dev/disk/
  248. 248 ls /dev/disk/by-uuid/
  249. 249 ls /dev/disk/by-uuid/ -l
  250. 250 free -m
  251. 251 fdisk /dev/sda
  252. 252 mkswap -L myswap /dev/sda7
  253. 253 free -m
  254. 254 vim /etc/fstab
  255. 255 swapon -a
  256. 256 free -m
  257. 257 history
  258. 258 cd rhcsa9/
  259. 259 git pull
  260. 260 cd labs/
  261. 261 ls
  262. 262 ls -l
  263. 263 systemctl list-units
  264. 264 systemctl status vmtoolsd.service
  265. 265 systemctl status sshd.service
  266. 266 cd
  267. 267 dnf install -yn httpd
  268. 268 dnf install -y httpd
  269. 269 systemctl status httpd.service
  270. 270 systemctl enable --now httpd
  271. 271 systemctl status httpd.service
  272. 272 systemctl -t help
  273. 273 systemctl list-units -t mounts
  274. 274 systemctl list-units -t mount
  275. 275 systemctl cat ext4.mount
  276. 276 systemctl cat -.mount
  277. 277 systemctl cat -- -.mount
  278. 278 systemctl status sshd
  279. 279 kill -9 1080
  280. 280 systemctl status sshd
  281. 281 systemctl cat sshd.service
  282. 282 systemctl edit httpd.service
  283. 283 export EDITOR=/usr/bin/vim
  284. 284 systemctl cat httpd.service
  285. 285 systemctl cat sshd.service
  286. 286 systemctl cat httpd.service
  287. 287 systemctl show httpd.service
  288. 288 man systemd.directives
  289. 289 man systemd.resource-control
  290. 290 systemctl daemon-reload
  291. 291 systemctl disable --now httpd
  292. 292 systemctl mask httpd
  293. 293 systemctl start httpd.service
  294. 294 systemctl unmask httpd.service
  295. 295 systemctl start httpd.service
  296. 296 systemctl stop httpd.service
  297. 297 systemctl status httpd
  298. 298 journalctl
  299. 299 journalctl -x
  300. 300 journalctl -xb
  301. 301 journalctl -p err
  302. 302 grep 'Storage=' /etc/systemd/journald.conf
  303. 303 mkdir /var/log/journal
  304. 304 ls -l /var/log/journal/
  305. 305 systemctl daemon-reload
  306. 306 ls -l /var/log/journal/
  307. 307 systemctl restart systemd-journal-flush
  308. 308 ls -l /var/log/journal/
  309. 309 history
  310. 310 cd rhcsa9/
  311. 311 ls
  312. 312 cd
  313. 313 dd if=/dev/zero of=/dev/null &
  314. 314 top
  315. 315 echo 0 > /sys/bus/cpu/devices/cpu1/online
  316. 316 lscpu | less
  317. 317 top
  318. 318 renice --help | less
  319. 319 renice -n 5 -p 9944
  320. 320 top
  321. 321 nice --help
  322. 322 nice -n -5 dd if=/dev/zero of=/dev/null &
  323. 323 top
  324. 324 killall dd
  325. 325 history
  326. 326 echo 1 > /sys/bus/cpu/devices/cpu1/online
  327. 327 tuned-adm list
  328. 328 tuned-adm active
  329. 329 tuned-adm recommend
  330. 330 tuned-adm profile balanced
  331. 331 tuned-adm active
  332. 332 history
  333. 333 systemctl status tuned
  334. 334 echo vm.swappiness = 33 > /etc/sysctl.d/swappiness.conf
  335. 335 sysctl -a
  336. 336 sysctl -a | wc -l
  337. 337 sysctl -a | grep swappi
  338. 338 sysctl -p /etc/sysctl.d/swappiness.conf
  339. 339 sysctl -a | grep swappi
  340. 340 ls -l /usr/lib/tuned/
  341. 341 less /usr/lib/tuned/desktop/tuned.conf
  342. 342 mkdir /etc/tuned/myprofile
  343. 343 vim /etc/tuned/myprofile/tuned.conf
  344. 344 tuned-adm list
  345. 345 tuned-adm profile myprofile
  346. 346 tuned-adm active
  347. 347 sysctl -a | grep swappi
  348. 348 vim /etc/tuned/tuned-main.conf
  349. 349 ip a
  350. 350 systemctl status NetworkManager
  351. 351 nmtui
  352. 352 ip a
  353. 353 exit
  354. 354 ./countdown.sh 16
  355. 355 ./countdown.sh 14
  356. 356 cd /etc/NetworkManager/system-connections/
  357. 357 ls
  358. 358 cat ens160.nmconnection
  359. 359 cd
  360. 360 reboot
  361. 361 exit
  362. 362 history
  363. 363 cd rhcsa9/
  364. 364 git pull
  365. 365 cd labs/
  366. 366 lsblk
  367. 367 fdisk -l /dev/sda
  368. 368 cd
  369. 369 fdisk /dev/sda
  370. 370 pvcreate /dev/sda8
  371. 371 xxd /dev/sda8 | less
  372. 372 pvs
  373. 373 vgcreate vgdata /dev/sda8
  374. 374 pvs
  375. 375 vgs
  376. 376 lvcreate -n lvdata -L 2G vgdata
  377. 377 lvcreate -n lvdata -l 100%FREE vgdata
  378. 378 lvs
  379. 379 lvdisplay lvdata
  380. 380 lvdisplay /dev/vgdata/lvdata
  381. 381 echo $(( 511 * 4 ))
  382. 382 mkfs.ext4 /dev/vgdata/lvdata
  383. 383 vim /etc/fstab
  384. 384 mount -a
  385. 385 mkdir /lvdata
  386. 386 mount -a
  387. 387 mount
  388. 388 ls -l /dev/mapper/vgdata-lvdata /dev/vgdata/lvdata
  389. 389 tail -1 /etc/fstab
  390. 390 history
  391. 391 tail -1 /etc/fstab
  392. 392 vgdisplay vgdata
  393. 393 vgcreate --help | less
  394. 394 lvs
  395. 395 df -h
  396. 396 vgs
  397. 397 lsblk
  398. 398 fdisk /dev/sda
  399. 399 vgextend vgdata /dev/sda9
  400. 400 vgs
  401. 401 lvextend --help | less
  402. 402 lvresize -r -l +50%FREE /dev/vgdata/lvdata
  403. 403 df -h
  404. 404 history
  405. 405 lvcreate --help | less
  406. 406 man lvresize
  407. 407 cd rhcsa9/labs/
  408. 408 ls
  409. 409 cd ..
  410. 410 git pull
  411. 411 cd labs/
  412. 412 ./live-lab9-grade.sh
  413. 413 history
  414. 414 fdisk /dev/sda
  415. 415 vgs
  416. 416 vgextend rhel /dev/sda10
  417. 417 vgs
  418. 418 lvresize -r -l +100%FREE /dev/rhel/root
  419. 419 ./live-lab9-grade.sh
  420. 420 vim live-lab9-grade.sh
  421. 421 ./live-lab9-grade.sh
  422. 422 pvs
  423. 423 getenforce
  424. 424 vim /etc/httpd/conf/httpd.conf
  425. 425 echo hello world > /var/www/html/index.html
  426. 426 systemctl start httpd
  427. 427 curl localhost
  428. 428 vim /etc/httpd/conf/httpd.conf
  429. 429 echo hello from the web > /web/index.html
  430. 430 mkdir /web
  431. 431 echo hello from the web > /web/index.html
  432. 432 systemctl restart httpd
  433. 433 curl localhost
  434. 434 setenforce permissive
  435. 435 curl localhost
  436. 436 vim /etc/httpd/conf/httpd.conf
  437. 437 systemctl restart httpd
  438. 438 curl localhost
  439. 439 setenforce enforcing
  440. 440 curl localhost
  441. 441 systemctl edit httpd.service
  442. 442 systemctl restart httpd.service
  443. 443 vim /etc/default/grub
  444. 444 grub2-mkconfig -o /boot/grub2/grub.cfg
  445. 445 vim /etc/sysconfig/selinux
  446. 446 history
  447. 447 ps Zaux | grep http
  448. 448 ls -lZ /var/www
  449. 449 ls -ldZ /web
  450. 450 ls -ldZ /var/tmp
  451. 451 ls -lZ /var/www/html/index.html
  452. 452 grep AVC /var/log/audit/audit.log
  453. 453 man semanage-fcontext
  454. 454 semanage fcontext -a -t httpd_sys_content_t "/web(/.*)?"
  455. 455 ls -Zd /web
  456. 456 restorecon -Rv /web
  457. 457 ls -lZ /web
  458. 458 getenforce
  459. 459 curl localhost
  460. 460 history
  461. 461 man semanage-port
  462. 462 getsebool -a
  463. 463 getsebool -a | wc -l
  464. 464 getsebool -a | grep ftp
  465. 465 setsebool -P ftpd_anon_write on
  466. 466 getsebool -a | grep ftp
  467. 467 dnf provides */sealert
  468. 468 journalctl | grep sealert
  469. 469 sealert -l db32d88c-4721-4184-99d7-b02785fdae09 | less
  470. 470 vim /etc/httpd/conf/httpd.conf
  471. 471 systemctl restart httpd
  472. 472 systemctl status httpd
  473. 473 journalctl -xeu httpd.service
  474. 474 setenforce permissive
  475. 475 systemctl restart httpd
  476. 476 journalctl | grep sealert
  477. 477 sealert -l d3841914-af71-46b4-8714-f13ff7bf941d | less
  478. 478 semanage port -a -t http_port_t -p tcp 82
  479. 479 setenforce enforcing
  480. 480 systemctl restart httpd
  481. 481 man -k _selinux
  482. 482 dnf install selinux-policy-doc
  483. 483 man -k _selinux
  484. 484 man -k _selinux | grep httpd
  485. 485 man httpd_selinux
  486. 486 history
  487. 487 ls -lZ /etc/hosts
  488. 488 mv /etc/hosts /web/
  489. 489 ls -lZ /web/hosts
  490. 490 curl localhost/hosts
  491. 491 curl localhost:82/hosts
  492. 492 getenforce
  493. 493 restorecon -v /web/hosts
  494. 494 systemctl status firewalld
  495. 495 firewall-cmd --list-all
  496. 496 firewall-cmd --get-services
  497. 497 firewall-cmd --add-service http
  498. 498 firewall-cmd --list-all
  499. 499 firewall-cmd --add-service http --permanent
  500. 500 vim /usr/lib/firewalld/services/http.xml
  501. 501 cp /usr/lib/firewalld/services/http.xml /etc/firewalld/services/
  502. 502 vim /etc/firewalld/services/http.xml
  503. 503 firewall-cmd --help | grep add-port
  504. 504 firewall-cmd --add-port=84/tcp
  505. 505 firewall-cmd --list-all
  506. 506 firewall-cmd --add-port=84/tcp --permanent
  507. 507 firewall-cmd --add-port=85/tcp --permanent
  508. 508 firewall-cmd --list-all
  509. 509 firewall-cmd --reload
  510. 510 firewall-cmd --list-all
  511. 511 history
  512. 512 cp /web/hosts /etc/
  513. 513 ls -Z /etc/hosts
  514. 514 history -w
  515. 515 ./countdown.sh 16
  516. 516 ./countdown.sh 1
  517. 517 ./countdown.sh 12
  518. 518 ./countdown.sh 5
  519. 519 ./countdown.sh 13
  520. 520 history
  521. 521 cd rhcsa9/
  522. 522 git pull
  523. 523 cd labs/
  524. 524 lsblk
  525. 525 fdisk -l /dev/sda
  526. 526 cd
  527. 527 fdisk /dev/sda
  528. 528 pvcreate /dev/sda8
  529. 529 xxd /dev/sda8 | less
  530. 530 pvs
  531. 531 vgcreate vgdata /dev/sda8
  532. 532 pvs
  533. 533 vgs
  534. 534 lvcreate -n lvdata -L 2G vgdata
  535. 535 lvcreate -n lvdata -l 100%FREE vgdata
  536. 536 lvs
  537. 537 lvdisplay lvdata
  538. 538 lvdisplay /dev/vgdata/lvdata
  539. 539 echo $(( 511 * 4 ))
  540. 540 mkfs.ext4 /dev/vgdata/lvdata
  541. 541 vim /etc/fstab
  542. 542 mount -a
  543. 543 mkdir /lvdata
  544. 544 mount -a
  545. 545 mount
  546. 546 ls -l /dev/mapper/vgdata-lvdata /dev/vgdata/lvdata
  547. 547 tail -1 /etc/fstab
  548. 548 history
  549. 549 tail -1 /etc/fstab
  550. 550 vgdisplay vgdata
  551. 551 vgcreate --help | less
  552. 552 lvs
  553. 553 df -h
  554. 554 vgs
  555. 555 lsblk
  556. 556 fdisk /dev/sda
  557. 557 vgextend vgdata /dev/sda9
  558. 558 vgs
  559. 559 lvextend --help | less
  560. 560 lvresize -r -l +50%FREE /dev/vgdata/lvdata
  561. 561 df -h
  562. 562 history
  563. 563 lvcreate --help | less
  564. 564 man lvresize
  565. 565 cd rhcsa9/labs/
  566. 566 ls
  567. 567 cd ..
  568. 568 git pull
  569. 569 cd labs/
  570. 570 ./live-lab9-grade.sh
  571. 571 history
  572. 572 fdisk /dev/sda
  573. 573 vgs
  574. 574 vgextend rhel /dev/sda10
  575. 575 vgs
  576. 576 lvresize -r -l +100%FREE /dev/rhel/root
  577. 577 ./live-lab9-grade.sh
  578. 578 vim live-lab9-grade.sh
  579. 579 ./live-lab9-grade.sh
  580. 580 pvs
  581. 581 getenforce
  582. 582 vim /etc/httpd/conf/httpd.conf
  583. 583 echo hello world > /var/www/html/index.html
  584. 584 systemctl start httpd
  585. 585 curl localhost
  586. 586 vim /etc/httpd/conf/httpd.conf
  587. 587 echo hello from the web > /web/index.html
  588. 588 mkdir /web
  589. 589 echo hello from the web > /web/index.html
  590. 590 systemctl restart httpd
  591. 591 curl localhost
  592. 592 setenforce permissive
  593. 593 curl localhost
  594. 594 vim /etc/httpd/conf/httpd.conf
  595. 595 systemctl restart httpd
  596. 596 curl localhost
  597. 597 setenforce enforcing
  598. 598 curl localhost
  599. 599 systemctl edit httpd.service
  600. 600 systemctl restart httpd.service
  601. 601 vim /etc/default/grub
  602. 602 grub2-mkconfig -o /boot/grub2/grub.cfg
  603. 603 vim /etc/sysconfig/selinux
  604. 604 history
  605. 605 ps Zaux | grep http
  606. 606 ls -lZ /var/www
  607. 607 ls -ldZ /web
  608. 608 ls -ldZ /var/tmp
  609. 609 ls -lZ /var/www/html/index.html
  610. 610 grep AVC /var/log/audit/audit.log
  611. 611 man semanage-fcontext
  612. 612 semanage fcontext -a -t httpd_sys_content_t "/web(/.*)?"
  613. 613 ls -Zd /web
  614. 614 restorecon -Rv /web
  615. 615 ls -lZ /web
  616. 616 getenforce
  617. 617 curl localhost
  618. 618 history
  619. 619 man semanage-port
  620. 620 getsebool -a
  621. 621 getsebool -a | wc -l
  622. 622 getsebool -a | grep ftp
  623. 623 setsebool -P ftpd_anon_write on
  624. 624 getsebool -a | grep ftp
  625. 625 dnf provides */sealert
  626. 626 journalctl | grep sealert
  627. 627 sealert -l db32d88c-4721-4184-99d7-b02785fdae09 | less
  628. 628 vim /etc/httpd/conf/httpd.conf
  629. 629 systemctl restart httpd
  630. 630 systemctl status httpd
  631. 631 journalctl -xeu httpd.service
  632. 632 setenforce permissive
  633. 633 systemctl restart httpd
  634. 634 journalctl | grep sealert
  635. 635 sealert -l d3841914-af71-46b4-8714-f13ff7bf941d | less
  636. 636 semanage port -a -t http_port_t -p tcp 82
  637. 637 setenforce enforcing
  638. 638 systemctl restart httpd
  639. 639 man -k _selinux
  640. 640 dnf install selinux-policy-doc
  641. 641 man -k _selinux
  642. 642 man -k _selinux | grep httpd
  643. 643 man httpd_selinux
  644. 644 history
  645. 645 ls -lZ /etc/hosts
  646. 646 mv /etc/hosts /web/
  647. 647 ls -lZ /web/hosts
  648. 648 curl localhost/hosts
  649. 649 curl localhost:82/hosts
  650. 650 getenforce
  651. 651 restorecon -v /web/hosts
  652. 652 systemctl status firewalld
  653. 653 firewall-cmd --list-all
  654. 654 firewall-cmd --get-services
  655. 655 firewall-cmd --add-service http
  656. 656 firewall-cmd --list-all
  657. 657 firewall-cmd --add-service http --permanent
  658. 658 vim /usr/lib/firewalld/services/http.xml
  659. 659 cp /usr/lib/firewalld/services/http.xml /etc/firewalld/services/
  660. 660 vim /etc/firewalld/services/http.xml
  661. 661 firewall-cmd --help | grep add-port
  662. 662 firewall-cmd --add-port=84/tcp
  663. 663 firewall-cmd --list-all
  664. 664 firewall-cmd --add-port=84/tcp --permanent
  665. 665 firewall-cmd --add-port=85/tcp --permanent
  666. 666 firewall-cmd --list-all
  667. 667 firewall-cmd --reload
  668. 668 firewall-cmd --list-all
  669. 669 history
  670. 670 cp /web/hosts /etc/
  671. 671 ls -Z /etc/hosts
  672. 672 history -w
  673. 673 reboot
  674. 674 ip a
  675. 675 vim /etc/hosts
  676. 676 systemctl restart httpd
  677. 677 showmount -e nfsserver
  678. 678 dnf install -y nfs-utils
  679. 679 showmount -e nfsserver
  680. 680 mount nfsserver:/nfsdata /mnt
  681. 681 mount
  682. 682 umount /mnt
  683. 683 dnf install -y autofs
  684. 684 vim /etc/auto.master
  685. 685 vim /etc/auto.misc
  686. 686 vim /etc/auto.master
  687. 687 vim /etc/auto.data
  688. 688 systemctl restart autofs
  689. 689 mount
  690. 690 cd /data
  691. 691 ls -a
  692. 692 cd files
  693. 693 mount
  694. 694 vim /etc/auto.master
  695. 695 vim /etc/auto.ldap
  696. 696 systemctl restart autofs
  697. 697 cd /home/ldap/
  698. 698 ls
  699. 699 cd ldapuser1
  700. 700 pwd
  701. 701 cd ..
  702. 702 mount
  703. 703 cd ldapuser2
  704. 704 mount
  705. 705 cd ..
  706. 706 cd sander
  707. 707 cd
  708. 708 history
  709. 709 date
  710. 710 date -s 07:49
  711. 711 date -s 19:50
  712. 712 date
  713. 713 hwclock
  714. 714 hwclock --hctosys
  715. 715 date
  716. 716 timedatectl
  717. 717 timedatectl --help
  718. 718 timedatectl list-timezones
  719. 719 timedatectl set-timezone Africa/Harare
  720. 720 timedatectl status
  721. 721 vim /etc/chrony.conf
  722. 722 systemctl restart chronyd
  723. 723 chronyc sources
  724. 724 history
  725. 725 cat /etc/auto.ldap
  726. 726 tuned-adm list
  727. 727 vim /etc/containers/registries.conf
  728. 728 podman search nginx
  729. 729 podman pull registry.access.redhat.com/ubi9/nginx-122
  730. 730 podman login --get-login
  731. 731 podman login registry.redhat.io --get-login
  732. 732 exit
  733. 733 password
  734. 734 ./countdown.sh 45
  735. 735 vim /etc/httpd/conf/httpd.conf
  736. 736 man semanage-port
  737. 737 semanage port -a -t http_port_t -p tcp 82
  738. 738 useradd -u 1100 -s /sbin/nologin lori
  739. 739 grep lori /etc/passwd
  740. 740 cd /etc
  741. 741 grep -R 'strator' *
  742. 742 grep -Rl 'strator' *
  743. 743 grep -Rl 'strator' * > /tmp/stratorfiles.txt
  744. 744 ln -s /etc/hosts /tmp/hosts
  745. 745 find /etc -exec grep -l 'strator' {} \; > /tmp/findfiles.txt
  746. 746 diff /tmp/stratorfiles.txt /tmp/findfiles.txt
  747. 747 cd
  748. 748 mkdir -p /data/sales
  749. 749 chmod 2770 /data/sales
  750. 750 chgrp sales /data/sales
  751. 751 groupadd sales
  752. 752 chgrp sales /data/sales
  753. 753 vgs
  754. 754 mkdir /lvlab
  755. 755 lvcreate -n lvlab -l 50 vgdata
  756. 756 lvs
  757. 757 mkfs.xfs /dev/vgdata/lvlab
  758. 758 vim /etc/fstab
  759. 759 systemctl daemon-reload
  760. 760 mount -a
  761. 761 mount
  762. 762 cd /run/systemd/generator/
  763. 763 ls
  764. 764 cat lvlab.mount
  765. 765 cp lvlab.mount /etc/systemd/system/
  766. 766 vim /etc/systemd/system/lvlab.mount
  767. 767 vim /etc/fstab
  768. 768 systemctl daemon-reload
  769. 769 umount /lvlab
  770. 770 systemctl enable --now lvlab.mount
  771. 771 systemctl status lvlab.mount
  772. 772 cd
  773. 773 tuned-adm profiles
  774. 774 tuned-adm profile
  775. 775 tuned-adm recommend
  776. 776 tuned-adm profile virtual-guest
  777. 777 tuned-adm profile
  778. 778 cd rhcsa9/
  779. 779 git pull
  780. 780 cd labs/
  781. 781 ./live-mini-exam-grade.sh
  782. 782 cd ..
  783. 783 cat resources.txt
  784. 784 exit
  785. 785 ps faux | less
  786. 786 cd rhcsa9/
  787. 787 ls
  788. 788 git pull
  789. 789 cd labs/
  790. 790 vim live-lab15-grade.sh
  791. 791 ./live-lab15-grade.sh
  792. 792 history | grep git
  793. 793 cd ..
  794. 794 ls
  795. 795 vim mini-exam-30min.txt
  796. 796 cd labs/
  797. 797 ls
  798. 798 cd ..
  799. 799 vim mini-exam-30min.txt
  800. 800 cat mini-exam-30min.txt
  801. 801 exit
  802. 802 history
  803.  
  804. ####student commands
  805. 1 sudo -i
  806. 2 sudo -i
  807. 3 id
  808. 4 ls /root
  809. 5 sudo ls /root
  810. 6 sudo -i
  811. 7 touch mynewfile
  812. 8 ls
  813. 9 sudo -i
  814. 10 echo $UID
  815. 11 sudo -i
  816. 12 su -
  817. 13 sudo -i
  818. 14 exit
  819. 15 podman ps
  820. 16 podman stop sleepy
  821. 17 podman run registry.redhat.io/ubi7/nginx-120
  822. 18 podman login registry.redhat.io
  823. 19 podman search nginx
  824. 20 podman pull registry.access.redhat.com/ubi9/nginx-122
  825. 21 podman search nginx
  826. 22 podman login --get-login registry.redhat.io
  827. 23 ls .config
  828. 24 mkdir .config/containers
  829. 25 sudo dnf install container-tools
  830. 26 git clone https://github.com/sandervanvugt/rhcsa9
  831. 27 cd rhcsa9/
  832. 28 ls
  833. 29 podman info
  834. 30 podman images
  835. 31 podman login registry.access.redhat.com
  836. 32 ls ~/.config/containers/
  837. 33 ls a ~/.config/containers/
  838. 34 ls -a ~/.config/containers/
  839. 35 cd /run/user/1000/
  840. 36 ls
  841. 37 cd containers/
  842. 38 ls
  843. 39 pwd
  844. 40 cd
  845. 41 cd rhcsa9/
  846. 42 vim Containerfile
  847. 43 which echo
  848. 44 podman build -t echoworld .
  849. 45 podman images
  850. 46 vim Containerfile
  851. 47 podman build -t echoworld .
  852. 48 podman images
  853. 49 vim Containerfile
  854. 50 podman build -t echopine .
  855. 51 podman images
  856. 52 podman run echopine
  857. 53 vim Containerfile
  858. 54 podman build -t echopine .
  859. 55 podman run echopine
  860. 56 ls
  861. 57 podman ps
  862. 58 podman ps -a
  863. 59 podman inspect bfa
  864. 60 podman inspect bfa | less
  865. 61 podman images
  866. 62 podman run echopine whoami
  867. 63 podman run ubi8
  868. 64 podman ps
  869. 65 podman ps -a
  870. 66 podman run -it ubi8
  871. 67 podman ps
  872. 68 podman attach quirky_sanderson
  873. 69 sudo -i cp /root/count* /usr/local/bin/
  874. 70 sudo -i
  875. 71 exit
  876. 72 exit
  877. 73 history
  878.  
  879.  
  880. ####linda commands 1 sudo useradd bill
  881. 2 sudo userdel bill
  882. 3 sudo passwd bill
  883. 4 sudo passwd root
  884. 5 exit
  885. 6 sudo passwd root
  886. 7 sudo passwd bill
  887. 8 exit
  888. 9 cat lindafile
  889. 10 chmod u+r lindafile
  890. 11 ls -l
  891. 12 cat lindafile
  892. 13 exit
  893. 14 mkdir -p .config/systemd/user
  894. 15 cd .config/systemd/user
  895. 16 podman run -d --name mynginx -p 8081:80 nginx
  896. 17 podman ps
  897. 18 podman generate systemd --name mynginx --files --new
  898. 19 vim container-mynginx.service
  899. 20 systemctl --user daemon-reload
  900. 21 systemctl --user enable container-mynginx.service
  901. 22 systemctl --user status container-mynginx.service
  902. 23 exit
  903. 24 history
  904.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement