Advertisement
sandervanvugt

RHCSA nov23 day2

Nov 7th, 2023
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.12 KB | None | 0 0
  1. 1 cd /etc
  2. 2 cd -
  3. 3 tar -czvf /root/archive.tgz /etc/
  4. 4 tar tvf archive.tgz | less
  5. 5 tar -czvf /root/archive.tgz -C /etc/ .
  6. 6 tar tvf archive.tgz | less
  7. 7 history
  8. 8 sort /etc/dnsmasq.conf | sed '/^[\s]*$/d'
  9. 9 cat /etc/dnsmasq.conf | grep -v '^$' | sort
  10. 10 cat /etc/dnsmasq.conf | grep -v '^$' | sort > /var/tmp/dnslines.txt
  11. 11 history
  12. 12 useradd bob
  13. 13 su - bob
  14. 14 mkdir /root/userfiles
  15. 15 find / -type f -user bob
  16. 16 find / -type f -user bob -exec cp -p {} /root/userfiles/ \;
  17. 17 ls -al /root/userfiles/
  18. 18 history
  19. 19 vim /home/student/countdown
  20. 20 /home/student/countdown
  21. 21 find / -type f -user bob
  22. 22 find / -type f -user bob > /root/newfile
  23. 23 cat newfile
  24. 24 cp --help | less
  25. 25 echo $PATH
  26. 26 ln /home/student/countdown /usr/bin/countdown
  27. 27 man -k user
  28. 28 man man
  29. 29 man apropos
  30. 30 man mandb
  31. 31 mandb
  32. 32 man man
  33. 33 man -K SYNOPSIS
  34. 34 history
  35. 35 man -K autorelabel
  36. 36 man -k selinux
  37. 37 man selinux
  38. 38 visudo
  39. 39 useradd linda
  40. 40 echo password | passwd --stdin linda
  41. 41 su - linda
  42. 42 visudo
  43. 43 su - linda
  44. 44 history
  45. 45 which passwd
  46. 46 find / -name "passwd"
  47. 47 less /etc/passwd
  48. 48 vim /etc/login.defs
  49. 49 cd /etc/skel/
  50. 50 ls -a
  51. 51 touch hellofile
  52. 52 useradd lisa
  53. 53 useradd bob
  54. 54 useradd bill
  55. 55 ls -l /home/bill
  56. 56 usermod --help | less
  57. 57 tail -1 /etc/passwd
  58. 58 tail -1 /etc/group
  59. 59 cd
  60. 60 id lisa
  61. 61 usermod -aG wheel lisa
  62. 62 vim /etc/group
  63. 63 id lisa
  64. 64 usermod -L lisa
  65. 65 passwd lisa
  66. 66 usermod -L lisa
  67. 67 vim /etc/shadow
  68. 68 history
  69. 69 vim /etc/login.defs
  70. 70 touch /etc/skel/newfile
  71. 71 for i in anna anouk linda lisa; do useradd $i; done
  72. 72 for i in anna anouk linda lisa; do echo password | passwd --stdin $i; done
  73. 73 passwd lisa
  74. 74 groupadd profs
  75. 75 groupadd students
  76. 76 usermod -aG profs anna
  77. 77 usermod -aG profs anouk
  78. 78 usermod -aG students lisa
  79. 79 usermod -aG students linda
  80. 80 exit
  81. 81 id anna
  82. 82 exit
  83. 83 chage --help | less
  84. 84 chage -l anna
  85. 85 chage anna
  86. 86 vim /etc/shadow
  87. 87 vipw --help
  88. 88 vipw -s
  89. 89 ls -l /etc/shadow
  90. 90 chmod u+rw /etc/shadow
  91. 91 vipw -s
  92. 92 ls -ld /home/linda
  93. 93 ls -l /etc/hosts
  94. 94 touch /tmp/testfiles
  95. 95 chown linda:student /tmp/testfile
  96. 96 chown linda:student /tmp/testfiles
  97. 97 ls -l /tmp/testfiles
  98. 98 chmod 060 /tmp/tesfiles
  99. 99 chmod 060 /tmp/testfiles
  100. 100 id linda
  101. 101 ls -l /tmp/testfiles
  102. 102 chgrp students /tmp/testfiles
  103. 103 ls -l /tmp/testfiles
  104. 104 su - linda
  105. 105 touch /home/linda/rootfile
  106. 106 su - linda
  107. 107 mkdir -p /data/students
  108. 108 touch /data/students/{1..9}.txt
  109. 109 ls -l /data/students/
  110. 110 mkdir /data/students/202{0..4}
  111. 111 ls -l /data/students/
  112. 112 cd /data/students
  113. 113 chmod 660 202*
  114. 114 ls -l
  115. 115 chmod -R +x .
  116. 116 ls
  117. 117 ls -l
  118. 118 chmod -R -x .
  119. 119 chmod -R +X .
  120. 120 ls -l
  121. 121 pwd
  122. 122 cd ..
  123. 123 mkdir profs
  124. 124 chgrp profs profs
  125. 125 ls -l
  126. 126 chmod 770 *
  127. 127 ls -l
  128. 128 su - anna
  129. 129 chmod g+s /data/profs
  130. 130 ls -ld /data/profs
  131. 131 su - anna
  132. 132 su - anouk
  133. 133 chmod +t /data/profs
  134. 134 su - anouk
  135. 135 history
  136. 136 mkdir -p /data/students /data/profs
  137. 137 chgrp students /data/students
  138. 138 chgrp profs /data/profs
  139. 139 ls -l /data/profs
  140. 140 ls -l /data/
  141. 141 chmod 770 *
  142. 142 ls -l
  143. 143 lsblk
  144. 144 poweroff
  145. 145 lsblk
  146. 146 touch bb
  147. 147 cat /etc/fstab
  148. 148 blkid
  149. 149 blkid | awk '/n1p5 { print $2 }'
  150. 150 blkid | awk '/n1p5/ { print $2 }'
  151. 151 blkid | awk '/n1p5/ { print $2 }' >> /etc/fstab
  152. 152 vim /etc/fstab
  153. 153 reboot
  154. 154 lsblk
  155. 155 mount
  156. 156 mkfs.xfs --help
  157. 157 mkfs.xfs /dev/sdb1 -L mylabel
  158. 158 xfs_admin --help
  159. 159 xfs_admin -L myxfs /dev/nvme0n1p5
  160. 160 umount /dev/nvme0n1p5
  161. 161 xfs_admin -L myxfs /dev/nvme0n1p5
  162. 162 tune2fs -L myext4 /dev/nvme0n1p5
  163. 163 vim /etc/fstab
  164. 164 blkid
  165. 165 cd /dev/disk
  166. 166 ls
  167. 167 ls -l by-uuid
  168. 168 pwd
  169. 169 free -m
  170. 170 swapon -s
  171. 171 fdisk /dev/nvme0n1
  172. 172 lsbk
  173. 173 lsblk
  174. 174 mkswap /dev/nvme0n1p6
  175. 175 vim /etc/fstab
  176. 176 free -m
  177. 177 swapon -a
  178. 178 free -m
  179. 179 swapon -s
  180. 180 history
  181. 181 grep swap /etc/fstab
  182. 182 cd
  183. 183 lsblk
  184. 184 fdisk /dev/nvme0n2
  185. 185 mkdir -p /mounts/files /mounts/xfs
  186. 186 mkfs.ext4 /dev/nmve0n2p1
  187. 187 lsblk
  188. 188 mkfs.ext4 /dev/nvme0n2p1
  189. 189 mkfs.xfs /dev/nvme0n2p5 -L myxfs
  190. 190 mkswap /dev/nvme0n2p6
  191. 191 blkid
  192. 192 blkid | tail -3 | awk '{ print $2 }'
  193. 193 blkid | tail -3 | awk '{ print $2 }' >> /etc/fstab
  194. 194 vim /etc/fstab
  195. 195 mount -a
  196. 196 vim /etc/fstab
  197. 197 mount -a
  198. 198 swapon -a
  199. 199 reboot
  200. 200 history
  201. 201 df -h
  202. 202 lsblk
  203. 203 dd if=/dev/sr0 of=/rhel9.iso bs=1M
  204. 204 ls -l /
  205. 205 mkdir /repo
  206. 206 vim /etc/fstab
  207. 207 mount -a
  208. 208 ls /repo
  209. 209 history
  210. 210 ls /repo
  211. 211 ls
  212. 212 cd /repo
  213. 213 ls BaseOS/Packages/
  214. 214 cd AppStream/Packages/
  215. 215 ls
  216. 216 cd /
  217. 217 dnf config-manager --add-repo="file:///repo/BaseOS"
  218. 218 dnf config-manager --add-repo="file:///repo/AppStream"
  219. 219 dnf repolist
  220. 220 cd /etc/yum.repos.d/
  221. 221 ls
  222. 222 cat repo_BaseOS.repo
  223. 223 dnf install -y nmap
  224. 224 vim repo_BaseOS.repo
  225. 225 vim repo_AppStream.repo
  226. 226 dnf install nmap
  227. 227 dnf list "selinux*"
  228. 228 dnf provides */seinfo
  229. 229 seinfo
  230. 230 dnf provides */Dockerfile
  231. 231 history
  232. 232 dnf groups list
  233. 233 dnf groups install "Virtualization Host"
  234. 234 dnf groups list
  235. 235 history
  236. 236 cd
  237. 237 man dnf
  238. 238 dnf download httpd
  239. 239 ls
  240. 240 rpm -qp --scripts httpd-2.4.53-11.el9_2.4.x86_64.rpm
  241. 241 history
  242. 242 ip addr show
  243. 243 ip a
  244. 244 ifconfig
  245. 245 man ifconfig
  246. 246 ip a
  247. 247 nmtui
  248. 248 ip a
  249. 249 systemctl status NetworkManager
  250. 250 systemctl list-units
  251. 251 systemctl -t help
  252. 252 systemctl list-unit-files
  253. 253 dnf install -y httpd
  254. 254 systemctl status httpd
  255. 255 systemctl start httpd
  256. 256 systemctl status httpd
  257. 257 systemctl enable httpd
  258. 258 systemctl cat sshd.service
  259. 259 systemctl edit sshd.service
  260. 260 systemctl cat sshd.service
  261. 261 systemctl status sshd
  262. 262 kill -9 1108
  263. 263 systemctl status sshd
  264. 264 systemctl status httpd
  265. 265 systemctl disable httpd
  266. 266 systemctl status httpd
  267. 267 systemctl stop httpd
  268. 268 systemctl enable --now httpd
  269. 269 systemctl cat sshd.service
  270. 270 dnf install -y nginx
  271. 271 systemctl status nginx
  272. 272 systemctl mask nginx
  273. 273 systemctl start nginx
  274. 274 cd /var/log
  275. 275 ls -l
  276. 276 cd
  277. 277 journalctl
  278. 278 grep 'Storage' /etc/systemd/journald.conf
  279. 279 mkdir /var/log/journal
  280. 280 ls -l /var/log/journal
  281. 281 systemctl restart systemd-journal-flush.service
  282. 282 ls -l /var/log/journal
  283. 283 history
  284. 284 systemctl show httpd.service
  285. 285 man systemd.directives
  286. 286 man systemd.service
  287. 287 systemctl edit httpd.service
  288. 288 ls /etc/systemd/system/httpd.service.d/
  289. 289 cat /etc/systemd/system/httpd.service.d/override.conf
  290. 290 systemctl cat httpd
  291. 291 fdisk /dev/nvme0n2
  292. 292 pvcreate /dev/nvme0n2p7
  293. 293 pvcreate /dev/nvme0n2p8
  294. 294 pvs
  295. 295 vgcreate --help | less
  296. 296 vgcreate -s 8M vgdata /dev/nvme0n2p7
  297. 297 vgs
  298. 298 vgdisplay vgdata
  299. 299 echo $(( 255 * 8 ))
  300. 300 lvcreate -n lvdata -L 2G vgdata
  301. 301 lvcreate -n lvdata -l 255 vgdata
  302. 302 lvs
  303. 303 mkfs.ext4 /dev/vgdata/lvdata
  304. 304 mkdir /lvdata
  305. 305 vim /etc/fstab
  306. 306 mount -a
  307. 307 mount
  308. 308 ls -l /dev/mapper/vgdata-lvdata /dev/vgdata/lvdata
  309. 309 history
  310. [root@localhost ~]# cat /etc/fstab
  311.  
  312. #
  313. # /etc/fstab
  314. # Created by anaconda on Mon Nov 6 14:44:44 2023
  315. #
  316. # Accessible filesystems, by reference, are maintained under '/dev/disk/'.
  317. # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info.
  318. #
  319. # After editing this file, run 'systemctl daemon-reload' to update systemd
  320. # units generated from this file.
  321. #
  322. /dev/mapper/rhel-root / xfs defaults 0 0
  323. UUID=9b29d61c-3e07-4941-994c-4e140e1944fc /boot xfs defaults 0 0
  324. /dev/mapper/rhel-swap none swap defaults 0 0
  325. /dev/nvme0n1p3 /myfiles xfs defaults 0 0
  326. #/dev/nvme0n1p5 /part5 xfs defaults 0 0
  327. #/dev/nvme0n1p6 /part6 ext4 defaults 0 0
  328. UUID="ba1a7707-d70a-4c3e-9968-83065a70e5e2" /part6 ext4 defaults 0 0
  329. #LABEL=myext4 /part6 ext4 defaults 0 0
  330. UUID=c3e37d5c-c1a8-484c-99c8-ba3617e4a66f none swap defaults 0 0
  331. UUID="d46b33a3-2cad-4125-ae2a-05019295185c" /mounts/files ext4 defaults 0 0
  332. UUID="05cc3079-7dc5-4404-8f65-a38349e8e10c" none swap defaults 0 0
  333. LABEL="myxfs" /mounts/xfs xfs defaults 0 0
  334. /rhel9.iso /repo iso9660 defaults 0 0
  335. /dev/vgdata/lvdata /lvdata ext4 defaults 0 0
  336.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement