First off all you have to crack root password.
Follow these steps-
reboot the system and press ‘e’
find kernel line and type in the last
rd.break console=tty1
after that press ctrl+x
mount -o remount,rw /sysroot
chroot /sysroot
passwd “type your password”
again type
touch /.autorelabel
Configure your network setup.
IP address 172.15.92.4/24
Gateway 172.15.92.254
DNS 172.15.92.1
Hostname Student.net4.example.com
Type nmtui and configure all setting as above.
After that change hostname
hostnamectl set-hostname student.net4.example.com
reboot the system.
Selinux must be running in enforcing mode.
Vim /etc/sysconfig/selinux
set the enforcing
and reboot the system.
Configure yum client repo using this following url
http://server.net4.example.com/content/rhel7.0/x86_64/dvd
vim /etc/yum.repos.d/client.repo
[yum-client]
name = my yum client
baseurl = http://server.net4.example.com/content/rhel7.0/x86_64/dvd
enable = 1
gpgcheck = 0
save and exit
yum clean all
yum repolist
Extend your lv to 250M named datasource mounted under /datascript. (Note because
partition sizes are seldome exactly what is specified when they are created, any thing
within the range of 230 to 280M is acceptable.)
first of all you have to unmount the partition
umount /datascript
lvetxend -L 250M /dev/data/datasource
now do this
resize2fs /dev/data /datasource
after all of this mount the partition and check using df -TH
create a user jean having user identity as 40320 and his home directory should be in
/India/redhat directory.
Mkdir -p /India /redhat
useradd -u 40320 -d /India /redhat /jean jean
cat /etc /passwd
Increase your swap by 512mb. Both swap partiton must be available. Your new swap
space should be mounted at the booting time also.
First check you partition information
cat /proc/partitions\
fdisk /dev/vda
press n
press e for extended (you have to create extended partition you can create only 4 primary
partition and 3 primary partition already created.)
after that press enter and give all remaining space to this extended partition.
Press w for write
after that do this
partprobe /dev/vda
after this again type
fdisk /dev/vda
press n
press l (for logical)
in the last sector option type +512M
after that press t to change type
82 (linux lvm)
w
and again parprobe /dev/vda
cat /proc/partitions
find your partition and format in the form of swap
mkswap /dev/vda5
open the fstab
vim /etc/fstab
/dev/vda5 swap swap defaults 0 0
save and exit
type mount -a
swapon /dev/vda5
free -h (check the new size)
reboot the system
Install the appropriate kernel update from
http://server.net4.example.com/content/rhel7.0/x86_64/errata/packages
kernel must available on booting time.
Open the link in browser and search for kernel rpm.
Click on the name of kernel and copy the kernel name and add in the last of url and then use it
to download kernel as following-
wget http://server.net4.example.com/content/rhel7.0/x86_64/errata/packages/kernel-
3.10.0-123.1.2.el7.x86_64.rpm
after that type rpm -Uvh kernel-3.10.0-123.1.2.el7.x86_64.rpm
The user Natasha must be configure a cron job that runs daily at 14:23 local time and
executes
– /bin/echo Hello_World
open crontab configuration file and edit as following-
vim /etc/crontab
23 14 * * * natasha /bin/echo Hello_world
systemctl restart crond
OR
crontab -u natasha -e
23 14 * * * /bin/echo Hello_world
save and exit
to verify
crontab -u natasha -l
Copy the file /etc/fstab to /var/tmp. Configure the permission of /var/tmp/fstab so that-
the file /var/tmp/fstab is owned by the root user.
The file /var/tmp/fstab belongs to group root.
The file /var/tmp/fstab should not be executable by anyone.
The user natasha is able to read and write /var/tmp/fstab.
The user harry neither write nor read /var/tmp/fstab.
All other users (current or future) have the ability to read /var/tmp/fstab.
cp /etc /fstab /var/tmp/
ls -l /var/tmp/fstab
chmod a-x /var/tmp/fstab
setfacl -m u:natasha:rw /var/tmp/fstab
setfacl -m u:harry:--- /var/tmp/fstab
getfacl /var/tmp/fstab
Configure your system so that it is an NTP client of server.net4.example.com.
Vim /etc /chrony.conf
put # in the front of server pool addresses and add another line in the last
server server.net4.example.com iburst
systemctl restart chronyd
timedatectl
search all the lines from /usr /share /dict /words which having word errata and store
output originally to the /root /list file and there should not be any blank line in copied file.
Grep errata /usr /share /dict /words > /root /list
cat /root /list
Create the following users, groups, and group memberships-
a group named sysadmins
a user natasha who belongs to sysadmins as a secondary group
a user harry who also belongs to sysadmins as a secondary group
a user sarah who does not have access to an interactive shell on the systems, and who is
also not a member of sysadmins group.
Natasha, harry and sarah should all have the password of ‘winkymin’.
Groupadd sysadmins
useradd -G sysadmins natasha
useradd -G sysadmins harry
useradd -s /sbin /nologin sarah
echo “winkymin” | passwd –stdin natasha
echo “winkymin” | passwd –stdin harry
echo “winkymin” | passwd –stdin sarah
Create a collaborative directory /home /materials with the following characteristics -
group ownership of /home /materials should be goes to sysadmins group.
The directory should be readable writable and accessible to members of sysadmins, but
not to any other users.
Files created in /home /materials automatically have group ownership set to the
sysadmins group.
Mkdir /home /materials
chgrp sysadmins /home /materials
chmod g+rwx,o-rwx /home /materials
chmod g+s /home /materials
Make a tarball of existing /usr /local directory in local.tar.bz2 format and put it in /root.
(bzip2 command must be used by compression process).
Tar -cvf /root /local.tar /usr /local
bzip2 /root /local.tar
Create a new physical volume, create a new volume group in the name of dataconatainer,
vg extent is 8.00MB, create a new logical volume in the name of datacopy with the size of
100 extents and file system must vfat then mount it under /datasource.
Fdisk /dev /vda
press n
press l
add +1G in last sector
press t for type
8e for linux lvm
press w for write
after that partprobe /dev /vda
check the partiton no using fdisk -l
pvcreate /dev /vda6
vgcreate -s 8M datacontainer /dev /vda6
lvcreate -n datacopy -l 100 datacontainer
mkfs.vfat /dev /dataconatiner /datacopy
mount permanently
mkdir /datasource
vim /etc /fstab
/dev /datacontainer /datacopy /datasource vfat defaults 0 0
save and exit
mount -a
df -TH
Bind to the LDAP domain ‘dc=net4,dc=example,dc=com’ provided by
server.net4.example.com for user authentication.
Ldapuser4 should be able to log into your system, but will not have home directory until
you have completed the autofs requirements.
Ldapuser4 have a password of ‘winkymin’
you will get your CA certificate at-
http://server.net4.example.com/pub/example-ca.pem
yum install openldap-clients nss-pam-ldapd -y
now download certificate and paste it in the directory /etc /openldap /cacerts
wget -o /etc /openldap /cacerts example-ca.pem http://server.net4.example.com/pub/example-
ca.pem
reboot the system
now open authconfig-tui
press next and follow this-
after this press ok and now you have to verify the users
getent passwd ldapuser4
if it shows users info then your ques has done.
Configure autofs to automount the home directory of LDAP users.
Note the following:
(server.net4.example.com) NFS-exports /rhome to your system.
Ldapuser4 home directory is server.net4.example.com:/rhome/ldapuser4
ldpauser4’s home directory should be automounted locally beneath /rhome as
/rhome/ldapuser4
home directory must be writable by their users.
Yum install autofs -y
mkdir /rhome
vim /etc /auto.master
/rhome /etc /auto.share
save and exit
now open create a file auto.share under /etc
touch /etc /auto.share
vim /etc /auto.share
* -rw,sync server.net4.example.com:/rhome/ldapuser4
save and exit
systemctl restart autofs
now login to your user and verify it
su ldapuser4
and logout.
Thank You
BY- Abhishek Singh
RedHat Certified System Administrator