Exam Questions Flashcards

1
Q
Configure:
HOSTNAME: station.domain40.example.com
IPV4: 172.24.40.40/24
GATEWAY: 172.24.40.1
DNS: 172.24.40.1
A

hostenamectl set-hostename station.domain40.example.com

ncli con mod enp0s3 connection.id=PriEth ipv4.method=manual ipv4.adrr=172.24.40.40/24 ipv4.gateway=172.24.40.1 ipv4.dns= 172.24.40.1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Create a catalog under /home named admins. Its respective group is requested to be the admin group. The group users could read and write, while other users are not allowed to access it. The files created by users from the same group should also be the admin group.

A

mkdir /home/admins
chown admin /home/admins
chmod 770 /home/admins
chmod g+2 /home/admins

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

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

A

crontab -e

23 14 * * * /bin/echo hello

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

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

A

mkdir /opt/dir

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Find the rows that contain abcde from file /etc/testfile, and write it to the file/tmp/testfile, and the sequence is requested as the same as /etc/testfile.

A

grep `abcde’ /etc/testfile > /tmp/testfile

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

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.)

A
sudo nano /etc/yum.repos.d/local.repo
name=local.repo
baseurl= INSERT_BASE_URL
enabled=1
gpgcheck=0

dnf makecache
sudo dnf install vsftp
sudo systemctl service vsftpd restart
sudo systemctl service vsftpd enable

chkconfig vsftpd on
chkconfig –list vsftpd
nano /etc/vsftpd/vsftpd.conf
anonymous_enable=YES

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Configure a HTTP server, URL= http://station.domain40.example.com.
Please download the released page from http://ip/dir/example.html.

A
sudo dnf install -y httpd
systemctl enable httpd
cd var/www/html
wget http://ip/dir/example.html
mv example.html index.html
systemctl start httpd
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Configure autofs after successful login, it has the home directory autofs, which is shared as /rhome/ldapuser40 at the ip: 172.24.40.10. and it also requires that, other ldap users can use the home directory normally.

A

sudo systemctl enable autofs
cd /etc
nano auto.master
/rhome /etc/auto.ldap

cp auto.misc auto.ldap
nano auto.ldap
ldapuser40 -rw,soft,intr 172.24.40.10:/rhome/ldapuser40
* -rw,soft,intr 172.24.40.10:/rhome/ldapuser40/&

sudo systemctl stop autofs
sudo systemctl start autofs
showmount -e 172.24.40.10
su - ldapuser40

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Configure the system synchronous as 172.24.40.10.

A

sudo dnf install -y crony
sudo nano /etc/crony.conf
server 172.24.40.10 iburst

sudo timedatectl set-ntp true
sudo systemctl enable cronyd

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Create a volume group, and set 16M as a extends. And divided a volume group containing 50 extends on volume group lv, make it as ext4 file system, and mounted automatically under /mnt/data.

A
sudo pvcreate /dev/vdb1 /dev/vdb2
sudo vgcreate -s 16M vg1 /dev/vdb1 /dev/vdb2
sudo lvcrate -l 50 -n lv1
sudo mkfs.xfs /dev/vg1/lv1
sudo blkid
#Copy UUID#
sudo nano /etc/fstab
UUID=#COPIED UUID#
/mnt/data
xfs
defaults
0 0
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Upgrade the kernel to 2.6.36.7.1 and configure the system to Start the default kernel. Keep the old kernel available.

A

sudo dnf update kenel
sudo grubby –info=ALL | grep ^kernel
sudo grubby –set-default= 2.6.36.7.1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Create a 512M partition, format ext4 file system, mount automatically under /mnt/data and take effect automatically at boot-start.

A

sudo fdisk /dev/vda
n
+512M
w

partprobe /dev/vda
mkfs -t ext4 /dev/vda5
mkdir -p /mnt/data
sudo blkid
nano /etc/fstab
UUID=#From blkid command#
/mnt/data
ext4
defaults
0 0

mount -a

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Create a volume group called vg2, size 8MB. Create a logical volume called lv2 -l 50 on volume group vg2, formatted as ext4 file system, and mount automatically under directory /mnt/data2. And the size of the floating range should set between 380M and 400M.

A
sudo pvcreate /dev/vda3
sudo vgcreate -s 8M -n vg2 /dev/vda3
sudo lvcreate -l 50 -n vg2 
mkfs -t ext4 /dev/vg2/lv2
mkdir /mnt/data2
blkid
sudo nano /etc/fstab
UUID=#From blkid command#
/mnt/data2
ext4
defaults
0 0

mount -a

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Add a gourp called admin and set the to gid 600

A

sudo groupadd -g 600 admin

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Create users user2 and user3 with their passwords set to redhat.
Add them to the admin group.

A

useradd -G admin -p redhat user2

useradd -G admin -p redhat user3

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Copy /etc/fstab to /var/tmp.
User1 must have RW permissions.
User2 must not have any permissions.

A

cp /etc/fstab /var/tmp
sudo setfacl -m u:user1:rw- /var/tmp/fstab
sudo setfacl -m u:user2:— /var/tmp/fstab

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Configure a task to echo “file” at 14:23 every day.

A

crontab -e

23 14 * * * /bin/echo “file”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Configure a default software repository for your system.
One YUM has already provided to configure your system on http://server.domain11.example.com/pub/ x86_64/Server, and can be used normally.

A

subscription-manager repos –list

subscription-manager repos –enable=rhel-8-for-x86_64-sap-netweaver-rpms

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Adjust the size of the Logical Volume.
Adjust the size of the lv1 Logical Volume, its file system size should be 290M. Make sure that the content of this system is complete.
Note: the partition size is rarely accurate to the same size as required, so in the range 270M to 320M is acceptable.

A

sudo unmount /dev/vg1/lv1 /mnt/data

lvreduce -r -L 290M /dev/vg1/lv1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

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 set to RW /var/tmp/fstab
User harry must not have RW /var/tmp/fstab
All other users set to R var/tmp/fstab.

A
cp /etc/fstab /var/tmp/
chown root /var/tmp/fstab
chmod o-x /var/tmp/fstab
chmod o=r /var/tmp/fstab
setfacl u:natasha:rw- /var/tmp/fstab
setfacl u:harry:--- /var/tmp/fstab
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Create a shared directory /home/admins with the following characteristics:
/home/admins belongs to group adminuser.
This directory can be read and written to by members of group adminuser. Any files created in /home/admin must be automatically owned by the adminuser group.

A

mkdir /home/admins

sudo setfacl -m g:adminuser:rw-
chgrp adminuser /home/admins
chmod g+w adminuser /home/admins

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Configure NTP.

Configure NTP service, Synchronize the server time. NTP server: classroom.example.com

A
sudo dnf install -y cronyd
sudo systemctl enable cronyd
sudo systemctl start conyd
timedatectl -H classroom.example.com
timedatectl set-ntp on
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Create a user iar uid is 3400. Password is redhat

A

sudo useradd -p redhat -u 3400 iar

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Search files.

Find out files owned by jack, and copy them to directory /root/findresults

A

mkdir /root/findresults

find / -user jack -exec cp -rfp {} /root/findresults/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

Find out all the columns that contains the string seismic within /usr/share/dict/words. Then copy all these columns to /root/lines.txt in the original order, no blank line, all columns must be the accurate copy of the original columns.

A

grep seismic /usr/share/dict/words > /root/lines.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

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

A

sudo tar -cvjf /root/backup.tar /usr/local

bzip2 /root/backup.tar

27
Q
Create a new logical volume:
Name the logical volume database, from the datastore  volume group, size 50 PE.
Expansion size of logical volume 16MB.
Format with ext4. 
Mount automatically to /mnt/database.
A
sudo pvcreate /dev/vda4
sudo vgextend datastore /dev/vda4
sudo lvcreate -l 16M -n database
sudo mkfs -t ext4 /dev/datastore/database
sudo mkdir /mnt/database
blkid #Copy UUID from here#
sudo nano etc/fstab
UUID=#from above#
/mnt/database
ext4
defaults
0 0
mount -a
28
Q

Set ipforward automatically.

A

sudo sysctl -w net.ipv4.ip_forward=1

sudo sysctl -w

29
Q

Configure firewalld:
The address of local domain is 172.24.0.0/16 and the remote domain is 172.25.0.0/16
Refuse 172.25.0.0/16 to access to the local server.

A

sudo firewall-cmd –permanent –zone=block –add-source=172.25.0.0/16
sudo firewall-cmd –reload

30
Q

Your System is 192.168.0.1/24.
A router running on aRHEL6 System is already running and configured.
192.168.0.254 and 192.168.1.254 IP Addresses are assigned on that Server.
Configure your system so you can ping the 192.168.1.1/24 host.

A

sudo nmcli con mod enp0s3 connection.id=PriEth ipv4.addr=192.168.0.1/24 ipv4.gateway=192.168.0.254

31
Q

Make a swap partition of 100MB. Automatically mounted at System Boot Time.

A
sudo pvcreate /dev/vda7
sudo vgcreate vgswap /dev/vda7
sudo lvcreate -l 100M -n lvswap
mkswap /dev/vgswap/lvswap
swapon /dev/vgswap/lvswap
blkid
sudo nano /etc/fstab
UUID=#from blkid command#
swap
swap
0 0
mount -a
32
Q

Make a swap partition of 100MB. Automatically mounted at System Boot Time.

A
sudo pvcreate /dev/vda7
sudo vgcreate vgswap /dev/vda7
sudo lvcreate -l 100M -n lvswap
mkswap /dev/vgswap/lvswap
swapon /dev/vgswap/lvswap
blkid
sudo nano /etc/fstab
UUID=#from blkid command#
swap
swap
0 0
mount -a
reboot system
33
Q

There is a Logical Volume myvol under the vo volume group. The Initial Size of that Logical Volume is 400MB. Resize the Logical Volume to 200MB without losing any data. 200MB to 210MB is acceptable.

A

resize2fs /dev/vo/myvol 200M
sudo lvresize -size 200M /dev/vo/myvol
lvdisplay /dev/vo/myvol

34
Q

/dev/test0/lvtestvolume is mounted on /data. You require more space on /data. All the space on physical volume has been used up. You have unallocated space of 5 GB on your disk. Increase the size of lvtestvolume by 5GB.

A

sudo pvcreate /dev/vda8
sudo vgextend test0 /dev/vda8
sudo lvextend -L +5120M -n /dev/test0/lvtestvolume
sudo lvdisplay /dev/test0/lvtestvolume

35
Q

Change the permissions on the directory data:
User: RWX
Group: RWX
Other: —

A

sudo chmod /data 770

36
Q

Who ever creates the files/directories on a /data the group owner should automatically be the same as /data.

A

sudo chmod g+s /data

37
Q

You need to set up a system as a router.
The two networks are 192.168.0.0/24 and 192.168.1.0/24.
The remote ends have been configured.

A

echo “1” /proc/sys/net/ipv4/ip_forward
nano /etc/sysctl.conf
net.ipv4.ip_forward=1

38
Q

/data Directory is shared from server1.example.com. Mount the shared directory that under /mnt

A

sudo mount server1.example.com/data /mnt

39
Q

You are a new System Administrator and your main tasks are to manage network monitoring and Backup and Restore.
You don’t know the root password.
Change the root password to redhat and login in default Runlevel.

A
Reboot and press E at the kernel selection.
Scroll to vmlinuz and press the N key
typr rd.break
Ctrl + X
mount -o remount,rw /sysroot
chroot /sysroot
passwd
touch /.autorelabel
exit 
exit
40
Q

You have 50 servers providing various services.

Configure a log server to accept logs from remote hosts.

A

nano /etc/sysconfig/rsyslog
SYSLOGD_OPTIONS=”-m 0 -r”

service syslog restart

41
Q

Add a new name server 192.168.0.254/24.

A

sudo nano /etc/resolv.conf

nameserver 192.168.0.254

42
Q

You are sharing some users home dirs.
They are not showing under the showmount -e localhost command.
Provide access to the shared directory.

A
cat /etc/exports
systemctl start nfs
systemctl enable nfs
systemctl start portmap
systemctl enable nfs
firewall-cmd --reload
showmount -e localhost
43
Q

Configure an Apache server using SSL named www.rhcsa.com on 192.100.0.2.

A

sudo nano /etc/httpd/conf.d/ssl.conf ServerName www.rhcsa .com DocumentRoot /var/www/rhce DirectoryIndex index.html index.htm
ServerAdmin webmaster@rhce.com SSLEngine on SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key
VirtualHost>

cd etc/httpd/conf
3 make testcert
touch /etc/httpd/index.html
systemctl start httpd
systemctl enable httpd
44
Q

Set SE Linux into enforcing mode.

A

SELINUX=enforcing

45
Q

Automatically mount the iso image /root/examine.iso to /mnt/iso directory.

A
sudo nano etc/fstab
/root/examine.iso 
/mnt/iso
iso 9660
loop
0 0

mount -a

46
Q

Find all files of 10KB in the /etc directory and copy it to /tmp/findfiles.
Find all files belonging to lucy and copy them to /tmp/findfiles.

A

find /etc -size 10k -exec cp {} /tmp/findfiles \;

find / -user lucy -exec cp -a {} /tmp/findfiles \;

47
Q

Create the /common/admin dir.
Set the group of /common/admin to admin group.
User owner and the user group musr have RWX perms.
All other have no perms.
All new files and dirs must below to the admin group.

A

mkdir -p /common/admin
chgrp admin /common/admin
chmod 2770 /common/admin

48
Q

Create the user sarah and remove their interactive shell.

A

useradd -s /bash/nologin sarah

49
Q

Boot into the emergency target.

A
Reboot.
Press E at kernel select stage.
Scroll to vmlinuz and press N.
Type systemd.unit=emergency.
Ctrl + X.
50
Q

Uncompress /data/testfile.tar.bz2

A

sudo tar -xvzf /data/testfile.tar.bz2

51
Q

Create a soft link of /data/slinkfile.txt to /home/liam/softlink

A

sudo ln -t /data/slinkfile.txt /home/liam

52
Q

Create a hard link of /data/hlinkfile.txt to /home/liam/hardlink

A

sudo ln /data/hlinkfile.txt /home/liam

53
Q

Install NFS on RHCSA1 (192.168.1.10) and RHCSA2 (192.168.1.11).
Create an NFS share on RHCSA1 from /srv/nfsshare and mount it automatically under /mnt/nfsshare on RHCSA2.

A
#ON RHCSA1
Sudo dnf install -y nfs-utils
sudo mkdir /srv/nfsshare
sudo chmod -R a+w /srv/nfsshare
sudo nano /etc/exports
/srv/nfsshare 192.168.1.11(rw,sync)

sudo systemctl start nfs-utils
sudo systemctl enable nfs-utils
sudo firewall-cmd –permanent –zone=public –add-service=nfs
sudo firewall-cmd –reload

#ON RHCSA2
sudo dnf install -y nfs-utils
sudo mkdir /mnt/nfsshare
sudo nano /etc/fstab
192.168.1.10:/srv/nfsshare
/mnt/nfsshare
nfs
default
0 0

sudo mount -a

54
Q

Find the most intensive cpu process and kill it.

A

DEMO ONLY

ps aux
kill #PID#

55
Q

Locate and display the log locations within rsyslog and display journald.

A

sudo cat /etc/rsyslog.conf

sudo journalctl

56
Q

Make the journald persistent.

A

mkdir /var/log/journal
sudo chown root /var/log/journal
sudo systemd-tmpfile –create –prefix /var/log/journal
sudo systemctl restart systemd-journald

57
Q

Securely transfer /data/tranfser.txt from RHCSA1 to RHCSA2 under /mnt/shared.

A

scp /data/transfer.txt liam@192.168.1.11:/mnt/shared

58
Q

List all physical disc partitions.

A

sudo fdisk -l

59
Q

Change the user lucy password to never expire.

A

chage -l

chage -M -1 lucy

60
Q

Remove lucy from the sales group and add her to the hr group.

A

usermod -a -G hr lucy

61
Q

Add the RHEL FTP RPM repository from RHCSA1 on RHCSA2 and install the HTTPD package.

A
sudo nano /etc/yum.repos.d/remote.repo
[remote]
name=RHEL FTP
baseurl=192.168.1.11
enabled=1
gpgcheck=0

sudo rpm -ivh httpd

62
Q

Boot into another target automatically.

A

systemctl get-default graphical.target

systemctl set-defult runlevel1

63
Q

Configure PPK based authentication for SSH from RHCSA1 to RHCSA2 with the user lucy.

A

su - lucy
ssh-keygen
ssh-copy-is lucy@192.168.1.11