RHCSA Answer 2024 Key
RHCSA Answer 2024 Key
0 (Question&Answer)
Node 1
1.Network Configuration :
a) Assign Hostname and IP address for your virtual machine.
Hostname node1.lab.example.com
IP Address 172.25.250.10
Netmask 255.255.255.0
Gateway 172.25.250.254
Nameserver 172.25.250.254
Answer :
Hostname :
# hostname
2.Create repository :
http://content.example.com/rhel9.0/x86_64/dvd/BaseOS
http://content.example.com/rhel9.0/x86_64/dvd/AppStream Answer :
# cd /etc/yum.repos.d/
# vim one.repo
[BaseOS] name=BaseOS
baseurl=http://content.example.com/rhel9.0/x86_64/dvd/BaseOS
enabled=1
gpgcheck=0
[AppStream] name=AppStream
baseurl=http://content.example.com/rhel9.0/x86_64/dvd/AppStream
enabled=1
gpgcheck=0
Esc:wq
# yum repolist
# journalctl -xe
# man semanage-port
# cd /var/www/html
# vi index.html
(welcome to apache!!)
#curl localhost:82
(It is understood that root has access to all files and directories on the system.)
c) Files created in /common/sysmgrp automatically have group ownership set to
the sysmgrp group.
Answer :
# mkdir -p /common/sysmgrp
# ls -ld /common/sysmgrp/
6.Configure autofs to auto mount the home directories of remote users Note
the following :
Example: remoteuser2 would configure the auto mount such that the home directory
/rhome/remoteuser2 gets mounted automatically upon login.
Answer :
# vim /etc/auto.master
/rhome /etc/auto.misc
# vim /etc/auto.misc
# mount -a
# su – remoteuser2
# pwd
6. Set a Cron job for harry on 12.30 at noon print /bin/echo on "HELLO HOW ARE
YOU".
Answer :
Answer :
# chronyc sources
# vim /etc/chrony.conf
# chronyc sources -v
Answer :
i) Find the string "ng" from /usr/share/dict/words copy all lines to file /root/files ii)
Answer :
13. Umask
a) All new creating files for user Natasha as –r-------- as default permission
b) All new creating Directories for user Natasha as dr-x------ as default permission
Answer:
# su – natasha
# ls –la
# vi .bash_profile
umask 277
:wq!
# logout
Answer :
# vim /etc/sudoers
Answer :
# wget http://content.example.com/mock/Containerfile #
podman build -t monitor .
14. Configure the container as a system start-up service and mount volumes
persistently
* Also ensure that container is running on the node1 even after system
reboot.
Answer :
Node 2
# touch /.autorelabel
# exit
# exit
2.Create repository :
http://content/rhel9.0/x86_64/dvd/BaseOS
http://content/rhel9.0/x86_64/dvd/AppStream Answer :
# cd /etc/yum.repos.d/
# vim two.repo
[BaseOS] name=BaseOS
baseurl=http://content.example.com/rhel9.0/x86_64/dvd/BaseOS
enabled=1
gpgcheck=0
[AppStream]
name=AppStream
baseurl=http://content.example.com/rhel9.0/x86_64/dvd/AppStream
enabled=1
gpgcheck=0
# yum clean all
# yum repolist
3.Create a swap partition with 756MiB
Answer :
# fdisk -l
(primary) / e (extended) 2
(partition number)
(show) w (save)
# mkswap /dev/vdb2
# blkid
Copy UUID
# vim /etc/fstab
# mount -a
# swapon -a
# swapon -s
Answer :
# fdisk -l
# fdisk /dev/vdb n (new) p
(primary) / e (extended) 3
(partition number)
# udevadm settle
# pvcreate /dev/vdb3
# pvdisplay
# vgcreate -s 16M qa /dev/vdb3
# vgdisplay
# lvcreate -l 50 -n qagroup qa
# lvdisplay
# mkfs.vfat /dev/qa/qagroup
# blkid /dev/qa/qagroup
copy UUID
# vim /etc/fstab
<UUID> /lvmsample vfat defaults 0 0
# mkdir /lvmsample
# mount -a
# df –hT or lsblk
5. Resize your logical volume lv-ose to 230MiB
Answer :
# lvdisplay
# df -h
# lvextend -r -L 230M /dev/vg0/lv-ose
Answer :
Min days:…
Warn age:…
2. Configure a application name is “rhcsa”, when rhcsa run, at the time Pandora user
should have message as “borough satrato”
Ans:
(As root user)
#yum install podman *
# ssh Pandora@node1
# podman login registry.net1.example.com (as per exam registry)
Username:
Password:
3. Create a script file as “newsearch” and the source of the file is /usr directory the file
size is +20K to -70K and copy the files in /root/output directory
Ans:
# vi /usr/local/bin/newsearch
[!/bin/bash
Find /usr –type f –size +20K –size -70K –exec cp {} /root/output \;]
#chmod +x /usr/local/bin/newsearch
#mkdir /root/output
# /. /usr/local/bin/newsearch
#cd /root/output
# ll –lh