• No results found

Rhcsa Exam Model Question

N/A
N/A
Protected

Academic year: 2021

Share "Rhcsa Exam Model Question"

Copied!
15
0
0

Loading.... (view fulltext now)

Full text

(1)

RHCSA EXAM MODEL QUESTION

(2)

To Display Exam Question

Crack root password

Set hostname

Set IP Address

yum repo

(3)

Cracking root password

use ctl+alt+del in send keys tab in virtual server m/c

when grub displays press tab key to freeze .Press e to edit grub

search for Linux16 string and press end key and add this line

rd.break console=tty

press ctl+x to save and restart

#root: mount -o remount,rw /sysroot

#chroot /sysroot/

sh] passwd

new password: confirm password: sh] touch /autorelabel exit exit

(4)

Setting hostname

Setting hostname

#hostname (or) #cat /etc/hostname displays the current hostname Change host temporarily #host newhostname change host permanently

#hostctl set-hostname newhostname

Setting hostname using nmtui

#nmtui

(5)

Setting IP Address

Setting IP

Can be in 3 ways

● Network Manager (GUI) ● nmcli

● nmtui

Using Network Manager

Go to right top where network manager icon and set ip,dns and gateway address from the question Using nmtui

#nmtui

Set the values for ip,dns,gateway

Using nmcli

#nmcli device status adding connection

#nmcli connection.add con-name as ifname etho type ethernet ip4 172.25.7.0 gw4 172.25.0.0 set dns

#nmcli connection modify as ip4.dns 172.25.6.8 manual assign

#nmcli connection modify as ip4.method manual Set auto connect

#nmcli connection modify as connection. autoconnect yes

Activate connection

#nmcli connection up con-name Restart network

#systemctl restart network To check

#ifconfig

(6)

Setting yum repo and SElinux

Setting yum repo

#cd /etc/yum.repos.d/ #vim myown.repo [myown]

baseurl=”paste the url from the question” enabled=1

gpgcheck=0 :wq

#yum clean all #yum repolist all

#yum install any package to check if its installing from our own repo

Set SELinux Permission #vim /etc/sysconfig/selinux

change the line selinux=premissive to

selinux=enforcing :wq

(7)

1 . swap partition

#fdisk -l

#fdisk /dev/vda

P - print the list of pratitions

n - create new partition

e or p (extended or primary)

:e

default(first sector)

default(last sector)

: n

default(first sector)

default(last sector) +100M

t

l: 82 ( linux swap type)

:p (to print the partitions)

:w (to save the changes)

#partprobe (intimate to kernel)

#mkswap /dev/vda2

#mkdir /test

#vim /etc/fstab

/dev/vda2 /test swap swap defaults 0 0

#swapon -a

#mount -a

#df -h

(8)

2 . user, group creation with permissions

User creation with UID

#useradd -u 2323 ashwin

#passwd ashwin

#cat /etc/passwd

User creation with no login shell

#useradd -s /bin/nologin kaviya

#passwd kaviya

#su - kayiva

Not allowed

# date -d “+1month”

# usermod -e YYYY-MM-DD ashwin

or # chage -E YYYY-MM-DD ashwin

# chage -l ashwin

Group creation and adding user

#groudadd sysmanager

#chgrp sysmanager ashwin

Adding to user when creating user

#useradd -G sysmanager ashwin

Setting permission for file or folder

#chmod u-x,g-x,o-x /file or /folder

removes execute permission to all

#setfacl -m u:ashwin: 0 /file or /folder/

removes read/write for user ashwin

#chmod g+rwx,o= /file or folder

others dont have permission to read,write

#chmod g+s /file or folder

files will be created in group ownership

automatically

(9)

3 . Crontab

Set cronjon for user to /bin/echo string at h:m

#crontab -e -u username

m h * * * /bin/echo "string"

#systemctl restart crond.service

#su - username

#mail

Deny Cron for specific user

#vim /etc/cron.deny

ashwin

#crontab -e -u ashwin

This program is not allowed

(10)

4 . find grep copy command combined & collaborative directory

Locate files of user and copy to to some path #find / -user ashwin -exec cp -a {}/file path \; Note: If path doesnt exists create using mkdir Find string in all file and copy to some path #grep "string" /source > /destination path

Creating Collaborative directory #mkdir -p /a/b

#chgrp sysmanager /a/b #chmod g+rw,o= /a/b or

#chmod 770 /a/b

sets read,write to group sysmanger and other no permission to access /a/b

#chmod g+s /a/b

sets group permission automatically when files created in that directory

(11)

5 . LDAP

Setting LDAP

#yum install authconfig-gtk* ssd* krb5* -y

#authconfig-gtk

Set all the values from question

#getent passwd ldauserx( x denotes station

number)

You can see details about ldapuserx

Autofs

#yum install autofs* -y #systemctl restart autofs #systemctl enable autofs #vim /etc/auto.master /rhome /etc/auto.misc #vim /etc/auto.misc

ldapuserx -rw,sync,nfvers=3 servername:/rhome/ldapuserx #systemctl restart autofs

#systemctl enable autofs

(12)

LVM reduce #lvdisplay #vim /etc/fstab #umount /dev/vgname/vo #e2fsck -f /dev/vgname/vo #resize2fs -p* /dev/vgname/vo 120M #lvreduce -L 120M /dev/vgname/vo #mount /dev/vgname #lvdisplay #df -h LVM Increase #lvdisplay #vim /etc/fstab #umount /dev/vgname #e2fsck -f /dev/vgname #lvextend -L 120M /dev/vgname #resize2fs -p /dev/ #mount /dev/vgname #lvdisplay #df -h

6 . LVM

(13)

7 . LVM creation

#fdisk -l

#fdisk /dev/vda

P - print the list of pratitions

n - create new partition

e or p (extended or primary)

:e

default(first sector)

default(last sector)

: n

default(first sector)

default(last sector) +100M

t

l: 83 ( linux LVM type)

:p (to print the partitions)

:w (to save the changes)

#partprobe (intimate to kernel)

Creating physical volume #pvcreate /dev/vdb4 Creating volume group

#vgcreate -s 8M vgname /dev/vdb4 Creating volume

#lvcreate -l 35 -n volname /dev/mapper/vgname Display volume #lvdisplay

Create directory to mount #mkdir /lvm

Convert volume to filesystem #mkfs.ext3 /dev/mapper/vgnanme/volna me #mkfs.vfat /dev/mapper/vgname/volnam e

Add entry to fstab

#/dev/mapper/vgname /lvm ext3 defaults 0 0

:wq

Refresh using mount #mount -a

List the mounted directory #df -h

(14)

8 . Kernel update ,compression &

NTP service

Kernel Update

download the file from the given url using ezlink

#rpm -vh package name

#reboot

NTP Service

#vim /etc/chrony.conf

add the source url given the question for NTP

Compression methods:

tar

#tar -cvf /destionationpath/filename.tar /source path

bz2

#tar -cvjf /destionationpath/filename.bz2 /source path

gz

#tar -cvzf /destionationpath/filename.gz /source path

xz

(15)

Problem in booting due to wrong entry in /etc/fstab

Booting in emergency target:

use ctl+alt+del in send keys tab in virtual server m/c

when grub displays press tab key to freeze .Press e to edit grub

search for Linux16 string and press end key and add this line

systemd.unit =emergency.target

use ctl+x to save and reboot

#root: mount -o remount,rw /

#vim /etct/fstab

References

Related documents

The combined treatment of cells resulted in the activation of autophagy inducer to reach its maximum value at much lower level of stress, while its inactivation threshold moved to

Eight years ago, at the start of 2013, I gave a sermon entitled, “My First and Only Star Trek Geek Sermon,” asking those who heard it to indulge my obsession “just this

resource wraps multiple files from file path of reference results in custom kubernetes.. If male are comfortable writing Ruby and humble Chef extensions

Click on this button to change the file path and/or to name the backup file. Change File Path by navigating through the files structure shown. Type the required file name

If such path exists find alternate path called as Disjoint Path (DP) to route the traffic through this disjoint path using explicit routing technology of MPLS or else

Available documents suggest smuggling has been an important component of BAT’s market entry strategy in order to gain leverage in negotiating with governments for tax

Similarly, classical conditioning has been used to explain the role of deviant sexual fantasies in sexual offending (Laws & Marshall, 1990). According to this theory,

Problem Statement PKIX path building failed SunCertPathBuilderException unable to every valid certification path to requested target Error Message A fault.. Where are connecting