sandervanvugt

RHCSA jul20 day3

Jul 15th, 2020
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.38 KB | None | 0 0
  1. [root@localhost ~]# history
  2. 1 vimtutor
  3. 2 vim countdown
  4. 3 countdown 12
  5. 4 echo $PATH
  6. 5 ./countdown 12
  7. 6 ls -l countdown
  8. 7 chmod +x countdown
  9. 8 ./countdown 12
  10. 9 exit
  11. 10 visudo
  12. 11 id student
  13. 12 usermod -aG wheel student
  14. 13 id student
  15. 14 exit
  16. 15 visudo
  17. 16 useradd linda
  18. 17 passwd linda
  19. 18 su - linda
  20. 19 visudo
  21. 20 su - linda
  22. 21 visudo
  23. 22 vim /etc/sudoers.d/linda
  24. 23 history
  25. 24 systemctl isolate multi-user.target
  26. 25 systemctl start graphical.target
  27. 26 history
  28. 27 exit
  29. 28 ip a
  30. 29 systemctl status sshd
  31. 30 firewall-cmd --list-all
  32. 31 ./countdown 13
  33. 32 ./countdown
  34. 33 countdown
  35. 34 echo $PATH
  36. 35 cp countdown /usr/local/bin
  37. 36 cd /
  38. 37 ls -l
  39. 38 man hier
  40. 39 cd /etc
  41. 40 ls
  42. 41 cd
  43. 42 vim countdown
  44. 43 countdown 0
  45. 44 ln /etc/hosts myhosts
  46. 45 ls -il /etc/hosts myhosts
  47. 46 echo 10.0.0.10 dummy >> myhosts
  48. 47 ls -il /etc/hosts myhosts
  49. 48 ln -s myhosts symhosts
  50. 49 ls -il /etc/hosts myhosts symhosts
  51. 50 cat symhosts myhosts /etc/hosts
  52. 51 rm myhosts
  53. 52 ls -il /etc/hosts myhosts symhosts
  54. 53 cat symhosts
  55. 54 ln /etc/hosts myhosts
  56. 55 rm /etc/hosts
  57. 56 cat myhosts
  58. 57 ln myhosts /etc/hosts
  59. 58 ln /boot/vmlinuz-4.18.0-193.el8.x86_64 kernel
  60. 59 ln -s /boot/vmlinuz-4.18.0-193.el8.x86_64 kernel
  61. 60 ln /etc myetc
  62. 61 ln -s /etc myetc
  63. 62 lsblk
  64. 63 umount /dev/sdb1
  65. 64 ls /mnt
  66. 65 mount /dev/sdb1 /mnt
  67. 66 ls /mnt
  68. 67 cd /mnt
  69. 68 ls
  70. 69 umount /dev/sdb1
  71. 70 lsof /mnt
  72. 71 cd
  73. 72 umount /dev/sdb1
  74. 73 cd /boot
  75. 74 ls
  76. 75 cd
  77. 76 ls
  78. 77 rm myhosts
  79. 78 find / -xtype l
  80. 79 ls -l
  81. 80 find / -xtype l | grep host
  82. 81 find -P ./ -xtype l
  83. 82 find / -xtype l -exec ls -l {} \;
  84. 83 find / -xtype l -exec ls -l {} \; 2>/dev/null
  85. 84 find / -name "hosts"
  86. 85 find / -name "*hosts*"
  87. 86 find / -size +100M > bigfiles.txt
  88. 87 less bigfiles.txt
  89. 88 find / -user linda
  90. 89 ls -l /run/user/1000/
  91. 90 ls -il /run/user/1000/
  92. 91 ls -il /run/user/1000/gvfs
  93. 92 echo $?
  94. 93 history
  95. 94 alias twaalf='countdown 12'
  96. 95 twaalf
  97. 96 man password
  98. 97 man -k password
  99. 98 man man
  100. 99 man apropos
  101. 100 mandb
  102. 101 man -k password
  103. 102 man -k password | wc
  104. 103 man -k password | grep 1
  105. 104 man passwd
  106. 105 man -k authentication
  107. 106 man -k user
  108. 107 less /etc/passwd
  109. 108 less /etc/shadow
  110. 109 man passwd
  111. 110 man 5 passwd
  112. 111 man pwconv
  113. 112 ls -l /etc/passwd
  114. 113 ls -l /etc/shadow
  115. 114 cat /etc/shadow
  116. 115 id student
  117. 116 grep student /etc/group
  118. 117 grep student /etc/passwd
  119. 118 id student
  120. 119 vim /etc/login.defs
  121. 120 useradd lisa
  122. 121 passwd -l lisa
  123. 122 passwd -u lisa
  124. 123 passwd -L lisa
  125. 124 chage lisa
  126. 125 chage -L lisa
  127. 126 chage -l lisa
  128. 127 groups --help
  129. 128 groups student
  130. 129 history
  131. 130 chage lisa
  132. 131 chage --help
  133. 132 groupadd account
  134. 133 groupadd sales
  135. 134 useradd -G account anna
  136. 135 useradd -G account anouk
  137. 136 id anna
  138. 137 w
  139. 138 id linda
  140. 139 id lisa
  141. 140 usermod -aG sales lisa
  142. 141 usermod -aG sales linda
  143. 142 id lisa
  144. 143 usermod -G wheel lisa
  145. 144 id lisa
  146. 145 usermod -aG sales lisa
  147. 146 usermod --help | less
  148. 147 ls -l $(which useradd) $(which adduser)
  149. 148 ls -l /etc/skel
  150. 149 ls -al /etc/skel
  151. 150 touch /etc/skel/blah
  152. 151 useradd bill
  153. 152 ls -la /home/bill
  154. 153 history
  155. 154 cd /home
  156. 155 ls -l
  157. 156 cd /etc
  158. 157 ls -l
  159. 158 cd
  160. 159 tail -2 /etc/group
  161. 160 tail -8 /etc/group
  162. 161 mkdir /data/sales
  163. 162 mkdir -p /data/sales
  164. 163 mkdir -p /data/account
  165. 164 cd /data
  166. 165 ls -l
  167. 166 id
  168. 167 chown linda.sales sales
  169. 168 ls -l
  170. 169 chgrp account account
  171. 170 ls -l
  172. 171 chmod 770 *
  173. 172 ls -l
  174. 173 history
  175. 174 mkdir linda
  176. 175 chown linda linda
  177. 176 chmod 100 linda
  178. 177 ls -l
  179. 178 cd linda
  180. 179 touch a b c d e
  181. 180 ls -l
  182. 181 su - linda
  183. 182 pwd
  184. 183 chmod u+w .
  185. 184 ls -ld .
  186. 185 pwd
  187. 186 su - linda
  188. 187 pwd
  189. 188 chmod 400 .
  190. 189 ls -ld .
  191. 190 su - linda
  192. 191 history
  193. 192 pwd
  194. 193 cd /home/linda
  195. 194 touch rootfile
  196. 195 ls -l
  197. 196 su - linda
  198. 197 pwd
  199. 198 touch r2
  200. 199 su - linda
  201. 200 ls -l
  202. 201 cd
  203. 202 ls -l
  204. 203 ln /etc/hosts myhosts
  205. 204 ls -l /etc/hosts myhosts symhosts
  206. 205 passwd linda
  207. 206 ls -l /home/linda
  208. 207 ls -ld /home/linda
  209. 208 pwd
  210. 209 cd /home/linda
  211. 210 echo wortel > rootfile3
  212. 211 su - linda
  213. 212 pwd
  214. 213 cd ..
  215. 214 ls -l
  216. 215 userdel bill
  217. 216 ls -l
  218. 217 useradd jim -u 1006 -g 1008
  219. 218 ls -l
  220. 219 useradd jim -u 1006
  221. 220 ls -l
  222. 221 cd
  223. 222 find / -user "jim" -exec mv {} /root/ \;
  224. 223 ls
  225. 224 userdel --help
  226. 225 userdel -r jim
  227. 226 cd /home/linda
  228. 227 vim playme
  229. 228 chmod +x playme
  230. 229 su - linda
  231. 230 vim playme
  232. 231 chmod u+s playme
  233. 232 ls -l
  234. 233 find / -perm /4000 2>/dev/null
  235. 234 ls -l /usr/bin/passwd
  236. 235 ls -l /etc/shadow
  237. 236 cd /data
  238. 237 ls -l
  239. 238 su - anna
  240. 239 chmod g+s account/
  241. 240 ls -l
  242. 241 su - anna
  243. 242 ls
  244. 243 ls -l
  245. 244 su anouk
  246. 245 su - anouk
  247. 246 chmod +t *
  248. 247 ls -l
  249. 248 su - anouk
  250. 249 su - lisa
  251. 250 su - linda
  252. 251 su - anouk
  253. 252 history
  254. 253 countdown 13
  255. 254 ls -l
  256. 255 cd sales
  257. 256 ls
  258. 257 su - linda
  259. 258 chmod g+s sales
  260. 259 chmod g+s .
  261. 260 pwd
  262. 261 ls -ld .
  263. 262 su - linda
  264. 263 cd ..
  265. 264 getfacl sales
  266. 265 setfacl -m -R g:account:rx sales
  267. 266 setfacl -R -m g:account:rx sales
  268. 267 getfacl sales
  269. 268 ls -l sales
  270. 269 man setfacl
  271. 270 setfacl -x g:account sales
  272. 271 getfacl sales
  273. 272 setfacl -R -m g:account:rX sales
  274. 273 ls -l sales/
  275. 274 setfacl -x g:account sales
  276. 275 ls -l sales/
  277. 276 setfacl -R -x g:account sales
  278. 277 ls -l sales/
  279. 278 setfacl -R -m g:account:rX sales
  280. 279 ls -l sales/
  281. 280 getfacl sales
  282. 281 cd sales
  283. 282 getfacl a
  284. 283 history
  285. 284 su - linda
  286. 285 setfacl -m d:g:account:rx sales
  287. 286 setfacl -m d:g:account:rx .
  288. 287 su - linda
  289. 288 cd
  290. 289 yum repolist
  291. 290 cd /etc/yum.repos.d/
  292. 291 ls
  293. 292 rm -f *
  294. 293 yum repolist
  295. 294 cd /
  296. 295 df -h
  297. 296 dd if=/dev/sr0 of=/centos82.iso bs=1M &
  298. 297 mkdir /repo
  299. 298 vim /etc/fstab
  300. 299 ls /repo
  301. 300 mount -a
  302. 301 ls /repo
  303. 302 mount | grep repo
  304. 303 cd repo
  305. 304 ls
  306. 305 cd BaseOS/
  307. 306 ls
  308. 307 cd Packages/
  309. 308 ls
  310. 309 cd ..
  311. 310 cd repodata/
  312. 311 ls
  313. 312 cd ../../AppStream/
  314. 313 ls
  315. 314 cd
  316. 315 yum repolist
  317. 316 cd /etc/yum.repos.d/
  318. 317 vim BaseOS.repo
  319. 318 yum repolist
  320. 319 vim AppStream.repo
  321. 320 yum repolist
  322. 321 vim classroom.repo
  323. 322 yum repolist
  324. 323 cat classroom.repo
  325. 324 vim classroom.repo
  326. 325 yum repolist
  327. 326 cd
  328. 327 mount
  329. 328 mount | grep '^/'
  330. 329 history
  331. 330 history | grep dd
  332. 331 countdown 12
  333. 332 which yum
  334. 333 ls -l /usr/bin/yum
  335. 334 yum search nmap
  336. 335 yum install nmap-ncat
  337. 336 yum install nmap
  338. 337 yum search seinfo
  339. 338 yum provides */seinfo
  340. 339 yum install setools-console
  341. 340 yum module list
  342. 341 yum module provides httpd
  343. 342 yum module provides python
  344. 343 yum module provides python36
  345. 344 yum module provides nginx
  346. 345 yum module info nginx
  347. 346 yum module info postgresql
  348. 347 yum module info nginx
  349. 348 yum module install nginx:1.16
  350. 349 ip a
  351. 350 ip addr show
  352. 351 ip addr add dev ens33 10.0.0.10/24
  353. 352 ip a
  354. 353 ping 10.0.0.10
  355. 354 ifconfig
  356. 355 ifconfig -a
  357. 356 man ifconfig
  358. 357 ip -s link
  359. 358 which ifconfig
  360. 359 rpm -qf $(which ifconfig)
  361. 360 rpm -ql net-tools | grep bin
  362. 361 yum remove net-tools
  363. 362 ip route show
  364. 363 ping nu.nl
  365. 364 ip route del default via 192.168.4.2
  366. 365 ping nu.nl
  367. 366 ip route show
  368. 367 ip route add default via 192.168.4.2
  369. 368 ping nu.nl
  370. 369 cat /etc/resolv.conf
  371. 370 which dig
  372. 371 rpm -qf /usr/bin/dig
  373. 372 systemctl status NetworkManager
  374. 373 nmtui
  375. 374 ip a
  376. 375 vim /etc/sysconfig/network-scripts/ifcfg-ens33
  377. 376 nmtui
  378. 377 ip a
  379. 378 yum install bash-completion
  380. 379 nmcli connection show
  381. 380 nmcli connection show ens33
  382. 381 nmcli connection modify ens33 ipv4.addresses 192.168.4.190/24
  383. 382 cat /etc/sysconfig/network-scripts/ifcfg-ens33
  384. 383 ip a
  385. 384 nmcli connection up ens33
  386. 385 ip a
  387. 386 history
  388. 387 ip a
  389. 388 ip route show
  390. 389 cat /etc/resolv.conf
  391. 390 ping nu.nl
  392. 391 countdown 12
  393. 392 poweroff
  394. 393 history
  395. 394 lsblk
  396. 395 groupadd students
  397. 396 groupadd profs
  398. 397 vim /etc/login.defs
  399. 398 vim /etc/shadow
  400. 399 change anna
  401. 400 chage anna
  402. 401 chage --help
  403. 402 passwd --help
  404. 403 usermod -aG students lisa
  405. 404 usermod -aG students linda
  406. 405 usermod -aG profs anna
  407. 406 usermod -aG profs anouk
  408. 407 id anna
  409. 408 cd /data
  410. 409 mkdir students profs
  411. 410 ls -l
  412. 411 chown anna:students students
  413. 412 chown anna:profs profs
  414. 413 ls -l
  415. 414 chmod 3770 students/
  416. 415 chmod 3770 profs/
  417. 416 setfacl -R -m g:profs:rX students/
  418. 417 setfacl -m d:g:profs:rx students/
  419. 418 getfacl students/
  420. 419 history
  421. 420 cd
  422. 421 lsblk
  423. 422 fdisk /dev/sda
  424. 423 lsblk
  425. 424 cat /proc/partitions
  426. 425 mkfs.xfs /dev/sda3
  427. 426 mkdir /files
  428. 427 mount /dev/sda3 /files
  429. 428 mount
  430. 429 mount | grep '^/'
  431. 430 umount /files
  432. 431 vim /etc/fstab
  433. 432 reboot
  434. 433 mount | grep sd3
  435. 434 mount | grep sda3
  436. 435 fdisk /dev/sda
  437. 436 xxd -l 512 /dev/sda
  438. 437 fdisk /dev/sda
  439. 438 mkfs.xfs /dev/sda4
  440. 439 fdisk /dev/sda
  441. 440 partprobe
  442. 441 reboot
  443. 442 fdisk -l
  444. 443 lsblk
  445. 444 vim /etc/default/grub
  446. 445 grub2-mkconfig -o /boot/grub2/grub.cfg
  447. 446 mkfs.ext4 /dev/sda5
  448. 447 mkfs.xfs /dev/sda6
  449. 448 mkdir /ext4
  450. 449 mkdir /xfs
  451. 450 vim /etc/fstab
  452. 451 reboot
  453. 452 mount | grep sda
  454. 453 vim /etc/fstab
  455. 454 fdisk /dev/sda
  456. 455 reboot
  457. 456 mount | grep sda
  458. 457 lsblk
  459. 458 xfs_admin --help
  460. 459 xfs_admin -L goat /dev/sda5
  461. 460 vim /etc/fstab
  462. 461 reboot
  463. 462 mount | grep sda
  464. 463 blkid
  465. 464 vim /etc/fstab
  466. 465 fdisk -l /dev/sda
  467. 466 blkid
  468. 467 ls
  469. 468 ./countdown 12
  470. 469 blkid
  471. 470 blkid | cut -f 2
  472. 471 blkid | awk '{ print $2 }'
  473. 472 blkid | awk '{ print $2 }' | head -2 | tail -1
  474. 473 blkid | awk '{ print $2 }' | head -2 | tail -1 >> somefile
  475. 474 fdisk /dev/sda
  476. 475 mount /dev/sda6 /mnt
  477. 476 umount /mnt
  478. 477 mkfs.ext4 --help
  479. 478 mkfs.ext4 -L cow /dev/sda6
  480. 479 e2label --help
  481. 480 vim /etc/fstab
  482. 481 fdisk /dev/sda
  483. 482 reboot
  484. 483 fdisk /dev/sda
  485. 484 systemctl status tuned
  486. 485 tuned-adm --help
  487. 486 tuned-adm list
  488. 487 tuned-adm profile throughput-performance
  489. 488 tuned-adm list
  490. 489 cd /usr/lib/tuned/
  491. 490 ls
  492. 491 cd throughput-performance/
  493. 492 ls
  494. 493 cat tuned.conf
  495. 494 cd
  496. 495 ls -ld /usr/lib/tuned/ /etc/tuned/
  497. 496 mkdir /etc/tuned/sander
  498. 497 cp /usr/lib/tuned/throughput-performance/tuned.conf /etc/tuned/sander
  499. 498 tuned-adm list
  500. 499 history
  501. 500 vim /etc/tuned/sander/tuned.conf
  502. 501 lsblk
  503. 502 fdisk /dev/sda
  504. 503 cat /proc/partitions
  505. 504 lsblk
  506. 505 pvcreate /dev/sda7
  507. 506 pvs
  508. 507 vgcreate --help
  509. 508 vgcreate -s 8M vgdata /dev/sda7
  510. 509 vgs
  511. 510 pvs
  512. 511 lvcreate -n lvdata -L 1G vgdata
  513. 512 lvcreate -n lvdata -l 127 vgdata
  514. 513 lvs
  515. 514 mkfs.xfs /dev/vgdata/lvdata
  516. 515 vim /etc/fstab
  517. 516 mount -a
  518. 517 mkdir /lvdata
  519. 518 mount -a
  520. 519 history
  521. 520 mount | grep lvdata
  522. 521 ls -l /dev/vgdata/lvdata /dev/mapper/vgdata-lvdata
  523. 522 history
  524. 523 man lvcreate
  525. 524 vgs
  526. 525 mount | grep '^/'
  527. 526 pvs
  528. 527 xxd /dev/sda7 | less
  529. 528 ./countdown 12
  530. 529 df -h
  531. 530 dd if=/dev/zero of=/lvdata/bigfile
  532. 531 df -h
  533. 532 lvs
  534. 533 vgs
  535. 534 vgextend --help
  536. 535 vgextend vgdata /dev/sda8
  537. 536 vgs
  538. 537 lvextend -r -L +100M /dev/vgdata/lvdata
  539. 538 df -h
  540. 539 lvextend -l +50%FREE /dev/vgdata/lvdata
  541. 540 lvs
  542. 541 df -h
  543. 542 xfs_growfs /dev/vgdata/lvdata
  544. 543 df -h
  545. 544 history
  546. 545 free -m
  547. 546 fdisk /dev/sda
  548. 547 free -m
  549. 548 mkswap --help
  550. 549 mkswap /dev/sda9
  551. 550 free -m
  552. 551 vim /etc/fstab
  553. 552 swapon -a
  554. 553 free -m
  555. 554 grep ctive /proc/meminfo
  556. 555 top
  557. 556 yum install httpd -y
  558. 557 systemctl enable --now httpd
  559. 558 ps Zaux | grep http
  560. 559 ss -Ztupen
  561. 560 ss -Ztupenl
  562. 561 cd /var/www/
  563. 562 ls -lZ
  564. 563 ls -ldZ /tmp
  565. 564 ps Zaux | grep httpd | grep root
  566. 565 cd
  567. 566 ./countdown 12
  568. 567 getenforce
  569. 568 setenforce
  570. 569 cat /etc/sysconfig/selinux
  571. 570 vim /etc/httpd/conf/httpd.conf
  572. 571 mkdir /web
  573. 572 vim /web/index.html
  574. 573 systemctl restart httpd
  575. 574 curl http://localhost
  576. 575 setenforce permissive
  577. 576 curl http://localhost
  578. 577 vim /etc/httpd/conf/httpd.conf
  579. 578 systemctl restart httpd
  580. 579 curl http://localhost
  581. 580 setenforce 1
  582. 581 curl http://localhost
  583. 582 grep AVC /var/log/audit/audit.log
  584. 583 ls -Zd /var/www/html/
  585. 584 man semanage
  586. 585 man semanage-fcontext
  587. 586 semanage fcontext -a -t httpd_sys_content_t "/web(/.*)?"
  588. 587 ls -lZd /web
  589. 588 restorecon -Rv /web
  590. 589 curl http://localhost
  591. 590 restorecon --help
  592. 591 man restorecon
  593. 592 journalctl | grep sealert
  594. 593 sealert -l 9c70cfd0-5ed6-4b45-be83-666c83f7406e | less
  595. 594 getsebool -a
  596. 595 getsebool -a | wc
  597. 596 getsebool -a | grep ftp
  598. 597 setsebool -P ftpd_anon_write on
  599. 598 getsebool -a | grep ftp
  600. 599 yum provides systemd-journald
  601. 600 yum provides */systemd-journald
  602. 601 systemctl status firewalld
  603. 602 firewall-cmd --list-all
  604. 603 firewall-cmd --get-services
  605. 604 firewall-cmd --add-service http
  606. 605 firewall-cmd --list-all
  607. 606 firewall-cmd --reload
  608. 607 firewall-cmd --list-all
  609. 608 firewall-cmd --add-service http --permanent
  610. 609 firewall-cmd --list-all
  611. 610 firewall-cmd --reload
  612. 611 firewall-cmd --list-all
  613. 612 history
Add Comment
Please, Sign In to add comment