Advertisement
sandervanvugt

RHCSA day2 nov20

Nov 11th, 2020
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.64 KB | None | 0 0
  1. 1 ps fax
  2. 2 exit
  3. 3 bash
  4. 4 exit
  5. 5 bash
  6. 6 exit
  7. 7 tar cvzf /root/archive1.tgz -C /etc
  8. 8 tar cvzf /root/archive1.tgz -C /etc .
  9. 9 tar tvf archive1.tgz | less
  10. 10 tar cvzf /root/archive2.tgz /etc
  11. 11 history
  12. 12 sort /etc/dnsmasq.conf | grep -v '^$' > /var/tmp/dnslines.txt
  13. 13 less /var/tmp/dnslines.txt
  14. 14 vim /etc/services
  15. 15 sort /etc/services | grep -v '^$' > /var/tmp/dnslines.txt
  16. 16 less /var/tmp/dnslines.txt
  17. 17 useradd betty
  18. 18 find / -user "betty"
  19. 19 mkdir /root/userfiles
  20. 20 find / -user "betty" -exec cp {} /root/userfiles \;
  21. 21 find / -user "betty" -exec cp -r {} /root/userfiles \;
  22. 22 history
  23. 23 vim countdown
  24. 24 chmod +x countdown
  25. 25 ./countdown 12
  26. 26 man cp
  27. 27 vim countdown
  28. 28 ./countdown 0
  29. 29 history
  30. 30 echo $(( 2 + 4 ))
  31. 31 vim /etc/login.defs
  32. 32 useradd --help | less
  33. 33 useradd -D
  34. 34 vim /etc/default/useradd
  35. 35 useradd --help | less
  36. 36 useradd bob -s /usr/bin/false
  37. 37 grep bob /etc/passwd
  38. 38 cd /etc/skel/
  39. 39 ls -a
  40. 40 echo hello > hellofile
  41. 41 useradd bill -s /bin/false
  42. 42 cd /home/bill
  43. 43 ls -a
  44. 44 tail -1 /etc/passwd
  45. 45 tail -1 /etc/shadow
  46. 46 man 5 passwd
  47. 47 tail -1 /etc/group
  48. 48 passwd bill
  49. 49 echo password | passwd --stdin bill
  50. 50 passwd --help
  51. 51 grep bill /etc/passwd /etc/shadow /etc/group
  52. 52 passwd -l bill
  53. 53 grep bill /etc/passwd /etc/shadow /etc/group
  54. 54 man 5 shadow
  55. 55 su - bill
  56. 56 w
  57. 57 useradd alex
  58. 58 su - alex
  59. 59 passwd -l alex
  60. 60 su - alex
  61. 61 passwd alex
  62. 62 su - alex
  63. 63 passwd -l alex
  64. 64 su - alex
  65. 65 passwd --help
  66. 66 usermod --help
  67. 67 usermod -L alex
  68. 68 su - alex
  69. 69 passwd -u alex
  70. 70 grep alex /etc/shadow
  71. 71 usermod -L alex
  72. 72 grep alex /etc/shadow
  73. 73 passwd --help
  74. 74 passwd -e alex
  75. 75 grep alex /etc/shadow
  76. 76 su - alex
  77. 77 bash
  78. 78 exit
  79. 79 groupadd mygroup
  80. 80 useradd myuser -G mygroup
  81. 81 id myuser
  82. 82 usermod -aG wheel myuser
  83. 83 id myuser
  84. 84 grep myuser /etc/passwd /etc/group
  85. 85 groups myuser
  86. 86 id myuser
  87. 87 chage myuser
  88. 88 ./countdown 15
  89. 89 vim jason.txt
  90. 90 groupadd student
  91. 91 groupadd students
  92. 92 groupadd profs
  93. 93 vim /etc/login.defs
  94. 94 useradd linda -G students
  95. 95 useradd lisa -G students
  96. 96 useradd anna -G profs
  97. 97 useradd anouk -G profs
  98. 98 id anna
  99. 99 history
  100. 100 groupadd sales
  101. 101 groupadd account
  102. 102 usermod -aG sales linda
  103. 103 usermod -aG sales lisa
  104. 104 usermod -aG account anna
  105. 105 usermod -aG account anouk
  106. 106 mkdir -p /data/sales
  107. 107 mkdir -p /data/account
  108. 108 cd /data
  109. 109 ls -l
  110. 110 id
  111. 111 chgrp sales sales
  112. 112 chgrp account account
  113. 113 ls -l
  114. 114 chmod 770 *
  115. 115 ls -l
  116. 116 cd /home/linda
  117. 117 touch wortel
  118. 118 ls -l
  119. 119 su - linda
  120. 120 touch anotherwortel
  121. 121 pwd
  122. 122 su - linda
  123. 123 vim playme
  124. 124 chmod +x playme
  125. 125 su - linda
  126. 126 chmod u+s playme
  127. 127 vim playme
  128. 128 su - linda
  129. 129 find / -perm /4000 2>/dev/null
  130. 130 find / -perm /4000 -exec ls -l {} ]; 2>/dev/null
  131. 131 find / -perm /4000 -exec ls -l {} \; 2>/dev/null
  132. 132 ls -l /etc/shadow
  133. 133 less /etc/passwd
  134. 134 useradd myservice -u 2000 -s /sbin/nologin
  135. 135 su - linda
  136. 136 su - lisa
  137. 137 ls -ld .
  138. 138 cd /data/sales
  139. 139 ls -ld .
  140. 140 chmod g+s .
  141. 141 ls -ld .
  142. 142 su - lisa
  143. 143 chmod +t /data/sales
  144. 144 ls -ld /data/sales
  145. 145 su - lisa
  146. 146 cd ..
  147. 147 ls -l
  148. 148 su - anna
  149. 149 getfacl sales
  150. 150 setfacl -R -m g:account:rx /data/sales
  151. 151 cd /data/sales
  152. 152 ls -l
  153. 153 getfacl lisa1
  154. 154 man setfacl
  155. 155 cd ..
  156. 156 setfacl -x g:account sales
  157. 157 getfacls sales
  158. 158 getfacl sales
  159. 159 getfacl sales/linda2
  160. 160 setfacl -R -x g:account sales
  161. 161 getfacl sales/linda2
  162. 162 setfacl -R -m g:account:rX /data/sales
  163. 163 getfacl /data/sales/linda2
  164. 164 su - linda
  165. 165 setfacl -m d:g:account:rx /data/sales
  166. 166 getfacl /data/sales
  167. 167 exit
  168. 168 su - linda
  169. 169 ./countdown 12
  170. 170 lsblk
  171. 171 poweroff
  172. 172 lslbk
  173. 173 lsblk
  174. 174 fdisk /dev/sda
  175. 175 lslbk
  176. 176 alias lslbk=lsblk
  177. 177 lslbk
  178. 178 mkfs.xfs /dev/sda3
  179. 179 lsbk
  180. 180 lsblk
  181. 181 mkdir /partition
  182. 182 vim /etc/fstab
  183. 183 mount -a
  184. 184 mount
  185. 185 reboot
  186. 186 poweroff
  187. 187 fdisk /dev/sda
  188. 188 fdisk -l /dev/sda
  189. 189 cat /proc/partitions
  190. 190 lslbk
  191. 191 lsblk
  192. 192 reboot
  193. 193 lsblk
  194. 194 mkfs.ext4 /dev/sda6
  195. 195 mkdir /oldfiles
  196. 196 vim /etc/fstab
  197. 197 fdisk /dev/sda
  198. 198 reboot
  199. 199 vim /etc/fstab
  200. 200 reboot
  201. 201 history
  202. 202 vim /etc/fstab
  203. 203 reboot
  204. 204 journalctl -xb
  205. 205 mount
  206. 206 mount -a
  207. 207 fdisk /dev/sda
  208. 208 blkid
  209. 209 blkid | grep sda5 | cut -f 2
  210. 210 blkid | grep sda5 | awk '{ print $2 }'
  211. 211 blkid | grep sda5 | awk '{ print $2 }' >> /etc/fstab
  212. 212 vim /etc/fstab
  213. 213 exit
  214. 214 mount
  215. 215 fdisk /dev/sda
  216. 216 lsblk
  217. 217 mkfs.xfs --help
  218. 218 mkfs.xfs -L horse /dev/sda6
  219. 219 mkdir /horses
  220. 220 vim /etc/fstab
  221. 221 mount -a
  222. 222 xfs_admin --help
  223. 223 fdisk /dev/sda
  224. 224 reboot
  225. 225 cd /data
  226. 226 ls -l
  227. 227 mkdir students profs
  228. 228 cgrp students students
  229. 229 chgrp students students
  230. 230 chgrp profs profs
  231. 231 ls -l
  232. 232 chmod 770 profs
  233. 233 chmod 770 students
  234. 234 chmod 3770 [sp]*
  235. 235 ls -l
  236. 236 chown anna profs
  237. 237 chown anna students
  238. 238 setfacl -m -R g:profs:rX students
  239. 239 setfacl -R -m g:profs:rX students
  240. 240 setfacl -R -m d:g:profs:rx students
  241. 241 chown -R anna /data
  242. 242 cd /
  243. 243 dd if=/dev/sr0 of=/centos82.iso bs=1M
  244. 244 mkdir /repo
  245. 245 vim /etc/fstab
  246. 246 mount -a
  247. 247 ls /repo
  248. 248 cd /repo
  249. 249 ls BaseOS/
  250. 250 ls AppStream/
  251. 251 cd /etc/yum.repos.d/
  252. 252 ls
  253. 253 rm -f *
  254. 254 yum repolist
  255. 255 vim baseOS.repo
  256. 256 vim AppStream.repo
  257. 257 cat baseOS.repo
  258. 258 yum repolist
  259. 259 cd
  260. 260 cd /repo
  261. 261 ls
  262. 262 cd
  263. 263 ls
  264. 264 ./countdown 12
  265. 265 yum search nmap
  266. 266 cd /etc/yum.repos.d/
  267. 267 vim baseOS.repo
  268. 268 ls
  269. 269 vim AppStream.repo
  270. 270 yum search nmap
  271. 271 cd
  272. 272 yum search seinfo
  273. 273 yum provides */seinfo
  274. 274 yum install nmap
  275. 275 yum remove nmap
  276. 276 yum info nmap
  277. 277 man 5 yum.conf
  278. 278 yum modules list
  279. 279 yum module list
  280. 280 yum module info postgresql
  281. 281 yum module info --profile postgresql
  282. 282 yum module install postgresql:9.6
  283. 283 yum module install postgresql:9.6/devel
  284. 284 yum module install postgresql:9.6
  285. 285 yum install httpd
  286. 286 yum module info httpd
  287. 287 yum module enable postgresql:10
  288. 288 yum module info --profile php
  289. 289 yum module install php:7.2/devel
  290. 290 yum module reset php
  291. 291 yum module install --allowerasing php:7.3
  292. 292 history
  293. 293 ip a
  294. 294 ip -c -brie a
  295. 295 ip addr
  296. 296 ip route
  297. 297 ip addr add dev ens33 10.0.0.11/24
  298. 298 ping 10.0.0.11
  299. 299 ip a
  300. 300 man ifconfig
  301. 301 ifconfig
  302. 302 ifconfig -a
  303. 303 man ifconfig
  304. 304 ip route show
  305. 305 ip route del default via 192.168.4.2
  306. 306 ip r
  307. 307 ping nu.nl
  308. 308 ip route add default via 192.168.4.2
  309. 309 ping nu.nl
  310. 310 history
  311. 311 ./countdown 12
  312. 312 nmtui
  313. 313 ip a
  314. 314 nmtui
  315. 315 ip a
  316. 316 man nmcli-examples
  317. 317 nmcli connection modify ens33 ipv4.addresses +10.0.0.12/24
  318. 318 nmcli connection add ens33 ipv4.addresses +10.0.0.12/24
  319. 319 nmcli connection modify ens33 ipv4.addresses 192.168.4.188/24
  320. 320 nmcli connection up ens33
  321. 321 ip a
  322. 322 cd /etc/sysconfig/network-scripts/
  323. 323 ls
  324. 324 vim ifcfg-ens33
  325. 325 cd
  326. 326 systemctl status tuned
  327. 327 tuned-adm --help
  328. 328 tuned-adm list
  329. 329 tuned-adm recommend
  330. 330 tuned-adm profile desktop
  331. 331 tuned-adm list
  332. 332 cd /usr/lib/tuned/virtual-guest/
  333. 333 ls
  334. 334 vim tuned.conf
  335. 335 lspci
  336. 336 cd
  337. 337 fdisk /dev/sda
  338. 338 xxd /dev/sda7 | less
  339. 339 pvcreate /dev/sda7
  340. 340 pvs
  341. 341 xxd /dev/sda7 | less
  342. 342 vgcreate --help
  343. 343 vgcreate -s 16m vgdata /dev/sda7
  344. 344 vgs
  345. 345 vgdisplay vgdata
  346. 346 lvcreate -n lvdata -L 1G vgdata
  347. 347 echo $(( 63 * 4 ))
  348. 348 echo $(( 63 * 16 ))
  349. 349 echo $(( 66 * 16 ))
  350. 350 echo $(( 64 * 16 ))
  351. 351 lvcreate -n lvdata -l 63 vgdata
  352. 352 lvs
  353. 353 mkfs.ext3 /dev/vgdata/lvdata
  354. 354 vim /etc/fstab
  355. 355 mount -a
  356. 356 mkdir /lvdata
  357. 357 mount -a
  358. 358 df -h
  359. 359 ls -l /dev/mapper/vgdata-lvdata /dev/vgdata/lvdata
  360. 360 \ls -l /dev/mapper/vgdata-lvdata /dev/vgdata/lvdata
  361. 361 history
  362. 362 tail -1 /etc/fstab
  363. 363 alias
  364. 364 xxd /dev/sda7 | less
  365. 365 yum provides */lvcreate
  366. 366 ./countdown 12
  367. 367 vgs
  368. 368 vgextend --help | less
  369. 369 vgextend vgdata /dev/sda8
  370. 370 vgs
  371. 371 man lvresize
  372. 372 lvresize --help | less
  373. 373 df -h
  374. 374 lvresize -r -L +500M /dev/vgdata/lvdata
  375. 375 lvresize -l +100%FREE /dev/vgdata/lvdata
  376. 376 lvs
  377. 377 df -h
  378. 378 resize2fs /dev/mapper/vgdata-lvdata
  379. 379 df -h
  380. 380 history
  381. 381 free -m
  382. 382 fdisk /dev/sda
  383. 383 mkswap /dev/sda9
  384. 384 free -m
  385. 385 vim /etc/fstab
  386. 386 swapon -a
  387. 387 free -m
  388. 388 history
  389. 389 grep -i active /proc/meminfo
  390. 390 cd /proc
  391. 391 ls
  392. 392 mkswap --help
  393. 393 swapon -s
  394. 394 grep -i activ /proc/meminfo
  395. 395 cd
  396. 396 history
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement