Sample Questions
Sample Questions
Sample Questions
v=sQn5AEQDyGU&t=7s
https://www.youtube.com/watch?v=HO3LDRNbSO0&t=492s
https://www.youtube.com/watch?v=GTS4vpptZNU
http://youtu.be/LZ6gHuh-Um8
http://youtu.be/FrfBKDxDcYY
http://youtu.be/aB2YlS_FHn0
http://youtu.be/s4THo4nBbTc
http://youtu.be/H3CFLvFflJ0
https://youtu.be/QAVg894XIUQ
https://www.youtube.com/watch?v=-4lUOI5OY8k
https://www.youtube.com/watch?v=nXubiHgIkus
1. SELINUX
2. LVM – Extend your /mnt/lvm up to 750M
3. Usermgmt
Create a group sysadmin
Create users susan, natasha and harry
User susan and harry should be part of the sysadmin group
Natasha should not be a part of that group and she is given a non-interactive shell
Password of all users are “password”
4. ACL
Copy /etc/fstab to /var/tmp/fstab
The user and group owner of that file should be root
All users should be able to read the file
No one should be able to execute
Susan should not be able to read nor write
Natasha should be able to read and write
6. LDAP
Configure an LDAP client where your ldap server is district.example.com
LDAP Base DN: dc=station,dc=district,dc=com (dc=example.dc=com)
Authenticate your LDAP server using certificate
http://classroom.example.com/pub/example-ca.crt
7. NTP
Configure your NTP server to synchronize with station.district.example.com
8. LDAP
You can use the user ldapuserX with passwd password
Home directories for your LDAP users should be automatically mounted on access
These home directories are served from the NFS share
station.district.example.com:/home/guests/
9. Kernel
Install the kernel from the site https://district.example.com/repo/errata
The newly installed kernel should be default kernel
The previous kernel should be available and bootable at grub
10. CRON
Add a cron jon for the user jane /bin/echo hiya
This job should run every day at 2:23PM
11. TAR
Synchronize the /etc directory tree on server to the /configbackup directory on server
Create an archive named /root/configuration-backup-server.tar.gz with the
/configbackup directory as content.
To prepare the archived directory tree compression with the currently actively used
configuration file on server, extract the contents of the /root/configuration-backup-
server.tar.gz archive to the /tmp/configcompare/ directory on serverXtimedatectl set-
ntp true
13. FIND
Locate all files owned by user sasha and copy them to /home/lost+found/
14. LVM
Create a logical volume lvmgroup from volume group v2group
The volume group should have extents of size 8.
The logical volume should have 100 extents
Mount this lvm as /mnt/lvm2 as ext4 filesystems
15. SEARCH
Display the first 12 lines of the /usr/bin/clean-binary-file
Send the output to the /home/student/headtail.txt file
16. Record the command to display all system journal entries recorded between 9:05:00 and
9:15:00 in the /home/student/systemdreview.txt
17. Deny user sasha to create cron job for herself
1. Assuming the root user password is lost for C1 and your system is running in multiuser target
with no current root session open. Boot the system into an appropriate target and change the
root user password to root1234
2. Configure the primary network interface with hostname c1.home.local (alias rhcsa1)
IP Address: 192.168.0.121/24
Gateway: 192.168.0.1
Nameserver: 192.168.0.1
9. Create a directory called dir1 as user anna in her home directory and set default ACLs on it for
user same for read and write access
10. Set up a local repository for the remote FTP yum repository in the /pub/ directory on S1. The IP
Address for the S1 server is 192.168.0.120
11. Create a logical volume called lv01 of size equal to 15 Les in vg01 volume group
Create vg01 with PE size 16MB with mount point /mnt/dirxfs and xfs file system
structures
Create a file called testxfs1 in the mount point
Set the file system to automatically mount at each system reboot
12. Add a group called tester and change the group ownership of /mnt/dirxfs1 to tester
Set read/write/execute permissions on /mnt/dirxfs1 for the owner and group members
No permission for others
13. Extend lv01 file system in vg01 online by 105MB without losing any data
14. Create a swap partition of size 200MB on an available disk. Use its UUID and ensure it is
activated after every system reboot.
15. Create a standard partition of size 500MB on any available disk and format it with ext4 file
system structures.
Mount the file system on /mnt/dirext4 persistently using its UUID
Create a file called testext4 in the mount point
16. Create a directory /dir1 and apply SELinux contexts for /root on it
17. Set up a cron job as the root user to execute the backup script which is located under the root
home directory. This job should run every Sunday at 1:00AM
18. Use star to create a compressed archive of the /etc directory. Store the archive in /root using
any name of your choice
19. Enable at access for user Sam and deny for user Bob
20. Modify the bootloader and set the default autoboot timer value to 30 seconds
4. Install the ftp package and allow it to get documents stored in CIFS mounted directories
5. Extend the existing root file system with an additional size of 1GB
6. Assign the same SELinux contexts that are used by the users’ home directories to the /dir1
directory
7. Create user Ahmed with UID 1100
Ahmed account expire 9 months from the date you created the account
Create another user Rabah with UID 1200 and with cshel login shell
Both users passwords must be P@ss
9. Create an xfs file system on a logical volume named lvm2 with the size of 150MB and mount it
permanently using UUID under a directory named /xfs2
10. Create a new logical volume lvm5 with size 700MB and file system ext4 mounted on /ext4dir
permanently using its label name “data”
11. Create a logical volume named swap2 with the size of 1024MB and add it permanently to the
current swap space
12. Create a cron job as root that deletes empty files and directory from /tmp at 00:30AM daily.
13. Allow Ahmed to get full access to Rabah home directory
DAHJI
1. Assuming the root user password is lost for rchsa1 and your system is running in multiuser
target with no current root session open. Boot the system into an appropriate target and change
the root user password to root1234
ANSWER:
a) Boot to single user. Press e to edit
b) Input rd.break then CTRL+X
c) Type mount –o rw,remount /sysroot/
d) chroot /sysroot/
e) passwd or passwd root
f) enter the desired password
g) touch /.autorelabel
2. Configure the primary network interface with hostname example.com (alias rhcsa1)
IP Address: 192.168.4.251/24
Gateway: 192.168.4.2
Nameserver: 192.168.4.200
You may use different IP assignments
ANSWER: (Procedure1)
a) ifconfig
b) nmcli connection delete interface-name
c) nmcli connection add con-name eth0 ifname ens3 type Ethernet autoconnect yes ip4
192.168.4.251/24 gw4 192.168.4.2
d) nmcli connection modify eth0 ipv4.dns 192.168.4.200
e) nmcli connection down eth0 ; nmcli connection up eth0
f) cat /etc/resolv.conf
g) cat /etc/sysconfig/network-scripts/ifcfg-eth0
ANSWER: (Procedure2)
a) ifconfig
b) nmtui > edit a connection > ensxxxxxx
IPv4 Configuration = Manual
Address = 192.168.4.251
Gateway = 192.168.4.2
DNS = 192.168.4.200
A user sarah who does not have access to an interactive shell on system and who is not
a member of sysgrp - #useradd –s /sbin/nologin sarah
Susan, Andrew and sarap password = “Postroll”
#passwd Andrew
#passwd susan
#passwd sarah
#id andrew
#id susan
#su – sarah
ANSWER:
a) mkdir –p /redhat/sysgrp
b) chgrp sysgrp /redhat/sysgrp/
c) chmod 2770 /redhat/sysgrp/
d) ls –ltr /redhat
e) cd /redhat/sysgrp/
f) touch test.txt
g) ls –ltr test.txt
ANSWER:
a) cp /etc/fstab /var/tmp/
b) cd /var/tmp
c) ls fstab
d) setfacl –m u:andrew:rw- /var/tmp/fstab
e) setfacl –m u:susan:--- /var/tmp/fstab
f) getfacl /var/tmp/fstab
11. Create an archive file /root/local.tgz for /usr/local. It should be compressed by gzip
ANSWER:
a) tar –cvzf /root/local.tgz /usr/local
b) ls
12. Search the string sarah un the /etc/passwd file and save the output un /root/lines
ANSWER:
a) grep sarah /etc/passwd > /root/lines
b) cat /root/lines
1. Network setup
IP Address: 172.25.x.11/255.255.255.0
Gateway: 172.25.254.254
DNS IP: 172.25.254.254
ANSWER:
a) ifconfig
b) nmcli connection delete interface-name
c) nmcli connection add con-name eth0 ifname ens3 type Ethernet autoconnect yes ip4
192.168.4.251/24 gw4 192.168.4.2
d) nmcli connection modify eth0 ipv4.dns 192.168.4.200
e) nmcli connection down eth0 ; nmcli connection up eth0
f) nmcli connection show
g) systemctl restart NetworkManager
h) systemctl enable NetworkManager
i) cat /etc/resolv.conf
j) cat /etc/sysconfig/network-scripts/ifcfg-eth0
UDEMY