sandervanvugt

RHCSA day3 march 22

Mar 3rd, 2022
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.57 KB | None | 0 0
  1. 1 mkdir /sda6
  2. 2 vim /etc/fstab
  3. 3 mount -a
  4. 4 cp /etc/passwd /sda5
  5. 5 cp /etc/motd /sda6
  6. 6 history
  7. 7 lsblk
  8. 8 umount /dev/sda5
  9. 9 vim /etc/fstab
  10. 10 fdisk /dev/sda
  11. 11 reboot
  12. 12 journalctl -xb
  13. 13 touch bb
  14. 14 lsblk
  15. 15 vim /etc/fstab
  16. 16 blkid
  17. 17 blkid | awk '/sda5/ { print $2 }'
  18. 18 blkid | awk '/sda5/ { print $2 }' >> /etc/fstab
  19. 19 vim /etc/fstab
  20. 20 mount -a
  21. 21 reboot
  22. 22 blkid
  23. 23 tune2fs --help
  24. 24 tune2fs -L cow /dev/sda5
  25. 25 blkid
  26. 26 xfs_admin --help
  27. 27 xfs_admin -L goat /dev/sda3
  28. 28 umount /dev/sda3
  29. 29 xfs_admin -L goat /dev/sda3
  30. 30 mount -a
  31. 31 blkid
  32. 32 groupadd student
  33. 33 groupadd students
  34. 34 groupadd profs
  35. 35 vim /etc/login.defs
  36. 36 usermod -aG students lisa
  37. 37 usermod -aG students linda
  38. 38 id lisa
  39. 39 usermod -aG profs anna
  40. 40 usermod -aG profs anouk
  41. 41 mkdir -p /data/profs /data/students
  42. 42 cd /data
  43. 43 ls -l
  44. 44 usermod --help
  45. 45 mkdir --help
  46. 46 chown anna:students students/
  47. 47 chown anna:profs profs/
  48. 48 ls -l
  49. 49 chmod 3770 *
  50. 50 ls -l
  51. 51 cd
  52. 52 df -h
  53. 53 dd if=/dev/zero of=/diskfile.img bs=1 count=2048
  54. 54 dd if=/dev/zero of=/diskfile.img bs=1M count=2048
  55. 55 ls -l /diskfile.img
  56. 56 losetup -fP /diskfile.img
  57. 57 losetup -a
  58. 58 lsblk
  59. 59 reboot
  60. 60 lsblk
  61. 61 losetup -a
  62. 62 lsblk
  63. 63 losetup -fP /diskfile.img
  64. 64 lsblk
  65. 66 cd /data
  66. 67 getfacl sales
  67. 68 cd sales
  68. 69 ls
  69. 70 ls -l
  70. 71 cd ..
  71. 72 setfacl -m -R g:sales:rx /data/sales
  72. 73 setfacl -R -m g:sales:rx /data/sales
  73. 74 ls -l sales/
  74. 75 getfacl sales/lisa1
  75. 76 man setfacl
  76. 77 setfacl -R -x g:sales /data/sales
  77. 78 ls -l sales
  78. 79 setfacl -R -m g:account:rx /data/sales
  79. 80 ls -l sales/
  80. 81 getfacl sales/lisa1
  81. 82 setfacl -R -x g:account /data/sales
  82. 83 setfacl -R -m g:account:rX /data/sales
  83. 84 ls -l sales/
  84. 85 getfacl sales
  85. 86 getfacl sales/lisa1
  86. 87 setfacl -m d:g:account:rx /data/sales
  87. 88 getfacl sales
  88. 89 touch sales/root1
  89. 90 getfacl sales/root1
  90. 91 countdown 16
  91. 92 df -h
  92. 93 lsblk
  93. 94 dd if=/dev/sr0 of=/rhel85.iso bs=1M
  94. 95 df -h
  95. 96 mkdir /repo
  96. 97 vim /etc/fstab
  97. 98 mount -a
  98. 99 cd /repo
  99. 100 ls
  100. 101 cd BaseOS/
  101. 102 ls
  102. 103 ls Packages/
  103. 104 ls repodata/
  104. 105 cd ..
  105. 106 cd
  106. 107 yum repolist
  107. 108 cd /etc/yum.repos.d/
  108. 109 vim base.repo
  109. 110 vim appstream.repo
  110. 111 vim base.repo
  111. 112 yum repolist
  112. 113 vim appstream.repo
  113. 114 yum repolist
  114. 115 yum search btrfs
  115. 116 yum search zsh
  116. 117 yum install zsh
  117. 118 seinfo
  118. 119 yum provides */seinfo
  119. 120 history
  120. 121 cd
  121. 122 yum module list
  122. 123 yum module provides httpd
  123. 124 yum module info postgresql
  124. 125 yum module info postgresql | less
  125. 126 yum module info --profile postgresql
  126. 127 yum module list postgresql
  127. 128 yum module install posgresql:9.6
  128. 129 yum module install postgresql:9.6
  129. 130 yum module install postgresql:9.6/server
  130. 131 yum module enable postgresql:9.6
  131. 132 man ifconfig
  132. 133 ip a
  133. 134 ip addr add dev ens160 10.0.0.10/24
  134. 135 ip a
  135. 136 ping 10.0.0.10
  136. 137 ifconfig
  137. 138 cat /etc/resolv.conf
  138. 139 ip route show
  139. 140 ip
  140. 141 countdown 12
  141. 142 df -h
  142. 143 cd /repo
  143. 144 ls
  144. 145 ls BaseOS/Packages/
  145. 146 ls BaseOS/repodata/
  146. 147 cd /etc/yum.repos.d/
  147. 148 cat base.repo
  148. 149 cat appstream.repo
  149. 150 yum repolist
  150. 151 cd
  151. 152 history
  152. 153 systemctl status NetworkManager
  153. 154 nmtui
  154. 155 ip a
  155. 156 fdisk /dev/sda
  156. 157 lsblk
  157. 158 pvcreate /dev/sda6
  158. 159 xxd /dev/sda6 | less
  159. 160 pvs
  160. 161 vgcreate vgdata /dev/sda6
  161. 162 vgs
  162. 163 pvs
  163. 164 vgremove vgdata
  164. 165 vgs
  165. 166 vgcreate --help | less
  166. 167 vgcreate -s 8m vgdata /dev/sda6
  167. 168 vgdisplay vgdata
  168. 169 lvcreate -L 2G -n lvdata vgdata
  169. 170 echo $(( 256 * 8 ))
  170. 171 vgs
  171. 172 echo $(( 255 * 8 ))
  172. 173 lvcreate -l 255 -n lvdata vgdata
  173. 174 lvs
  174. 175 mkfs.xfs /dev/vgdata/lvdata
  175. 176 mkdir /lvdata
  176. 177 vim /etc/fstab
  177. 178 mount -a
  178. 179 mount | tail -1
  179. 180 ls -l /dev/mapper/vgdata-lvdata /dev/vgdata/lvdata
  180. 181 xxd /dev/sda6 | less
  181. 182 history
  182. 183 tail -1 /etc/fstab
  183. 184 df -h
  184. 185 vgs
  185. 186 pvs
  186. 187 gdisk /dev/nvme0n1
  187. 188 lsblk
  188. 189 vgextend rhel /dev/nvme0n1p1
  189. 190 vgs
  190. 191 lvextend -r -l +100%FREE /dev/rhel/root
  191. 192 df -h
  192. 193 xfs_growfs /dev/rhel/root
  193. 194 countdown 12
  194. 195 yum install -y httpd
  195. 196 systemctl status httpd
  196. 197 systemctl enable --now httpd
  197. 198 systemctl status httpd
  198. 199 systemctl stop httpd
  199. 200 systemctl get-default
  200. 201 systemctl set-default multi-user.target
  201. 202 systemctl get-default
  202. 203 reboot
  203. 204 touch ccc
  204. 205 mount
  205. 206 mount -o remount,rw /
  206. 207 touch hhh
  207. 208 systemctl list-units
  208. 209 systemctl list-units
  209. 210 systemctl isolate rescue.target
  210. 211 systemctl list-units
  211. 212 systemctl reboot
  212. 213 systemctl set-default graphical.target
  213. 214 reboot
  214. 215 journalctl
  215. 216 cd /var/log
  216. 217 ls
  217. 218 mkdir journal
  218. 219 ls journal/
  219. 220 systemctl daemon-reload
  220. 221 ls journal/
  221. 222 vim /etc/systemd/journald.conf
  222. 223 journalctl
  223. 224 sysctl -a
  224. 225 sysctl -a | wc
  225. 226 systemctl status tuned
  226. 227 tuned-adm --help
  227. 228 tuned-adm list
  228. 229 tuned-adm profile_info desktop
  229. 230 tuned-adm profile desktop
  230. 231 tuned-adm list
  231. 232 cd /usr/lib/tuned/
  232. 233 ls
  233. 234 cd desktop/
  234. 235 ls
  235. 236 vim tuned.conf
  236. 237 cd
  237. 238 free -m
  238. 239 tuned-adm list
  239. 240 reboot
  240. 241 free -m
  241. 242 vmstat 2 5
  242. 243 gdisk /dev/nvme0n1
  243. 244 lsblk
  244. 245 partprobe
  245. 246 lsblk
  246. 247 free -m
  247. 248 mkswap /dev/nvme0p2
  248. 249 mkswap /dev/nvme0n1p2
  249. 250 free -m
  250. 251 swapon /dev/nvme0n1p2
  251. 252 free -m
  252. 253 vim /etc/fstab
  253. 254 history
  254. 255 reboot
  255. 256 history
  256. 257 yum install stratis-cli stratisd
  257. 258 systemctl enable --now stratisd
  258. 259 systemctl status stratisd
  259. 260 lsblk
  260. 261 fdisk /dev/sdb
  261. 262 fdisk /dev/sdc
  262. 263 lsblk
  263. 264 stratis pool create mypool /dev/sdb1
  264. 265 stratis pool list
  265. 266 stratis fs create mypool myfs1
  266. 267 stratis fs create mypool myfs2
  267. 268 stratis fs list mypool
  268. 269 stratis fs list mypool | awk '/myfs1/ { print $10 }'
  269. 270 stratis fs list mypool | awk '/myfs1/ { print $10 }' >> /etc/fstab
  270. 271 stratis fs list mypool | awk '/myfs2/ { print $10 }' >> /etc/fstab
  271. 272 mkdir /myfs1 /myfs2
  272. 273 vim /etc/fstab
  273. 274 mount -a
  274. 275 man 5 fstab
  275. 276 man -k stratis
  276. 277 mount
  277. 278 df -h
  278. 279 stratis pool list
  279. 280 stratis fs list mypool
  280. 281 cd /run/systemd/system/
  281. 282 ls
  282. 283 cd ../generator/
  283. 284 ls
  284. 285 lsblk
  285. 286 cd
  286. 287 yum install vdo kmod-kvdo
  287. 288 man vdo
  288. 289 #vdo create --name=vdo0 --device=/dev/sdb1 --vdoLogicalSize=10T
  289. 290 vdo create --name=vdo1 --device=/dev/sdb2 --vdoLogicalSize=1T
  290. 291 mkfs.xfs -K /dev/mapper/vdo1
  291. 292 ls -l /dev/mapper/vdo1
  292. 293 cd /usr/share/doc/vdo/examples/
  293. 294 ls
  294. 295 cd systemd/
  295. 296 ls
  296. 297 pwd
  297. 298 vim VDO.mount.example
  298. 299 mkdir /vdo1
  299. 300 cp VDO.mount.example /etc/systemd/system/vdo1.mount
  300. 301 cd /etc/systemd/system/
  301. 302 vim vdo1.mount
  302. 303 systemctl enable --now vdo1.mount
  303. 304 systemctl status vdo1.mount
  304. 305 mount
  305. 306 reboot
  306. 307 mount
  307. 308 cd /run/systemd/generator/
  308. 309 ls
  309. 310 vim myfs1.mount
  310. 311 cd /dev/disk
  311. 312 ls
  312. 313 ls -l by-uuid/
  313. 314 blkid
  314. 315 cd
  315. 316 cd /run/systemd/generator/
  316. 317 ls
  317. 318 vim sda3.mount
  318. 319 cd
  319. 320 systemctl daemon-reload
  320. 321 showmount -e 192.168.29.241
  321. 322 mount 192.168.29.241:/myshare /mnt
  322. 323 cd /mnt
  323. 324 ls
  324. 325 touch file100000
  325. 326 cd
  326. 327 ls -Z
  327. 328 ps Zaux | grep http
  328. 329 cd /var/www/
  329. 330 ls -Z
  330. 331 getenforce
  331. 332 vim /etc/sysconfig/selinux
  332. 333 cd
  333. 334 mkdir /web
  334. 335 vim /web/index.html
  335. 336 vim /etc/httpd/conf/httpd.conf
  336. 337 systemctl restart httpd
  337. 338 curl localhost
  338. 339 q!
  339. 340 getenforce
  340. 341 setenforce permissive
  341. 342 curl localhost
  342. 343 vim /etc/httpd/conf/httpd.conf
  343. 344 systemctl restart httpd
  344. 345 curl localhost
  345. 346 getenforce
  346. 347 setenforce enforcing
  347. 348 curl localhost
  348. 349 less /var/log/audit/audit.log
  349. 350 grep AVC /var/log/audit/audit.log
  350. 351 grep http /var/log/audit/audit.log
  351. 352 reboot
  352. 353 systemctl status auditd
  353. 354 systemctl status auditd.service
  354. 355 systemctl start auditd
  355. 356 systemctl status auditd.service
  356. 357 systemctl status httpd
  357. 358 getenforce
  358. 359 curl localhost
  359. 360 grep AVC /var/log/audit/audit.log
  360. 361 ls -ldZ /var/www/html
  361. 362 ls -Z /web
  362. 363 man semanage
  363. 364 man semanage-fcontext
  364. 365 # semanage fcontext -a -t httpd_sys_content_t "/web(/.*)?"
  365. 366 # restorecon -R -v /web
  366. 367 semanage fcontext -a -t httpd_sys_content_t "/web(/.*)?"
  367. 368 ls -Zd /web
  368. 369 restorecon -Rv /web
  369. 370 curl localhost
  370. 371 history
  371. 372 ls -dZ /var/www/html/
  372. 373 countdown 13
  373. 374 history
  374. 375 cd /etc/selinux/
  375. 376 ls
  376. 377 cd targeted/
  377. 378 ls
  378. 379 cd contexts/
  379. 380 ls
  380. 381 cd files
  381. 382 pwd
  382. 383 ls
  383. 384 cat file_contexts.local
  384. 385 cd
  385. 386 man -k _selinux
  386. 387 yum search selinux
  387. 388 yum install -y selinux-policy-doc
  388. 389 man -k _selinux
  389. 390 man -k _selinux | wc
  390. 391 man -k _selinux | grep http
  391. 392 man apache_selinux
  392. 393 journalctl | grep sealert
  393. 394 sealert -l ceecd0da-9ddd-4c47-988e-c643a601d77b | less
  394. 395 grep AVC /var/log/audit/audit.log
  395. 396 getsebool -a | grep http
  396. 397 setsebool -P httpd_use_nfs on
  397. 398 ls -Z /etc/hosts
  398. 399 cp /etc/hosts .
  399. 400 rm /etc/hosts
  400. 401 ls -Z hosts
  401. 402 cp hosts /etc/hosts
  402. 403 ls -Z /etc/hosts
  403. 404 rm /etc/hosts
  404. 405 mv hosts /etc/hosts
  405. 406 ls -Z /etc/hosts
  406. 407 restorecon /etc/hosts -v
  407. 408 vim /etc/httpd/conf/httpd.conf
  408. 409 systemctl restart httpd
  409. 410 systemctl status httpd
  410. 411 getenforce
  411. 412 setenforce permissive
  412. 413 systemctl restart httpd
  413. 414 setenforce enforcing
  414. 415 journalctl | grep sealert
  415. 416 sealert -l 70cc8934-3dab-47b0-a2bb-f64630549047 | less
  416. 417 semanage port -a -t http_port_t -p tcp 82
  417. 418 getenforce
  418. 419 systemctl restart httpd
  419. 420 systemctl status httpd
  420. 421 ss -Ztuna
  421. 422 systemctl status firewalld
  422. 423 firewall-cmd --list-all
  423. 424 firewall-cmd --get-services
  424. 425 firewall-cmd --add-service http
  425. 426 firewall-cmd --add-service https
  426. 427 firewall-cmd --list-all
  427. 428 systemctl restart firewalld
  428. 429 firewall-cmd --list-all
  429. 430 firewall-cmd --add-service https --permanent
  430. 431 firewall-cmd --add-service http --permanent
  431. 432 firewall-cmd --list-all
  432. 433 systemctl restart firewalld
  433. 434 firewall-cmd --list-all
  434. 435 cd /usr/lib/firewalld
  435. 436 ls
  436. 437 cd services/
  437. 438 ls
  438. 439 vim http.xml
  439. 440 cp http.xml /etc/firewalld/services/sander.xml
  440. 441 vim /etc/firewalld/services/sander.xml
  441. 442 systemctl restart firewalld
  442. 443 firewall-cmd --get-services
  443. 444 cd ..
  444. 445 ls
  445. 446 cd zones/
  446. 447 pwd
  447. 448 ls
  448. 449 cat work.xml
  449. 450 cat public.xml
  450. 451 cd
  451. 452 vim /etc/default/grub
  452. 453 grub2-mkconfig -o /boot/grub2/grub.cfg
  453. 454 reboot
  454. 455 history
  455. 456 sleep 120; countdown 11
  456. 457 systemctl status autofs
  457. 458 yum install -y autofs
  458. 459 systemctl enable --now autofs
  459. 460 vim /etc/auto.master
  460. 461 ls /
  461. 462 vim /etc/auto.misc
  462. 463 showmount -e 192.168.29.141
  463. 464 showmount -e 192.168.29.241
  464. 465 vim /etc/auto.master
  465. 466 vim /etc/auto.nfsfiles
  466. 467 systemctl restart autofs
  467. 468 ls /
  468. 469 cd /nfsfiles/
  469. 470 mount
  470. 471 ls -a
  471. 472 cd data
  472. 473 cat /etc/auto.nfsfiles
  473. 474 showmount -e 192.168.29.241
  474. 475 vim /etc/auto.nfsfiles
  475. 476 systemctl restart autofs
  476. 477 cd data
  477. 478 ls
  478. 479 pwd\
  479. 480 pwd
  480. 481 mount
  481. 482 cd
  482. 483 showmount -e 192.168.29.241
  483. 484 vim /etc/auto.master
  484. 485 vim auto.ldap
  485. 486 vim /etc/auto.ldap
  486. 487 systemctl restart autofs
  487. 488 cd /home
  488. 489 ls
  489. 490 cd ldap
  490. 491 ls
  491. 492 cd ldapuser1
  492. 493 pwd
  493. 494 reboot
  494. 495 mount -o remount,rw /
  495. 496 cd /
  496. 497 ls
  497. 498 ls -a
  498. 499 rm .autorelabel
  499. 500 reboot
  500. 501 history
  501.  
Advertisement
Add Comment
Please, Sign In to add comment