1. Which service is used for managing SELinux policies?
semanage
firewalld
systemctl
selinuxctl
Show Answer
✅ Correct Answer: semanage
2. Which command is used to configure and manage firewall rules in RHEL 8?
firewall-cmd
iptables
nft
ufw
Show Answer
✅ Correct Answer: firewall-cmd
3. Which file stores persistent network interface configuration in RHEL?
/etc/sysconfig/network-scripts/
/etc/network/interfaces
/etc/netplan/
/etc/network.d/
Show Answer
✅ Correct Answer: /etc/sysconfig/network-scripts/
4. Which command is used to troubleshoot SELinux denials?
ausearch -m AVC
dmesg | grep selinux
journalctl -u selinux
sestatus -v
Show Answer
✅ Correct Answer: ausearch -m AVC
5. Which command is used to set up a software RAID in Linux?
mdadm
raidctl
lvmraid
mkraid
Show Answer
✅ Correct Answer: mdadm
6. Which command is used to list all SELinux booleans?
getsebool -a
seinfo -b
selinux-booleans
sestatus --booleans
Show Answer
✅ Correct Answer: getsebool -a
7. Which tool is used to manage logical volumes in Linux?
lvcreate
vgextend
fsck
mkfs
Show Answer
✅ Correct Answer: lvcreate
8. Which command is used to enable a service to start on boot?
systemctl enable
service enable
chkconfig on
initctl enable
Show Answer
✅ Correct Answer: systemctl enable
9. Which tool is used to monitor system logs in real-time?
journalctl -f
dmesg
syslogd
logread
Show Answer
✅ Correct Answer: journalctl -f
10. Which command is used to create an LVM volume group?
vgcreate
lvcreate
mkfs.ext4
vgextend
Show Answer
✅ Correct Answer: vgcreate
11. Which command is used to display SELinux context of files?
ls -Z
sestatus
getsebool
semodule -l
Show Answer
✅ Correct Answer: ls -Z
12. Which command is used to restart the networking service in RHEL 8?
systemctl restart NetworkManager
service network restart
systemctl restart networking
networkctl restart
Show Answer
✅ Correct Answer: systemctl restart NetworkManager
13. Which command is used to check active network connections?
ss -tuln
netstat -r
ip route show
ifconfig -a
Show Answer
✅ Correct Answer: ss -tuln
14. Which command is used to create a new partition in Linux?
fdisk
mkfs.ext4
parted
pvcreate
Show Answer
✅ Correct Answer: fdisk
15. Which command is used to resize a logical volume in LVM?
lvresize
vgextend
pvresize
lvextend
Show Answer
✅ Correct Answer: lvresize
16. Which command is used to enable IP forwarding in Linux?
echo 1 > /proc/sys/net/ipv4/ip_forward
sysctl -w net.ipv4.forward=1
ip_forward enable
netctl forward enable
Show Answer
✅ Correct Answer: echo 1 > /proc/sys/net/ipv4/ip_forward
17. Which command is used to apply SELinux policies?
restorecon
chcon
semanage apply
selinuxpolicy -apply
Show Answer
✅ Correct Answer: restorecon
18. Which file contains information about mounted file systems?
/etc/fstab
/etc/mtab
/proc/mounts
/var/log/mounts
Show Answer
✅ Correct Answer: /etc/fstab
19. Which command is used to check disk space usage?
df -h
du -sh
lsblk
fdisk -l
Show Answer
✅ Correct Answer: df -h
20. Which tool is used to update all installed packages in RHEL 8?
dnf update
yum update
apt upgrade
rpm -Uvh
Show Answer
✅ Correct Answer: dnf update
21. Which command is used to force a user logout in Linux?
pkill -KILL -u username
killall username
logout -f username
terminate username
Show Answer
✅ Correct Answer: pkill -KILL -u username
22. Which file is used to configure GRUB bootloader settings?
/etc/default/grub
/boot/grub.cfg
/etc/grub.conf
/boot/grub/menu.lst
Show Answer
✅ Correct Answer: /etc/default/grub
23. Which command is used to verify the integrity of an RPM package?
rpm -V
dnf check
yum verify
rpm --validate
Show Answer
✅ Correct Answer: rpm -V
24. Which command is used to start a service in systemd?
systemctl start
service start
initctl start
runlevel start
Show Answer
✅ Correct Answer: systemctl start
25. Which tool is used to manage containerized applications in RHEL 8?
Show Answer
✅ Correct Answer: podman
26. Configure firewalld to allow HTTP and HTTPS traffic permanently
firewall-cmd --permanent --add-service=http --add-service=https && firewall-cmd --reload
iptables -A INPUT -p tcp --dport 80,443 -j ACCEPT
echo "http https" > /etc/firewalld/allowed_services
setsebool -P httpd_can_network_connect 1
Show Answer
✅ Correct Answer: firewall-cmd --permanent --add-service=http --add-service=https && firewall-cmd --reload
27. Create a 5GB logical volume named "data_lv" in volume group "vg_data"
lvcreate -n data_lv -L 5G vg_data
lvm create -n data_lv -s 5G -g vg_data
mkvol -n data_lv -v vg_data -s 5G
vgcreate -n data_lv -s 5G vg_data
Show Answer
✅ Correct Answer: lvcreate -n data_lv -L 5G vg_data
28. Configure SELinux to allow Apache to connect to a non-standard port 8080
semanage port -a -t http_port_t -p tcp 8080
setsebool -P httpd_use_nonstandard_port 1
echo "8080 http_port_t" >> /etc/selinux/ports
chcon -t http_port_t 8080
Show Answer
✅ Correct Answer: semanage port -a -t http_port_t -p tcp 8080
29. Create an ext4 filesystem on /dev/vg_data/data_lv and mount it persistently at /data
mkfs.ext4 /dev/vg_data/data_lv && echo "/dev/vg_data/data_lv /data ext4 defaults 0 0" >> /etc/fstab && mount -a
format /dev/vg_data/data_lv ext4 && automount /data
newfs -t ext4 /dev/vg_data/data_lv /data
mkfs -t ext4 /dev/vg_data/data_lv && mount /dev/vg_data/data_lv /data
Show Answer
✅ Correct Answer: mkfs.ext4 /dev/vg_data/data_lv && echo "/dev/vg_data/data_lv /data ext4 defaults 0 0" >> /etc/fstab && mount -a
30. Configure NFS to share /shared with 192.168.1.0/24 with read/write access
Add "/shared 192.168.1.0/24(rw,sync)" to /etc/exports && exportfs -a
echo "192.168.1.0/24:/shared rw" > /etc/nfs.conf
nfsshare add /shared -net 192.168.1.0/24 -perm rw
share -p nfs -o rw=192.168.1.0/24 /shared
Show Answer
✅ Correct Answer: Add "/shared 192.168.1.0/24(rw,sync)" to /etc/exports && exportfs -a
31. Configure a cron job that runs /usr/local/bin/backup.sh every Sunday at 3 AM
crontab -e then add "0 3 * * 0 /usr/local/bin/backup.sh"
echo "0 3 * * 0 /usr/local/bin/backup.sh" >> /etc/crontab
addcron -d sunday -h 3 /usr/local/bin/backup.sh
schedule -t weekly -d 0 -h 3 /usr/local/bin/backup.sh
Show Answer
✅ Correct Answer: crontab -e then add "0 3 * * 0 /usr/local/bin/backup.sh"
32. Configure the system to use 192.168.1.1 as its default gateway
ip route add default via 192.168.1.1
route add default gw 192.168.1.1
echo "GATEWAY=192.168.1.1" >> /etc/sysconfig/network
netconfig set gateway 192.168.1.1
Show Answer
✅ Correct Answer: ip route add default via 192.168.1.1
33. Create a VDO volume named "vdo1" with 50GB physical size and 100GB logical size
vdo create --name=vdo1 --device=/dev/sdb --vdoLogicalSize=100G
mkvdo -n vdo1 -d /dev/sdb -p 50G -l 100G
vdocreate vdo1 /dev/sdb 50G 100G
createvdo --name vdo1 --size 50G --logical 100G
Show Answer
✅ Correct Answer: vdo create --name=vdo1 --device=/dev/sdb --vdoLogicalSize=100G
34. Configure a systemd service that restarts automatically if it fails
Add "Restart=on-failure" to the [Service] section in the unit file
systemctl enable autorestart servicename
echo "autorestart=true" >> /etc/systemd/service.conf
servicecfg set servicename autorestart=on
Show Answer
✅ Correct Answer: Add "Restart=on-failure" to the [Service] section in the unit file
35. Configure a user "admin" to have passwordless sudo access
Add "admin ALL=(ALL) NOPASSWD:ALL" to /etc/sudoers
usermod -aG wheel admin
echo "admin" >> /etc/sudoers.nopasswd
setpriv admin +sudo-nopasswd
Show Answer
✅ Correct Answer: Add "admin ALL=(ALL) NOPASSWD:ALL" to /etc/sudoers
36. Configure a MariaDB database to listen on port 3307 instead of 3306
Edit /etc/my.cnf.d/mariadb-server.cnf and add "port = 3307" under [mysqld] section
mysqladmin --port=3307
setsebool -P mysql_port_3307=1
echo "3307" > /etc/mysql/port
Show Answer
✅ Correct Answer: Edit /etc/my.cnf.d/mariadb-server.cnf and add "port = 3307" under [mysqld] section
37. Configure a Podman container to run Nginx on host port 8080
podman run -d --name nginx -p 8080:80 nginx
container start nginx -p 8080:80
podman create -e PORT=8080 nginx
docker run -p 8080 nginx
Show Answer
✅ Correct Answer: podman run -d --name nginx -p 8080:80 nginx
38. Configure a custom SELinux policy to allow Apache to write to /var/www/html/uploads
semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/uploads(/.*)?" && restorecon -Rv /var/www/html/uploads
chcon -t httpd_sys_content_t /var/www/html/uploads
setsebool -P httpd_write_content 1
selinux allow httpd /var/www/html/uploads w
Show Answer
✅ Correct Answer: semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/uploads(/.*)?" && restorecon -Rv /var/www/html/uploads
39. Configure a RAID 1 array using /dev/sdc and /dev/sdd
mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdc /dev/sdd
raidcreate /dev/md0 raid1 /dev/sdc /dev/sdd
mkraid /dev/md0 -l 1 -d /dev/sdc /dev/sdd
mdadm -C /dev/md0 -n 2 -l mirror /dev/sdc /dev/sdd
Show Answer
✅ Correct Answer: mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdc /dev/sdd
40. Configure the system to log all failed SSH login attempts to /var/log/ssh_fails.log
Add "auth.* /var/log/ssh_fails.log" to /etc/rsyslog.conf and restart rsyslog
echo "LogLevel VERBOSE" >> /etc/ssh/sshd_config
auditctl -w /usr/sbin/sshd -p wa -k sshd_logins
Add "session required pam_faillog.so silent audit deny=3" to /etc/pam.d/sshd
Show Answer
✅ Correct Answer: Add "auth.* /var/log/ssh_fails.log" to /etc/rsyslog.conf and restart rsyslog
41. Configure a systemd timer that runs /usr/local/bin/backup.sh daily at 2 AM
Create a .timer unit with OnCalendar=daily 02:00:00 and associate with a .service file
echo "0 2 * * * /usr/local/bin/backup.sh" > /etc/cron.d/backup
systemd-timer create --name=backup --on-calendar="02:00:00"
timed --add-job --command="/usr/local/bin/backup.sh" --daily --at=2am
Show Answer
✅ Correct Answer: Create a .timer unit with OnCalendar=daily 02:00:00 and associate with a .service file
42. Configure a network bond using interfaces eth0 and eth1 with mode 802.3ad
Create bond0 config in /etc/sysconfig/network-scripts/ with BONDING_OPTS="mode=4"
nmcli con add type bond ifname bond0 mode 802.3ad
ifenslave bond0 eth0 eth1
bondcreate --name=bond0 --mode=802.3ad eth0 eth1
Show Answer
✅ Correct Answer: Create bond0 config in /etc/sysconfig/network-scripts/ with BONDING_OPTS="mode=4"
43. Configure a Kerberos-authenticated NFSv4 share
Add "sec=krb5p" to the export options in /etc/exports and configure Kerberos principals
nfssec --enable kerberos
authconfig --enablenfsv4krb5 --update
echo "AUTH_GSS" > /etc/nfs.conf
Show Answer
✅ Correct Answer: Add "sec=krb5p" to the export options in /etc/exports and configure Kerberos principals