Advertisement
sandervanvugt

RHCSA day3 nov.21

Nov 18th, 2021
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.31 KB | None | 0 0
  1. [root@localhost ~]# history
  2. 1 tar -cvzf /root/archive.tgz /etc
  3. 2 ls -l
  4. 3 tar -tvf archive.tgz
  5. 4 cat /etc/dnsmasq.conf | sed '/^$/d' | sort
  6. 5 cat /etc/dnsmasq.conf | sed '/^$/d' | sort > /var/tmp/dnslines.txt
  7. 6 useradd bob
  8. 7 mkdir /root/usersfiles; find / -user bob -exec cp {} /root/userfiles/ \;
  9. 8 mkdir /root/userfiles; find / -user bob -exec cp {} /root/userfiles/ \;
  10. 9 ls userfiles/
  11. 10 ls -Ra userfiles/
  12. 11 dnf install -y git
  13. 12 vim countdown
  14. 13 ./countdown 12
  15. 14 ls -l
  16. 15 chmod +x countdown
  17. 16 ./countdown 12
  18. 17 less /etc/passwd
  19. 18 id bob
  20. 19 su - bob
  21. 20 id student
  22. 21 visudo
  23. 22 vim /etc/login.defs
  24. 23 passwd bob
  25. 24 grep bob /etc/shadow
  26. 25 vim /etc/login.defs
  27. 26 useradd whoeve3r
  28. 27 passwd whoeve3r
  29. 28 tail -5 /etc/shadow
  30. 29 ls /etc/skel
  31. 30 ls -a /etc/skel
  32. 31 ls -a /home/bob
  33. 32 passwd --help | less
  34. 33 passwd -l bob
  35. 34 tail -5 /etc/shadow
  36. 35 chage --help
  37. 36 chage -l bob
  38. 37 groupadd dudes
  39. 38 usermod -aG dudes bob
  40. 39 id bob
  41. 40 grep bob /etc/passwd
  42. 41 grep bob /etc/group
  43. 42 id bob
  44. 43 passwd -S
  45. 44 passwd -S bob
  46. 45 vim /etc/ssh/sshd_config
  47. 46 ls -l /home
  48. 47 ls -l /etc/hosts
  49. 48 mkdir -p /data/sales
  50. 49 cd /data
  51. 50 ls -l
  52. 51 groupadd sales
  53. 52 usermod -aG sales bob
  54. 53 id
  55. 54 chgrp sales /data/sales
  56. 55 ls -l
  57. 56 chmod 770 sales
  58. 57 ls -l
  59. 58 history
  60. 59 cd
  61. 60 useradd linda
  62. 61 cd /home/linda
  63. 62 vim runme
  64. 63 chmod +x runme
  65. 64 su - linda
  66. 65 chmod u+s runme
  67. 66 ls -l
  68. 67 find / -perm /4000 2>/dev/null
  69. 68 find / -perm /4000 -exec ls -l {} \; 2>/dev/null
  70. 69 ls -l /etc/shadow
  71. 70 #find / -perm /4000 -exec ls -l {} \; 2>/dev/null
  72. 71 pwd
  73. 72 touch removeme
  74. 73 su - linda
  75. 74 touch writeme
  76. 75 su - linda
  77. 76 cd
  78. 77 ./countdown 12
  79. 78 man find
  80. 79 find / -perm /6000 -exec ls {} \;
  81. 80 find / -perm /6000 -exec ls -l {} \;
  82. 81 for i in find / -perm /4000;
  83. 82 find / -perm /6000 -exec ls -l {} \;
  84. 83 find / -perm /6000
  85. 84 for i in find / -perm /4000 2>/dev/null; do ls -l $i; done
  86. 85 for i in $(find / -perm /4000); do ls -l $i; done
  87. 86 strace -c for i in $(find / -perm /4000); do ls -l $i; done
  88. 87 strace -c "for i in $(find / -perm /4000); do ls -l $i; done"
  89. 88 vim countdown
  90. 89 ./countdown 1
  91. 90 vim countdown
  92. 91 ./countdown 5
  93. 92 vim countdown
  94. 93 history
  95. 94 strace -f /bin/bash -c 'for i in $(find / -perm /4000); do ls -l $i; done'
  96. 95 strace -c -f /bin/bash -c 'for i in $(find / -perm /4000); do ls -l $i; done'
  97. 96 strace -c find / -perm /6000 -exec ls -l {} \;
  98. 97 strace -c -f /bin/bash -c 'for i in $(find / -perm /4000); do ls -l $i; done'
  99. 98 strace -c -f find / -perm /6000 -exec ls -l {} \;
  100. 99 grep sales /etc/group
  101. 100 useradd -aG sales linda
  102. 101 usermod -aG sales linda
  103. 102 grep sales /etc/group
  104. 103 cd /data
  105. 104 ls -l
  106. 105 su - bob
  107. 106 su - linda
  108. 107 chmod g+s sales
  109. 108 ls -l
  110. 109 su - bob
  111. 110 su - linda
  112. 111 chmod +t /data/sales
  113. 112 ls -l
  114. 113 su - linda
  115. 114 chown linda sales
  116. 115 ls -l
  117. 116 su - linda
  118. 117 history
  119. 118 cd
  120. 119 ./countdown 10
  121. 120 vim countdown
  122. 121 ./countdown 10
  123. 122 groupadd students
  124. 123 groupadd profs
  125. 124 vim /etc/login.defs
  126. 125 groupadd -G students lisa
  127. 126 useradd -G students lisa
  128. 127 usermod -aG students linda
  129. 128 useradd -G profs anna
  130. 129 useradd -G profs anouk
  131. 130 mkdir -p /data/profs /data/students
  132. 131 cd /data
  133. 132 chgrp students students
  134. 133 chgrp profs profs
  135. 134 chmod 3770 profs
  136. 135 chmod 3770 students/
  137. 136 ls -l
  138. 137 chown anna students/
  139. 138 chown anna profs
  140. 139 ls -l
  141. 140 cd
  142. 141 ./countdown 13
  143. 142 lsblk
  144. 143 poweroff
  145. 144 man find
  146. 145 useradd --help
  147. 146 passwd --help
  148. 147 lsblk
  149. 148 fdisk /dev/sda
  150. 149 lsblk
  151. 150 mkfs.xfs /dev/sda3
  152. 151 mkdir /files
  153. 152 vim /etc/fstab
  154. 153 mount -a
  155. 154 vim /etc/fstab
  156. 155 mount -a
  157. 156 lsblk
  158. 157 mount
  159. 158 mount | wc
  160. 159 mount | grep '^/'
  161. 160 lsblk
  162. 161 history
  163. 162 man test
  164. 163 vim hintscript.sh
  165. 164 chmod +x hintscript.sh
  166. 165 ./hintscript.sh
  167. 166 vim hintscript.sh
  168. 167 lsblk
  169. 168 df -h
  170. 169 dd if=/dev/zero of=/root/diskfile.img bs=1M count=8192
  171. 170 du -h diskfile.img
  172. 171 losetup -fP diskfile.img
  173. 172 losetup -a
  174. 173 fdisk -l /dev/loop0
  175. 174 lsblk
  176. 175 xxd -l 512 /dev/sda | less
  177. 176 fdisk /dev/sda
  178. 177 fdisk -l /dev/sda
  179. 178 cat /proc/partitions
  180. 179 reboot
  181. 180 cat /proc/partitions
  182. 181 mkdir /xfsfiles
  183. 182 mkdir /ext4files
  184. 183 mkfs.xfs /dev/sda5
  185. 184 mkfs.ext4 /dev/sda6
  186. 185 vim /etc/fstab
  187. 186 mount -a
  188. 187 lsblk
  189. 188 fdisk /dev/sda
  190. 189 vim /etc/fstab
  191. 190 reboot
  192. 191 fdisk -l /dev/sda
  193. 192 touch aa
  194. 193 mount -o remount,rw /
  195. 194 history
  196. 195 vim /etc/fstab
  197. 196 reboot
  198. 197 blkid
  199. 198 vim /etc/fstab
  200. 199 tune2fs -L cow /dev/sda5
  201. 200 blkid
  202. 201 vim /etc/fstab
  203. 202 reboot
  204. 203 xxd -l 512 /dev/sda
  205. 204 cat /dev/sda | less
  206. 205 mkfs.ext4 --help | less
  207. 206 xfs_admin --help
  208. 207 tune2fs --help
  209. 208 cd /data
  210. 209 ls -l
  211. 210 su - anna
  212. 211 man setfacl
  213. 212 setfacl -R -m g:profs:rX students
  214. 213 ls students/
  215. 214 ls students/ -l
  216. 215 ls -l
  217. 216 getfacl students/
  218. 217 getfacl students/student1
  219. 218 su - anna
  220. 219 getfacl students/newfile
  221. 220 ls -lZ
  222. 221 setfacl -m d:g:profs:rx students
  223. 222 getfacl students/
  224. 223 su - anna
  225. 224 getfacl students/newfile2
  226. 225 history
  227. 226 sleep 180; /root/countdown 12
  228. 227 history
  229. 228 df -h
  230. 229 poweroff
  231. 230 lsblk
  232. 231 fdisk /dev/sdb
  233. 232 lsblk
  234. 233 pvcreate --help
  235. 234 pvcreate /dev/sdb1
  236. 235 pvs
  237. 236 vgcreate --help | less
  238. 237 vgcreate -s 8M vgdata /dev/sdb1
  239. 238 man lvcreate
  240. 239 lvcreate -L 1G -n lvdata vgdata
  241. 240 pvs
  242. 241 vgs
  243. 242 lvs
  244. 243 mkfs.xfs /dev/vgdata/lvdata
  245. 244 mkdir /lvdata
  246. 245 vim /etc/fstab
  247. 246 mount -a
  248. 247 mount
  249. 248 tail -1 /etc/fstab
  250. 249 ls -l /dev/vgdata/lvdata /dev/mapper/vgdata-lvdata
  251. 250 history
  252. 251 df -h
  253. 252 lvs
  254. 253 vgs
  255. 254 vgextend --help | less
  256. 255 vgextend rhel /dev/sdb2
  257. 256 vgs
  258. 257 lvextend --help | less
  259. 258 lvextend -r -l +100%FREE /dev/rhel
  260. 259 lvextend -r -l +100%FREE /dev/rhel/root
  261. 260 df -h
  262. 261 lvs
  263. 262 vgs
  264. 263 pvs
  265. 264 lvdisplay
  266. 265 lvs
  267. 266 history
  268. 267 ./countdown 15
  269. 268 dd if=/dev/sr0 of=/rhel8.iso bs=1M
  270. 269 df -h
  271. 270 mkdir /repo
  272. 271 vim /etc/fstab
  273. 272 mount -a
  274. 273 mount
  275. 274 cd /repo
  276. 275 ls
  277. 276 cd BaseOS/
  278. 277 ls
  279. 278 ls Packages/
  280. 279 cd /
  281. 280 lsblk
  282. 281 yum repolist
  283. 282 cd /etc/yum.repos.d/
  284. 283 ls
  285. 284 cat redhat.repo
  286. 285 rm -f *.repo
  287. 286 vim base.repo
  288. 287 vim appstream.repo
  289. 288 yum repolist
  290. 289 yum search nmap
  291. 290 yum install nmap-ncat
  292. 291 yum provides */yum-config-manager
  293. 292 man yum.conf
  294. 293 yum module list
  295. 294 yum module provides podman
  296. 295 yum module info container-tools
  297. 296 yum module info postgress
  298. 297 yum module info postgres
  299. 298 yum module info postgresql | less
  300. 299 yum module list postgresql
  301. 300 yum module install postgresql:9.6/client
  302. 301 yum install httpd
  303. 302 ls -l $(which yum) $(which dnf)
  304. 303 cd
  305. 304 ./countdown 15
  306. 305 lslbk
  307. 306 lsblk
  308. 307 history
  309. 308 ip a
  310. 309 ip route
  311. 310 cat /etc/resolv.conf
  312. 311 ping 8.8.8.8
  313. 312 ping nu.nl
  314. 313 man ifconfig
  315. 314 ip addr add dev ens160 10.0.0.10/24
  316. 315 ip a
  317. 316 ifconfig
  318. 317 ifconfig --all
  319. 318 ifconfig -a
  320. 319 ifconfig /all
  321. 320 rpm -qf $(which ifconfig)
  322. 321 yum remove net-tools
  323. 322 ip route del default via 192.168.29.2
  324. 323 ip route show
  325. 324 ping 8.8.8.8
  326. 325 ip route add default via 192.168.29.1
  327. 326 ping 8.8.8.8
  328. 327 ip route
  329. 328 ip route del default via 192.168.29.
  330. 329 ip route add default via 192.168.29.2
  331. 330 ping 8.8.8.8
  332. 331 ip a
  333. 332 systemctl status NetworkManager
  334. 333 cd /etc/sysconfig/network-scripts/
  335. 334 ls
  336. 335 vim ifcfg-ens160
  337. 336 nmtui
  338. 337 ip a
  339. 338 ping 8.8.8.8
  340. 339 ping nu.nl
  341. 340 nmtui
  342. 341 nmcli connection show
  343. 342 nmcli connection add ipv4.addresses 10.0.0.10/24
  344. 343 nmcli connection add ipv4.addresses 10.0.0.10/24 type ethernet
  345. 344 nmcli con show
  346. 345 mount /dev/sr0 /mnt
  347. 346 ls /mnt/
  348. 347 history
  349. 348 su --help
  350. 349 su linda -c touch /tmp/linda
  351. 350 su linda -c "touch /tmp/linda"
  352. 351 ls -l /tmp/linda
  353. 352 systemctl status tuned
  354. 353 tuned-adm --help
  355. 354 tuned-adm list
  356. 355 tuned-adm profile latency-performance
  357. 356 tuned-adm list
  358. 357 sysctl -a
  359. 358 sysctl -a | wc
  360. 359 free -m
  361. 360 swapon -a
  362. 361 swapon -s
  363. 362 fdisk /dev/sda
  364. 363 lsblk
  365. 364 free -m
  366. 365 mkswap --help | less
  367. 366 mkswap -L SWAP /dev/sda7
  368. 367 vim /etc/fstab
  369. 368 systemctl isolate multi-user.target
  370. 369 blkid
  371. 370 blkid | grep SWAP
  372. 371 blkid | grep SWAP | awk '{ print $3 }'
  373. 372 blkid | grep SWAP | awk '{ print $3 }' >> /etc/fstab
  374. 373 vim /etc/fstab
  375. 374 reboot
  376. 375 mount -o remount,rw /
  377. 376 mount -o remount,rw /
  378. 377 systemctl list-units
  379. 378 cd /boot
  380. 379 ls
  381. 380 cd ..
  382. 381 systemctl start rescue.target
  383. 382 systemctl list-units
  384. 383 cd /boot
  385. 384 ls
  386. 385 cd ..
  387. 386 mount -a
  388. 387 systemctl start default.target
  389. 388 cat /etc/fstab
  390. 389 systemctl list-units -t mount
  391. 390 cd /run/systemd/generator
  392. 391 ls
  393. 392 cat files.mount
  394. 393 cd /etc/systemd/system/
  395. 394 vim files.mount
  396. 395 systemctl list-dependencies
  397. 396 vim files.mount
  398. 397 vim /etc/fstab
  399. 398 vim files.mount
  400. 399 systemctl enable files.mount
  401. 400 reboot
  402. 401 mount
  403. 402 systemctl status files.mount
  404. 403 lsblk
  405. 404 df -h
  406. 405 journalctl
  407. 406 cd /var/log
  408. 407 ls
  409. 408 mkdir journal
  410. 409 ls journal
  411. 410 systemctl daemon-reload
  412. 411 ls journal
  413. 412 vim dglab.txt
  414. 413 poweroff
  415. 414 yum install vdo kmod-kvdo
  416. 415 man vdo
  417. 416 vdo create --name=vdo1 --device=/dev/sde --vdoLogicalSize=1T
  418. 417 mkfs.xfs -K /dev/mapper/vdo1
  419. 418 cat /etc/fstab
  420. 419 cd /usr/share/doc/vdo/examples/
  421. 420 ls
  422. 421 cd systemd/
  423. 422 ls
  424. 423 mkdir /myvdo
  425. 424 cp VDO.mount.example /etc/systemd/system/myvdo.mount
  426. 425 cd /etc/systemd/system/
  427. 426 vim myvdo.mount
  428. 427 systemctl enable --now myvdo.mount
  429. 428 systemctl status myvdo.mount
  430. 429 mount | grep vdo
  431. 430 reboot
  432. 431 mount | grep vdo
  433. 432 man lvmvdo
  434. 433 vdostats --human-readable
  435. 434 history 424 cp VDO.mount.example /etc/systemd/system/myvdo.mount
  436. 425 cd /etc/systemd/system/
  437. 426 vim myvdo.mount
  438. 427 systemctl enable --now myvdo.mount
  439. 428 systemctl status myvdo.mount
  440. 429 mount | grep vdo
  441. 430 reboot
  442. 431 mount | grep vdo
  443. 432 man lvmvdo
  444. 433 vdostats --human-readable
  445. 434 history
  446. 435 reboot
  447. 436 vim /etc/default/grub
  448. 437 grub2-mkconfig -o /boot/grub2/grub.cfg
  449. 438 reboot
  450. 439 history
  451.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement