Exam4Training

RedHat EX200 Red Hat Certified System Administrator – RHCSA Online Training

Question #1

CORRECT TEXT

Notes:

NFS NFS instructor.example.com:/var/ftp/pub/rhel6/dvd

YUM http://instructor.example.com/pub/rhel6/dvd

ldap http//instructor.example.com/pub/EXAMPLE-CA-CERT

Install dialog package.

Reveal Solution Hide Solution

Correct Answer: yum install dialog
Question #2

CORRECT TEXT

Install a FTP server, and request to anonymous download from /var/ftp/pub catalog. (it needs you to configure yum direct to the already existing file server.)

Reveal Solution Hide Solution

Correct Answer: # cd /etc/yum.repos.d

# vim local.repo [local] name=local.repo

baseurl=file:///mnt

enabled=1

gpgcheck=0

# yum makecache

# yum install -y vsftpd

# service vsftpd restart

# chkconfig vsftpd on

# chkconfig –list vsftpd

# vim /etc/vsftpd/vsftpd.conf anonymous_enable=YES

Question #3

CORRECT TEXT

Configure /var/tmp/fstab Permission.

Copy the file /etc/fstab to /var/tmp/fstab. Configure var/tmp/fstab permissions as the following:

Owner of the file /var/tmp/fstab is Root, belongs to group root File /var/tmp/fstab cannot be executed by any user

User natasha can read and write /var/tmp/fstab User harry cannot read and write /var/tmp/fstab

All other users (present and future) can read var/tmp/fstab.

Reveal Solution Hide Solution

Correct Answer: cp /etc/fstab /var/tmp/

✑ /var/tmp/fstab view the owner setfacl -m u:natasha:rw- /var/tmp/fstab setfacl -m u:haryy:— /var/tmp/fstab

Use getfacl /var/tmp/fstab to view permissions

Question #4

CORRECT TEXT

According the following requirements to create a local directory /common/admin.

✑ This directory has admin group.

✑ This directory has read, write and execute permissions for all admin group members.

✑ Other groups and users don’t have any permissions.

✑ All the documents or directories created in the/common/admin are automatically inherit the admin group.

Reveal Solution Hide Solution

Correct Answer: mkdir -p /common/admin

chgrp admin /common/admin

chmod 2770 /common/admin

Question #5

CORRECT TEXT

You are new System Administrator and from now you are going to handle the system and your main task is Network monitoring, Backup and Restore. But you don’t know the root password. Change the root password to redhat and login in default Runlevel.

Reveal Solution Hide Solution

Correct Answer: When you Boot the System, it starts on default Runlevel specified in /etc/inittab:

Id:?:initdefault:

When System Successfully boot, it will ask for username and password. But you don’t know the root’s password. To change the root password you need to boot the system into single user mode. You can pass the kernel arguments from the boot loader.

Question #5

CORRECT TEXT

You are new System Administrator and from now you are going to handle the system and your main task is Network monitoring, Backup and Restore. But you don’t know the root password. Change the root password to redhat and login in default Runlevel.

Reveal Solution Hide Solution

Correct Answer: When you Boot the System, it starts on default Runlevel specified in /etc/inittab:

Id:?:initdefault:

When System Successfully boot, it will ask for username and password. But you don’t know the root’s password. To change the root password you need to boot the system into single user mode. You can pass the kernel arguments from the boot loader.

Question #5

CORRECT TEXT

You are new System Administrator and from now you are going to handle the system and your main task is Network monitoring, Backup and Restore. But you don’t know the root password. Change the root password to redhat and login in default Runlevel.

Reveal Solution Hide Solution

Correct Answer: When you Boot the System, it starts on default Runlevel specified in /etc/inittab:

Id:?:initdefault:

When System Successfully boot, it will ask for username and password. But you don’t know the root’s password. To change the root password you need to boot the system into single user mode. You can pass the kernel arguments from the boot loader.

Question #5

CORRECT TEXT

You are new System Administrator and from now you are going to handle the system and your main task is Network monitoring, Backup and Restore. But you don’t know the root password. Change the root password to redhat and login in default Runlevel.

Reveal Solution Hide Solution

Correct Answer: When you Boot the System, it starts on default Runlevel specified in /etc/inittab:

Id:?:initdefault:

When System Successfully boot, it will ask for username and password. But you don’t know the root’s password. To change the root password you need to boot the system into single user mode. You can pass the kernel arguments from the boot loader.

Question #5

CORRECT TEXT

You are new System Administrator and from now you are going to handle the system and your main task is Network monitoring, Backup and Restore. But you don’t know the root password. Change the root password to redhat and login in default Runlevel.

Reveal Solution Hide Solution

Correct Answer: When you Boot the System, it starts on default Runlevel specified in /etc/inittab:

Id:?:initdefault:

When System Successfully boot, it will ask for username and password. But you don’t know the root’s password. To change the root password you need to boot the system into single user mode. You can pass the kernel arguments from the boot loader.

Question #5

CORRECT TEXT

You are new System Administrator and from now you are going to handle the system and your main task is Network monitoring, Backup and Restore. But you don’t know the root password. Change the root password to redhat and login in default Runlevel.

Reveal Solution Hide Solution

Correct Answer: When you Boot the System, it starts on default Runlevel specified in /etc/inittab:

Id:?:initdefault:

When System Successfully boot, it will ask for username and password. But you don’t know the root’s password. To change the root password you need to boot the system into single user mode. You can pass the kernel arguments from the boot loader.

Question #5

CORRECT TEXT

You are new System Administrator and from now you are going to handle the system and your main task is Network monitoring, Backup and Restore. But you don’t know the root password. Change the root password to redhat and login in default Runlevel.

Reveal Solution Hide Solution

Correct Answer: When you Boot the System, it starts on default Runlevel specified in /etc/inittab:

Id:?:initdefault:

When System Successfully boot, it will ask for username and password. But you don’t know the root’s password. To change the root password you need to boot the system into single user mode. You can pass the kernel arguments from the boot loader.

Question #12

CORRECT TEXT

Add users: user2, user3.

The Additional group of the two users: user2, user3 is the admin group Password: redhat

Reveal Solution Hide Solution

Correct Answer: # useradd -G admin user2

# useradd -G admin user3

# passwd user2

redhat

# passwd user3 redhat

Question #13

CORRECT TEXT

A YUM repository has been provided at http://server.domain11.example.com/pub/x86_64/Server.

Configure your system to use this location as a default repository.

Reveal Solution Hide Solution

Correct Answer: vim/etc/yum.repos/base.repo

[base]

name=base

baseurl= http://server.domain11.example.com/pub/x86_64/Server

gpgcheck=0

enable=1

Save and Exit

Use yum list for validation, the configuration is correct if list the package information. If the Yum configuration is not correct then maybe cannot answer the following questions.

Question #14

CORRECT TEXT

Create a new logical volume according to the following requirements:

The logical volume is named database and belongs to the datastore volume group and has a size of 50 extents.

Logical volumes in the datastore volume group should have an extent size of 16 MB.

Format the new logical volume with a ext3 filesystem.

The logical volume should be automatically mounted under /mnt/database at system boot time.

Reveal Solution Hide Solution

Correct Answer: fdisk -cu /dev/vda

partx -a /dev/vda

pvcreate /dev/vdax

vgcreate datastore /dev/vdax -s 16M

lvcreate-l 50 -n database datastore

mkfs.ext3 /dev/datastore/database

mkdir /mnt/database

mount /dev/datastore/database /mnt/database/ df -Th

vi /etc/fstab

/dev/datastore /database /mnt/database/ ext3 defaults 0 0 mount -a

Question #14

CORRECT TEXT

Create a new logical volume according to the following requirements:

The logical volume is named database and belongs to the datastore volume group and has a size of 50 extents.

Logical volumes in the datastore volume group should have an extent size of 16 MB.

Format the new logical volume with a ext3 filesystem.

The logical volume should be automatically mounted under /mnt/database at system boot time.

Reveal Solution Hide Solution

Correct Answer: fdisk -cu /dev/vda

partx -a /dev/vda

pvcreate /dev/vdax

vgcreate datastore /dev/vdax -s 16M

lvcreate-l 50 -n database datastore

mkfs.ext3 /dev/datastore/database

mkdir /mnt/database

mount /dev/datastore/database /mnt/database/ df -Th

vi /etc/fstab

/dev/datastore /database /mnt/database/ ext3 defaults 0 0 mount -a

Question #14

CORRECT TEXT

Create a new logical volume according to the following requirements:

The logical volume is named database and belongs to the datastore volume group and has a size of 50 extents.

Logical volumes in the datastore volume group should have an extent size of 16 MB.

Format the new logical volume with a ext3 filesystem.

The logical volume should be automatically mounted under /mnt/database at system boot time.

Reveal Solution Hide Solution

Correct Answer: fdisk -cu /dev/vda

partx -a /dev/vda

pvcreate /dev/vdax

vgcreate datastore /dev/vdax -s 16M

lvcreate-l 50 -n database datastore

mkfs.ext3 /dev/datastore/database

mkdir /mnt/database

mount /dev/datastore/database /mnt/database/ df -Th

vi /etc/fstab

/dev/datastore /database /mnt/database/ ext3 defaults 0 0 mount -a

Question #17

Find all the files or directories with Lucy as the owner, and copy to /tmp/findfiles directory.

Reveal Solution Hide Solution

Correct Answer: (1) find /etc -size 10k -exec cp {} /tmp/findfiles ;

(2) find / -user lucy -exec cp -a {} /tmp/findfiles ;

Note: If find users and permissions, you need to use cp – a options, to keep file permissions and user attributes etc.

Question #18

CORRECT TEXT

Upgrading the kernel as 2.6.36.7.1, and configure the system to Start the default kernel, keep the old kernel available.

Reveal Solution Hide Solution

Correct Answer: # cat /etc/grub.conf

# cd /boot

# lftp it

# get dr/dom/kernel-xxxx.rpm

# rpm -ivh kernel-xxxx.rpm

# vim /etc/grub.conf default=0

Question #19

CORRECT TEXT

Locate all the files owned by ira and copy them to the / root/findresults directory.

Reveal Solution Hide Solution

Correct Answer: # find / -user ira > /root/findresults (if /root/findfiles is a file)

# mkdir -p /root/findresults

# find / -user ira -exec cp -a {} /root/findresults; [ if /root/findfiles is a directory] ls /root/findresults

Question #20

CORRECT TEXT

Configure your web services, download from

http://instructor.example.com/pub/serverX.html And the services must be still running after

system rebooting.

Reveal Solution Hide Solution

Correct Answer: cd /var/www/html

wget http://instructor.example.com/pub/serverX.html mv serverX.html index.html

/etc/init.d/httpd restart

chkconfig httpd on

Question #21

CORRECT TEXT

SELinux must be running in the Enforcing mode.

Reveal Solution Hide Solution

Correct Answer: getenforce // Check the current mode of SELinux // SELinux runs in enforcing mode //

Check

getenforce 1

getenforce

vim /etc/selinux/config selinux=enforcing // To temporarily enable SELinux

wg

sestatus

Question #22

CORRECT TEXT

Create a volume group, and set the size is 500M, the size of single PE is 16M. Create logical volume named lv0 in this volume group, set size is 20 PE, make it as ext3 file system, and mounted automatically under data.

Reveal Solution Hide Solution

Correct Answer: fdisk /dev/vda

pvcreate /dev/vda3

vgcreate Cs 16M vg0 /dev/vda3

lvcreate Cn lv0 Cl 20 vg0

mkfs.ext3 /dev/mapper/vg0-lv0

mkdir /data

/etc/fstab:

/dev/mapper/vg0-lv0 /data ext3 defaults 0 0

mount Ca

mount | grep data

Question #23

CORRECT TEXT

Create a backup file named /root/backup.tar.bz2, which contains the contents of /usr/local, bar must use the bzip2 compression.

Reveal Solution Hide Solution

Correct Answer: cd /usr/local

tar -jcvf /root/backup.tar.bz2*

mkdir /test

tar -jxvf /root/backup.tar.bz2 -C /test/

Question #23

CORRECT TEXT

Create a backup file named /root/backup.tar.bz2, which contains the contents of /usr/local, bar must use the bzip2 compression.

Reveal Solution Hide Solution

Correct Answer: cd /usr/local

tar -jcvf /root/backup.tar.bz2*

mkdir /test

tar -jxvf /root/backup.tar.bz2 -C /test/

Question #23

CORRECT TEXT

Create a backup file named /root/backup.tar.bz2, which contains the contents of /usr/local, bar must use the bzip2 compression.

Reveal Solution Hide Solution

Correct Answer: cd /usr/local

tar -jcvf /root/backup.tar.bz2*

mkdir /test

tar -jxvf /root/backup.tar.bz2 -C /test/

Question #26

vi /etc/sysctl.conf net.ipv4.ip_forward=1

Reveal Solution Hide Solution

Correct Answer: /proc is the virtual filesystem, containing the information about the running kernel.

To change the parameter of running kernel you should modify on /proc. From Next reboot the system, kernel will take the value from /etc/sysctl.conf.

Question #27

CORRECT TEXT

Install the appropriate kernel update from

http://server.domain11.example.com/pub/updates.

The following criteria must also be met:

The updated kernel is the default kernel when the system is rebooted

The original kernel remains available and bootable on the system

Reveal Solution Hide Solution

Correct Answer: ✑ ftp server.domain11.example.com Anonymous login

ftp> cd /pub/updates ftp> ls

ftp> mget kernel* ftp> bye

✑ rpm -ivh kernel* ✑ vim /etc/grub.conf

Check the updatted kernel is the first kernel and the orginal kernel remains available. set

default=0

wq!

Question #28

CORRECT TEXT

Make on /archive directory that only the user owner and group owner member can fully access.

Reveal Solution Hide Solution

Correct Answer: ✑ chmod 770 /archive

✑ Verify using : ls -ld /archive Preview should be like:

drwxrwx— 2 root sysuser 4096 Mar 16 18:08 /archive

To change the permission on directory we use the chmod command. According to the question that only the owner user (root) and group member (sysuser) can fully access the directory so: chmod 770 /archive

Question #29

CORRECT TEXT

Create a 2G swap partition which take effect automatically at boot-start, and it should not affect the original swap partition.

Reveal Solution Hide Solution

Correct Answer: # fdisk /dev/sda

p

(check Partition table) n

(create new partition: press e to create extended partition, press p to create the main partition, and the extended partition is further divided into logical partitions)

Enter

+2G t

8 I

82 W

partx -a /dev/sda partprobe mkswap /dev/sda8

Copy UUID

swapon -a

vim /etc/fstab

UUID=XXXXX swap swap defaults 0 0

(swapon -s)

Question #30

CORRECT TEXT

Configure the system synchronous as 172.24.40.10.

Reveal Solution Hide Solution

Correct Answer: Graphical Interfaces:

System–>Administration–>Date & Time

OR

# system-config-date

Question #31

CORRECT TEXT

Part 2 (on Node2 Server)

Task 7 [Implementing Advanced Storage Features]

Create a thin-provisioned filesystem with the name think_fs from a pool think_pool using the devices.

The filesystem should be mounted on /strav and must be persistent across reboot

Reveal Solution Hide Solution

Correct Answer: *

[root@node2 ~]# lsblk

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT

vdd 252:48 0 5G 0 disk

vde 252:64 0 10G 0 disk

vdo1 253:4 0 50G 0 vdo /vbread

[root@node2 ~]# yum install stratis* -y

[root@node2 ~]# systemctl enable –now stratisd.service [root@node2 ~]# systemctl start stratisd.service [root@node2 ~]# systemctl status stratisd.service [root@node2 ~]# stratis pool create think_pool /dev/vdd [root@node2 ~]# stratis pool list Name Total Physical Properties

think_pool 5 GiB / 37.63 MiB / 4.96 GiB ~Ca,~Cr

*

[root@node2 ~]# stratis filesystem create think_pool think_fs [root@node2 ~]# stratis filesystem list

Pool Name Name Used Created Device UUID

think_pool think_fs 546 MiB Mar 23 2021 08:21 /stratis/think_pool/think_fs ade6fdaab06449109540c2f3fdb9417d [root@node2 ~]# mkdir /strav

[root@node2 ~]# lsblk

[root@node2 ~]# blkid

/dev/mapper/stratis-1-91ab9faf36a540f49923321ba1c5e40d-thin-fs-

ade6fdaab06449109540c2f3fdb9417d: UUID="ade6fdaa-b064-4910-9540-c2f3fdb9417d"

BLOCK_SIZE="512" TYPE="xfs"

*

[root@node2 ~]# vim /etc/fstab

UUID=ade6fdaa-b064-4910-9540-c2f3fdb9417d /strav xfs defaults,x-

systemd.requires=stratisd.service 0 0

[root@node2 ~]# mount /stratis/think_pool/think_fs /strav/

[root@node2 ~]# df -hT

/dev/mapper/stratis-1-91ab9faf36a540f49923321ba1c5e40d-thin-fs-

ade6fdaab06449109540c2f3fdb9417d xfs 1.0T 7.2G 1017G 1% /strav

Question #32

CORRECT TEXT

SELinux must run in force mode.

Reveal Solution Hide Solution

Correct Answer: /etc/sysconfig/selinux

SELINUX=enforcing

Question #33

CORRECT TEXT

Create a 2G swap partition which take effect automatically at boot-start, and it should not affect the original swap partition.

Reveal Solution Hide Solution

Correct Answer: # fdisk /dev/sda

p

(check Partition table) n

(create new partition: press e to create extended partition, press p to create the main partition, and the extended partition is further divided into logical partitions) Enter +2G

t l

W

partx -a /dev/sda partprobe mkswap /dev/sda8

Copy UUID

swapon -a

vim /etc/fstab

UUID=XXXXX swap swap defaults 0 0

(swapon -s)

Question #34

CORRECT TEXT

Part 1 (on Node1 Server)

Task 17 [Accessing Linux File Systems]

Find all the files owned by user “alex” and redirect the output to /home/alex/files.

Reveal Solution Hide Solution

Correct Answer: * root@node1 ~]# find / -user alex -type f > /home/alex/files
Question #35

CORRECT TEXT

According the following requirements to create user, user group and the group members:

– A group named admin.

– A user named mary, and belong to admin as the secondary group.

– A user named alice, and belong to admin as the secondary group.

– A user named bobby, bobby’s login shell should be non-interactive. Bobby not belong to admin as the secondary group.

Mary, Alice, bobby users must be set "password" as the user’s password.

Reveal Solution Hide Solution

Correct Answer: groupadd admin

useradd -G admin mary

useradd -G admin alice

useradd -s /sbin/nologin bobby

echo "password" | passwd –stdin mary

echo "password" | passwd –stdin alice

echo "password" | passwd –stdin bobby

Question #36

CORRECT TEXT

Open kmcrl value of 5, and can verify in /proc/ cmdline

Reveal Solution Hide Solution

Correct Answer: # vim /boot/grub/grub.conf

kernel/vmlinuz-2.6.32-71.el6.x86_64 ro root=/dev/mapper/GLSvg-

GLSrootrd_LVM_LV=GLSvg/GLSroot

rd_LVM_LV=GLSvg/GLSswaprd_NO_LUKSrd_NO_MDrd_NO_DM

LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto rhgb quiet kmcrl=5

Restart to take effect and verification:

# cat /proc/cmdline

ro root=/dev/mapper/GLSvg-GLSroot rd_LVM_LV=GLSvg/GLSroot rd_LVM_LV=GLSvg/GLSswap rd_NO_LUKS rd_NO_MD rd_NO_DM

LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rhgb quiet kmcrl=5

Question #37

CORRECT TEXT

Resize the logical volume vo and its filesystem to 290 MB. Make sure that the filesystem contents remain intact.

Note: Partitions are seldom exactly the same size requested, so a size within the range of 260 MB to 320 MiB is acceptable.

Reveal Solution Hide Solution

Correct Answer: df -hT

lvextend -L +100M /dev/vg0/vo

lvscan

xfs_growfs /home/ // home is LVM mounted directory

Note: This step is only need to do in our practice environment, you do not need to do in the real exam

resize2fs /dev/vg0/vo // Use this comand to update in the real exam df -hT OR

e2fsck -f/dev/vg0/vo

umount /home

resize2fs /dev/vg0/vo required partition capacity such as 100M lvreduce -l 100M /dev/vg0/vo mount /dev/vg0/vo /home

df CHt

Question #38

CORRECT TEXT

User mary must configure a task.

Requirement: The local time at 14:23 every day echo "Hello World.".

Reveal Solution Hide Solution

Correct Answer: crontab -u mary -e

23 14 * * * echo "Hello World."

Question #39

CORRECT TEXT

Part 1 (on Node1 Server)

Task 10 [Configuring NTP/Time Synchronization]

Configure your system so that it is an NTP client of utility.domain15.example.com

The system time should be set to your (or nearest to you) timezone and ensure NTP sync is configured

Reveal Solution Hide Solution

Correct Answer: *

[root@node1 ~]# yum install chrony

[root@node1 ~]# vim /etc/chrony.conf

pool utility.domain15.example.com iburst

[root@node1 ~]# systemctl enable chronyd

[root@node1 ~]# systemctl restart chronyd

[root@node1 ~]# systemctl status chronyd

[root@node1 ~]# tzselect

Please identify a location so that time zone rules can be set correctly.

Please select a continent, ocean, "coord", or "TZ".

1) Africa

2) Americas

3) Antarctica

4) Asia

11) TZ – I want to specify the time zone using the Posix TZ format. #? 4

*

Please select a country whose clocks agree with yours.

1) Afghanistan 18) Israel 35) Palestine

2) Armenia 19) Japan 36) Philippines

3) Azerbaijan 20) Jordan 37) Qatar

4) Bahrain 21) Kazakhstan 38) Russia

5) Bangladesh 22) Korea (North) 39) Saudi Arabia #? 5

The following information has been given: Bangladesh

Therefore TZ=’Asia/Dhaka’ will be used. Is the above information OK?

1) Yes

2) No

#? 1

Asia/Dhaka

[root@node1 ~]# chronyc sources -v

^? utility.domain15.example> 0 7 0 – +0ns[ +0ns] +/- 0ns

Question #40

CORRECT TEXT

In the system, mounted the iso image /root/examine.iso to/mnt/iso directory. And enable automatically mount (permanent mount) after restart system.

Reveal Solution Hide Solution

Correct Answer: mkdir -p /mnt/iso

/etc/fstab:

/root/examine.iso /mnt/iso iso9660 loop 0 0 mount -a mount | grep examine

Question #41

CORRECT TEXT

Configure a task: plan to run echo "file" command at 14:23 every day.

Reveal Solution Hide Solution

Correct Answer: (a) Created as administrator

# crontab -u natasha -e 23 14 * * * /bin/echo "file"

(b)Created as natasha

# su – natasha $ crontab -e

23 14 * * * /bin/echo "file"

Question #42

CORRECT TEXT

Configure the verification mode of your host account and the password as LDAP. And it can login successfully through ldapuser40. The password is set as "password". And the certificate can be downloaded from http://ip/dir/ldap.crt. After the user logs on the user has no host directory unless you configure the autofs in the following questions.

Reveal Solution Hide Solution

Correct Answer: system-config-authentication

LDAP Server: ldap//instructor.example.com (In domain form, not write IP)

OR

# yum groupinstall directory-client (1.krb5-workstation 2.pam-krb5 3.sssd)

# system-config-authentication

Question #42

CORRECT TEXT

Configure the verification mode of your host account and the password as LDAP. And it can login successfully through ldapuser40. The password is set as "password". And the certificate can be downloaded from http://ip/dir/ldap.crt. After the user logs on the user has no host directory unless you configure the autofs in the following questions.

Reveal Solution Hide Solution

Correct Answer: system-config-authentication

LDAP Server: ldap//instructor.example.com (In domain form, not write IP)

OR

# yum groupinstall directory-client (1.krb5-workstation 2.pam-krb5 3.sssd)

# system-config-authentication

Question #42

CORRECT TEXT

Configure the verification mode of your host account and the password as LDAP. And it can login successfully through ldapuser40. The password is set as "password". And the certificate can be downloaded from http://ip/dir/ldap.crt. After the user logs on the user has no host directory unless you configure the autofs in the following questions.

Reveal Solution Hide Solution

Correct Answer: system-config-authentication

LDAP Server: ldap//instructor.example.com (In domain form, not write IP)

OR

# yum groupinstall directory-client (1.krb5-workstation 2.pam-krb5 3.sssd)

# system-config-authentication

Question #42

CORRECT TEXT

Configure the verification mode of your host account and the password as LDAP. And it can login successfully through ldapuser40. The password is set as "password". And the certificate can be downloaded from http://ip/dir/ldap.crt. After the user logs on the user has no host directory unless you configure the autofs in the following questions.

Reveal Solution Hide Solution

Correct Answer: system-config-authentication

LDAP Server: ldap//instructor.example.com (In domain form, not write IP)

OR

# yum groupinstall directory-client (1.krb5-workstation 2.pam-krb5 3.sssd)

# system-config-authentication

Question #42

CORRECT TEXT

Configure the verification mode of your host account and the password as LDAP. And it can login successfully through ldapuser40. The password is set as "password". And the certificate can be downloaded from http://ip/dir/ldap.crt. After the user logs on the user has no host directory unless you configure the autofs in the following questions.

Reveal Solution Hide Solution

Correct Answer: system-config-authentication

LDAP Server: ldap//instructor.example.com (In domain form, not write IP)

OR

# yum groupinstall directory-client (1.krb5-workstation 2.pam-krb5 3.sssd)

# system-config-authentication

Question #42

CORRECT TEXT

Configure the verification mode of your host account and the password as LDAP. And it can login successfully through ldapuser40. The password is set as "password". And the certificate can be downloaded from http://ip/dir/ldap.crt. After the user logs on the user has no host directory unless you configure the autofs in the following questions.

Reveal Solution Hide Solution

Correct Answer: system-config-authentication

LDAP Server: ldap//instructor.example.com (In domain form, not write IP)

OR

# yum groupinstall directory-client (1.krb5-workstation 2.pam-krb5 3.sssd)

# system-config-authentication

Question #48

CORRECT TEXT

Configure iptables, there are two domains in the network, the address of local domain is 172.24.0.0/16 other domain is 172.25.0.0/16, now refuse domain 172.25.0.0/16 to access the server.

Reveal Solution Hide Solution

Correct Answer: below

✑ iptables -F

✑ service iptables save

✑ iptables -A INPUT -s 172.25.0.0/16 -j REJECT ✑ service iptables save

✑ service iptables restart

Question #48

CORRECT TEXT

Configure iptables, there are two domains in the network, the address of local domain is 172.24.0.0/16 other domain is 172.25.0.0/16, now refuse domain 172.25.0.0/16 to access the server.

Reveal Solution Hide Solution

Correct Answer: below

✑ iptables -F

✑ service iptables save

✑ iptables -A INPUT -s 172.25.0.0/16 -j REJECT ✑ service iptables save

✑ service iptables restart

Question #48

CORRECT TEXT

Configure iptables, there are two domains in the network, the address of local domain is 172.24.0.0/16 other domain is 172.25.0.0/16, now refuse domain 172.25.0.0/16 to access the server.

Reveal Solution Hide Solution

Correct Answer: below

✑ iptables -F

✑ service iptables save

✑ iptables -A INPUT -s 172.25.0.0/16 -j REJECT ✑ service iptables save

✑ service iptables restart

Question #51

168.1.0/24 Network’s Host.

Reveal Solution Hide Solution

Correct Answer: ✑ vi /etc/sysconfing/network NETWORKING=yes HOSTNAME=station?.example.com GATEWAY=192.168.0.254

service network restart

Question #51

168.1.0/24 Network’s Host.

Reveal Solution Hide Solution

Correct Answer: ✑ vi /etc/sysconfing/network NETWORKING=yes HOSTNAME=station?.example.com GATEWAY=192.168.0.254

service network restart

Question #53

CORRECT TEXT

Part 1 (on Node1 Server)

Task 16 [Running Containers]

Configure your host journal to store all journal across reboot

Copy all journal files from /var/log/journal/ and put them in the /home/shangrila/container-logserver

Create and mount /home/shangrila/container-logserver as a persistent storage to the container as /var/log/ when container start

Reveal Solution Hide Solution

Correct Answer: *

[shangrila@node1 ~]$ podman ps

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

d5ffe018a53c registry.domain15.example.com:5000/rhel8/rsyslog:latest /bin/rsyslog.sh 5

seconds ago Up 4 seconds ago logserver

[shangrila@node1 ~]$ podman stats logserver

Error: stats is not supported in rootless mode without cgroups v2 [shangrila@node1 ~]$ podman stop logserver d5ffe018a53ca7eb075bf560d1f30822ab6fe51eba58fd1a8f370eda79806496 [shangrila@node1 ~]$ podman rm logserver

Error: no container with name or ID logserver found: no such container [shangrila@node1 ~]$ mkdir -p container-journal/

*

[shangrila@node1 ~]$ sudo systemctl restart systemd-journald [sudo] password for shangrila:

[shangrila@node1 ~]$ sudo cp -av /var/log/journal/* container-journal/ [shangrila@node1 ~]$ sudo cp -av /var/log/journal/* container-journal/ [shangrila@node1 ~]$ sudo chown -R shangrila container-journal/ [shangrila@node1 ~]$ podman run -d –name logserver -v /home/shangrila/container-journal/:/var/log/journal:Z registry.domain15.example.com:5000/rhel8/rsyslog [shangrila@node1 ~]$ podman ps

[shangrila@node1 ~]$ loginctl enable-linger

[shangrila@node1 ~]$ loginctl show-user shangrila|grep -i linger Linger=yes

*

[shangrila@node1 ~]$ podman stop logserver [shangrila@node1 ~]$ podman rm logserver [shangrila@node1 ~]$ systemctl –user daemon-reload [shangrila@node1 ~]$ systemctl –user enable –now container-logserver [shangrila@node1 ~]$ podman ps

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 3903e1d09170 registry.domain15.example.com:5000/rhel8/rsyslog:latest /bin/rsyslog.sh 4 seconds ago Up 4 seconds ago logserver

[shangrila@node1 ~]$ systemctl –user stop container-logserver.service

*

[shangrila@node1 ~]$ sudo reboot

[shangrila@node1 ~]$ podman ps -a

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

7e6cd59c506a registry.domain15.example.com:5000/rhel8/rsyslog:latest /bin/rsyslog.sh 10 seconds ago Up 9 seconds ago logserver

Question #54

CORRECT TEXT

One Logical Volume named lv1 is created under vg0. The Initial Size of that Logical Volume is 100MB. Now you required the size 500MB. Make successfully the size of that Logical Volume 500M without losing any data. As well as size should be increased online.

Reveal Solution Hide Solution

Correct Answer: The LVM system organizes hard disks into Logical Volume (LV) groups. Essentially, physical hard disk partitions (or possibly RAID arrays) are set up in a bunch of equal sized chunks known as Physical Extents (PE). As there are several other concepts associated with the LVM system, let’s start with some basic definitions:

Physical Volume (PV) is the standard partition that you add to the LVM mix. Normally, a physical volume is a standard primary or logical partition. It can also be a RAID array.

Physical Extent (PE) is a chunk of disk space. Every PV is divided into a number of equal sized PEs. Every PE in a LV group is the same size. Different LV groups can have different sized PEs.

Logical Extent (LE) is also a chunk of disk space. Every LE is mapped to a specific PE.

Logical Volume (LV) is composed of a group of LEs. You can mount a file system such as /home and /var on an LV.

Volume Group (VG) is composed of a group of LVs. It is the organizational group for LVM.

Most of the commands that you’ll use apply to a specific VG.

✑ Verify the size of Logical Volume: lvdisplay /dev/vg0/lv1

✑ Verify the Size on mounted directory: df -h or df -h mounted directory name

✑ Use: lvextend -L+400M /dev/vg0/lv1

✑ ext2online -d /dev/vg0/lv1 to bring extended size online. ✑ Again Verify using lvdisplay and df -h command.

Question #55

CORRECT TEXT

Configure autofs.

Configure the autofs automatically mount to the home directory of LDAP, as required:

server.domain11.example.com use NFS to share the home to your system. This file system contains a pre

configured home directory of user ldapuserX.

Home directory of ldapuserX is:

server.domain11.example.com /home/guests/ldapuser

Home directory of ldapuserX should automatically mount to the ldapuserX of the local

/home/guests Home directory’s write permissions must be available for users ldapuser1’s password is password

Reveal Solution Hide Solution

Correct Answer: yum install -y autofs

mkdir /home/rehome

✑ /etc/auto.master /home/rehome/etc/auto.ldap Keep then exit

cp /etc/auto.misc /etc/auto.ldap

✑ /etc/auto.ldap

ldapuserX -fstype=nfs,rw server.domain11.example.com:/home/guests/

Keep then exit

systemctl start autofs

systemctl enable autofs

su – ldapuserX// test

If the above solutions cannot create files or the command prompt is -bash-4.2$, it maybe exist multi-level directory, this needs to change the server.domain11.example.com:/home/guests/ to server.domain11.example.com:/home/guests/ldapuserX.

What is multi-level directory? It means there is a directory of ldapuserX under the /home/guests/ldapuserX in the questions. This directory is the real directory.

Question #56

CORRECT TEXT

Add a new logical partition having size 100MB and create the data which will be the mount point for the new partition.

Reveal Solution Hide Solution

Correct Answer:
Question #56

CORRECT TEXT

Add a new logical partition having size 100MB and create the data which will be the mount point for the new partition.

Reveal Solution Hide Solution

Correct Answer:
Question #56

CORRECT TEXT

Add a new logical partition having size 100MB and create the data which will be the mount point for the new partition.

Reveal Solution Hide Solution

Correct Answer:
Question #56

CORRECT TEXT

Add a new logical partition having size 100MB and create the data which will be the mount point for the new partition.

Reveal Solution Hide Solution

Correct Answer:
Question #56

CORRECT TEXT

Add a new logical partition having size 100MB and create the data which will be the mount point for the new partition.

Reveal Solution Hide Solution

Correct Answer:

Question #56

CORRECT TEXT

Add a new logical partition having size 100MB and create the data which will be the mount point for the new partition.

Reveal Solution Hide Solution

Correct Answer:
Question #56

CORRECT TEXT

Add a new logical partition having size 100MB and create the data which will be the mount point for the new partition.

Reveal Solution Hide Solution

Correct Answer:
Question #56

CORRECT TEXT

Add a new logical partition having size 100MB and create the data which will be the mount point for the new partition.

Reveal Solution Hide Solution

Correct Answer:
Question #56

CORRECT TEXT

Add a new logical partition having size 100MB and create the data which will be the mount point for the new partition.

Reveal Solution Hide Solution

Correct Answer:
Question #56

CORRECT TEXT

Add a new logical partition having size 100MB and create the data which will be the mount point for the new partition.

Reveal Solution Hide Solution

Correct Answer:
Question #56

CORRECT TEXT

Add a new logical partition having size 100MB and create the data which will be the mount point for the new partition.

Reveal Solution Hide Solution

Correct Answer:
Question #56

CORRECT TEXT

Add a new logical partition having size 100MB and create the data which will be the mount point for the new partition.

Reveal Solution Hide Solution

Correct Answer:
Question #56

CORRECT TEXT

Add a new logical partition having size 100MB and create the data which will be the mount point for the new partition.

Reveal Solution Hide Solution

Correct Answer:
Question #56

CORRECT TEXT

Add a new logical partition having size 100MB and create the data which will be the mount point for the new partition.

Reveal Solution Hide Solution

Correct Answer:
Question #70

CORRECT TEXT

Create one partitions having size 100MB and mount it on data.

Reveal Solution Hide Solution

Correct Answer:

Question #70

CORRECT TEXT

Create one partitions having size 100MB and mount it on data.

Reveal Solution Hide Solution

Correct Answer:
Question #70

CORRECT TEXT

Create one partitions having size 100MB and mount it on data.

Reveal Solution Hide Solution

Correct Answer:
Question #70

CORRECT TEXT

Create one partitions having size 100MB and mount it on data.

Reveal Solution Hide Solution

Correct Answer:
Question #70

CORRECT TEXT

Create one partitions having size 100MB and mount it on data.

Reveal Solution Hide Solution

Correct Answer:
Question #70

CORRECT TEXT

Create one partitions having size 100MB and mount it on data.

Reveal Solution Hide Solution

Correct Answer:
Question #70

CORRECT TEXT

Create one partitions having size 100MB and mount it on data.

Reveal Solution Hide Solution

Correct Answer:
Question #70

CORRECT TEXT

Create one partitions having size 100MB and mount it on data.

Reveal Solution Hide Solution

Correct Answer:
Question #70

CORRECT TEXT

Create one partitions having size 100MB and mount it on data.

Reveal Solution Hide Solution

Correct Answer:
Question #70

CORRECT TEXT

Create one partitions having size 100MB and mount it on data.

Reveal Solution Hide Solution

Correct Answer:
Question #80

CORRECT TEXT

Part 2 (on Node2 Server)

Task 4 [Managing Logical Volumes]

Resize the logical volume, lvrz and reduce filesystem to 4600 MiB. Make sure the the filesystem contents remain intact with mount point /datarz

(Note: partitions are seldom exactly the size requested, so anything within the range of 4200MiB to 4900MiB is acceptable)

Reveal Solution Hide Solution

Correct Answer: *

[root@node2 ~]# lsblk

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT

vdb 252:16 0 5G 0 disk

vdb1 252:17 0 4.2G 0 part

vgrz-lvrz 253:2 0 4.1G 0 lvm /datarz

vdc 252:32 0 5G 0 disk

vdc1 252:33 0 4.4G 0 part

datavg-datalv 253:3 0 3.9G 0 lvm /data

vdd 252:48 0 5G 0 disk

vde 252:64 0 10G 0 disk

[root@node2 ~]# lvs

LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert

lvrz vgrz -wi-ao—- 4.10g

[root@node2 ~]# vgs

VG #PV #LV #SN Attr VSize VFree vgrz 1 1 0 wz–n- <4.15g 48.00m [root@node2 ~]# parted /dev/vdb print Number Start End Size Type File system Flags 1 1049kB 4456MB 4455MB primary lvm

*

[root@node2 ~]# df -hT

Filesystem Type Size Used Avail Use% Mounted on /dev/mapper/vgrz-lvrz ext4 4.0G 17M 3.8G 1% /datarz [root@node2 ~]# parted /dev/vdb mkpart primary 4456MiB 5100MiB [root@node2 ~]# parted /dev/vdb set 2 lvm on [root@node2 ~]# udevadm settle

[root@node2 ~]# pvcreate /dev/vdb2

Physical volume "/dev/vdb2" successfully created.

*

[root@node2 ~]# vgextend vgrz /dev/vdb2 Volume group "vgrz" successfully extended [root@node2 ~]# lvextend -r -L 4600M /dev/vgrz/lvrz

Size of logical volume vgrz/lvrz changed from 4.10 GiB (1050 extents) to 4.49 GiB (1150 extents).

Logical volume vgrz/lvrz successfully resized.

[root@node2 ~]# resize2fs /dev/vgrz/lvrz

[root@node2 ~]# df -hT

Filesystem Type Size Used Avail Use% Mounted on /dev/mapper/vgrz-lvrz ext4 4.4G 17M 4.2G 1% /datarz

Question #81

CORRECT TEXT

Add admin group and set gid=600

Reveal Solution Hide Solution

Correct Answer: # groupadd -g 600 admin
Question #82

CORRECT TEXT

Part 2 (on Node2 Server)

Task 1 [Controlling the Boot Process]

Interrupt the boot process and reset the root password. Change it to kexdrams to gain access to the system

Reveal Solution Hide Solution

Correct Answer: *
Question #82

CORRECT TEXT

Part 2 (on Node2 Server)

Task 1 [Controlling the Boot Process]

Interrupt the boot process and reset the root password. Change it to kexdrams to gain access to the system

Reveal Solution Hide Solution

Correct Answer: *
Question #82

CORRECT TEXT

Part 2 (on Node2 Server)

Task 1 [Controlling the Boot Process]

Interrupt the boot process and reset the root password. Change it to kexdrams to gain access to the system

Reveal Solution Hide Solution

Correct Answer: *
Question #82

CORRECT TEXT

Part 2 (on Node2 Server)

Task 1 [Controlling the Boot Process]

Interrupt the boot process and reset the root password. Change it to kexdrams to gain access to the system

Reveal Solution Hide Solution

Correct Answer: *
Question #82

CORRECT TEXT

Part 2 (on Node2 Server)

Task 1 [Controlling the Boot Process]

Interrupt the boot process and reset the root password. Change it to kexdrams to gain access to the system

Reveal Solution Hide Solution

Correct Answer: *
Question #82

CORRECT TEXT

Part 2 (on Node2 Server)

Task 1 [Controlling the Boot Process]

Interrupt the boot process and reset the root password. Change it to kexdrams to gain access to the system

Reveal Solution Hide Solution

Correct Answer: *
Question #82

CORRECT TEXT

Part 2 (on Node2 Server)

Task 1 [Controlling the Boot Process]

Interrupt the boot process and reset the root password. Change it to kexdrams to gain access to the system

Reveal Solution Hide Solution

Correct Answer: *
Question #82

CORRECT TEXT

Part 2 (on Node2 Server)

Task 1 [Controlling the Boot Process]

Interrupt the boot process and reset the root password. Change it to kexdrams to gain access to the system

Reveal Solution Hide Solution

Correct Answer: *
Question #82

CORRECT TEXT

Part 2 (on Node2 Server)

Task 1 [Controlling the Boot Process]

Interrupt the boot process and reset the root password. Change it to kexdrams to gain access to the system

Reveal Solution Hide Solution

Correct Answer: *

Question #91

CORRECT TEXT

Who ever creates the files/directories on archive group owner should be automatically should be the same group owner of archive.

Reveal Solution Hide Solution

Correct Answer: ✑ chmod g+s /archive

✑ Verify using: ls -ld /archive Permission should be like:

drwxrws— 2 root sysuser 4096 Mar 16 18:08 /archive

If SGID bit is set on directory then who every users creates the files on directory group owner automatically the owner of parent directory. To set the SGID bit: chmod g+s directory

To Remove the SGID bit: chmod g-s directory

Question #92

CORRECT TEXT

Configure autofs to automount the home directories of LDAP users as follows:

host.domain11.example.com NFS-exports /home to your system.

This filesystem contains a pre-configured home directory for the user ldapuser11 ldapuser11’s home directory is host.domain11.example.com /rhome/ldapuser11 ldapuser11’s home directory should be automounted locally beneath /rhome as /rhome/ldapuser11

Home directories must be writable by their users

ldapuser11’s password is ‘password’.

Reveal Solution Hide Solution

Correct Answer: ✑ vim /etc/auto.master /rhome /etc/auto.misc

wq!

# vim /etc/auto.misc

ldapuser11 –rw,sync host.domain11.example.com:/rhome/ldpauser11 :wq!

#service autofs restart

✑ service autofs reload ✑ chkconfig autofs on ✑ su -ldapuser11

Login ldapuser with home directory

# exit

Question #93

CORRECT TEXT

Find the files owned by harry, and copy it to catalog: /opt/dir

Reveal Solution Hide Solution

Correct Answer: # cd /opt/

# mkdir dir

# find / -user harry -exec cp -rfp {} /opt/dir/ ;

Question #94

CORRECT TEXT

The firewall must be open.

Reveal Solution Hide Solution

Correct Answer: /etc/init.d/iptables start

iptables -F

iptables -X

iptables -Z

/etc/init.d/iptables save

chkconfig iptables on

Question #95

CORRECT TEXT

Create a backup

Create a backup file named /root/backup.tar.bz2, contains the content of /usr/local, tar must use bzip2 to compress.

Reveal Solution Hide Solution

Correct Answer: cd /usr/local

tar Cjcvf /root/backup.tar.bz2

mkdir /test

tar Cjxvf /root/backup.tar.bz2 CC /test// Decompression to check the content is the same as the /usr/loca after

If the questions require to use gzip to compress. change Cj to Cz.

Question #96

CORRECT TEXT

Part 1 (on Node1 Server)

Task 11 [Scheduling Future Tasks]

The user natasha must configure a cron job that runs daily at 14:23 local time and also the same cron job will run after every 2 minutes and executes:

/bin/echo hello

Reveal Solution Hide Solution

Correct Answer: *

[root@node1 ~]# crontab -l -u natasha

no crontab for natasha

[root@node1 ~]# crontab -e -u natasha

23 14 * * * /bin/echo hello

*/2 * * * * /bin/echo 2min

crontab: installing new crontab

[root@node1 ~]# crontab -l -u natasha

23 14 * * * /bin/echo hello

*/2 * * * * /bin/echo 2min

[root@node1 ~]# systemctl status crond.service

*

### For Checking ###

[root@node1 ~]# tail -f /var/log/cron

Mar 23 13:23:48 node1 crontab[10636]: (root) REPLACE (natasha)

Mar 23 13:23:48 node1 crontab[10636]: (root) END EDIT (natasha)

Mar 23 13:23:50 node1 crontab[10638]: (root) LIST (natasha)

Mar 23 13:24:01 node1 crond[1349]: (root) FAILED (loading cron table)

Mar 23 13:24:02 node1 CROND[10673]: (natasha) CMD (/bin/echo 2min)

Question #97

CORRECT TEXT

One Logical Volume named /dev/test0/testvolume1 is created. The initial Size of that disk is 100MB now you required more 200MB. Increase the size of Logical Volume, size should be increase on online.

Reveal Solution Hide Solution

Correct Answer: ✑ lvextend -L+200M /dev/test0/testvolume1 Use lvdisplay /dev/test0/testvolume1) ✑ ext2online -d /dev/test0/testvolume1

lvextend command is used the increase the size of Logical Volume. Other command lvresize command also here to resize. And to bring increased size on online we use the ext2online command.

Question #98

CORRECT TEXT

Part 2 (on Node2 Server)

Task 3 [Managing Logical Volumes]

Create a new volume group in the name of datavg and physical volume extent is 16 MB

Create a new logical volume in the name of datalv with the size of 250 extents and file system must xfs

Then the logical volume should be mounted automatically mounted under /data at system boot time

Reveal Solution Hide Solution

Correct Answer: *

[root@node2 ~]# lsblk

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT

vdb 252:16 0 5G 0 disk

vdb1 252:17 0 4.2G 0 part

vgrz-lvrz 253:2 0 4.1G 0 lvm /datarz

vdc 252:32 0 5G 0 disk

vdd 252:48 0 5G 0 disk

vde 252:64 0 10G 0 disk

[root@node2 ~]# parted /dev/vdc mklabel msdos

[root@node2 ~]# parted /dev/vdc mkpart primary 1MiB 4200MiB [root@node2 ~]# parted /dev/vdc set 1 lvm on

*

[root@node2 ~]# udevadm settle

[root@node2 ~]# pvcreate /dev/vdc1

Physical volume "/dev/vdc1" successfully created. [root@node2 ~]# vgcreate -s 16M datavg /dev/vdc1 Volume group "datavg" successfully created [root@node2 ~]# lvcreate -n datalv -L 4000M datavg Logical volume "datalv" created. [root@node2 ~]# mkfs.xfs /dev/datavg/datalv

[root@node2 ~]# mkdir /data

[root@node2 ~]# blkid

/dev/mapper/datavg-datalv: UUID="7397a292-d67d-4632-941e-382e2bd922ce"

BLOCK_SIZE="512" TYPE="xfs"

*

[root@node2 ~]# vim /etc/fstab

UUID=7397a292-d67d-4632-941e-382e2bd922ce /data xfs defaults 0 0

[root@node2 ~]# mount UUID=7397a292-d67d-4632-941e-382e2bd922ce /data

[root@node2 ~]# reboot

[root@node2 ~]# df -hT

Filesystem Type Size Used Avail Use% Mounted on /dev/mapper/datavg-datalv xfs 3.9G 61M 3.9G 2% /data

Exit mobile version