Advertisement
sandervanvugt

rhcsa july23 day1

Jul 18th, 2023
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.71 KB | None | 0 0
  1. [root@localhost ~]# history
  2. 1 ls
  3. 2 exit
  4. 3 tar cvzf archive.tgz /etc
  5. 4 tar tvf archive.tgz
  6. 5 history
  7. 6 grep -v '^$' /etc/dnsmasq.conf
  8. 7 grep -v '^$' /etc/dnsmasq.conf | sort
  9. 8 grep -v '^$' /etc/dnsmasq.conf | sort > /var/tmp/dnslines.txt
  10. 9 useradd bob
  11. 10 find / -user bob
  12. 11 find / -user bob -type f
  13. 12 mkdir /root/userfiles; find / -user bob -type f -exec cp {} /root/userfiles/ \;
  14. 13 ls -al /root/userfiles/
  15. 14 history
  16. 15 ls -ld /etc/sudo*
  17. 16 visudo
  18. 17 vim /etc/sudoers.d/bob
  19. 18 tail -1 /etc/passwd
  20. 19 su - bob
  21. 20 passwd bob
  22. 21 su - bob
  23. 22 cat /etc/sudoers.d/bob
  24. 23 id student
  25. 24 history
  26. 25 visudo
  27. 26 exit
  28. 27 history
  29. 28 su - lisa
  30. 29 grep lisa /etc/sudoers
  31. 30 cat /etc/passwd
  32. 31 head /etc/passwd
  33. 32 useradd --help | less
  34. 33 useradd bill -p password
  35. 34 tail -1 /etc/shadow
  36. 35 tail -5 /etc/shadow
  37. 36 echo password | passwd --stdin bill
  38. 37 tail -5 /etc/shadow
  39. 38 vim /etc/login.defs
  40. 39 useradd -p password peter
  41. 40 su - student
  42. 41 cd /etc/skel/
  43. 42 ls -a
  44. 43 touch hellefile
  45. 44 useradd bea
  46. 45 ls -l /home/bea
  47. 46 ls -al /home/bea
  48. 47 id lisa
  49. 48 id student
  50. 49 groupadd sales
  51. 50 usermod -aG sales lisa
  52. 51 usermod --help
  53. 52 usermod -G wheel lisa
  54. 53 id lisa
  55. 54 usermod -aG sales lisa
  56. 55 id lisa
  57. 56 exit
  58. 57 chage --help
  59. 58 chage -l lisa
  60. 59 chage -M 99 lisa
  61. 60 chage -l lisa
  62. 61 chage lisa
  63. 62 /home/student/countdown 15
  64. 63 vim /etc/login.defs
  65. 64 cd /etc/skel/
  66. 65 touch newfile
  67. 66 vim /etc/default/useradd
  68. 67 for i in anna anouk lisa linda; do useradd $i; done
  69. 68 for i in anna anouk lisa linda; do echo password | passwd --stdin $i; done
  70. 69 groupadd profs
  71. 70 groupadd students
  72. 71 usermod -aG profs anouk
  73. 72 usermod -aG profs anna
  74. 73 usermod -aG students linda
  75. 74 usermod -aG students lisa
  76. 75 ls -l /etc/hosts
  77. 76 cd /tmp
  78. 77 echo hello > hellofile
  79. 78 chown linda hellofile
  80. 79 chmod 077 hellofile
  81. 80 ls -l hellofile
  82. 81 su - linda
  83. 82 cd
  84. 83 cd /home/linda
  85. 84 touch lindafile
  86. 85 ls -l lindafile
  87. 86 echo linda > lindafile
  88. 87 su - linda
  89. 88 ls -l
  90. 89 chmod 640 lindafile
  91. 90 su - linda
  92. 91 cd
  93. 92 cd /tmp
  94. 93 mkdir testdir
  95. 94 touch testdir/file{1..10}
  96. 95 ls -l testdir/
  97. 96 chmod --helo
  98. 97 chmod --hel
  99. 98 chmod -R +x testdir/
  100. 99 ls -l testdir/
  101. 100 chmod -R -x testdir/
  102. 101 mkdir testdir/subdir
  103. 102 chmod -R +X testdir/
  104. 103 ls -ld testdir/
  105. 104 ls -l testdir/
  106. 105 cd
  107. 106 mkdir -p /data/profs /data/students
  108. 107 ls -l /data
  109. 108 chown :profs /data/profs
  110. 109 ls -l /data
  111. 110 chgrp students /data/students
  112. 111 ls -l /data
  113. 112 chmod 770 /data/students
  114. 113 ls -l /data
  115. 114 chmod g+w,o-rx /data/profs
  116. 115 ls -l /data
  117. 116 su - anna
  118. 117 chmod g+s /data/profs
  119. 118 ls -l /data
  120. 119 su - anna
  121. 120 su - anouk
  122. 121 chmod +t /data/profs
  123. 122 ls -l /data
  124. 123 su - anouk
  125. 124 umask
  126. 125 /home/student/countdown 15
  127. 126 mkdir -p /data/students /data/profs
  128. 127 ls /data
  129. 128 cd /data
  130. 129 chmod 770 *
  131. 130 ls -l
  132. 131 umask
  133. 132 cd profs
  134. 133 umask 002
  135. 134 touch rootfile
  136. 135 ls -l rootfile
  137. 136 lsblk
  138. 137 poweroff
  139. 138 lsblk
  140. 139 cat /proc/partitions
  141. 140 fdisk /dev/sda
  142. 141 lsblk
  143. 142 mkfs.xfs /dev/sda3
  144. 143 mount /dev/sda3 /mnt
  145. 144 cd /mnt
  146. 145 touch afile
  147. 146 cd
  148. 147 vim /etc/fstab
  149. 148 mount -a
  150. 149 mkdir /files
  151. 150 mount -a
  152. 151 history
  153.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement