Advertisement
sandervanvugt

RHCSA day4 march 21

Mar 5th, 2021
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.70 KB | None | 0 0
  1. 1 tar -czvf /root/archive.tgz /etc
  2. 2 tar -tvf archive.tgz
  3. 3 cat /etc/dnsmasq.conf
  4. 4 cat /etc/dnsmasq.conf | grep -v ""
  5. 5 cat /etc/dnsmasq.conf | grep -v " "
  6. 6 cat /etc/dnsmasq.conf | grep -v ''
  7. 7 cat /etc/dnsmasq.conf | grep -v '^$'
  8. 8 cat /etc/dnsmasq.conf | grep -v '^$' | sort
  9. 9 cat /etc/dnsmasq.conf | grep -v '^$' | grep -v '^#'
  10. 10 cat /etc/dnsmasq.conf | grep -v '^$' | grep -v '^#' | sort
  11. 11 find / -user $USER
  12. 12 useradd lisa
  13. 13 find / -user lisa
  14. 14 find / -user lisa -exec cp {} /root/userfiles/ \;
  15. 15 mkdir userfiles; find / -user lisa -exec cp {} /root/userfiles/ \;
  16. 16 mkdir userfiles; find / -user lisa -exec cp {} /root/userfiles/ \; 2>/dev/null
  17. 17 mkdir userfiles; find / -user lisa -exec cp {} /root/userfiles/ \; 2> finderr.txt
  18. 18 less finderr.txt
  19. 19 ls
  20. 20 ls /home/student/
  21. 21 /home/student/countdown 12
  22. 22 find / -user student -exec cp {} /root/userfiles/ \; 2>/dev/null
  23. 23 find / -user student
  24. 24 find / -user student -exec ls -l {} \; 2>/dev/null
  25. 25 history
  26. 26 less /etc/passwd
  27. 27 id lisa
  28. 28 id student
  29. 29 vim /etc/login.defs
  30. 30 ls -a /etc/skel/
  31. 31 ls -a /home/lisa
  32. 32 vim /etc/login.defs
  33. 33 groupadd sales
  34. 34 groupadd account
  35. 35 useradd -G sales linda
  36. 36 id linda
  37. 37 id lisa
  38. 38 usermod --help
  39. 39 usermod -aG sales lisa
  40. 40 id lisa
  41. 41 chage lisa
  42. 42 su - linda
  43. 43 tail -5 /etc/shadow
  44. 44 man shadow
  45. 45 man 5 shadow
  46. 46 tail -5 /etc/shadow
  47. 47 passwd linda
  48. 48 tail -5 /etc/shadow
  49. 49 grep linda /etc/passwd
  50. 50 grep linda /etc/shadow
  51. 51 grep linda /etc/group
  52. 52 authconfig
  53. 53 man authselect
  54. 54 grep account /etc/group
  55. 55 useradd -G account anna
  56. 56 useradd -G account anouk
  57. 57 mkdir /data/account
  58. 58 mkdir -p /data/account
  59. 59 mkdir -p /data/sales
  60. 60 cd /data
  61. 61 ls -l
  62. 62 chgrp account account
  63. 63 ls -lk
  64. 64 chgrp sales sales
  65. 65 ls -l
  66. 66 chmod g+w account/
  67. 67 ls -l
  68. 68 chmod g+w,o-rx account/
  69. 69 ls -l
  70. 70 chmod 770 sales/
  71. 71 ls -l
  72. 72 cd /home/linda
  73. 73 touch wortel
  74. 74 ls -l
  75. 75 ls -ld .
  76. 76 su - linda
  77. 77 touch carrot
  78. 78 su - linda
  79. 79 useradd bob
  80. 80 cd /home/sales
  81. 81 cd /data/sales
  82. 82 touch bobfile
  83. 83 ls -l
  84. 84 ls -ld .
  85. 85 su - bob
  86. 86 ln /home/student/countdown /usr/bin/countdown
  87. 87 countdown 12
  88. 88 cd
  89. 89 man chattr
  90. 90 su - linda
  91. 91 ls
  92. 92 chattr +i archive.tgz
  93. 93 rm -f archive.tgz
  94. 94 cd /home/linda
  95. 95 vim runme
  96. 96 chmod +x runme
  97. 97 su - linda
  98. 98 chmod u+s runme
  99. 99 ls -l
  100. 100 su - linda
  101. 101 vim runme
  102. 102 exit
  103. 103 su - linda
  104. 104 find / -perm /4000 2>/dev/null
  105. 105 ls -l /usr/bin/passwd
  106. 106 ls -l /etc/shadow
  107. 107 su - linda
  108. 108 chmod g+s /data/sales
  109. 109 su - linda
  110. 110 su - lisa
  111. 111 chmod +t /data/sales
  112. 112 su - lisa
  113. 113 cd /
  114. 114 ls -l
  115. 115 cd /tmp
  116. 116 ls
  117. 117 cd /data/
  118. 118 ls -ld
  119. 119 ls -l
  120. 120 chown lisa sales
  121. 121 su - lisa
  122. 122 history | grep find
  123. 123 find / -perm /1000 -exec ls -l {} 2>/dev/null
  124. 124 find / -perm /1000 -type d -exec ls -l {} 2>/dev/null
  125. 125 find / -perm /1000 -exec ls -l {} \; 2>/dev/null
  126. 126 find / -perm /1000 -exec ls -ld {} \; 2>/dev/null
  127. 127 ls -l
  128. 128 getfacl sales
  129. 129 ls -ld salesx
  130. 130 ls -ld sales
  131. 131 setfacl -m R g:account:rx /data/sales
  132. 132 setfacl -R -m g:account:rx /data/sales
  133. 133 ls -l sales
  134. 134 man setfacl
  135. 135 setfacl -R -x g:account sales
  136. 136 ls -l
  137. 137 ls -l sales/
  138. 138 setfacl -R -m g:account:rX sales
  139. 139 getfacl sales
  140. 140 getfacl sales/linda2
  141. 141 history
  142. 142 countdown 12
  143. 143 setfacl -m d:g:account:rx sales
  144. 144 getfacl sales/
  145. 145 lsblk
  146. 146 poweroff
  147. 147 lsblk
  148. 148 fdisk /dev/sda
  149. 149 lsblk
  150. 150 mkfs.xfs /dev/sda
  151. 151 mkfs.xfs /dev/sda3
  152. 152 mkdir /files
  153. 153 vim /etc/fstab
  154. 154 mount -a
  155. 155 mount
  156. 156 lsblk
  157. 157 xxd -l 512 /dev/sda | less
  158. 158 fdisk /dev/sda
  159. 159 reboot
  160. 160 lsblk
  161. 161 mkfs.xfs /dev/sda5
  162. 162 mkfs.ext4 /dev/sda6
  163. 163 mkdir /xfs
  164. 164 mkdir /ext4
  165. 165 vim /etc/fstab
  166. 166 fdisk /dev/sda
  167. 167 reboot
  168. 168 vim /etc/fstab
  169. 169 reboot
  170. 170 history
  171. 171 vim /etc/fstab
  172. 172 reboot
  173. 173 journalctl -xb
  174. 174 mount
  175. 175 mount | grep '^/'
  176. 176 vim /etc/fstab
  177. 177 lslbk
  178. 178 lsblk
  179. 179 blkid
  180. 180 vim /etc/fstab
  181. 181 tune2fs --help
  182. 182 tune2fs -L cow /dev/sda5
  183. 183 tune2fs -l /dev/sda5 | less
  184. 184 blkid
  185. 185 vim /etc/fstab
  186. 186 blkid
  187. 187 blkid | grep sda5 | awk '{ print $3 }'
  188. 188 blkid | grep sda5 | awk '{ print $3 }' >> /etc/fstab
  189. 189 vim /etc/fstab
  190. 190 exit
  191. 191 mount | grep xfs
  192. 192 xfs_admin --help
  193. 193 xfs_admin -L goat /dev/sda1
  194. 194 umount /dev/sda1
  195. 195 xfs_admin -L goat /dev/sda1
  196. 196 mount -a
  197. 197 tune2fs --help
  198. 198 gdisk /dev/sda
  199. 199 fdisk -l
  200. 200 fdisk -l /dev/sda
  201. 201 cat /proc/partitions
  202. 202 lsblk
  203. 203 mount | grep '^/'
  204. 204 tail -1 /etc/fstab
  205. 205 tail /etc/fstab
  206. 206 cd /dev/disk/by-path/
  207. 207 ls
  208. 208 ls -l
  209. 209 cd
  210. 210 yum repolist
  211. 211 yum install nmap
  212. 212 cd /etc/yum.repos.d/
  213. 213 ls
  214. 214 cat redhat.repo
  215. 215 rm -f *
  216. 216 yum repolist
  217. 217 cd
  218. 218 #dd if=/dev/ser0 of=/rhel8.iso bs=1M
  219. 219 df -h
  220. 220 dd if=/dev/sr0 of=/rhel8.iso bs=1M
  221. 221 yum clean all
  222. 222 ls -l/ /
  223. 223 ls -l /
  224. 224 mkdir /repo
  225. 225 vim /etc/fstab
  226. 226 mount -a
  227. 227 cd /repo
  228. 228 ls
  229. 229 cd
  230. 230 cd /
  231. 231 lsblk
  232. 232 yum repolist
  233. 233 countdown 12
  234. 234 history
  235. 235 cd /etc/yum.repos.d/
  236. 236 vim base.repo
  237. 237 vim appstream.repo
  238. 238 cd /repo
  239. 239 ls
  240. 240 cd AppStream/
  241. 241 ls
  242. 242 cd Packages/
  243. 243 ls
  244. 244 ls | wc
  245. 245 yum repolist
  246. 246 vim /etc/yum.repos.d/appstream.repo
  247. 247 cd
  248. 248 yum search nmap
  249. 249 yum install nmap
  250. 250 yum remove nmap
  251. 251 yum search seinfo
  252. 252 yum provides */seinfo
  253. 253 seinfo
  254. 254 vim /etc/yum.repos.d/base.repo
  255. 255 grep iso /etc/fstab
  256. 256 cat /etc/yum.repos.d/appstream.repo
  257. 257 yum module list
  258. 258 yum module list | less
  259. 259 yum module provides httpd
  260. 260 yum module info postgresql
  261. 261 yum module info postgresql | less
  262. 262 yum module info --profile postgresql
  263. 263 yum module list postgresql
  264. 264 yum module enable postgresql:9.6
  265. 265 yum install httpd
  266. 266 yum module info --profile php
  267. 267 yum module install php:7.2/devel
  268. 268 yum module reset php
  269. 269 yum module install --allowerasing php:7.3
  270. 270 lsblk
  271. 271 ip --help
  272. 272 ip a
  273. 273 ifconfig
  274. 274 man ifconfig
  275. 275 ip a
  276. 276 ip a a dev ens160 10.0.0.10/24
  277. 277 ip a
  278. 278 ifconfig
  279. 279 ifconfig -a
  280. 280 ifconfig /all
  281. 281 man ifconfig
  282. 282 ip 0c a
  283. 283 ip -c a
  284. 284 rpm -qf $(which ifconfig)
  285. 285 rpm -ql net-tools
  286. 286 rpm -ql net-tools | grep bin
  287. 287 yum remove net-tools
  288. 288 ifconfig
  289. 289 ip route show
  290. 290 ip route del default via 192.168.29.1
  291. 291 ping nu.nl
  292. 292 ip route add default via 192.168.29.1
  293. 293 nmap -sn 192.168.29.0/24
  294. 294 vim /etc/resolv.conf
  295. 295 cd /etc/sysconfig/network-scripts/
  296. 296 ls
  297. 297 cat ifcfg-ens160
  298. 298 cd
  299. 299 nmtui
  300. 300 ip a
  301. 301 ping nu.nl
  302. 302 countdown 12
  303. 303 vim /etc/sysconfig/network-scripts/ifcfg-ens160
  304. 304 nmcli connection up ens160
  305. 305 ip a
  306. 306 nmcli connection load ens160
  307. 307 ip a
  308. 308 nmtui
  309. 309 ip
  310. 310 ip a
  311. 311 nmcli connection down ens160
  312. 312 ip a
  313. 313 nmcli connection up ens160
  314. 314 ip a
  315. 315 reboot
  316. 316 mount | grep vdo
  317. 317 vdostats --human-readable
  318. 318 df -h
  319. 319 df -h | grep vdo
  320. 320 systemctl list-units -t mount
  321. 321 systemctl cat vdo1.mount
  322. 322 vim /etc/systemd/system
  323. 323 systemctl daemon-reload
  324. 324 systemctl cat vdo1.mount
  325. 325 countdown 12
  326. 326 yum install httpd curl
  327. 327 systemctl status httpd
  328. 328 systemctl enable httpd
  329. 329 systemctl status httpd
  330. 330 systemctl start httpd
  331. 331 systemctl status httpd
  332. 332 ps aux | grep httpd
  333. 333 ps Zaux | grep httpd
  334. 334 ls -lZ /var/www
  335. 335 ls -lZd /var/tmp
  336. 336 ps Zaux | grep http
  337. 337 vim /etc/sysconfig/selinux
  338. 338 getenforce
  339. 339 setenforce
  340. 340 setenforce permissive
  341. 341 getenforce
  342. 342 setenforce enforcing
  343. 343 vim /etc/httpd/conf/httpd.conf
  344. 344 vim /web/index.html
  345. 345 mkdir /web
  346. 346 echo hello moon > /web/index.html
  347. 347 systemctl restart httpd
  348. 348 curl http://localhost
  349. 349 getenforce
  350. 350 setenforce permissive
  351. 351 curl http://localhost
  352. 352 cd /var/log
  353. 353 ls
  354. 354 cd httpd/
  355. 355 ls
  356. 356 cat error_log
  357. 357 vim /web/index.html
  358. 358 vim /etc/httpd/conf/httpd.conf
  359. 359 systemctl restart httpd
  360. 360 getenforce
  361. 361 curl http://localhost
  362. 362 setenforce enforcing
  363. 363 curl http://localhost
  364. 364 grep AVC /var/log/audit/audit.log
  365. 365 ls -lZ /var/www
  366. 366 man semanage-fcontext
  367. 367 semanage fcontext -a -t httpd_sys_content_t "/web(/.*)?"
  368. 368 ls -ldZ /web
  369. 369 cd /etc/selinux/targeted/contexts/files/
  370. 370 ls
  371. 371 cat file_contexts.local
  372. 372 restorecon -Rv /web
  373. 373 setenforce 1
  374. 374 getenforce
  375. 375 curl http://localhost
  376. 376 cd
  377. 377 countdown 12
  378. 378 man -k selinux
  379. 379 man -k s_elinux
  380. 380 man -k _selinux
  381. 381 yum search selinux
  382. 382 yum install selinux-policy-doc
  383. 383 man -k _selinux
  384. 384 man -k _selinux | wc
  385. 385 man -k _selinux | grep http
  386. 386 man httpd_selinux
  387. 387 grep sealert /var/log/messages
  388. 388 sealert -l 23c9e991-e00f-4c05-9cab-3bc1f7912e58
  389. 389 sealert -l 23c9e991-e00f-4c05-9cab-3bc1f7912e58 | less
  390. 390 vim /etc/httpd/conf/httpd.conf
  391. 391 systemctl restart httpd
  392. 392 systemctl status httpd
  393. 393 getenforce
  394. 394 setenforce permissive
  395. 395 systemctl restart httpd
  396. 396 grep sealert /var/log/messages
  397. 397 sealert -l 6b1004fc-4033-46ba-a1ef-abad895c4057 | less
  398. 398 semanage port -a -t http_port_t -p tcp 82
  399. 399 setenforce enforcing
  400. 400 systemctl restart httpd
  401. 401 systemctl status httpd
  402. 402 getsebool -a | grep ftp
  403. 403 setsebool -P ftpd_anon_write on
  404. 404 getsebool -a | grep ftp
  405. 405 getsebool -a | grep http
  406. 406 grep AVC /var/log/audit/audit.log
  407. 407 grep AVC /var/log/audit/audit.log | grep -v USER
  408. 408 ssh root@192.168.29.27
  409. 409 showmount -e 192.168.29.27
  410. 410 vim /etc/fstab
  411. 411 mkdir /remotefs
  412. 412 cat /etc/fstab
  413. 413 mkdir /remotedata
  414. 414 mount -a
  415. 415 mount
  416. 416 vim /etc/fstab
  417. 417 yum install -y autofs
  418. 418 vim /etc/auto.master
  419. 419 vim /etc/auto.misc
  420. 420 vim /etc/auto.master
  421. 421 vim /etc/auto.remote
  422. 422 showmount -e 192.168.29.27
  423. 423 vim /etc/auto.remote
  424. 424 systemctl enable --now autofs
  425. 425 cd /
  426. 426 ls
  427. 427 cd remote
  428. 428 ls -a
  429. 429 cd data
  430. 430 ls
  431. 431 mount
  432. 432 showmount -e 192.168.29.27
  433. 433 vim /etc/auto.master
  434. 434 vim /etc/auto.ldap
  435. 435 systemctl restart autofs
  436. 436 cd /home/ldap
  437. 437 ls -a
  438. 438 cd ldapuser5
  439. 439 cd ldapuser1
  440. 440 ip a
  441. 441 countdown 12
  442. 442 cd
  443. 443 vim /usr/lib/firewalld/services/
  444. 444 cp /usr/lib/firewalld/services/ssh.xml /etc/firewalld/services/sander.xml
  445. 445 vim /etc/firewalld/services/sander.xml
  446. 446 firewall-cmd --get-services | grep sander
  447. 447 systemctl restart firewalld
  448. 448 firewall-cmd --get-services | grep sander
  449. 449 systemctl get-default
  450. 450 systemctl list-units
  451. 451 systemctl list-units -t target
  452. 452 systemctl list-unit-files -t target
  453. 453 systemctl isolate emergency.target
  454. 454 systemctl list-units
  455. 455 systemctl restart
  456. 456 reboot
  457. 457 ssh root@192.168.29.27
  458. 458 cd /home
  459. 459 ls
  460. 460 cd ldap
  461. 461 ls -a
  462. 462 cd ldapuser1
  463. 463 vim /etc/auto.master
  464. 464 vim /etc/auto.ldap
  465. 465 journalctl
  466. 466 grep sealert /var/log/messages
  467. 467 mount
  468. 468 vim /etc/auto.ldap
  469. 469 systemctl list-units
  470. 470 systemctl restart
  471. 471 systemctl reboot
  472. 472 systemctl status autofs
  473. 473 vim /etc/auto.master
  474. 474 vim /etc/auto.ldap
  475. 475 cd /home/ldap
  476. 476 ls
  477. 477 cd ldapuser1
  478. 478 pwd
  479. 479 mount
  480. 480 vim /boot/grub2/grub.cfg
  481. 481 cd /
  482. 482 df -h
  483. 483 yum module install container-tools
  484. 484 podman run nginx
  485. 485 podman run -d nginx
  486. 486 podman ps
  487. 487 ps fax | less
  488. 488 vim /etc/containers/registries.conf
  489. 489 podman login
  490. 490 podman pull registry.access.redhat.com/ubi8/ubi:latest
  491. 491 podman images
  492. 492 history
  493. 493 podman run -it ubuntu bash
  494. 494 docker ps
  495. 495 podman ps
  496. 496 podman ps -a
  497. 497 podman run ubuntu
  498. 498 podman ps -a
  499. 499 countdown 12
  500. 500 podman info
  501. 501 podman images
  502. 502 podman inspect registry.access.redhat.com/ubi8/ubi
  503. 503 podman inspect registry.access.redhat.com/ubi8/ubi | less
  504. 504 podman images
  505. 505 podman rmi docker.io/library/ubuntu
  506. 506 podman run -d -p 8000:80 nginx
  507. 507 podman port -a
  508. 508 podman ps
  509. 509 systemctl disable --now httpd
  510. 510 podman run -d -p 82:80 nginx
  511. 511 podman ps
  512. 512 su - student
  513. 513 grep AVC /var/log/audit/audit.log
  514. 514 cd /opt/
  515. 515 ls -lZ
  516. 516 grep sealert /var/log/messages
  517. 517 sealert -l d384e5e0-b7b2-4ebe-bd8a-55b9bb7520ae | less
  518. 518 su - student
  519. 519 exit
  520. 520 ps aux | grep nginx
  521. 521 ps aux | grep runc
  522. 522 countdown 40
  523. 523 ln -s /etc/hosts /tmp/hosts
  524. 524 ls -l /tmp/hosts
  525. 525 vim /etc/login.defs
  526. 526 cd /etc/skel/
  527. 527 touch myfile
  528. 528 ls -l
  529. 529 date
  530. 530 find / -size +100M
  531. 531 find / -size +100M > /tmp/bigfiles
  532. 532 find / -size +100M -exec ls -l {} \; 2>/dev/null
  533. 533 find / -size +100M -ls
  534. 534 cd
  535. 535 vgs
  536. 536 lvcreate -L 500M -n lv500 vgdata
  537. 537 mkfs.ext3 --help
  538. 538 mkfs.ext3 -L myvolume /dev/vgdata/lv500
  539. 539 mkdir /myvol
  540. 540 vim /etc/fstab
  541. 541 mount -a
  542. 542 mount
  543. 543 yum install seinfo
  544. 544 yum provides */seinfo
  545. 545 yum install setools-console
  546. 546 groupadd profs
  547. 547 useradd --help
  548. 548 useradd -G profs anna
  549. 549 useradd -G profs bananna
  550. 550 id bananna
  551. 551 usermod -aG profs anna
  552. 552 mkdir -p /data/profs
  553. 553 cd /data
  554. 554 ls -l
  555. 555 chgrp profs profs
  556. 556 chmod 770 profs/
  557. 557 ls -l
  558. 558 chown anna profs
  559. 559 chmod +t profs
  560. 560 ls -l
  561. 561 crontab -e
  562. 562 cd /etc/cron.d
  563. 563 ls
  564. 564 vim raid-check
  565. 565 cd
  566. 566 lvs
  567. 567 ls -l /dev/vgdata/lvdata /dev/mapper/vgdata-lvdata
  568. 568 history
  569.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement