Skip to content

omarelsheekh/RHCSA8

Repository files navigation

RHCSA8

Solution for RHCSA8 course tasks

About the Course

Red Hat Certified System Administrator (RHCSA) 3rd Edition
Author: Sander Van Vugt
The Red Hat Certified System Administrator (RHCSA), 3rd edition is all new and fully updated for RHEL 8. This course is designed to teach you everything you need to know to pass the RHCSA exam. Every objective in the exam is discussed, along with in-depth lessons on complex topics, so they are not confusing. Each lesson ends with a lab, so you can dive into your own projects and see Red Hat in action; many of these labs mimic scenarios you might find on the exam, so you get the experience you need to practice for the exam. These labs also include video solutions, so you can also see in real-time how to work through the problems and figure out the best methods for working through each scenario.

Index

lesson 2 task

    • mandb update manual db
    • man -k password search for pages that contains word password
    • man -k password | wc count the results
    • unfortunatly we couldn't find any usefull results
    • man useradd and look for command in see also section
    • now we found passwd command
    • useradd anna add anna user first
    • passwd anna set a passwd for her
    • cd /etc
    • ls -d *[0-9]* note -d to list directories themselves, not their contents
    • ls -l | less then you can press h to browse commands
    • some usefull commands in vim
    • Esc back to command mode
    • i insert mode
    • a append
    • o open a new line
    • :wq write and quite
    • :q! quite and don't complain
    • dd delete a line
    • yy copy the current line
    • p paste
    • G goto the last line in the file
    • gg goto the beggining of the file
    • d$ delete after cursor in line
    • $ move cursor to the end of the line
    • ^ move cursor to the start of the line
    • v visual mode to select text
    • u undo
    • Ctrl + r redo
    • /text search for text forword
    • ?text search for text backword
    • :%s/old/new for replacing text

lesson 3 task

    • mkdir -p /tmp/files/pictures
    • mkdir -p /tmp/files/photos
    • mkdir -p /tmp/files/videos
    • cp /etc/[a-c]* /tmp/files/
    • mv /tmp/files/[a-b]* /tmp/files/photos/
    • mv /tmp/files/c* /tmp/files/videos/
    • find /etc/ -size -1000c -exec cp {} /tmp/files/pictures
    • ln -s /var/ /tmp/files/varlink
    • tar -cvJf /tmp/files/home.tar.xz /home
    • -J for .xz compression
    • mkdir /tmp/arch/ ; tar -xvf /tmp/files/home.tar.xz -C /tmp/arch/
    • note that we can use Ctrl + a to goto the start of the command line, and we can seperate commands using ;

lesson 4 task

    • head -n 5 /etc/passwd | tail -n 1
    • sed -n 5p /etc/passwd
    • ps aux | awk '{ print $NF }'
    • grep -R root /etc/ 2> /dev/null | cut -f 1 -d : | less
    • grep -R '^...$' /etc/ 2> /dev/null |less
    • grep -R 'alex$' /etc/ 2> /dev/null

lesson 5 task

    • chvt 6
    • chvt 1
    • ssh root@localhost

lesson 6 task

    • edit file /etc/login.defs and set PASS_MIN_LEN to 6 and PASS_MAX_DAYS to 90
    • note that you can change defaults in
    • /etc/login.defs and /etc/default/useradd
    • touch /etc/skel/newfile
    • note that files in /etc/skel/ dir will be created in user home upon creation
    • to add user useradd username
    • to change password passwd username
    • to lock password passwd -l username
    • to add group groupadd name
    • to add user to a group usermod -aG gname uname

lesson 7 task

    • vim /home/linda/.bash_profile
    • add this line umask 007
    • mkdir /data/profs /data/students
    • chmod 3770 /data/students
    • chmod 3770 /data/profs
    • chown anna:profs /data/profs
    • chown anna:students /data/students
    • setfacl -m d:g:profs:rx /data/students

lesson 8 task

  • you can do that using one of these option
    • nmcli and make sure that bash-completion is installed
    • nmtui
    • you can edit existing connection and reactivate it or add and activate a new one
    • or by editing config file /etc/sysconfig/network-scripts/ifcfg-ens32

lesson 9 task

    • Ctrl+Z to pause process
    • bg will move the most recent job to background
    • bg [job id] will move the job to the background
    • fg will move the most recent job to foreground
    • command & will run the command in the background
    • jobs to list running jobs
    • some usefull commands in top
    • h for help
    • r for renice
    • k to kill processes
    • 9 sig kill
    • 15 sig terminate
    • killall -15 dd
    • install psmisc package if killall command not found

lesson 10 task

    • ls /etc/yum.repos.d
    • you should see repos files there
    • yum search sepolicy
    • yum provides */sepolicy for deeper search
    • yum module list to list all versions
    • yum module install php:7.1
    • yumdownloader httpd
    • rpm -qp --scripts httpd-2.4....

lesson 11 task

    • systemctl enable httpd --now
    • to list paramters systemctl show httpd
    • set Restart to always and RestartSec to 60
    • systemctl deamon-reload to reload configrations
    • systemctl restart httpd

About

Solution for RHCSA8-course tasks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published