RHEL lab demonstrating foundational Linux system administration skills including configuration inspection, text processing, and secure archival of system files.
- Find the all occurences of the string "Listen" in
etc/httpd/conf/httpd.conf/and save the output to/root/web.txt. - Create a gzip-compressed tar archive of
/etc/namedetc_vault.tar.gzin/vaults/directory. - Imposed Challenge: Complete the above without using GNOME desktop environment.
- At the user login page I used
Ctrl + Alt + F2to open a new terminal window. - Once I logged in I navigated to
/etc/, only to discover that the package group I installed with RHEL didn't come with the/httpd/folder. After some learning about Red Hat's Package Manager and the commandsdnf,yum, and the difference between installing packages individually vs. in groups I installed the correct package usingdnf install httpd. - When in the
/etc/httpd/conf/directory, I grep searched for all occurences of the string "Listen" and redirected the stdout of thegrep "Listen"to a new fileweb.txtleveraging the standard output redirection operator>ingrep "Listen" > web.txt. - Next I needed to move this text file to the
/root/folder, to accomplish this I usedmv web.txt root/.
I will note that I later discovered that I could've searched for the string I needed to look for and create the web.txt file in the correct directory in a single command.
- Commands Covered:
su -udnf install httpdgrep "Listen"mv answer.txt /root/mv answer.txt web.txt
-
to accomplish creating a tar archive and gzip compressed folder the following commands were used sequentially:
tar -cf etc_vault.tar /etc/gzip etc_vault.tar
-
The final step of this lab can be broken down into just moving the
.tar.gzfile into a newly created/vaults/directory.- Created a new
/vaults/directory withmkdir /vaults/ - Move the
etc_vault.tar.gzfile into/vaults/withmv etc_vault.tar.gz /vaults/
- Created a new