Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
664 views6 pages

RHCSA - Exam Sample Questions

This document provides instructions for various system administration tasks on Red Hat Enterprise Linux including: 1. Configuring the tuned profile manager, NTP client, password changes, IP configuration, firewall rules, SELinux settings, and Yum repositories. 2. Creating users and groups, managing file system access control, finding files, and changing the Apache document root. 3. Configuring storage with LVM, growing and reducing logical volumes, installing Autofs for automounting remote shares, and managing cron jobs.

Uploaded by

Qammar Abbas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
664 views6 pages

RHCSA - Exam Sample Questions

This document provides instructions for various system administration tasks on Red Hat Enterprise Linux including: 1. Configuring the tuned profile manager, NTP client, password changes, IP configuration, firewall rules, SELinux settings, and Yum repositories. 2. Creating users and groups, managing file system access control, finding files, and changing the Apache document root. 3. Configuring storage with LVM, growing and reducing logical volumes, installing Autofs for automounting remote shares, and managing cron jobs.

Uploaded by

Qammar Abbas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 6

Tune Profile

yum install tuned


tuned-adm list
tuned-adm profile profile_name
tuned-adm active
tuned-adm recommend
tined-adm off

NTP Client:
vi /et chrony.conf
systemctl restart chronyd
chronyc sources -c
timedatectl
timedatectl set-ntp flase
timedatectl set-ntp true

timedatectl set-ntp true

Systemctl
systemctl status service
systemctl start service
systemctl stop service
systemctl enable serivce
systemctl disable service

Password Change
-----------------------------
rd.break enforcing=0
mount -o remount,rw /sysroot/
chroot /sysroot/
passwd root

restorecon /etc/shadow

IP Address:
------------------------------

cd /etc/sysconfig/
cat /etc/resolve

Disable Firewall
-----------------------------
systemctl stop firewalld
systemctl disable firewalld

Enable SeLinux
-----------------------------
vim /etc/selinux/config
SELINUX=enforceing

Setup Yum
----------------------------
[d1]
baseurl=
gpgcheck=0

[d2]
baseurl=
gpgcheck=-0

useradd -s /sbin/nologin sarah

getfacli /common/share
setfacli -m u:sarah:r /common/share

find the files creation by user:


------------------------------------
find / -user username
find . -user root -exec cp {} /mnt/root \;

Chnage document root


----------------------------------
cd /etc/httpd/conf.d
vi web.conf
DocumentRoot /var/www/myweb
Listen 82

getenforing
semanage port -l
semanage port -a -t http_port_t -p tcp 82

yum install policycoreutils-python-utils

Disk Configure
-------------------------------------------

udevadm settle
vgcreate -s 16M myvg1 /dev/sdb1
lvcreate --size 320M --name mylv1 myvg1

lvextend --size 2G /dev/mapper/vg1-lv2


extend ext4
resize2fs /dev/mapper/vg1-lv2
extend xfs
xfs_grow /dev/mapper/vg1_lv2

reduce

e2fsck -f /dev/mapper/vg1_lv3
resize2fs /dev/mapper/vg1_lv3 500M
mount -a

yum install autofs


vi /etc/auto.misc
jack servera.lab.example.com:/data

vi /etc/auto.master
/rhome /etc/auto.misc
systemctl restart autofs

crontab -e
*/3 * * * * logger "hi lo"

/dev/vd0 /mnt/data xfs defaults,x-systemd.requires=vdo.service 0 0


startis

tar / archive
gzip
tar -czf /root/my.tgz /usr/share
bzip
tar -cjf /root/my.tbz /usr/share

find file with size


#! /bin/bash
find /usr/o -size +30k -size -50k -perm /u=s
chmod +x /user/file.sh

podman login registry.redhat.com


username
password
podman -itd --name=mycontainer imagename
cd ~/.config/systemd/user/
podman genrate_systemd --name inventorydb --files --new
podman stop inventorydb
podman rm invon

loginctl enable-linger

podman -itd --name=mycontainer -v /homeyash/mydata:/var/log/myserver rhek/imagename

ls
tar -cvfa etc.tar.gz /etc

SWAP
--------

mkswap

STRATIS
------------------------------------------

VDO
-----------------------
yum install vdo kmod-kvdo
vdo create --name VDO1 --device=/dev/sdc --vdoLogicalSize=50G
fstab
/dev/mapper/VDO1 /vdo1 auto default,x-systemd.requires=vdo.serivce 0 0

CHange Password:
-------------------------------------

line Linux --> rd.break


mount -o remount,rw /sysroot
chroot /sysroot
passwd root
touch /.autorelabel
exit
exit
SELinux
------------------------------------

getenforce
permissive --> setenforce 0
disable --> setenforce 1

vi /etc/sysconfig/selinux

Boolian
getseboot -a | grep httpd
setseboot -P httpd_enable_homedirs on

SELinux Port

semanage port -a -t http_port_t -p tcp 82

semange fcontext -a -t httpd_sys_content_t "/test(.*)?"


restorecon -Rv /test

ls -lZ

vi /httpd/conf/httpd.confg
DocumentRoot
directory

Container_---
==================

yum install podman @container-tools


podman login https://url
username
password

podman search httpd


podman pull /docker.io/libraru/httpd
podman images

podman rmi image-id


podman run -d --name web1 imageid
podman ps
podman run -d --name web2 -p8080:80 image-id

podman stop web1


podman stop web2
podman rm web1
podman rm web2

podman run -it imagename /bin/bash

mkdir /web
tocuh /web/mypage.html
podman run -d --name web4 -p 8081:80 -v /web:/usr/local/apache2/htdocs

running container as service


podman genrate systemd web5 > /etc/systmd/system/we5-container.service
systemctl daemon-reload
systemctl start we5-container
systemctl status we5-container
systemctl enable we5-container

useradd test
passwd test

ssh test@localhost
podman pull docker.io/httpd
podman run -d --name web6 -p 8085:80 imageid
mkdir -p `/.config/systemd/user
podman generate systemd new > ~/.config/systemd/user/new-container.service
systemctl --user daemon-reload
systemctl --user start new-container
vi ~/.config/systemd/user/new-container.service
intall=default.service

AUTOFS
---------------------------------

server:
yum install nfs*
mkdir /share
touch /share/f1
touch /share/f2
chmod 777 /share
vi /etc/exports
/share client_ip(ro,sync)
exportfs -avr
firewall-cmd --add-service={nfs,mountd,rpc-bind} --permanent

Client
yum install nfs-utils autofs
showmount -e serverip

vi /etc/auto.master
/auto_mount /etc/auto.misc --timeout=30

vi /etc/auto.misc
access -rw,soft,intr serverip:/share

You might also like