RHCSA v9-DUMPS
RHCSA v9-DUMPS
Q2. Configure YUM repos with the given link || (2repos: 1st is BaseOS and 2nd is
AppStream)
baseurl = http://content.example.com/rhel9.0/x86_64/dvd/BaseOS ( for baseos )
baseurl = http://content.example.com/rhel9.0/x86_64/dvd/AppStream ( for appstream )
ANS:-
# vim /etc/yum.repos.d/rhel.repo
[BaseOs]
name=BaseOs
baseurl=http://content.example.com/rhel8.0/x86_64/dvd/BaseOS/
enabled=true
gpgcheck=false
[AppStream]
name=AppStream
baseurl=http://content.example.com/rhel8.0/x86_64/dvd/AppStream/
enabled=true
gpgcheck=false
:wq!
# yum clean all
# yum repolist all
# yum install httpd -y (verify)
--------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------
ANS:-
# groupadd sysadmin
# useradd -G sysadmin natasha
# useradd -G sysadmin harry
# id natasha (verify)
# id harry (verify)
# useradd -s /sbin/nologin sarah
# tail /etc/passwd (verify)
# chpasswd (to set the password for multiple user)
natasha:trootent
harry:trootent
sarah:trootent
--------------------------------------------------------------------------------------------------------------
Q5. Configure a cron job that runs every 1 minutes and executes logger "EX200 in
progress" as the user natasha.
ANS:-
# systemctl status crond.service (verify)
# yum install cronie -y (if the package is not there)
# systemctl enable --now crond.service
# crontab -eu natasha
*/1 * * * * logger "EX200 in progress
wq!
# tail -f /var/log/message | grep "EX200" (verify)
------------------------------------------------------------------------------------------------------------------
ANS:-
# mkdir /home/manager
# chgrp sysadms /home/manager
# ls -ld /home/manager (verify)
# chmod g+rwx,o-rwx /home/manager
# ls -ld /home/manager (verify)
# chmod g+s /home/manager (apply sgid permission)
# touch /home/sysadms/file1.txt (verify)
# ls -l /home/sysadms/file1.txt (verify)
-------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------
ANS:-
# yum install autofs -y
# systemctl enable --now autofs.service
# systemctl status autofs.service
# vim /etc/auto.master
/home/guests /etc/auto.misc
:wq!
# vim /etc/auto.misc
ldapuserX -fstype=nfs,rw,sync classroom.example.com:/home/guests/&
:wq!
# systemctl restart autofs.service
# ls -ld /home/guests (verify)
------------------------------------------------------------------------------------------------------------------------------
Q9. Create user 'alex' with 3456 uid and set the password 'trootent'
ANS:-
# useradd -u 3456 alex
# passwd --stdin alex
trootent
# id alex (verify)
------------------------------------------------------------------------------------------------------------------------------
Q10. Locate all files owned by user "harry" and copy it under /root/harry-files.
ANS:-
# mkdir /root/harry-files
# find / -user harry -exec cp -rpvf {} /root/harry-files \;
# ls -la /root/harry-files (verify)
------------------------------------------------------------------------------------------------------------------------------
Q12. Find a string 'ich' from "/usr/share/dict/words" and put it into /root/lines file.
ANS:-
# grep 'ich' /usr/share/dict/words > /root/lines
# cat /root/lines (verify)
-------------------------------------------------------------------------------------------------------------------------------
ANS:-
# tar cfj /root/backup.tar.bz2 /usr/local
# ls -l /root/backup.tar.bz2 (verify)
NOTE:- If it's asking you on gzip then # tar cfz /root/backup.tar.gz /usr/local
If it's asking you on xzip then # tar cfJ /root/backup.tar.xz /usr/local
------------------------------------------------------------------------------------------------------------------------------
ANS:-
# vim /bin/script.sh
#!/bin/bash
mkdir /root/d1
find /usr/local -size +30k -size -50k -exec cp -rpvf {} /root/d1 \;
chmod g+s /root/d1
:wq
# chmod a+x /bin/script.sh
# sh /bin/script.sh
-------------------------------------------------------------------------------------------------------------------------------
ANS:-
# id athena
# ssh athena@localhost
$ podman -u admin
password: redhat
$ wget http://utility.example.com/container/Containerfile (from given url)
$ podman build -t process_files -f <filename> (which you have downloaded from top link)
$ podman images (verify)
localhost/process_files (output will get)
$ exit
-------------------------------------------------------------------------------------------------------------------------------
Q16. Create rootless container and do volume mapping which they asked you in the
question and run container as a service from normal
user account, the service must be enable so it could start automatically after reboot.
- Create a container named as 'ascii2pdf' using the previously created container image
from previous question 'process_files'
- Map the '/opt/files' to container '/opt/incoming'
- Map the '/opt/processed' to container '/opt/outgoing'
- Create systemd service as container-ascii2pdf.service
- Make service active after all server reboots.
ANS:-
# mkdir /opt/files /opt/processed
# chown -R athena:athena /opt/files
# chown -R athena:athena /opt/processed
# ssh athena@localhost
$ podman run -d --name ascii2pdf -v /opt/files:/opt/incoming:Z -v
/opt/processed:/opt/outgoing:Z localhost/process_files
$ podman ps
$ mkdir /home/athena/.config/systemd/user/
$ cd /home/william/.config/systemd/user/
$ podman generate systemd --name ascii2pdf --files --new
$ ls -lrt
container-ascii2pdf.service (output will get)
$ loginctl enable-linger athena
$ loginctl show-user athena
$ systemctl --user daemon-reload
$ systemctl --user enable container-ascii2pdf.service
$ systemctl --user start container-ascii2pdf.service
$ systemctl --user status container-ascii2pdf.service
-------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------
INSTRUCTION:-
In this server 3 disks will be given.
* /dev/vda : For root filesystem (don't do anything under this disk).
* /dev/vdb : You need to use swap or lvm.
* /dev/vdc :
-----------------------------------------------------------------------------------------------------------------------
ANS:-
STEP_1: Find alt+ctrl+del
STEP_2: Interrupt the boot-loader countdown by pressing any key, except Enter (press
uparrow and downarrow)
STEP_3: Move the cursor to the rescue kernel entry to boot (the one with the word rescue in
its name)
STEP_4: Press e to edit the selected entry
STEP_5: Move the cursor to the kernel command line (the line that starts with linux)
STEP_6: In that line end Append "rd.break console=tty1"
STEP_7: Press Ctrl+x to boot with the changes
STEP_8: Press Enter to perform maintenance when prompted
sh-5.1# mount -o remount,rw /sysroot (Remount /sysroot as read/write)
sh-5.1# chroot /sysroot (Switch into a chroot jail, where /sysroot is treated as the root of the
file-system tree)
sh-5.1# passwd root (Set a new root password)
sh-5.1# touch /.autorelabel (to relebl all files)
sh-5.1# exit (twice)
---------------------------------------------------------------------------------------------------------------
Q18. Configure YUM repos with the given link || (2repos: 1st is BaseOS and 2nd is
AppStream)
baseurl = http://content.example.com/rhel9.0/x86_64/dvd/BaseOS ( for baseos )
baseurl = http://content.example.com/rhel9.0/x86_64/dvd/AppStream ( for appstream
)
ANS:-
# vim /etc/yum.repos.d/rhel.repo
[BaseOs]
name=BaseOs
baseurl=http://content.example.com/rhel8.0/x86_64/dvd/BaseOS/
enabled=true
gpgcheck=false
[AppStream]
name=AppStream
baseurl=http://content.example.com/rhel8.0/x86_64/dvd/AppStream/
enabled=true
gpgcheck=false
:wq!
# yum clean all
# yum repolist all
----------------------------------------------------------------------------------------------------------------------
ANS:-
# lvs
# lsblk
# lvextend -L 310M /dev/myvg/mylv
# resize2fs /dev/mapper/myvg-mylv
# lsblk (verify)
# df -Th (verify)
----------------------------------------------------------------------------------------------------------
Q20. Add a swap partition of 512MB and mount it permanently.
-----------------------------------------------------------------------------------------------------------------
Q21. Create a logical volume of name "wshare" from a volume group name "wgroup"
physical extents of 16M and logical volume should
have size of 50extents.Formate with vfat filesystem and permanently mounted to
/mnt/wshare.
ANS:-
# gdisk /dev/vdb
Command (? for help): n
Partition number (3-128, default 3): 3
First sector (34-2047, default = 34) or {+-}size{KMGTP}: Press Enter
Last sector (34-2047, default = 2047) or {+-}size{KMGTP}: +1024M
Hex code or GUID (L to show codes, Enter = 8300): Press Enter
Command (? for help): t
Partition number (1-3): 3
Current type is 8300 (Linux filesystem)
Hex code or GUID (L to show codes, Enter = 8300): 8e00
Changed type of partition to 'Linux lvm'
Command (? for help): w
# udevadm settle
# pvcreate /dev/vdb3
# vgcreate -s 16M wgroup /dev/vdb3
# vgs / vgdisplay (verify)
# lvcreate -n wshare -l +50 wgroup /dev/vdb3
# lvdisplay (verify)
# mkfs vfat /dev/mapper/wgroup-wshare
# blkid
# mkdir /mnt/wshare
# vim /etc/fstab
/dev/mapper/wgroup-wshare /mnt/wshare vfat defaults 0 0
:wq
# mount -a
# lsblk (verify)
# reboot
# lsblk / df -Th (verify)
--------------------------------------------------------------------------------------------------------------------
ANS:-
# systemctl status tuned.service
# yum install tuned -y (If it's not installed)
# systemctl enable --now tuned.service
# tuned-adm recommend
virtul-guest (output)
# tuned-adm profile virtul-guest
# tuned-adm active
Current active profile: virtual-guest (output)
-------------------------------------------------------------------------------------------------------------------
BEST OF LUCK
-------------------------------------------------------------------------------------------------------------------