0 of 14 questions completed
This is a sample RHCSA exam for RHEL7. You’ve got 2 hours and half.
– a file system of 1GB for /home,
– 1GB of non-allocated space.
One precision: nobody checks your answers but solutions are provided.
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading...
You must sign in or sign up to start the quiz.
You have to finish following quiz, to start this quiz:
0 of 14 questions answered correctly
Time has elapsed
You have reached 0 of 0 points, (0)
Question 1 of 14
Install the Apache package. Allow it to get documents stored on NFS mounted directories.
# yum install -y httpd
# firewall-cmd –permanent –add-service=http
# firewall-cmd –reload
# systemctl enable httpd
# systemctl start httpd
# getsebool -a | grep nfs | grep httpd
# setsebool -P httpd_use_nfs on
Question 2 of 14
Extend the existing xfs file system to a total size of 200MB and add a label called myFS.
# lvextend –size 200M -r /dev/vg/lv_xfs
or # lvextend –size +100M -r /dev/vg/lv_xfs
# umount /xfs
# xfs_admin -L “myFS” /dev/vg/lv_xfs
# mount /xfs
Question 3 of 14
Assign the same SELinux contexts used by the home directories to the /xfs directory permanently.
# yum install -y setroubleshoot-server
# semanage fcontext -a -t user_home_dir_t “/xfs(/.*)?”
# restorecon -R /xfs
Question 4 of 14
Create two users: john with uid/gid equal to 2000, password 12345678 and davis with uid/gid equal to 3000, password 87654321. Make davis‘ account validity stopping in one month.
# useradd -u 2000 john
# passwd john
New password: 12345678
# useradd -u 3000 davis
# passwd davis
New password: 87654321
# date -d “+1month”
# usermod -e YYYY-MM-DD davis
or # chage -E YYYY-MM-DD davis
# chage -l davis
Question 5 of 14
Allow davis (and only davis) to get full access to john‘s home directory.
# setfacl -R -m u:davis:rwx /home/john
Question 6 of 14
Create a directory named /common. Allow john and davis to share documents in the /common directory using a group called team. Both of them can read, write and remove documents from the other in this directory but any user not member of the group can’t.
# mkdir /common
# groupadd -g 50000 team
# chgrp team /common
# chmod 2770 /common
# usermod -aG team john
# usermod -aG team davis
Question 7 of 14
Create a xfs file system on a new logical volume of 100MB called lv_xfs. Mount it permanently with uuid under /xfs.
# lvcreate –size 100M –name lv_xfs /dev/vg
# mkfs.xfs /dev/vg/lv_xfs
# mkdir /xfs
# blkid | grep lv_xfs >> /etc/fstab
# vi /etc/fstab
UUID=… /xfs xfs defaults 1 2
# mount -a
Question 8 of 14
Write a Bash script called prog.sh in the /root directory that creates 40 files of 2MB each with the fallocate command in the mounted /xfs directory. Each file has got a name as follows: .file_N where N is a number from 1 to 40.
while [ “$N” -gt 0 ]
fallocate -l 2M .file_$N
N=`expr $N – 1`
# chmod u+x prog.sh
Question 9 of 14
Create an ext4 file system on a new logical volume of 100MB called lv_ext4. Mount it permanently under the /ext4 directory. Copy the files previously created into this new space.
# lvcreate –size 100M –name lv_ext4 /dev/vg
# mkfs.ext4 /dev/vg/lv_ext4
# mkdir /ext4
# vi /etc/fstab
/dev/vg/lv_ext4 /ext4 ext4 defaults 1 2
# cp -p /xfs/.f* /ext4
Question 10 of 14
Configure a virtual console.
# grubby –update-kernel=ALL –args=”console=ttyS0″
Question 11 of 14
Create a logical volume of 200MB called lv_swap2 and add it permanently to the current swap space.
# lvcreate –size 200M –name lv_swap2 /dev/vg
# mkswap /dev/vg/lv_swap2
# swapon /dev/vg/lv_swap2
/dev/vg/lv_swap2 swap swap defaults 0 0
Question 12 of 14
Create a cron job running as root, starting at 11PM every day and writing a report on daily system resource consumption in the /var/log/consumption.log file.
# crontab -e
00 23 * * * /usr/bin/sar -A > /var/log/consumption.log
Question 13 of 14
Set the default target to boot into X Window level (previously level 5).
# systemctl set-default graphical.target
Question 14 of 14
Change the hostname to mycentos.example.com
# hostnamectl set-hostname mycentos.example.com