Advertisement
sandervanvugt

RHCSA day2 march23

Mar 14th, 2023
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.58 KB | None | 0 0
  1. root@server1 log]# history
  2. 1 dnf install git -y
  3. 2 vim countdown
  4. 3 chmod +x countdown
  5. 4 ./countdown 16
  6. 5 ./countdown 16 lab
  7. 6 ssh student@192.168.29.147
  8. 7 ip a
  9. 8 tar czvf /root/archive.tgx /etc
  10. 9 ls -l
  11. 10 mv archive.tgx archive.tgz
  12. 11 ls
  13. 12 grep -v '^$' /etc/dnsmasq.conf
  14. 13 grep -v '^$' /etc/dnsmasq.conf | sort
  15. 14 grep -v '^$' /etc/dnsmasq.conf
  16. 15 grep -v '^$' /etc/dnsmasq.conf | sort
  17. 16 grep -v '^$' /etc/dnsmasq.conf | sort > /var/tmp/dnslines.txt
  18. 17 useradd bob
  19. 18 mkdir userfiles
  20. 19 find / -user bob -type f
  21. 20 find / -user bob -type f -exec cp -a {} userfiles/ \;
  22. 21 man sort
  23. 22 grep -v '^$' /etc/dnsmasq.conf | sort -d
  24. 23 history
  25. 24 ./countdown 13 break
  26. 25 history
  27. 26 exit
  28. 27 su - bob
  29. 28 passwd bob
  30. 29 su - bob
  31. 30 id student
  32. 31 id bob
  33. 32 visudo
  34. 33 su - bob
  35. 34 visudo
  36. 35 su - bob
  37. 36 visudo
  38. 37 ./countdown 1
  39. 38 ls -l /etc/skel
  40. 39 ls -a /etc/skel
  41. 40 ls -a /home/linda
  42. 41 vim /etc/login.defs
  43. 42 useradd --help | less
  44. 43 cat /etc/passwd
  45. 44 cat /etc/shadow
  46. 45 vim /etc/shadow
  47. 46 su - linda
  48. 47 ssh linda@localhost
  49. 48 vim /etc/shadow
  50. 49 less /etc/passwd
  51. 50 lid -g wheel
  52. 51 groupadd sales
  53. 52 id bob
  54. 53 usermod -aG sales bob
  55. 54 id bob
  56. 55 usermod -G wheel bob
  57. 56 id bob
  58. 57 usermod --help | less
  59. 58 usermod -G sales bob
  60. 59 ./countdown 16 lab and break
  61. 60 ./countdown 16 "lab and break"
  62. 61 vim /etc/login.defs
  63. 62 touch /etc/skel/newfile
  64. 63 groupadd profs
  65. 64 groupadd student
  66. 65 groupadd students
  67. 66 useradd anna -G profs
  68. 67 useradd anouk -G profs
  69. 68 useradd lisa -G students
  70. 69 useradd linda -G students
  71. 70 for i in linda lisa anna anouk; do echo password | passwd --stdin $i; done
  72. 71 tail -4 /etc/shadow
  73. 72 history
  74. 73 ls -l /etc/hosts
  75. 74 touch testfile
  76. 75 ls -l
  77. 76 chown linda testfile
  78. 77 ls -l
  79. 78 chown linda:profs testfile
  80. 79 ls -l
  81. 80 chgrp students testfile
  82. 81 ls -l
  83. 82 mkdir -p /data/profs /data/students
  84. 83 ls -l /data
  85. 84 chown :profs /data/profs
  86. 85 chgrp students /data/students
  87. 86 ls -l
  88. 87 ls -l /data
  89. 88 chmod 770 /data/students
  90. 89 chmod g+w,o-rx /data/profs
  91. 90 ls -l /data
  92. 91 history
  93. 92 cd /home/linda
  94. 93 touch rootfile
  95. 94 su - linda
  96. 95 touch rootfile2
  97. 96 su - linda
  98. 97 su - anna
  99. 98 chmod g+s /data/profs
  100. 99 ls -l /data/
  101. 100 su - anna
  102. 101 su - anouk
  103. 102 chmod +t /data/profs
  104. 103 ls -ld /data/profs
  105. 104 su - anouk
  106. 105 cd
  107. 106 ./countdown 1 questions
  108. 107 cd /home/linda
  109. 108 touch roofile
  110. 109 ls -l rootfile2
  111. 110 ls -l rootfile
  112. 111 ls -l rootfile2
  113. 112 rm rootfile2
  114. 113 touch newfile
  115. 114 ls -l newfile
  116. 115 su - linda
  117. 116 history
  118. 117 mkdir -p /files/profs /files/students
  119. 118 cd /files
  120. 119 ls -l
  121. 120 chgrp profs profs
  122. 121 chgrp students students
  123. 122 chmod 770 *
  124. 123 ls -l
  125. 124 umask
  126. 125 umask 002
  127. 126 umask
  128. 127 umask 022
  129. 128 exit
  130. 129 ./countdown 15 "lab and break"
  131. 130 lsblk
  132. 131 poweroff
  133. 132 fdisk /dev/nvme0n1
  134. 133 lsblk
  135. 134 mkfs.xfs /dev/nvme0n1p3
  136. 135 mount /dev/nvme0n1p3 /mnt
  137. 136 lsblk
  138. 137 mount
  139. 138 lsblk
  140. 139 findmnt
  141. 140 vim /etc/fstab
  142. 141 mount -a
  143. 142 reboot
  144. 143 fdisk /dev/nvme0n1
  145. 144 vim /etc/fstab
  146. 145 mkfs.xfs /dev/nvme0n1p5
  147. 146 mkfs.ext4 /dev/nvme0n1p6
  148. 147 mkdir /part5 /part6
  149. 148 mount -a
  150. 149 touch /part5/part_5_file
  151. 150 touch /part6/part6_file
  152. 151 vim /etc/fstab
  153. 152 fdisk /dev/nvme0n1
  154. 153 history
  155. 154 reboot
  156. 155 journalctl -xb
  157. 156 vim /etc/fstab
  158. 157 lsblk
  159. 158 blkid
  160. 159 blkid | grep p5
  161. 160 blkid | grep p5 | awk '{ print $2 }'
  162. 161 blkid | grep p5 | awk '{ print $2 }' >> /etc/fstab
  163. 162 vim /etc/fstab
  164. 163 mount -a
  165. 164 ls /part6
  166. 165 top
  167. 166 ps aux | grep zombie
  168. 167 kill -9 38339
  169. 168 ps aux | grep zombie
  170. 169 kill -SIGCHLD 38338
  171. 170 kill -9 38338
  172. 171 ps aux | grep zombie
  173. 172 dd if=/dev/zero of=/dev/null &
  174. 173 top
  175. 174 echo 0 > /sys/bus/cpu/devices/cpu1/online
  176. 175 top
  177. 176 nice --help | less
  178. 177 nice -20 sleep 100
  179. 178 echo 1 > /sys/bus/cpu/devices/cpu1/online
  180. 179 history
  181. 180 mount | grep proc
  182. 181 cd proc
  183. 182 cd /proc
  184. 183 ls
  185. 184 cd sys
  186. 185 ls
  187. 186 cd vm/
  188. 187 ls
  189. 188 sysctl -a
  190. 189 sysctl -a | wc
  191. 190 tuned-adm list
  192. 191 dnf install -y tuned
  193. 192 dnf install -y tuned-adm
  194. 193 tuned-adm --list
  195. 194 tuned-adm list
  196. 195 tuned-amd profile virtual-guest
  197. 196 tuned-adm profile virtual-guest
  198. 197 tuned-adm list
  199. 198 systemctl status tuned
  200. 199 cd /usr/lib/tuned/
  201. 200 ls
  202. 201 cd virtual-
  203. 202 cd virtual-guest/
  204. 203 ls
  205. 204 vim tuned.conf
  206. 205 pwd
  207. 206 ls -ld /etc/tuned
  208. 207 cd /etc/tuned
  209. 208 ls
  210. 209 mkdir sander
  211. 210 cp /usr/lib/tuned/latency-performance/tuned.conf sander/
  212. 211 tuned-adm list
  213. 212 tuned-adm profile sander
  214. 213 tuned-adm recommend
  215. 214 history
  216. 215 cd
  217. 216 history
  218. 217 ip link show
  219. 218 ip addr show
  220. 219 hostnamectl status
  221. 220 hostnamectl hostname server1.example.local
  222. 221 hostnamectl status
  223. 222 cat /etc/hostname
  224. 223 exit
  225. 224 vim /etc/hosts
  226. 225 ping google.com
  227. 226 vim /etc/nsswitch.conf
  228. 227 ping google.com
  229. 228 cat /etc/resolv.conf
  230. 229 nmtui
  231. 230 cd /etc/NetworkManager/
  232. 231 ls
  233. 232 cd system-connections/
  234. 233 ls
  235. 234 vim ens160.nmconnection
  236. 235 ip a
  237. 236 cd
  238. 237 systemctl -t help
  239. 238 systemctl list-unit-files
  240. 239 systemctl list-units
  241. 240 systemctl list-units -t timer
  242. 241 systemctl cat logrotate.timer
  243. 242 systemctl cat logrotate.service
  244. 243 systemctl cat logrotate.timer
  245. 244 systemctl status logrotate.timer
  246. 245 systemctl cat sshd.service
  247. 246 systemctl status sshd.service
  248. 247 kill -9 4660
  249. 248 systemctl status sshd.service
  250. 249 systemctl status sshd
  251. 250 dnf install -y httpd
  252. 251 service sshd status
  253. 252 systemctl status httpd
  254. 253 systemctl enable --now httpd
  255. 254 exit
  256. 255 history
  257. 256 fdisk /dev/nvme0n1
  258. 257 lslbk
  259. 258 lsblk
  260. 259 cat /proc/partitions
  261. 260 fdisk -l /dev/nvme0n1
  262. 261 mkfs.xfs /dev/nvme0n1p4
  263. 262 cd /boot
  264. 263 umount /dev/sda1
  265. 264 umount /boot
  266. 265 lsof /boot
  267. 266 findmnt
  268. 267 lsblk
  269. 268 blkid
  270. 269 mount | grep part6
  271. 270 tune2fs -L cow /dev/nvme0n1p5
  272. 271 mount LABEL=cow /mnt
  273. 272 vim /etc/fstab
  274. 273 fdisk /dev/nvme0n1
  275. 274 mkswap /dev/nvme0n1p6
  276. 275 free -m
  277. 276 vim /etc/fstab
  278. 277 swapon -a
  279. 278 free -m
  280. 279 history
  281. 280 dd if=/dev/zero of=/swapfile bs=1M count=1024
  282. 281 mkswap /swapfile
  283. 282 chmod 0600 /swapfile
  284. 283 vim /etc/fstab
  285. 284 swapon -a
  286. 285 free -m
  287. 286 cd
  288. 287 ./countdown 1
  289. 288 df -h
  290. 289 dd if=/dev/sr0 of=/rhel9.iso bs=1M
  291. 290 mkdir /repo
  292. 291 vim /etc/fstab
  293. 292 mount -a
  294. 293 ls /rhel9
  295. 294 ls /repo/
  296. 295 dnf install nmap
  297. 296 dnf config-manager -h | less
  298. 297 dnf config-manager --add-repo="file:///repo/BaseOS"
  299. 298 dnf config-manager --add-repo="file:///repo/AppStream"
  300. 299 dnf install nmap -y
  301. 300 cd /etc/yum.repos.d/
  302. 301 ls
  303. 302 vim repo_BaseOS.repo
  304. 303 vim repo_AppStream.repo
  305. 304 dnf install nmap -y
  306. 305 ssh student@192.168.29.147
  307. 306 history
  308. 307 cat repo_BaseOS.repo
  309. 308 cd
  310. 309 cat /etc/fstab
  311. 310 dnf list 'selinux*'
  312. 311 dnf search selinux
  313. 312 dnf provides */Containerfile
  314. 313 ls -l $(which dnf) $(which yum)
  315. 314 dnf groups list
  316. 315 dnf groups install "Virtualization Host"
  317. 316 dnf groups list hidden
  318. 317 history
  319. 318 dd if=/dev/nvme0n1 of=/dev/zero &
  320. 319 kill -USR1 37341
  321. 320 fg
  322. 321 dnf install -y git
  323. 322 git clone https://github.com/sandervanvugt/rhcsa
  324. 323 cd rhcsa/
  325. 324 ls
  326. 325 ./zombie
  327. 326 systemctl status httpd
  328. 327 exit
  329. 328 systemctl cat httpd.service
  330. 329 systemctl show httpd.service
  331. 330 systemctl edit httpd.service
  332. 331 export EDITOR=/usr/bin/vim
  333. 332 systemctl edit httpd.service
  334. 333 systemctl cat httpd.service
  335. 334 systemctl daemon-reload
  336. 335 systemctl status httpd
  337. 336 kill -9 40478
  338. 337 systemctl status httpd
  339. 338 man -k systemd | less
  340. 339 man systemd.directives
  341. 340 man systemd.unit
  342. 341 ./countdown 13 "break and practice"
  343. 342 history
  344. 343 top
  345. 344 killall dd
  346. 345 top
  347. 346 dnf install nginx -y
  348. 347 systemctl mask httpd
  349. 348 systemctl unmask httpd
  350. 349 systemctl mask nginx
  351. 350 systemctl start nginx
  352. 351 systemctl status sshd
  353. 352 journalctl
  354. 353 journalctl -p err
  355. 354 journalctl -f
  356. 355 journalctl -u sshd.service
  357. 356 cd /var/log
  358. 357 ls
  359. 358 ls -l
  360. 359 grep 'Storage' /etc/systemd/journald.conf
  361. 360 ls -l /var/log/journal
  362. 361 mkdir /var/log/journal
  363. 362 ls /var/log/journal/
  364. 363 systemctl restart systemd-journal-flush.service
  365. 364 ls
  366. 365 ls journal/
  367. 366 lsblk
  368. 367 gdisk /dev/nvme0n2
  369. 368 pvcreate /dev/nvme0n2p1
  370. 369 pvs
  371. 370 vgcreate vgdata /dev/nvme0n2p1
  372. 371 pvs
  373. 372 vgs
  374. 373 vgdisplay
  375. 374 lvcreate -n lvdata -L 2G vgdata
  376. 375 lvcreate -n lvdata -l 100%FREE vgdata
  377. 376 lvs
  378. 377 mkfs.ext4 /dev/vgdata/lvdata
  379. 378 mkdir /lvdata
  380. 379 vim /etc/fstab
  381. 380 mount -a
  382. 381 mount
  383. 382 ls -l /dev/mapper/vgdata-lvdata /dev/vgdata/lvdata
  384. 383 history
  385.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement