Advertisement
sandervanvugt

RHCSA feb24 day1

Feb 6th, 2024
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.83 KB | None | 0 0
  1. [root@localhost ~]# 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 visudo
  81. 80 tail -1 /etc/passwd
  82. 81 id bob
  83. 82 su - bob
  84. 83 passwd bob
  85. 84 su - bob
  86. 85 journalctl
  87. 86 usermod -aG wheel bob
  88. 87 su - bob
  89. 88 visudo
  90. 89 useradd linda
  91. 90 echo password | passwd --stdin linda
  92. 91 su - linda
  93. 92 visudo
  94. 93 su - linda
  95. 94 history
  96. 95 #find / -name ".bash_history" -type f -exec rm -f {} \;
  97. 96 dnf repolist
  98. 97 ps aux | less
  99. 98 less /etc/passwd
  100. 99 usermod --help
  101. 100 vim /etc/login.defs
  102. 101 cd /etc/skel
  103. 102 ls
  104. 103 ls -a
  105. 104 touch hello
  106. 105 ls -a
  107. 106 useradd sander
  108. 107 ls -al /home/sander
  109. 108 cd
  110. 109 less /etc/passwd
  111. 110 id bob
  112. 111 grep bob /etc/passwd
  113. 112 grep bob /etc/group
  114. 113 lid wheel
  115. 114 lid -g wheel
  116. 115 useradd -g wheel baduser
  117. 116 id baduser
  118. 117 grep wheel /etc/group
  119. 118 grep baduser /etc/passwd
  120. 119 lid -g wheel
  121. 120 chage bob
  122. 121 history
  123. 122 cd rhcsa9/labs/
  124. 123 ls
  125. 124 vim live-lab2-grade.sh
  126. 125 ./live-lab2-grade.sh
  127. 126 vim /etc/login.defs
  128. 127 touch /etc/skel/newfile
  129. 128 groupadd profs
  130. 129 groupadd students
  131. 130 useradd -G students linda
  132. 131 useradd -G students lisa
  133. 132 usermod -aG students linda
  134. 133 useradd -G profs anna
  135. 134 useradd -G profs anouk
  136. 135 history | grep git
  137. 136 ./live-lab2-grade.sh
  138. 137 ls -l
  139. 138 cd /home/linda
  140. 139 echo linda > lindafile
  141. 140 ls -l lindafile
  142. 141 chmod u-rw
  143. 142 chmod u-rw linda
  144. 143 chmod u-rw lindafile
  145. 144 chown linda lindafile
  146. 145 ls -l lindafile
  147. 146 su - linda
  148. 147 cd
  149. 148 cd /etc/skel
  150. 149 mkdir tryme
  151. 150 chmod 2770 tryme
  152. 151 useradd pablo
  153. 152 ls -l pabl
  154. 153 ls -l /home/pablo
  155. 154 mkdir -p /data/profs /data/students
  156. 155 cd /data
  157. 156 ls -l
  158. 157 id
  159. 158 chown :profs profs
  160. 159 ls -l
  161. 160 chgrp students students
  162. 161 ls -l
  163. 162 chmod 770 students
  164. 163 ls -l
  165. 164 chmod g+w,o-rx profs
  166. 165 ls -l
  167. 166 su - anna
  168. 167 chmod g+s /data/profs
  169. 168 ls -ld /data/profs
  170. 169 su - anna
  171. 170 su - anouk
  172. 171 chmod +t /data/profs
  173. 172 su - anouk
  174. 173 chmod g-x,o+x /data/profs
  175. 174 ls -ld /data/profs
  176. 175 chmod g+x,o-x /data/profs
  177. 176 cd /profs
  178. 177 cd profs
  179. 178 mkdir one two three
  180. 179 for i in one two three; do touch $i/four; done
  181. 180 for i in one two three; do touch $i/five; done
  182. 181 tree
  183. 182 ls -lR
  184. 183 chmod -R g+s .
  185. 184 ls -lR
  186. 185 chmod -R g-s .
  187. 186 find . -type d
  188. 187 find . -type d -exec chmod g+s {} \;
  189. 188 ls -lR
  190. 189 history
  191. 190 who; find . -exec ls -l {} \;
  192. 191 umask
  193. 192 touch '-'
  194. 193 ls -l
  195. 194 echo hello > \-
  196. 195 ls
  197. 196 rm \-
  198. 197 rm -- \-
  199. 198 cd
  200. 199 history
  201.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement