Advertisement
sandervanvugt

rhcsa sept19-23 day2

Sep 19th, 2023
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.85 KB | None | 0 0
  1. 1 free -m
  2. 2 lscpu
  3. 3 df -h
  4. 4 lsblk
  5. 5 vim countdown
  6. 6 chmod +x countdown
  7. 7 ./countdown 14
  8. 8 ./countdown 14 lab
  9. 9 tar -czvf /root/archive.tgz /etc
  10. 10 ls -l
  11. 11 file archive.tgz
  12. 12 tar -tvf archive.tgz
  13. 13 tar -czvf /root/archive.tgz /etc/
  14. 14 tar -tvf archive.tgz
  15. 15 tar -czvf /root/archive.tgz /etc/*
  16. 16 tar -tvf archive.tgz
  17. 17 rm archive.tgz
  18. 18 tar -czvf /root/archive.tgz /etc/*
  19. 19 tar -tvf archive.tgz
  20. 20 cd /etc
  21. 21 tar -czvf /root/archive.tgz .
  22. 22 tar -tvf /root/archive.tgz
  23. 23 cd
  24. 24 rm archive.tgz
  25. 25 tar -czvf /root/archive.tgz -C /etc
  26. 26 tar -czvf /root/archive.tgz -C /etc .
  27. 27 history
  28. 28 grep -v '^$' /etc/dnsmasq.conf
  29. 29 grep -v '^$' /etc/dnsmasq.conf | sort
  30. 30 history
  31. 31 useradd bob
  32. 32 find / -type f -user bob
  33. 33 mkdir /root/userfiles ; find / -type f -user bob -exec cp {} /root/userfiles/ \;
  34. 34 history
  35. 35 mkdir /root/userfiles ; find / -type f -user bob -exec cp {} /root/userfiles/ \; 2> errors.txt
  36. 36 cat errors.txt
  37. 37 uname -r
  38. 38 visudo
  39. 39 useradd linda
  40. 40 echo password | passwd --stdin linda
  41. 41 visudo
  42. 42 which useradd
  43. 43 which userdel
  44. 44 which passwd
  45. 45 su - linda
  46. 46 visudo
  47. 47 su - linda
  48. 48 visudo
  49. 49 id student
  50. 50 exit
  51. 51 visudo
  52. 52 history
  53. 53 man -k sander
  54. 54 touch hello
  55. 55 locate hello
  56. 56 updatedb
  57. 57 locate hello
  58. 58 touch goedemiddag
  59. 59 locate goedemiddag
  60. 60 less /etc/passwd
  61. 61 vim /etc/login.defs
  62. 62 useradd --help | less
  63. 63 cd /etc/skel/
  64. 64 touch lijk
  65. 65 useradd anna
  66. 66 ls -al /home/anna
  67. 67 tail /etc/passwd
  68. 68 ls -l /etc/passwd
  69. 69 tail /etc/shadow
  70. 70 man 5 shadow
  71. 71 cd
  72. 72 grep anna /etc/passwd
  73. 73 grep 1004 /etc/group
  74. 74 groupadd profs
  75. 75 usermod -aG profs anna
  76. 76 grep anna /etc/passwd
  77. 77 grep anna /etc/group
  78. 78 id anna
  79. 79 lid -g wheel
  80. 80 history
  81. 81 vim /etc/login.defs
  82. 82 cd /etc/skel
  83. 83 touch newfile
  84. 84 groupadd profs
  85. 85 groupadd students
  86. 86 useradd -G profs anna
  87. 87 usermod -aG profs anna
  88. 88 usermod -aG profs linda
  89. 89 usermod -aG students lisa
  90. 90 usermod -aG students linda
  91. 91 useradd -G profs anouk
  92. 92 vim /etc/group
  93. 93 for i in anna anouk linda lisa; do echo password | passwd --stdin $i; done
  94. 94 history
  95. 95 su - linda
  96. 96 ls -l /tmp/linda1
  97. 97 id linda
  98. 98 su - linda
  99. 99 chmod 077 /tmp/linda1
  100. 100 su - linda
  101. 101 mkdir -p /data/specials
  102. 102 chgrp sales /data/specials
  103. 103 chgrp student /data/specials
  104. 104 ls -ld /data/specials/
  105. 105 chmod g+w /data/specials
  106. 106 chmod g-w /data/specials
  107. 107 mkdir /data/specials/dir{1-9}
  108. 108 touch /data/specials/file{1-9}
  109. 109 ls -l /data/specials/
  110. 110 touch /data/specials/file[1-9]
  111. 111 ls -l /data/specials/
  112. 112 cd /data/specials/*
  113. 113 rm -fr /data/specials/*
  114. 114 touch /data/specials/file{1..9}
  115. 115 mkdir /data/specials/dir{1..}
  116. 116 ls -l /data/specials/
  117. 117 mkdir /data/specials/dir{1..9}
  118. 118 ls -l /data/specials/
  119. 119 chgrp students /data/specials/ -R
  120. 120 ls -l /data/specials/
  121. 121 chmod -R +w /data/specials/
  122. 122 chmod -R -x /data/specials/
  123. 123 ls -l /data/specials/
  124. 124 chmod -R +x /data/specials/
  125. 125 ls -l /data/specials/
  126. 126 chmod -R -x /data/specials/
  127. 127 chmod -R +X /data/specials/
  128. 128 ls -l /data/specials/
  129. 129 mkdir -p /data/profs /data/students
  130. 130 ls -l /data/
  131. 131 chown :profs /data/profs
  132. 132 chgrp student /data/students
  133. 133 ls -l /data/
  134. 134 chmod 770 /data/*
  135. 135 ls -k
  136. 136 ls -l
  137. 137 ls -l /data
  138. 138 chmod g+w,o-rx /data/profs
  139. 139 cd
  140. 140 touch /home/linda/rootfile
  141. 141 su - linda
  142. 142 touch /home/linda/stuck
  143. 143 chattr +i /home/linda/stuck
  144. 144 rm -f /home/linda/stuck
  145. 145 chattr -i /home/linda/stuck
  146. 146 su - anna
  147. 147 chmod g+s /data/profs
  148. 148 ls -ld /data/profs
  149. 149 su - anna
  150. 150 su - anouk
  151. 151 chmod +t /data/profs
  152. 152 su - anouk
  153. 153 chmod o+x /data/profs
  154. 154 ls -ld /data/profs
  155. 155 history
  156. 156 umask
  157. 157 su - linda
  158. 158 su - lisa
  159. 159 cd /data
  160. 160 ls -,
  161. 161 ls -l
  162. 162 chmod 3770 *
  163. 163 ls -l
  164. 164 chattr +i students/
  165. 165 cd students/
  166. 166 ls
  167. 167 touch student1
  168. 168 echo hello > hello
  169. 169 exit
  170. 170 ./countdown 12
  171. 171 ./countdown 1
  172. 172 ./countdown 15
  173. 173 ./countdown 13
  174. 174 chattr -i /data/students/
  175. 175 poweroff
  176. 176 lsblk
  177. 177 fdisk /dev/sda
  178. 178 lsblk
  179. 179 mount /dev/sda3 /mnt
  180. 180 mkfs.ext4 /dev/sda3
  181. 181 mount /dev/sda3 /mnt
  182. 182 cd /mnt
  183. 183 ls
  184. 184 cp /etc/hosts .
  185. 185 history
  186. 186 cd
  187. 187 lsblk
  188. 188 mount
  189. 189 findmnt
  190. 190 lsblk
  191. 191 cd .mnt
  192. 192 cd /mnt
  193. 193 umount /dev/sda3
  194. 194 lsof /mnt
  195. 195 cd
  196. 196 fdisk /dev/sda
  197. 197 cat /proc/partitions
  198. 198 lsblk
  199. 199 mkfs.ext4 /dev/sda5
  200. 200 mkfs.xfs /dev/sda6
  201. 201 mkdir /ext4 /xfs
  202. 202 vim /etc/fstab
  203. 203 mount -a
  204. 204 mount
  205. 205 lsblk
  206. 206 reboot
  207. 207 lsblk
  208. 208 vim /etc/default/grub
  209. 209 grub2-mkconfig -o /boot/grub2/grub.cfg
  210. 210 vim /etc/default/grub
  211. 211 cat /etc/redhat-release
  212. 212 findmnt --help
  213. 213 cat /etc/redhat-release
  214. 214 man fstab
  215. 215 history
  216. 216 umount /dev/sda5
  217. 217 vim /etc/fstab
  218. 218 fdisk /dev/sda
  219. 219 reboot
  220. 220 lsblk
  221. 221 cat /etc/fstab
  222. 222 blkid
  223. 223 blkid | awk '/sda5/ { print $2 }'
  224. 224 blkid | awk '/sda5/ { print $2 }' >> /etc/fstab
  225. 225 vim /etc/fstab
  226. 226 reboot
  227. 227 history
  228. 228 tune2fs --help
  229. 229 mount | grep ext
  230. 230 xfs_admin --help
  231. 231 xfs_admin -L data /dev/sda5
  232. 232 umount /dev/sda5
  233. 233 xfs_admin -L data /dev/sda5
  234. 234 vim /etc/fstab
  235. 235 grep LABEL /etc/fstab
  236. 236 mount -a
  237. 237 blkid
  238. 238 free -m
  239. 239 reboot
  240. 240 free -m
  241. 241 grep -i active /proc/meminfo
  242. 242 free -m
  243. 243 fdisk /dev/sda
  244. 244 mkswap /dev/sda6
  245. 245 blkid
  246. 246 blkid | awk '/sda6/ { print $2 }'
  247. 247 blkid | awk '/sda6/ { print $2 }' >> /etc/fstab
  248. 248 vim /etc/fstab
  249. 249 free -m
  250. 250 swapon -a
  251. 251 free -m
  252. 252 reboot
  253. 253 fdisk -l /dev/sda
  254. 254 xxd -l 512 /dev/sda
  255. 255 history
  256. 256 dnf install nmap
  257. 257 ls -l $(which dnf) $(which yum)
  258. 258 df -h
  259. 259 dd if=/dev/sr0 of=/rhel9.iso bs=1M
  260. 260 mkdir /repo
  261. 261 echo "/rhel9.iso /repo iso9660 defaults 0 0" >> /etc/fstab
  262. 262 cat /etc/fstab
  263. 263 vim /etc/fstab
  264. 264 mount -a
  265. 265 mount
  266. 266 cd /repo
  267. 267 ls
  268. 268 ls BaseOS/
  269. 269 dnf config-manager --add-repo="file:///repo/BaseOS"
  270. 270 dnf config-manager --add-repo="file:///repo/AppStream"
  271. 271 dnf repolist
  272. 272 dnf search nmap
  273. 273 dnf install nmap
  274. 274 cd /etc/yum.repos.d/
  275. 275 ls
  276. 276 vim repo_BaseOS.repo
  277. 277 vim repo_AppStream.repo
  278. 278 dnf install nmap
  279. 279 history
  280. 280 dnf list selinux*
  281. 281 dnf provides */Containerfile
  282. 282 cd ..
  283. 283 dnf provides */dnsmasq.conf
  284. 284 seinfo
  285. 285 dnf groups list
  286. 286 dnf goups install "Virtualization Host"
  287. 287 dnf groups install "Virtualization Host"
  288. 288 cat yum.repos.d/repo_BaseOS.repo
  289. 289 systemctl enable --now tuned
  290. 290 systemctl status tuned
  291. 291 tuned-adm list
  292. 292 sysctl -a
  293. 293 sysctl -a | wc -l
  294. 294 sysctl -a | grep swappi
  295. 295 echo vm.swappiness = 33 > /etc/sysctl.d/swappiness.conf
  296. 296 sysctl -p /etc/sysctl.d/swappiness.conf
  297. 297 sysctl -a | grep swappi
  298. 298 mkdir /etc/tune/myprofile
  299. 299 mkdir /etc/tuned/myprofile
  300. 300 vim /etc/tuned/myprofile/tuned.conf
  301. 301 tuned-adm list
  302. 302 vim /usr/lib/tuned/latency-performance/tuned.conf
  303. 303 tuned-adm profile myprofile
  304. 304 sysctl -a | grep swapp
  305. 305 vim /etc/tuned/tuned-main.conf
  306. 306 tuned-adm list
  307. 307 systemctl status tuned
  308. 308 tuned-adm profile hpc-compute
  309. 309 tuned-adm list
  310. 310 history
  311. 311 cd
  312. 312 ip a
  313. 313 ping nu.nl
  314. 314 ip route show
  315. 315 cat /etc/resolv.conf
  316. 316 systemctl status NetworkManager
  317. 317 nmtui
  318. 318 ip a
  319. 319 ping nu.nl
  320. 320 man nmcli-examples
  321. 321 dnf install -y git
  322. 322 git clone https://github.com/sandervanvugt/rhcsa
  323. 323 cd rhcsa
  324. 324 ls
  325. 325 cat resources.txt
  326. 326 reboot
  327. 327 hwclock
  328. 328 date
  329. 329 hwclock --systohc
  330. 330 date -s 17:46
  331. 331 timedatectl set-time -h
  332. 332 systemctl status chronyd.service
  333. 333 vim /etc/chrony.conf
  334. 334 systemctl restart chronyd
  335. 335 chronyc sources
  336. 336 systemctl status firewalld
  337. 337 firewall-cmd --list-all
  338. 338 firewall-cmd --get-services
  339. 339 firewall-cmd --add-service sane
  340. 340 firewall-cmd --list-all
  341. 341 firewall-cmd --add-service sane --permanent
  342. 342 history
  343.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement