Sunteți pe pagina 1din 12

12/06/2019 RedHat Certified System Administrator-7 (RHCSA)- Questions with Solution.

– DevOpsAGE

RedHat Certi ed System Administrator-7 (RHCSA)-


Questions with Solution.
By DevopsAdmin | March 31, 2018 4 Comments

 Share  Tweet  Share  Share  Mail

In this blog, We will discuss the questions and its Solutions related to
the Redhat Certified System Administrator-7(RHCSA) (RHEL7 Q & A)
Examination. I’m writing this post, as I have already gone through this
examination and based on that questions, I thought of writing a post on it. You
can practice this on your Virtual machine and can appear for your
examination. Few things need to be kept under considerations.

Ldap Server needs to be configured


NTP(Network Time protocol) Server Should be Configured.

Note/Caution: This blog has been written to show you the exam pattern and to give you Linux System
Administration understanding. DevOpsAGE Technologies does not guarantee the passing of RedHat
Certified System Administration Exam.

So Let’s Start, You Will be Provided with the Network Details as


follow,

Note: Take care of the Ip’s, It will be different in the examination.

https://web.archive.org/web/20180926053149/http://www.devopsage.com/redhat-certified-system-administrator-7-rhcsa-questions-with-solution/ 1/12
12/06/2019 RedHat Certified System Administrator-7 (RHCSA)- Questions with Solution. – DevOpsAGE

Ethernet/Device = eth0
Hostname = serverX.example.com
IP address = 172.10.1.10
Netmask = 255.255.255.0
Default Gateway = 172.10.1.254
DNS search path = example.com
primary DNS server = 172.10.1.250

Prerequisite:

Step: 1 change the root password in your virtual machine using single user mode.
– No Marks for this activity.

Steps:-

login to the virtual machine and open terminal


Reboot the system, Interrupt the booting process
press “e”, delete the tty console in the second line and add “rd.break”
press ctrl+x
# mount -o, remount, rw /sysroot
# chroot /sysroot
# echo ‘your_password’ | passwd root –stdin
# touch /.autorelabel
# exit
Now, log in with the new password.

Step: 2. Create network Connection

# nmcli con add con-name eth0 ifname eth0 type ethernet


# nmcli con mod eth0 ipv4.address '172.10.1.10/24172.10.1.254' ipv4.dns172.10.1.250 ipv4.dns-searc
# nmcli con mod eth0 connection.autoconnect yes
# nmcli con up eth0
# nmcli con show
# nmcli device status
# systemctl enable network
# systemctl restart network
# hostnamectl set-hostname serverX.example.com
# systemctl set-default graphical.target
# systemctl isolate graphical.target
# systemctl restart network
# init 6

https://web.archive.org/web/20180926053149/http://www.devopsage.com/redhat-certified-system-administrator-7-rhcsa-questions-with-solution/ 2/12
12/06/2019 RedHat Certified System Administrator-7 (RHCSA)- Questions with Solution. – DevOpsAGE

Questions:

Qs-1. Configure yum client

Yum baseurl path = http://content.example.com/rhel7.0/x86_64/dvd

Solution:

# cd /etc/yum.repos.d
# rm -rf *
# vim devopsage.repo

[devopsage]
name=yum-repo
baseurl=http://content.example.com/rhel7.0/x86_64/dvd
gpgcheck=0
enabled=1
:wq

# yum clean all


# yum list all
# yum repolist

========================================================================================
==========

Qs-2. SELinux should be in enforcing mode on your both systems.

Solutions:

# getenforce
enforcing

If it is not in enforcing mode, then change it to enforcing mode by,

# vim /etc/selinux/config
SELINUX=enforcing
:wq!

# reboot

https://web.archive.org/web/20180926053149/http://www.devopsage.com/redhat-certified-system-administrator-7-rhcsa-questions-with-solution/ 3/12
12/06/2019 RedHat Certified System Administrator-7 (RHCSA)- Questions with Solution. – DevOpsAGE

Note: In order to reflect the changes, it is mandatory to reboot the system.

========================================================================================
==========

Qs-3. Install the appropriate Kernel from


http://server.domainX.example.com/pub/updates/kernel. Your machine should
boot with the updated kernel.

Solution:

# uname -r // Verify the Current Kernel


# yum install firefox* -y
# wget http://server.domainX.example.com/pub/updates/kernel.......rpm
# rpm -ivh kernel-firmware.2.-------.rpm
# init 6 // Choose the newly installed Kernel to boot

========================================================================================
=========

Qs-4. Create the “LVM” with the name “fedora” by using 100PE’s from the
volume group “redhat”. Consider the PE size as “8MB”. Mount it on /mnt/data
with filesystem xfs.

Note: In the exam, you should create an only extended partition, don’t create a primary
partition as 3 primary partitions already exist by default. So if you create a primary partition
you won’t be able to create a further partition.

Solution:

# fdisk -l
# fdisk /dev/vda (create a partition with "804M" & give hexa code as "8e" for linux LVM)
# partx -a /dev/vda (run this CMD twice)
(or)
# partprobe
# pvcreate /dev/vda4
# vgcreate -s 8M redhat /dev/vda4
# lvcreate -l 100 -n fedora redhat
# mkfs.xfs /dev/redhat/fedora
# blkid
# mkdir /mnt/date

# vim /etc/fstab

/dev/redhat/fedora /mnt/data xfs defaults 0 0


https://web.archive.org/web/20180926053149/http://www.devopsage.com/redhat-certified-system-administrator-7-rhcsa-questions-with-solution/ 4/12
12/06/2019 RedHat Certified System Administrator-7 (RHCSA)- Questions with Solution. – DevOpsAGE
/de / ed at/ edo a / t/data s de au ts 0 0

:wq

# mount -a
# df -h

========================================================================================
==========

Q5. Extend the lvm size to 250MB the location from “/dev/redhat/fedora”
without loosing any data.

Solution:

# lvextend -L +250M /dev/redhat/fedora


# lvs
# xfs_growfs /dev/redhat/fedora

Note: If it is in ext3 file system use below command,


# resize2fs/dev/redhat/fedora
# df -h

========================================================================================
==========

Qs-6. Extend the SWAP space with “512” MB don’t remove or extend the existing
swap. Your new Swap should be mounted at booting time also.

Solution:

# free -m
# fdisk -l
# fdisk /dev/vda // create a partition with 512M & give hexa code as 82
# partprobe
(or)
# partx -a /dev/vda // run this CMD twice
# mkswap /dev/vda5
# swapon /dev/vda5

# vim /etc/fstab

/dev/vda6 swap swap defaults 0 0

:wq
https://web.archive.org/web/20180926053149/http://www.devopsage.com/redhat-certified-system-administrator-7-rhcsa-questions-with-solution/ 5/12
12/06/2019 RedHat Certified System Administrator-7 (RHCSA)- Questions with Solution. – DevOpsAGE

# mount -a
# free -m

========================================================================================
==========

Qs-7. Create a group named “admin”

A user harry and natasha should belongs to “admin” group as a secondary


group with users password “wakennym”.
user sarah should not have access to interactive shell and she should not be
a member of “admin” group.

Solution:

# groupadd admin
# useradd -G admin harry
# useradd -G admin natasha
# useradd -s /sbin/nologin sarah
# passwd harry
# passwd natasha
# passwd sarah

OR

# echo "wakennym" | passwd --stdin sarah


# echo "wakennym" | passwd --stdin natasha
# echo "wakennym" | passwd --stdin harry
# cat /etc/passwd // Verify the newly created users
# cat /etc/group

========================================================================================
==========

Qs-8. Create the Directory “/home/admin” with the following characteristics.

Group ownership of “/home/admin” should go to “sysadmin” group.


The directory should have read, write & access permission for all members
of “sysadmin” group but not to any other users. ( It is
understood understand that the “root” has full access to all files present in
the system).
https://web.archive.org/web/20180926053149/http://www.devopsage.com/redhat-certified-system-administrator-7-rhcsa-questions-with-solution/ 6/12
12/06/2019 RedHat Certified System Administrator-7 (RHCSA)- Questions with Solution. – DevOpsAGE

Files created under “/home/admin” should get the same group ownership is
set to the “sysadmin” group.

# mkdir /home/admin
# chgrp sysadmin /home/admin
# chmod 2770 /home/admin
# ls -ld /home/admin

========================================================================================
==========

Qs-9. The user sarah must configure a cron job that runs daily at 14:23 every day.
and executes “/bin/echo “Welcome to the world of Linux”.

# crontab -eu sarah

23 14 * * * /bin/echo "Welcome to the world of Linux"

:wq

# systemctl restart crond


# systemctl enable crond
# crontab -lu sarah

========================================================================================
==========

Qs-10. Copy the file /etc/fstab to /var/tmp and configure the “ACL” as mention
following.

The file /vat/tmp/fstab is owned by the “root”.


The file /var/tmp/fstab belongs to the group “root”
The file /var/tmp/fstab should not be executable by any one.
The user “sarah” should able to read and write to the file.

The user “natasha” can neither read nor write to the file. other users (future and
current) shuold be able to read /var/tmp/fstab.

https://web.archive.org/web/20180926053149/http://www.devopsage.com/redhat-certified-system-administrator-7-rhcsa-questions-with-solution/ 7/12
12/06/2019 RedHat Certified System Administrator-7 (RHCSA)- Questions with Solution. – DevOpsAGE

# cp /etc/fstab /var/tmp
# setfacl -m u:sarah:rw- /var/tmp/fstab
# setfacl -m u:natasha:--- /var/tmp/fstab
# getfacl /var/tmp/fstab

========================================================================================
==========

Qs-11. Create the user “jein” with uid 4332 with password “wakennym”.

# useradd -u 4332 jein


# echo "wakennym" | passwd --stdin jein
(or)
# passwd jein

========================================================================================
==========

Qs-12. locate the files of owner “harry” and copy to the location /root/result
directory. Also preserve the permission, ownership and time stamp.

# mkdir /root/result
# find / -user harry -exec cp -rvfp {} /root/result/ \;
# cd /root/result
# ls -lrt

========================================================================================
=========

Qs-13. Find the string “squid” from “/usr/share/dict/words” file and copy the
lines in /root/lists.txt.

# grep "squid" /usr/share/dict/words > /root/lists.txt

========================================================================================
=========

https://web.archive.org/web/20180926053149/http://www.devopsage.com/redhat-certified-system-administrator-7-rhcsa-questions-with-solution/ 8/12
12/06/2019 RedHat Certified System Administrator-7 (RHCSA)- Questions with Solution. – DevOpsAGE

Qs-14. Note the following. BASE DN: dc=example,dc=com LDAP path


ldap://classroom.example.com/. Download the certificate from
“http://classroom.example.com/pub/example-ca.crt” Ldapuserx should login
into your system.

# yum install sssd authconfig-gtk -y


# system-config-authentication

Mention LDAP search base DN : dc=example,dc=com here,

LDAP SEVER = ldap://classroom.example.com/

Click the CA certificate http://classroom.example.com/pub/example-ca.crt

Click Apply

Provide the proper entries which are mention in the question paper & Click Apply

# getent passwd ldapuserX


or
# id ldapuser

========================================================================================
=========

Qs-15. Note the following,

classroom.example.com “Nfs exports” and Nfs Version 3


/home/guests/ldapuserX
Ldapuser’s home directory is
classroom.example.com:/home/guests/ldapuserX.
Ldapuser’s home directory should be automounted locally beneath
/home/guests/ldapuserX.
If login using ldapuserX then only home directory should accesible.

# yum install autofs* -y


# vim /etc/auto.master
/home/guests /etc/auto.misc
:wq
# vim /etc/auto.misc
ldapuserX -rw,vers=3 classroom.example.com:/home/guests/ldapuserX
:wq
# systemctl stop autofs.service
# systemctl start autofs service
https://web.archive.org/web/20180926053149/http://www.devopsage.com/redhat-certified-system-administrator-7-rhcsa-questions-with-solution/ 9/12
12/06/2019 RedHat Certified System Administrator-7 (RHCSA)- Questions with Solution. – DevOpsAGE
# systemctl start autofs.service
# systemctl enable autofs.service
# su - ldapuserX
# pwd

========================================================================================
==========

Qs-16. Synchronize time of your system with the server classroom.example.com.

# vim /etc/chrony.conf
// comment the above servers then write below as it is
serverX classroom.example.com iburst
:wq!
# systemctl restart chronyd.service
# systemctl enable chronyd.service
# chronyc sources -v
# timedatectl

NTP Sync: Yes

========================================================================================
========

Qs-17. Compression & archive for /etc folder in gunzip/bunzip2 format.

# tar czvf etc.tar.gz /etc


# du -h etc.tar.gz
(or)
# tar cjvf etc.tar.bz /etc
# du -h etc.tar.bz

If you Like Our Content here at Devopsage, then


please support us by sharing this post.

Please Like and follow us at, LinkedIn, Facebook, Twitter, and


GitHub

Also, Please comment on the post with your views and let us know if any
changes need to be done.

https://web.archive.org/web/20180926053149/http://www.devopsage.com/redhat-certified-system-administrator-7-rhcsa-questions-with-solution/ 10/12
12/06/2019 RedHat Certified System Administrator-7 (RHCSA)- Questions with Solution. – DevOpsAGE

Thanks!!

 Share  Tweet  Share  Share  Mail

Category: Linux Shell Script Tags: Redhat certified system administrator , RHCSA , RHCSA
Dumps

4 thoughts on “RedHat Certi ed System Administrator-7 (RHCSA)- Questions with Solution.”

Rich Davis
August 20, 2018

This is great stuff ! Thanks

Couple of corrections :-

Qs-8. Create the Directory “/home/admin” with the following characteristics.

“The directory should have read, write & access permission for all members…..”

Should read (replace access with execute) :-

“The directory should have read, write & EXECUTE permission for all members…..”

Qs-16. Synchronize time of your system with the server classroom.example.com.

# vim /etc/chrony.conf
// comment the above servers then write below as it is
serverX classroom.example.com iburst
:wq!

Should read (remove the X from serverX) :-

Qs-16. Synchronize time of your system with the server classroom.example.com.

# vim /etc/chrony.conf
// comment the above servers then write below as it is

https://web.archive.org/web/20180926053149/http://www.devopsage.com/redhat-certified-system-administrator-7-rhcsa-questions-with-solution/ 11/12
12/06/2019 RedHat Certified System Administrator-7 (RHCSA)- Questions with Solution. – DevOpsAGE

server classroom.example.com iburst


:wq!

DevopsAdmin Post author


August 24, 2018

Thanks Rich for Valuable comment, I will recheck and make changes accordingly.

Hillary
June 10, 2018

Extremely educative contents. I am preparing for RHCSA exams and i found the article
very elaborative. Share more Please. Thanks and keep it up.

DevopsAdmin Post author


June 12, 2018

Thanks Hillary, I’m Glad that you liked it. I will keep on updating the posts on Linux,
DevOps, cloud and more!!

https://web.archive.org/web/20180926053149/http://www.devopsage.com/redhat-certified-system-administrator-7-rhcsa-questions-with-solution/ 12/12

S-ar putea să vă placă și