Advertisement
sandervanvugt

RHCSA day3 may21

May 19th, 2021
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.32 KB | None | 0 0
  1. [root@rhcsa ~]# history
  2. 1 chmod -x countdown
  3. 2 ls -l countdown
  4. 3 ./countdown
  5. 4 chmod +x countdown
  6. 5 ./countdown 0
  7. 6 mkdir /data/sales
  8. 7 mkdir -p /data/sales
  9. 8 mkdir -p /data/account
  10. 9 cd /data
  11. 10 ls -l
  12. 11 groupadd sales
  13. 12 groupadd account
  14. 13 usermod -aG sales linda
  15. 14 usermod -aG sales lisa
  16. 15 id linda
  17. 16 id lisa
  18. 17 useradd --help
  19. 18 useradd -G account anna
  20. 19 useradd -G account anouk
  21. 20 id anna
  22. 21 passwd lisa
  23. 22 history
  24. 23 history -d 97
  25. 24 history -d 96
  26. 25 history -d 95
  27. 26 echo password | passwd --stdin anna
  28. 27 ls -l
  29. 28 chgrp account account
  30. 29 ls -l
  31. 30 chgrp sales sales
  32. 31 ls
  33. 32 for i in *; do echo $i; done
  34. 33 for i in *; do chgrp $i $i; done
  35. 34 ls -l
  36. 35 chmod 770 *
  37. 36 ls -l
  38. 37 su - linda
  39. 38 su - lisa
  40. 39 cd /home/linda
  41. 40 vim playme
  42. 41 chmod +x playme
  43. 42 su - linda
  44. 43 chmod u+s playme
  45. 44 ls -l
  46. 45 su - linda
  47. 46 find / -perm /4000 2>/dev/null
  48. 47 ls -l /usr/bin/passwd
  49. 48 ls -l /etc/shadow
  50. 49 cat /etc/shadow
  51. 50 ls -l /etc/shadow
  52. 51 cd /data/sales
  53. 52 ls -l
  54. 53 chmod g+s .
  55. 54 ls -ld .
  56. 55 su - linda
  57. 56 su - lisa
  58. 57 chmod +t .
  59. 58 ls -ld .
  60. 59 su - lisa
  61. 60 /root/countdown 12
  62. 61 ls -ld .
  63. 62 cd ..
  64. 63 chmod 3770 *
  65. 64 ls -k
  66. 65 ls -l
  67. 66 chmod o+x *
  68. 67 ls -l
  69. 68 chmod o-x *
  70. 69 ls -l
  71. 70 ls -lr *
  72. 71 setfacl -R -m g:account:rx sales
  73. 72 cd sales
  74. 73 ls -l
  75. 74 man setfacl
  76. 75 setfacl -R -x g:account sales
  77. 76 cd ..
  78. 77 setfacl -R -x g:account sales
  79. 78 ls -l sales
  80. 79 setfacl -R -m g:account:rX sales
  81. 80 ls -l sales/
  82. 81 ls -l sales
  83. 82 ls -ld sales
  84. 83 getfacl sales
  85. 84 setfacl -m d:g:account:rx sales
  86. 85 getfacl sales
  87. 86 su - linda
  88. 87 lsblk
  89. 88 fdisk /dev/sda
  90. 89 lsblk
  91. 90 mkfs.xfs /dev/sda3
  92. 91 mount /dev/sda3 /mnt
  93. 92 history
  94. 93 vim /etc/login.defs
  95. 94 groupadd --help | less
  96. 95 groupadd students
  97. 96 groupadd profs
  98. 97 usermod -aG students anna
  99. 98 usermod -aG students anouk
  100. 99 id anna
  101. 100 usermod -aG profs,account anna
  102. 101 usermod -aG profs,account anouk
  103. 102 usermod -G profs,account anouk
  104. 103 usermod -G profs,account anna
  105. 104 id anna
  106. 105 usermod -aG students linda
  107. 106 usermod -aG students lisa
  108. 107 mkdir -p /data/profs /data/students
  109. 108 cd /data
  110. 109 ls -l
  111. 110 chown anna:profs profs
  112. 111 chown anna:students students
  113. 112 ls -l
  114. 113 chmod 3770 *
  115. 114 ls -l
  116. 115 setfacl -m d:g:profs:rx /data/students
  117. 116 su - linda
  118. 117 su - anouk
  119. 118 getfacl /data/students
  120. 119 setfacl -m d:g:profs:rX /data/students/
  121. 120 su - anouke
  122. 121 su - anouk
  123. 122 ls -l
  124. 123 rm -rf students
  125. 124 mkdir students
  126. 125 chmod 3770 students
  127. 126 chown anna:students
  128. 127 chown anna:students students
  129. 128 ls -l
  130. 129 setfacl -R -m g:profs:rX students
  131. 130 setfacl -m d:g:profs:rx students
  132. 131 getfacl students
  133. 132 id anouk
  134. 133 su - anouk
  135. 134 ls l
  136. 135 ls -l
  137. 136 cd
  138. 137 lsblk
  139. 138 fdisk /dev/sda
  140. 139 lsblk
  141. 140 reboot
  142. 141 lsblk
  143. 142 mkfs.xfs /dev/sda5
  144. 143 mkdir /files
  145. 144 mount /dev/sda5 /files
  146. 145 mount
  147. 146 umount /files
  148. 147 vim /etc/fstab
  149. 148 mount -a
  150. 149 mount
  151. 150 df -h
  152. 151 mkfs.ext4 /dev/sda6
  153. 152 mkdir /ext4
  154. 153 vim /etc/fstab
  155. 154 mount -a
  156. 155 df -h
  157. 156 vim /etc/fstab
  158. 157 umount /files
  159. 158 fdisk /dev/sda
  160. 159 reboot
  161. 160 blkid
  162. 161 blkid | grep sda5
  163. 162 blkid | grep sda5 | awk '{ print $2 }'
  164. 163 blkid | grep sda5 | awk '{ print $2 }' >> /etc/fstab
  165. 164 vim /etc/fstab
  166. 165 reboot
  167. 166 ./countdown 12
  168. 167 fdisk -l /dev/sda
  169. 168 vim /etc/fstab
  170. 169 fstab /dev/sda
  171. 170 fdisk /dev/sda
  172. 171 lsblk
  173. 172 mount /dev/sda6 /mnt
  174. 173 df -h
  175. 174 xfs_admin --help
  176. 175 xfs_admin -L goat /dev/sda6
  177. 176 umount /dev/sda6
  178. 177 xfs_admin -L goat /dev/sda6
  179. 178 vim /etc/fstab
  180. 179 tune2fs /dev/sda5 -L cow
  181. 180 vim /etc/fstab
  182. 181 fdisk /dev/sda
  183. 182 reboot
  184. 183 blkid
  185. 184 cat /proc/partitions
  186. 185 lsblk
  187. 186 vim /etc/fstab
  188. 187 cd /etc/yum.repos.d/
  189. 188 ls
  190. 189 rm -f *
  191. 190 ls
  192. 191 yum repolist
  193. 192 yum install nmap
  194. 193 cd
  195. 194 dd if=/dev/sr0 of=/rhel8.iso bs=1M
  196. 195 ls -l /rhel8.iso
  197. 196 df -h
  198. 197 mkdir /repo
  199. 198 vim /etc/fstab
  200. 199 mount -a
  201. 200 ls /repo
  202. 201 yum repolist
  203. 202 ./countdown 12
  204. 203 cd /etc/yum.repos.d/
  205. 204 ls
  206. 205 cd /repo/
  207. 206 ls
  208. 207 cd BaseOS/
  209. 208 ls
  210. 209 ls Packages/
  211. 210 ls repodata/
  212. 211 cd /etc/yum.repos.d/
  213. 212 vim base.repo
  214. 213 yum repolist
  215. 214 vim appstream.repo
  216. 215 yum repolist
  217. 216 yum search nmap
  218. 217 yum search nano
  219. 218 vim base.repo
  220. 219 which yum
  221. 220 ls -l /bin/yum
  222. 221 yum provides */passwd
  223. 222 seinfo
  224. 223 grep iso /etc/fstab
  225. 224 cd /repo
  226. 225 ls
  227. 226 vim /etc/yum.repos.d/base.repo
  228. 227 cd
  229. 228 yum modules list
  230. 229 yum module list
  231. 230 yum module provides httpd
  232. 231 yum module info postgresql
  233. 232 yum module info --profile postgresql
  234. 233 yum module list postgresql
  235. 234 yum module list httpd
  236. 235 yum module install postgresql:9.6/devel
  237. 236 yum module install postgresql:9.6/server
  238. 237 yum install httpd
  239. 238 yum module info --profile php
  240. 239 yum modules install php:7.2/devel
  241. 240 yum module install php:7.2/devel
  242. 241 yum module reset php
  243. 242 yum module install --allowerasing php:7.3
  244. 243 systemctl status NetworkManager
  245. 244 cd /etc/sysconfig/network-scripts/
  246. 245 ls
  247. 246 vim ifcfg-ens160
  248. 247 nmtui
  249. 248 ip a
  250. 249 ip a a dev ens160 10.0.0.10/24
  251. 250 ip a
  252. 251 ifconfig
  253. 252 man ifconfig
  254. 253 rpm -qf $(which ifconfig)
  255. 254 yum delete net-tool
  256. 255 rpm -ql net-tools
  257. 256 yum remove net-tools
  258. 257 cd
  259. 258 ./countdown 12
  260. 259 systemctl status tuned
  261. 260 tuned-adm --help
  262. 261 tuned-adm list
  263. 262 tuned-adm profile desktop
  264. 263 tuned-adm list
  265. 264 fdisk /dev/sda
  266. 265 cat /proc/partitions
  267. 266 pvcreate /dev/sda7
  268. 267 pvs
  269. 268 xxd /dev/sda7 | less
  270. 269 vgcreate --help | less
  271. 270 vcreate -s 8M vgdata /dev/sda7
  272. 271 vgcreate -s 8M vgdata /dev/sda7
  273. 272 vgs
  274. 273 pvs
  275. 274 vgdisplay
  276. 275 man lvcreate
  277. 276 lvcreate -L 1G -n lvdata vgdata
  278. 277 echo $(( 128 * 8 ))
  279. 278 echo $(( 1016 / 8 ))
  280. 279 lvcreate -l 127 -n lvdata vgdata
  281. 280 lvs
  282. 281 mkfs.xfs /dev/vgdata/lvdata
  283. 282 mount /dev/vgdata/lvdata /mnt
  284. 283 mount
  285. 284 ls -l /dev/vgdata/lvdata /dev/mapper/vgdata-lvdata
  286. 285 xxd /dev/sda7 | less
  287. 286 vim /etc/fstab
  288. 287 mount -a
  289. 288 mkdir /lvdata
  290. 289 mount -a
  291. 290 history
  292. 291 vgs
  293. 292 poweroff
  294. 293 lsblk
  295. 294 vgs
  296. 295 fdisk /dev/sda
  297. 296 lsblk
  298. 297 vgs
  299. 298 lvs
  300. 299 pvs
  301. 300 vgextend vgdata /dev/sda8
  302. 301 vgs
  303. 302 df -h
  304. 303 mount | grep lvda
  305. 304 lvextend -l +50%FREE /dev/vgdata/lvdata
  306. 305 df -h
  307. 306 xfs_growfs --help
  308. 307 xfs_growfs /lvdata
  309. 308 df -h
  310. 309 vgs
  311. 310 lvcreate -n lvnew -l 100%FREE vgdata
  312. 311 lvs
  313. 312 mkfs.ext4 /dev/vgdata/lvnew
  314. 313 mount /dev/vgdata/lvnew /mnt
  315. 314 mount
  316. 315 df -h
  317. 316 lvreduce --help
  318. 317 lvreduce -r -L -100M /dev/vgdata/lvnew
  319. 318 df -h
  320. 319 free -m
  321. 320 fdisk /dev/sda
  322. 321 mkswap /dev/sda10
  323. 322 free -m
  324. 323 vim /etc/fstab
  325. 324 mount -a
  326. 325 free -m
  327. 326 swapon -a
  328. 327 free -m
  329. 328 vim /etc/fstab
  330. 329 history
  331. 330 ls -l /dev/mapper/vgdata-lvdata /dev/vgdata/lvdata
  332. 331 yum install stratis-cli startisd
  333. 332 yum install stratis-cli stratisd
  334. 333 systemctl enable --now stratisd
  335. 334 systemctl status stratisd
  336. 335 man stratis
  337. 336 stratis pool create mypool /dev/sdb
  338. 337 stratis pool list
  339. 338 stratis filesystem create mypool myfs1
  340. 339 stratis filesystem create mypool myfs2
  341. 340 stratis fs list
  342. 341 blkid
  343. 342 mkdir /myfs1 /myfs2
  344. 343 vim /etc/fstab
  345. 344 mount -a
  346. 345 reboot
  347. 346 stratis pool list
  348. 347 stratis filesystem list
  349. 348 df -h
  350. 349 stratis blockdev list
  351. 350 vdo
  352. 351 man vdo
  353. 352 #vdo create --name=vdo0 --device=/dev/sdb1 --vdoLogicalSize=10T
  354. 353 vdo create --name=vdo0 --device=/dev/sdc --vdoLogicalSize=10T
  355. 354 mkfs.xfs -K /dev/mapper/vdo0
  356. 355 cd /usr/share/doc/vdo/examples/
  357. 356 ls
  358. 357 cd systemd/
  359. 358 ls
  360. 359 vim VDO.mount.example
  361. 360 mv VDO.mount.example /etc/systemd/system/myvdo.mount
  362. 361 systemctl enable --now myvdo.mount
  363. 362 mount
  364. 363 reboot
  365. 364 systemctl status sshd.service
  366. 365 exit
  367. 366 history
  368. 367 mount | grep vdo
  369. 368 vim /etc/systemd/system/myvdo.mount
  370. 369 ./countdown 12
  371. 370 history | grep mkfs
  372. 371 systemctl status vdo
  373. 372 journalctl -u vdo
  374. 373 systemctl -t help
  375. 374 systemctl list-units
  376. 375 cd /usr/lib/systemd/system
  377. 376 ls
  378. 377 vim sshd.service
  379. 378 systemctl status sshd.service
  380. 379 kill -9 1523
  381. 380 systemctl status sshd.service
  382. 381 yum install -y vsftpd
  383. 382 rpm -ql vsftpd
  384. 383 rpm -ql vsftpd | grep systemd
  385. 384 systemctl status vsftpd
  386. 385 systemctl enable --now vsftpd
  387. 386 systemctl status vsftpd
  388. 387 systemctl list-unit-files -t target
  389. 388 systemctl get-default
  390. 389 systemctl set-default multi-user.target
  391. 390 systemctl set-default graphical.target
  392. 391 systemctl set-default multi-user.target
  393. 392 vim /etc/fstab
  394. 393 cd /run/systemd/
  395. 394 ls
  396. 395 cd generator/
  397. 396 ls
  398. 397 vim files.mount
  399. 398 vim /etc/fstab
  400. 399 systemctl daemon-reload
  401. 400 ls
  402. 401 cd ..
  403. 402 cd generator/
  404. 403 ls
  405. 404 cp ext4.mount /etc/systemd/system/lvdata.mount
  406. 405 cd /etc/systemd/system/
  407. 406 vim lvdata.mount
  408. 407 mount | grep lvdata
  409. 408 umount /lvdata
  410. 409 mount | grep lvdata
  411. 410 systemctl enable --now lvdata.mount
  412. 411 cd /etc/systemd/system/
  413. 412 cat myvdo.mount
  414. 413 vim lvdata.mount
  415. 414 systemctl enable --now lvdata.mount
  416. 415 systemctl status lvdata.mount
  417. 416 mount | grep lvdata
  418. 417 systemctl list-unit-files -t socket
  419. 418 systemctl cat cups.socket
  420. 419 systemctl cat sshd.socket
  421. 420 systemctl disable --now sshd.service
  422. 421 systemctl enable --now sshd.socket
  423. 422 systemctl status sshd.service
  424. 423 systemctl status sshd.socket
  425. 424 ssh localhost
  426. 425 systemctl status sshd.service
  427. 426 ssh localhost
  428. 427 systemctl enable cockpit.socket
  429. 428 systemctl start cockpit.socket
  430. 429 systemctl status cockpit.socket
  431. 430 cd
  432. 431 ./countdown 12
  433. 432 ps aux | grep nginx
  434. 433 ps aux | grep http
  435. 434 systemctl cat cockpit.service
  436. 435 yum install -y httpd
  437. 436 systemctl enable --now httpd
  438. 437 ps Zaux | grep http
  439. 438 ps Zaux | grep httpd
  440. 439 ls -Zl /var/www
  441. 440 mkdir /web
  442. 441 vim /web/index.html
  443. 442 vim /etc/httpd/conf/httpd.conf
  444. 443 systemctl restart httpd
  445. 444 curl localhost
  446. 445 ls -lZd /web
  447. 446 getenforce
  448. 447 vim /etc/sysconfig/selinux
  449. 448 curl localhost
  450. 449 setenforce Permissive
  451. 450 curl localhost
  452. 451 setenforce enforcing
  453. 452 grep AVC /var/log/audit/audit.log
  454. 453 grep AVC /var/log/audit/audit.log | grep http
  455. 454 ls -Z /var/www
  456. 455 man semanage-fcontext
  457. 456 semanage fcontext -a -t httpd_sys_content_t "/web(/.*)?"
  458. 457 curl localhost
  459. 458 cd /etc/selinux/targeted/
  460. 459 ls
  461. 460 cd contexts/
  462. 461 ls
  463. 462 cd files
  464. 463 ls
  465. 464 cat file_contexts.local
  466. 465 ls -Zd /web
  467. 466 restorecon -Rv /web
  468. 467 curl localhost
  469. 468 getenforce
  470. 469 man semanage-fcontext
  471. 470 yum search selinux
  472. 471 yum install selinux-policy-doc
  473. 472 man -k _selinux
  474. 473 man -k _selinux | wc
  475. 474 man -k _selinux | grep http
  476. 475 man httpd_selinux
  477. 476 getsebool -a | wc
  478. 477 getsebool -a
  479. 478 getsebool -a | grep ftp
  480. 479 setsebool -P ftpd_anon_write on
  481. 480 grep sealert /var/log/messages
  482. 481 sealert -l 286937b8-b633-4e8b-85e6-d8949797a189 | less
  483. 482 vim /etc/httpd/conf/httpd.conf
  484. 483 systemctl restart httpd
  485. 484 systemctl status httpd.service
  486. 485 journalctl | grep sealert
  487. 486 sealert -l f7d6f3ed-19f5-41f8-999c-67436fd83887 | less
  488. 487 semanage port -a -t http_port_t -p tcp 82
  489. 488 systemctl restart httpd
  490. 489 cd
  491. 490 vim /etc/sysconfig/selinux
  492. 491 semanage fcontext -l
  493. 492 semanage fcontext -l | wc
  494. 493 semanage port -l
  495. 494 ls -ld /web
  496. 495 history
  497. 496 ./countdown 12
  498. 497 vim /etc/default/grub
  499. 498 grub2-mkconfig -o /boot/grub2/grub.cfg
  500. 499 reboot
  501. 500 reboot
  502. 501 systemctl isolate graphical.target
  503. 502 firewall-cmd --help
  504. 503 firewall-cmd --get-services
  505. 504 firewall-cmd --list-all
  506. 505 firewall-cmd --add-service http
  507. 506 firewall-cmd --list-all
  508. 507 firewall-cmd --add-service http --permanent
  509. 508 firewall-cmd --help | grep port
  510. 509 firewall-cmd --add-port=82/tcp
  511. 510 firewall-cmd --list-all
  512. 511 firewall-cmd --add-port=82/tcp --permanent
  513. 512 firewall-cmd --list-all
  514. 513 firewall-cmd --reload
  515. 514 firewall-cmd --list-all
  516. 515 ssh root@192.168.29.78
  517. 516 showmount -e 192.168.29.78
  518. 517 history
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement