Rhcsa Exam
Rhcsa Exam
*************************
RHCSA-VM configuration.txt:
*you have been provided a virtual box named as serverX.example.com (hint:where X is your
domain number)
* password for both virtual machine should be "Postroll"
*serverX.example.com provided with ip=172.25.X.10/255.255.255.0
*serverX.example.com are provided with gateway 172.25.254.254 & example.com dns domain
with the IP: 172.25.254.254
#vim /etc/hostname
serverX.example.com
:wq
#/etc/sysconfig/network-scripts/ifcfg-eth0
IPADDR= 172.25.5.11
PREFIX=24
BOOTPROTO=static
:wq
#systemctl reboot and press "e" to edit and goto end of the line "linux16" type the following
entry.
systemd.unit=graphical.target then ctrl+x to boot the system
1) configure Selinux
The machine should be running enforcing mode
Answer:
Example:
[root@foundation3 ~]# cat /etc/sysconfig/selinux
Answer:
#fdisk /dev/vdb
:n,:p,:1,:Enter,:+100M,:w
#partprobe /dev/vdb
#cat /proc/partitions
#mkfs.ext4 /dev/vdb1
#mkdir /Gluster
#vim /etc/fstab
/dev/vdb1 /Gluster ext4 defaults 0 0
:wq
#mount -a
#df -h
Answer:
fdisk /dev/vdb
:n,:p,2:,Enter,+150M,t:82,:2,:w
#partprobe /dev/vdb
#cat /proc/partitions
#mkswap /dev/vdb2
#vim /etc/fstab
/dev/vdb2 swap swap defaults 0 0
:wq
#swapon /dev/vdb2
#free -m
#swapon -s ---> it will show the summary of swap configuration.
Answer:
#cd /etc/yum.repos.d
#ls
# rm -rf * --> remove any existing repo files.
#vim redhat.repo
[apps]
baseurl=http://content.example.com/rhel7.0/x86_64/dvd
gpgcheck=0
:wq
Anser:
#groupadd sysgrp
#useradd andrew
#useradd susan
#usermod -G sysgrp andrew
#usermod -G sysgrp susan
#useradd sarah
#usermod -s /sbin/nologin sarah
#passwd andrew
#passwd susan
#passwd sarah
Answer:
#mkdir -p /redhat/sysgrp
#chgrp sysgrp /redhat/sysgrp
#chmod 770 /redhat/sysgrp
#chmod g+s /redhat/sysgrp
Answer:
#vim /etc/grub.conf
#vim /etc/yum.repos.d/redhat.repo
[kernel]
baseurl=http://content.example.com/rhel7.0/x86_64/errata
gpgcheck=0
:wq
:wq
9) The user andrew must configure a cron job that runs daily at 14:23 local time and executes -
/bin/echo hiya
Answer:
#yum install cronie -y
#crontab -eu andrew
23 14 * * * /bin/echo hiya
:wq
#crontab -lu andrew --> to verify the crontab entries
10) Bind with LDAP used provided by classroom.example.com for userr authentication.
Note the following:-
--> The LDAP search base DN is dc=example,dc=com
--> The LDAP certificate file is
http://classroom.example.com/pub/EXAMPLE-CA-CERT
-->ldapuserX should be able to log into your system, whereX is your ServerX ((hint:where X is
your domain number),
but will not have a home directory, until you have completed the autofs requirement,
below all LDAP users have password of "password"
LDAP Answer
---------
Addition requirements:
1) autofs:package/service
system-config-authentication
Note: if you use ldaps://classroom.example.com then no need to select TLS encrpt connections.
To check the
#showmount -e classroom.example.com
#getent passwd ldapuserX ( if your LDAP is configured properly then you will get output)
#vim /etc/auto.master
make the following entry under /misc
/home/guests /etc/auto.misc
:wq
#vim /etc/auto.misc
ldapuserX -rw classroom.example.com:/home/guests/ldapuserX
:wq
:wq
#umount /datasource
#e2fsck -f /dev/datacontainer/datacopy
#resize2fs /dev/datacontainer/datacopy 400M
#lvreduce -L 400M /dev/datacontainer/datacopy
#mount -a
Answer:
16) create a new physical volume, create a new volume group in the name of datacontainer, vg
extent is 16.00MB
create a new logical volume in the name of datacopy with the size of 50 extents and file
system must vfat then
mount it under /datasource
Answer:
#fdisk /dev/vdb
:m,:n,:p,:3,Enter,:+900M,:t,:8e,:w
#partprobe /dev/vdb
#pvcreate /dev/vdb3
#vgcreate -s 16M datacontainer /dev/vdb3
#lvcreate -l 50 -n datacopy datacontainer
#lvs
#mkdir /datasource
#mkfs.vfat /dev/datacontainer/datacopy
#vim /etc/fstab
/dev/datacontainer/datacopy /datasource vfat defaults 0 0
:wq
#mount -a
17) create an archive file /root/local.tgz for /usr/local. it should be compressed by gzip.
Answer:
18) search the string sarah in the /etc/passwd file and save the output in /root/lines