Best Question Paper With Solutions
Best Question Paper With Solutions
Lab setup:
Activities(click on activities below options will be displayed with their respective icons)
Exam view
VM moniter
Terminal
Node1 Node2
close
● If we click on Node1
Start node1
Open node1
Close node1
Node1 console
Delete node1
2. Create a repository
http://classrom.example.com/rhel8.0/x86_64/devd/AppStream
http://classrom.example.com/rhel8.0/x86_64/devd/BaseOS
Extra work
Normally you will get error. If you want to get actual output in curl
command
Go to file
#vi /etc/httpd/conf/httpd.conf
And goto line no 45
Edit Listen value to 82 (Listen 82)
Make sure your vm is pinging to google.com(#ping google.com)
(d) A user sarah who does not have access to an interactive shell
on the system and who is not a member of admin.
#groupadd admin
#useradd -G admin harry (-G= secondary group, -g=primary group)
#useradd -G admin natasha
#useradd -s /sbin/nologin sarah (-s=shell)
#passwd --stdin harry
#passwd --stdin natasha
#passwd --stdin sarah
Note: --stdin is not mandatory, if we use it no need to retype password
and also it shows the password you typed.
5. Create a collaborative directory /common/admin with the
following characteristics:
(It is understood that root has access to all files and directories on
the system.)
7. Set a Cron job for harry on 12.30 at noon print /bin/echo on "hello".
#vim /etc/chrony.conf
Server classrom.lab.example.com iburst
Esc:wq
#systemctl restart chronyd.service
#chronyc sources
(a) Find the owner of the file sarih and copy the file to given path of /root/find.user
#mkdir /root/find.user
#find / -user sarah -type f
#find / -user sarah -type f -exec cp -pr {} /root/find.user \;
#ls -a /root/find.user
a) Create a new user with UID 1326 and user name as alies.
(a)Create the container name as logserver with the images rsyslog are stored in
registry on paradise user
15. Configure the Container as persistent storage and create logs for container
****** Take two terminals one is for root and another is for user. Note:”#” indicates
root and “$” indicates user. Take ssh to paradise user *******
#ls /var/log
#vim /etc/systemd/journald.conf
[journal]
storage=persistent (“Replace #storage=auto with storage=persistent”)
Esc :wq
#systemctl restart systemd-journald.service
#ls /var/log (o/p: need to find journal directory)
#ls /var/log/journal/f2………..(use tab) (need to find system.journal file)
$mkdir ~/container_journal
$podman images
$podman ps
$mkdir -p /home/paradise/.config/systemd/user
$cd /home/paradise/.config/systemd/user
$podman rm logserver
$podman ps
#reboot
After reboot
--------------------
#ssh paradise@serverip
(a)All new creating files for user natasha as -r-------- as default permission.
(b) All new creating directories for user natasha as dr-x------ as default permission.
#su - natasha
$umask
$ls -la
$vim .bash_profile
umask 277
Esc:wq
$source .bash_profile
$umask
$mkdir dir1
$ls -l ( o/p directory should have dr-x------ permissions)
$touch file1
$ls -l ( o/p file should have -r-------- permissions)
$logout
(a)The password for all new users in serverb.lab.example.com should expires after
20 days.
#vim /etc/login.defs
PASS_MAX_DAYS 20
Esc:wq
(a)Assign the Sudo Privilege for Group "admin" and Group members can administrate
without any password.
#vim /etc/sudoers
%admin ALL=(ALL) NOPASSWD=ALL
Esc:wq!
(a)Create a mysearch script to locate file under /usr/share having size less than IM
(b)After executing the mysearch script file and listed(searched) files has to be copied
under /root/myfiles.
#mkdir /root/myfiles
#vim mysearch
#!/bin/bash
find /usr/share -type f -size -1M -exec cp {} /root/myfiles \;
(if >1M put:::::: -size 1M
if the range is in between 100M and 200M then:::::: -size 100M -size -200M)
Esc:wq
#chmod +x mysearch
#./mysearch
#ls -a /root/myfiles
#reboot (mandatory)
In console:
Click on ctrl+alt+del(it will be there at the top right corner)
Press e
Rd.break
Ctrl+x
#mount -o remount,rw /sysroot
#chroot /sysroot
#passwd root
Type password:
Retype password:
#touch /.autorelabel
#exit
#exit
2. Create a repository file
http://classroom.example.com/content/thel8.0/x86_64/dvd/AppStream
http://classroom.example.com/content/thel8.0/x86_64/dvd/BaseOS
#vi /etc/yum.repos.d/local.repo
[1(any name, should be in square braces)]
name=AppStream(any name)
baseurl:http://classroom.example.com/content/thel8.0/x86_64/dvd/AppStream
enabled=1
gpgcheck=0
#lsblk
#fdisk /dev/vdb
n (for new)
Press Enter (for primary)
Press Enter (for partition )
Press Enter (for starting size)
+512M (need to provide size as given in question)
t (type)
82 (for swap)
W (to save and exit)
#udevadm settle
#mkswap /dev/vdb1
#vim /etc/fstab
/dev/vdb1 swap swap defaults 00
Esc :wq
#free -h
#swapon -a
#free -h
4. Create one logical volume named database and it should be on datastore volume
group with size 50 extent and assign the filesystem as ext3.
the datastore volume group extend should be 8MiB (mount the logical volume under
mount point /mnt/database.
#fdisk /dev/vdb
n
Press Enter
Press Enter
Press enter
+2G
t
8e
w
#udevadm settle
#lsblk
#mkfs.ext3 /dev/datastore/database
#mkdir /mnt/database
#vi /etc/fstab
/dev/datastore/database /mnt/database ext3 defaults 0 0
Esc :wq
#mount -a
#df -hT
5. Create the vectra volume using the VDO with the logical size 50GB and mount
under test directory
#vdo list
#mkfs.xfs /dev/mapper/vectra
#mkdir /test
#vi /etc/fstab
/dev/mapper/vectra /test xfs defaults,x-systemd.requires=vdo.service 0 0
Esc :wq
#mount -a
#df -hT
#systemctl restart vdo