Advertisement
sandervanvugt

rhcsa2 day2 july22

Jul 19th, 2022
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.17 KB | None | 0 0
  1. root@localhost ~]# xxd /dev/sda8 | less
  2. [root@localhost ~]# history
  3. 1 vim countdown
  4. 2 chmod +x countdown
  5. 3 ./countdown 14
  6. 4 vim countdown
  7. 5 ./countdown 14
  8. 6 tar -czf /root/archive.tgz /etc
  9. 7 ls -l archive.tgz
  10. 8 file archive.tgz
  11. 9 tar tvf archive.tgz
  12. 10 history
  13. 11 grep -v '^$' /etc/dnsmasq.conf | sort > /var/tmp/dnslines.txt
  14. 12 echo $USER
  15. 13 useradd bob
  16. 14 find / -user bob
  17. 15 mkdir /root/userfiles ; find / -user bob -exec cp {} /root/userfiles/ \;
  18. 16 find / -user bob
  19. 17 find / -user bob -t file
  20. 18 find / -user bob
  21. 19 find / -user bob -type f
  22. 20 visudo
  23. 21 useradd lisa
  24. 22 passwd lisa
  25. 23 visudo
  26. 24 su - lisa
  27. 25 visudo
  28. 26 su - lisa
  29. 27 ls -ld /etc/sudoers.d/
  30. 28 ls -l /etc/sudoers.d/
  31. 29 vim /etc/sudoers.d/bob
  32. 30 visudo
  33. 31 man visudo
  34. 32 visudo
  35. 33 ./countdown 12
  36. 34 tail /etc/shadow
  37. 35 usermod -L bob
  38. 36 tail /etc/shadow
  39. 37 passwd --help
  40. 38 passwd -u bob
  41. 39 tail /etc/shadow
  42. 40 vim /etc/passwd
  43. 41 vim /etc/login.defs
  44. 42 echo $(( 99999 / 365 ))
  45. 43 vim /etc/login.defs
  46. 44 useradd --help | less
  47. 45 groupadd sales
  48. 46 usermod -aG sales student
  49. 47 exit
  50. 48 lid -g wheel
  51. 49 lid sales
  52. 50 lid -g sales
  53. 51 chage bob
  54. 52 vim /etc/login.defs
  55. 53 cd /etc/skel/
  56. 54 ls -a
  57. 55 echo hidem > .hiddenfile
  58. 56 echo hello > hellofile
  59. 57 ls -a
  60. 58 for i in anna anouk linda lisa; do useradd $i; done
  61. 59 tail /etc/shadow
  62. 60 usermod --help
  63. 61 usermod -s /sbin/nologin linda
  64. 62 usermod -s /sbin/nologin lisa
  65. 63 groupadd students
  66. 64 groupadd profs
  67. 65 usermod -aG profs anna
  68. 66 usermod -aG profs anouk
  69. 67 id anna
  70. 68 usermod -aG wheel anna
  71. 69 id anna
  72. 70 usermod -G wheel anna
  73. 71 id anna
  74. 72 history
  75. 73 usermod -s /bin/bash linda
  76. 74 usermod -s /bin/bash lisa
  77. 75 usermod -aG students linda
  78. 76 usermod -aG students lisa
  79. 77 cd
  80. 78 ./countdown 12
  81. 79 tail /etc/group
  82. 80 usermod -aG profs anna
  83. 81 tail /etc/group
  84. 82 cd
  85. 83 mkdir /data/profs /data/students
  86. 84 mkdir -p /data/profs /data/students
  87. 85 cd /data
  88. 86 ls -l
  89. 87 chown anna:profs profs
  90. 88 chgrp student students/
  91. 89 ls -l
  92. 90 chmod 770 profs
  93. 91 ls -l
  94. 92 chmod g+w,o-rx students/
  95. 93 ls -l
  96. 94 cd
  97. 95 chmod -x countdown
  98. 96 cat countdown
  99. 97 ./countdown
  100. 98 ls -l countdown
  101. 99 chmod +x countdown
  102. 100 ls -l countdown
  103. 101 history
  104. 102 cd /data/profs/
  105. 103 su - anna
  106. 104 chmod g+s .
  107. 105 ls -ld .
  108. 106 su - anna
  109. 107 su - anouk
  110. 108 chmod +t .
  111. 109 ls -ld .
  112. 110 su - anouk
  113. 111 su - anna
  114. 112 history
  115. 113 cd
  116. 114 cd /home/linda
  117. 115 touch rootfile
  118. 116 ls -l
  119. 117 su - linda
  120. 118 umask
  121. 119 vim /etc/bashrc
  122. 120 pwd
  123. 121 vim .bashrc
  124. 122 ls -a
  125. 123 vim .bash_profile
  126. 124 cd
  127. 125 lsblk
  128. 126 poweroff
  129. 127 lsblk
  130. 128 cat /proc/partitions
  131. 129 ./countdown 12
  132. 130 lsblk
  133. 131 fdisk /dev/sda
  134. 132 lsblk
  135. 133 mkfs.xfs /dev/sda3
  136. 134 mount /dev/sda3 /mnt
  137. 135 lsblk
  138. 136 mount
  139. 137 df -h
  140. 138 cd /mnt
  141. 139 touch hellofile
  142. 140 umount /mnt
  143. 141 lsof /mnt
  144. 142 cd
  145. 143 umount /mnt
  146. 144 mount /dev/sda3 /mnt
  147. 145 mount
  148. 146 mount | grep '^/'
  149. 147 mkdir /mountpoint
  150. 148 vim /etc/fstab
  151. 149 mount -a
  152. 150 findmnt --verify
  153. 151 reboot
  154. 152 fdisk /dev/sda
  155. 153 lsblk
  156. 154 mkdir /ext4 /xfs
  157. 155 mkfs.ext4 /dev/sda5
  158. 156 mkfs.xfs /dev/sda6
  159. 157 vim /etc/fstab
  160. 158 fdisk /dev/sda
  161. 159 reboot
  162. 160 cat /etc/fstab
  163. 161 lsblk
  164. 162 blkid
  165. 163 blkid | grep sda5 | awk '{ print $2 }'
  166. 164 blkid | grep sda5 | awk '{ print $2 }' >> /etc/fstab
  167. 165 vim fstab
  168. 166 vim /etc/fstab
  169. 167 reboot
  170. 168 history
  171. 169 cat /etc/fstab
  172. 170 blkid
  173. 171 mount | grep '^/'
  174. 172 xfs_admin --help
  175. 173 xfs_admin -L koeien /dev/sda5
  176. 174 umount /dev/sda5
  177. 175 xfs_admin -L koeien /dev/sda5
  178. 176 vim /etc/fstab
  179. 177 lsblk
  180. 178 fdisk /dev/sda
  181. 179 mkswap /dev/sda6
  182. 180 vim /etc/fstab
  183. 181 free -m
  184. 182 swapon -a
  185. 183 free -m
  186. 184 history
  187. 185 swapon -s
  188. 186 fdisk /dev/sda
  189. 187 reboot
  190. 188 lsblk
  191. 189 fdisk -l /dev/sda
  192. 190 echo $(( 62914559 - 54530047 ))
  193. 191 echo $(( 8384512 / 2 ))
  194. 192 df -h
  195. 193 ls
  196. 194 vim /etc/systemd/system/stress1.service
  197. 195 cp /etc/systemd/system/stress1.service /etc/systemd/system/stress2.service
  198. 196 systemctl daemon-reload
  199. 197 systemctl start stress1.service
  200. 198 systemctl start stress2.service
  201. 199 top
  202. 200 echo 0 > /sys/bus/cpu/devices/cpu1/online
  203. 201 top
  204. 202 nice --help
  205. 203 nice -n 10 dd if=/dev/zero of=/dev/null
  206. 204 nice -n 10 dd if=/dev/zero of=/dev/null &
  207. 205 nice -n -5 dd if=/dev/zero of=/dev/null &
  208. 206 top
  209. 207 history
  210. 208 sysctl -a
  211. 209 sysctl -a | wc
  212. 210 systemctl status tuned
  213. 211 ip a
  214. 212 ip addr add dev ens160 10.0.0.24/16
  215. 213 ip a
  216. 214 ifconfig
  217. 215 man ifconfig
  218. 216 ip route show
  219. 217 nmtui
  220. 218 ip a
  221. 219 ping nu.nl
  222. 220 ./countdown 12
  223. 221 vim /etc/bashrc
  224. 222 rpm -qa
  225. 223 rpm -qf /etc/dnsmasq.conf
  226. 224 rpm -qc dnsmasq
  227. 225 df -h
  228. 226 dd if=/dev/sr0 of=/rhel9.iso bs=1M
  229. 227 mkdir /repo
  230. 228 echo "/rhel9.iso /repo iso9660 defaults 0 0" >> /etc/fstab
  231. 229 mount -a
  232. 230 ls /repo
  233. 231 cd /repo/BaseOS/
  234. 232 ls
  235. 233 ls Packages/
  236. 234 ls
  237. 235 ls repodata/
  238. 236 cd ../AppStream/
  239. 237 ls
  240. 238 cd
  241. 239 cd /etc/yum.repos.d/
  242. 240 ls
  243. 241 vim baseos.repo
  244. 242 dnf repolist
  245. 243 vim appstream.repo
  246. 244 dnf repolist
  247. 245 vim appstream.repo
  248. 246 pwd
  249. 247 cat baseos.repo
  250. 248 cat appstream.repo
  251. 249 history | tail -15
  252. 250 vim baseos.repo
  253. 251 vim appstream.repo
  254. 252 dnf install nmap
  255. 253 vim appstream.repo
  256. 254 vim baseos.repo
  257. 255 dnf install tuned
  258. 256 ls *
  259. 257 ls
  260. 258 pwd
  261. 259 dnf list selinux*
  262. 260 dnf search seinfo
  263. 261 dnf search all seinfo
  264. 262 dnf provides */Containerfile
  265. 263 cd
  266. 264 dnf groups list
  267. 265 dnf group install "Virtualization Host"
  268. 266 dnf history
  269. 267 history
  270. 268 history | tail -30
  271. 269 history | tail -30 | head -25
  272. 270 cat /etc/yum.repos.d/baseos.repo
  273. 271 cat /etc/yum.repos.d/appstream.repo
  274. 272 systemctl -t help
  275. 273 systemctl list-units -t service
  276. 274 systemctl cat stress1.service
  277. 275 cd /etc/systemd/system/
  278. 276 cp stress1.service sleep.service
  279. 277 vim sleep.service
  280. 278 systemctl start sleep.service
  281. 279 systemctl status sleep.service
  282. 280 systemctl status sshd
  283. 281 dnf install httpd
  284. 282 ls -l $(which dnf) $(which yum)
  285. 283 systemctl status httpd
  286. 284 systemctl start httpd
  287. 285 systemctl status httpd
  288. 286 systemctl enable httpd
  289. 287 systemctl status httpd
  290. 288 systemctl cat sshd.service
  291. 289 systemctl cat httpd.service
  292. 290 systemctl edit httpd.service
  293. 291 export SYSTEMD_EDITOR=/usr/bin/vim
  294. 292 systemctl edit httpd.service
  295. 293 systemctl status httpd.service
  296. 294 systemctl daemon-reload
  297. 295 kill -9 38511
  298. 296 systemctl status httpd.service
  299. 297 vimtutor
  300. 298 vim .bashrc
  301. 299 ls -ld /etc/systemd/system /usr/lib/systemd/system
  302. 300 ls -ld /etc/tuned /usr/lib/tuned
  303. 301 systemctl show httpd.service
  304. 302 man systemd.directives
  305. 303 man systemd.unit
  306. 304 systemctl list-dependencies
  307. 305 history
  308. 306 systemctl mask httpd
  309. 307 systemctl status httpd
  310. 308 systemctl stop httpd
  311. 309 systemctl daemon-reload
  312. 310 systemctl stop httpd
  313. 311 systemctl unmask httpd
  314. 312 systemctl stop httpd
  315. 313 systemctl mask httpd
  316. 314 systemctl start httpd
  317. 315 history
  318. 316 journalctl
  319. 317 journalctl -o verbose
  320. 318 journalctl -xb
  321. 319 grep 'Storage=' /etc/systemd/journald.conf
  322. 320 mkdir /var/log/journal
  323. 321 systemctl list-unit-files journal*
  324. 322 systemctl list-unit-files journal
  325. 323 cd /var/log
  326. 324 mkdir journal
  327. 325 ls journal/
  328. 326 systemctl restart systemd-journal-flush.service
  329. 327 ls journal/
  330. 328 cd /etc/logrotate.d/
  331. 329 cd ..
  332. 330 vim logrotate.conf
  333. 331 cd
  334. 332 dnf install tuned
  335. 333 systemctl status tuned
  336. 334 systemctl start tuned
  337. 335 systemctl status tuned
  338. 336 tuned-adm list
  339. 337 tuned-adm pprofile balanced
  340. 338 tuned-adm profile balanced
  341. 339 tuned-adm list
  342. 340 vim /usr/lib/tuned/balanced/tuned.conf
  343. 341 tuned-adm profile virtual-guest
  344. 342 top
  345. 343 echo 1 > /sys/bus/cpu/devices/cpu1/online
  346. 344 top
  347. 345 lsblk
  348. 346 fdisk /dev/sda
  349. 347 pvcreate /dev/sda8
  350. 348 pvs
  351. 349 vgcreate vgdata /dev/sda8
  352. 350 pvs
  353. 351 vgs
  354. 352 lvcreate -n lvdata -L 500M vgdata
  355. 353 lvs
  356. 354 vgs
  357. 355 pvs
  358. 356 mkfs.ext4 /dev/vgdata/lvdata
  359. 357 vim /etc/fstab
  360. 358 mount -a
  361. 359 mkdir /lvdata
  362. 360 mount -a
  363. 361 mount
  364. 362 ls -l /dev/mapper/vgdata-lvdata /dev/vgdata/lvdata
  365. 363 history
  366. 364 vgs
  367. 365 vgdisplay
  368. 366 xxd /dev/sda8 | less
  369. 367 history
  370.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement