Advertisement
sandervanvugt

RHCSA day2 feb24

Feb 7th, 2024
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.08 KB | None | 0 0
  1. [root@rhcsalabs ~]# history
  2. 1 dnf install nmap -y
  3. 2 vim countdown.sh
  4. 3 chmod +x countdown.sh
  5. 4 ./countdown.sh 19
  6. 5 tar zcvf /root/archive.tgz /etc
  7. 6 ls -l
  8. 7 tar tvf archive.tgz
  9. 8 tar zcvf /root/archive.tgz -C /etc
  10. 9 tar zcvf /root/archive.tgz -C /etc .
  11. 10 tar tvf archive.tgz
  12. 11 cd /etc
  13. 12 tar -cvzf /root/archive.tgz .
  14. 13 history
  15. 14 cut -d : -f 1 /etc/passwd
  16. 15 cat /etc/passwd
  17. 16 cut -d : -f 1 /etc/passwd | sort
  18. 17 cut -d : -f 1 /etc/passwd | sort | grep -v '^$'
  19. 18 cut -d : -f 1 /etc/passwd | sort | grep -v '^$' >/var/tmp/users
  20. 19 cat /var/tmp/users
  21. 20 man cut
  22. 21 man sort
  23. 22 sort -b /etc/passwd
  24. 23 sort -b /etc/passwd | cut -d : -f 1
  25. 24 cd
  26. 25 useradd bob
  27. 26 mkdir userfiles
  28. 27 find / -user "bob" -type f
  29. 28 find / -user "bob" -type f -exec cp {} /root/userfiles \; 2>/dev/null
  30. 29 ls -al /root/userfiles/
  31. 30 history
  32. 31 ls -l $(which yum) $(which dnf)
  33. 32 DNF
  34. 33 dnf install nmap
  35. 34 df -h
  36. 35 dd if=/dev/sr0 of=/rhel9.iso bs=1M
  37. 36 mkdir /repo
  38. 37 vim /etc/fstab
  39. 38 mount -a
  40. 39 ls /repo
  41. 40 cd /repo
  42. 41 ls BaseOS/
  43. 42 ls BaseOS/Packages/
  44. 43 cd
  45. 44 history
  46. 45 lsblk
  47. 46 dnf config-manager --add-repo="file:///repo/AppStream"
  48. 47 dnf config-manager --add-repo="file:///repo/BaseOS"
  49. 48 dnf repolist
  50. 49 dnf search nmap
  51. 50 dnf install nmap
  52. 51 cd /etc/yum.repos.d/
  53. 52 ls
  54. 53 vim repo_BaseOS.repo
  55. 54 vim repo_AppStream.repo
  56. 55 history
  57. 56 dnf install nmap
  58. 57 history
  59. 58 tail -1 /etc/fstab
  60. 59 cd /repo/AppStream/Packages/
  61. 60 ls
  62. 61 cd
  63. 62 dnf install -y git
  64. 63 git clone https://github.com/sandervanvugt/rhcsa9
  65. 64 cd rhcsa9/
  66. 65 ls
  67. 66 cd labs/
  68. 67 ls
  69. 68 ./live-lab1-grade.sh
  70. 69 vim live-lab1-grade.sh
  71. 70 history
  72. 71 dnf groups list
  73. 72 dnf groups install "Development Tools"
  74. 73 history
  75. 74 cd
  76. 75 ./countdown.sh 13
  77. 76 history
  78. 77 lsblk
  79. 78 exit
  80. 79 ./countdown.sh 12
  81. 80 ./countdown.sh 1
  82. 81 ./countdown.sh 13
  83. 82 ./countdown.sh 15
  84. 83 visudo
  85. 84 tail -1 /etc/passwd
  86. 85 id bob
  87. 86 su - bob
  88. 87 passwd bob
  89. 88 su - bob
  90. 89 journalctl
  91. 90 usermod -aG wheel bob
  92. 91 su - bob
  93. 92 visudo
  94. 93 useradd linda
  95. 94 echo password | passwd --stdin linda
  96. 95 su - linda
  97. 96 visudo
  98. 97 su - linda
  99. 98 history
  100. 99 #find / -name ".bash_history" -type f -exec rm -f {} \;
  101. 100 dnf repolist
  102. 101 ps aux | less
  103. 102 less /etc/passwd
  104. 103 usermod --help
  105. 104 vim /etc/login.defs
  106. 105 cd /etc/skel
  107. 106 ls
  108. 107 ls -a
  109. 108 touch hello
  110. 109 ls -a
  111. 110 useradd sander
  112. 111 ls -al /home/sander
  113. 112 cd
  114. 113 less /etc/passwd
  115. 114 id bob
  116. 115 grep bob /etc/passwd
  117. 116 grep bob /etc/group
  118. 117 lid wheel
  119. 118 lid -g wheel
  120. 119 useradd -g wheel baduser
  121. 120 id baduser
  122. 121 grep wheel /etc/group
  123. 122 grep baduser /etc/passwd
  124. 123 lid -g wheel
  125. 124 chage bob
  126. 125 history
  127. 126 cd rhcsa9/labs/
  128. 127 ls
  129. 128 vim live-lab2-grade.sh
  130. 129 ./live-lab2-grade.sh
  131. 130 vim /etc/login.defs
  132. 131 touch /etc/skel/newfile
  133. 132 groupadd profs
  134. 133 groupadd students
  135. 134 useradd -G students linda
  136. 135 useradd -G students lisa
  137. 136 usermod -aG students linda
  138. 137 useradd -G profs anna
  139. 138 useradd -G profs anouk
  140. 139 history | grep git
  141. 140 ./live-lab2-grade.sh
  142. 141 ls -l
  143. 142 cd /home/linda
  144. 143 echo linda > lindafile
  145. 144 ls -l lindafile
  146. 145 chmod u-rw
  147. 146 chmod u-rw linda
  148. 147 chmod u-rw lindafile
  149. 148 chown linda lindafile
  150. 149 ls -l lindafile
  151. 150 su - linda
  152. 151 cd
  153. 152 cd /etc/skel
  154. 153 mkdir tryme
  155. 154 chmod 2770 tryme
  156. 155 useradd pablo
  157. 156 ls -l pabl
  158. 157 ls -l /home/pablo
  159. 158 mkdir -p /data/profs /data/students
  160. 159 cd /data
  161. 160 ls -l
  162. 161 id
  163. 162 chown :profs profs
  164. 163 ls -l
  165. 164 chgrp students students
  166. 165 ls -l
  167. 166 chmod 770 students
  168. 167 ls -l
  169. 168 chmod g+w,o-rx profs
  170. 169 ls -l
  171. 170 su - anna
  172. 171 chmod g+s /data/profs
  173. 172 ls -ld /data/profs
  174. 173 su - anna
  175. 174 su - anouk
  176. 175 chmod +t /data/profs
  177. 176 su - anouk
  178. 177 chmod g-x,o+x /data/profs
  179. 178 ls -ld /data/profs
  180. 179 chmod g+x,o-x /data/profs
  181. 180 cd /profs
  182. 181 cd profs
  183. 182 mkdir one two three
  184. 183 for i in one two three; do touch $i/four; done
  185. 184 for i in one two three; do touch $i/five; done
  186. 185 tree
  187. 186 ls -lR
  188. 187 chmod -R g+s .
  189. 188 ls -lR
  190. 189 chmod -R g-s .
  191. 190 find . -type d
  192. 191 find . -type d -exec chmod g+s {} \;
  193. 192 ls -lR
  194. 193 history
  195. 194 who; find . -exec ls -l {} \;
  196. 195 umask
  197. 196 touch '-'
  198. 197 ls -l
  199. 198 echo hello > \-
  200. 199 ls
  201. 200 rm \-
  202. 201 rm -- \-
  203. 202 cd
  204. 203 history
  205. 204 poweroff
  206. 205 echo h > /proc/sysrq-trigger
  207. 206 dmesg
  208. 207 ls -l /data
  209. 208 rm -rf /data
  210. 209 mkdir -p /data/profs /data/students
  211. 210 cd /data
  212. 211 chgrp students students
  213. 212 chgrp profs profs
  214. 213 ls -l
  215. 214 chmod 770 *
  216. 215 ls -l
  217. 216 umask
  218. 217 cd /etc/
  219. 218 vim bashrc
  220. 219 cd /etc/profile.d/
  221. 220 ls
  222. 221 echo $UID
  223. 222 exit
  224. 223 vim umask.sh
  225. 224 grep 1005 /etc/passwd
  226. 225 grep 1004 /etc/passwd
  227. 226 cat /etc/passwd
  228. 227 su - lisa
  229. 228 lsblk
  230. 229 cat /proc/partitions
  231. 230 df -h
  232. 231 lsblk
  233. 232 poweroff
  234. 233 lsblk
  235. 234 blkid
  236. 235 cat /etc/fstab
  237. 236 touch ff
  238. 237 mount -o remount,rw /
  239. 238 touch ff
  240. 239 blkid | awk '/sda5/ { print $2 }'
  241. 240 blkid | awk '/sda5/ { print $2 }' >> /etc/fstab
  242. 241 vim /etc/fstab
  243. 242 mount -a
  244. 243 lsblk
  245. 244 reboot
  246. 245 #systemd.unit=emergency.target
  247. 246 history
  248. 247 ls /dev/disk/
  249. 248 ls /dev/disk/by-uuid/
  250. 249 ls /dev/disk/by-uuid/ -l
  251. 250 free -m
  252. 251 fdisk /dev/sda
  253. 252 mkswap -L myswap /dev/sda7
  254. 253 free -m
  255. 254 vim /etc/fstab
  256. 255 swapon -a
  257. 256 free -m
  258. 257 history
  259. 258 cd rhcsa9/
  260. 259 git pull
  261. 260 cd labs/
  262. 261 ls
  263. 262 ls -l
  264. 263 systemctl list-units
  265. 264 systemctl status vmtoolsd.service
  266. 265 systemctl status sshd.service
  267. 266 cd
  268. 267 dnf install -yn httpd
  269. 268 dnf install -y httpd
  270. 269 systemctl status httpd.service
  271. 270 systemctl enable --now httpd
  272. 271 systemctl status httpd.service
  273. 272 systemctl -t help
  274. 273 systemctl list-units -t mounts
  275. 274 systemctl list-units -t mount
  276. 275 systemctl cat ext4.mount
  277. 276 systemctl cat -.mount
  278. 277 systemctl cat -- -.mount
  279. 278 systemctl status sshd
  280. 279 kill -9 1080
  281. 280 systemctl status sshd
  282. 281 systemctl cat sshd.service
  283. 282 systemctl edit httpd.service
  284. 283 export EDITOR=/usr/bin/vim
  285. 284 systemctl cat httpd.service
  286. 285 systemctl cat sshd.service
  287. 286 systemctl cat httpd.service
  288. 287 systemctl show httpd.service
  289. 288 man systemd.directives
  290. 289 man systemd.resource-control
  291. 290 systemctl daemon-reload
  292. 291 systemctl disable --now httpd
  293. 292 systemctl mask httpd
  294. 293 systemctl start httpd.service
  295. 294 systemctl unmask httpd.service
  296. 295 systemctl start httpd.service
  297. 296 systemctl stop httpd.service
  298. 297 systemctl status httpd
  299. 298 journalctl
  300. 299 journalctl -x
  301. 300 journalctl -xb
  302. 301 journalctl -p err
  303. 302 grep 'Storage=' /etc/systemd/journald.conf
  304. 303 mkdir /var/log/journal
  305. 304 ls -l /var/log/journal/
  306. 305 systemctl daemon-reload
  307. 306 ls -l /var/log/journal/
  308. 307 systemctl restart systemd-journal-flush
  309. 308 ls -l /var/log/journal/
  310. 309 history
  311. 310 cd rhcsa9/
  312. 311 ls
  313. 312 cd
  314. 313 dd if=/dev/zero of=/dev/null &
  315. 314 top
  316. 315 echo 0 > /sys/bus/cpu/devices/cpu1/online
  317. 316 lscpu | less
  318. 317 top
  319. 318 renice --help | less
  320. 319 renice -n 5 -p 9944
  321. 320 top
  322. 321 nice --help
  323. 322 nice -n -5 dd if=/dev/zero of=/dev/null &
  324. 323 top
  325. 324 killall dd
  326. 325 history
  327. 326 echo 1 > /sys/bus/cpu/devices/cpu1/online
  328. 327 tuned-adm list
  329. 328 tuned-adm active
  330. 329 tuned-adm recommend
  331. 330 tuned-adm profile balanced
  332. 331 tuned-adm active
  333. 332 history
  334. 333 systemctl status tuned
  335. 334 echo vm.swappiness = 33 > /etc/sysctl.d/swappiness.conf
  336. 335 sysctl -a
  337. 336 sysctl -a | wc -l
  338. 337 sysctl -a | grep swappi
  339. 338 sysctl -p /etc/sysctl.d/swappiness.conf
  340. 339 sysctl -a | grep swappi
  341. 340 ls -l /usr/lib/tuned/
  342. 341 less /usr/lib/tuned/desktop/tuned.conf
  343. 342 mkdir /etc/tuned/myprofile
  344. 343 vim /etc/tuned/myprofile/tuned.conf
  345. 344 tuned-adm list
  346. 345 tuned-adm profile myprofile
  347. 346 tuned-adm active
  348. 347 sysctl -a | grep swappi
  349. 348 vim /etc/tuned/tuned-main.conf
  350. 349 ip a
  351. 350 systemctl status NetworkManager
  352. 351 nmtui
  353. 352 ip a
  354. 353 exit
  355. 354 ./countdown.sh 16
  356. 355 ./countdown.sh 14
  357. 356 cd /etc/NetworkManager/system-connections/
  358. 357 ls
  359. 358 cat ens160.nmconnection
  360. 359 cd
  361. 360 reboot
  362. 361 exit
  363. 362 history
  364.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement