0% found this document useful (0 votes)
46 views21 pages

Session7 Rhcsa

Session at

Uploaded by

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

Session7 Rhcsa

Session at

Uploaded by

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

Red Hat Linux

System Admin
BY P R AV E E N S I N G A M PA L L I
2 3 R D J U LY 2 0 2 2
4-6 PM
YO U T U B E - / P RVA E E N S I N G A M PA L L I

I N S TA G R A M / T W I T T E R / T E L EG R A M –
S I N G A M 4 D E VO P S
YUM REPO CREATE CONFIGURTION
Step 4 – Run the create repo command
* Creterepo is a software which helps to initialiaze the yum repo.
Repo (Play store)  Binary (.exe/.rpm/.apk)  install it amazon
(software) 
Step 1 – Create A Directory

Step 2 – Copy all packages

Step 3 – Initialize the create repo package


YUM CONFIGURTION
•YUM stands for Yellow Dog Updater Manager.
•Yum is the default package management utility in RHEL/Centos.
•Yum uses repository to get the necessary rpm files.
•A repository is collection of rpm files.
•Repository may contain multiple versions of the same RPM package.
•Repository may contain different builds for different architectures for example one for
i686 and other for x86_64.
•A repository can be configured locally or remotely.

vi /etc/yum.repos.d/rhcelab.repo As we know repository configuration files are stored


in /etc/yum.repos.d/ directory with an extension .repo, So we
executed this command to create the necessary configuration
file for repository.

[rhcerepo] This is the label of repository. Usually a repository file contains


configuration for multiple repositories. In that case label is
used as identifier of repository.
name=rhcerepo This configuration value is used to set the name of repository.
baseurl=file:///rhcelab/repo This configuration value defines the location of rpm files.
enabled=1 This key defines the state of repository. If value is set to 1 then
repository is enabled. If value is set to 0 then repository is
disabled.
gpgcheck=0 This key defines whether the integrity of package should be
check or not. If value is set to 1, integrity will be checked. If
value is set to 0, integrity will not be checked.
:wq We used vi editor to create the file. In vi editor, the command:
wq is used to save and quit from file.
CONFIGURING IP NETWORKING WITH NMCLI

The nmcli (NetworkManager Command Line Interface) command-line utility is used for controlling NetworkManager and
reporting network status.

yum install NetworkManager. - .repo. 


rhcelab/repo/

systemctl start NetworkManager

systemctl enable NetworkManager


 To make sure it is up 24/7
To Change the Linux system IP ADDRESS

To bring the connection down and up

To modify IPV4 Gateway

nmcli connection modify ethernet-enp0s8


ipv4.gateway “192.168.56.1”

To modify the DNS


nmcli connection modify ethernet-enp0s8 ipv4.dns
“192.168.56.103”
Resetting a Root Password in Linux CentOS (If Forgot)

Step 1: Boot to Recovery Mode


For resetting the root password we need to reboot our computer.
When the system restarts, press the “ESC” key immediately to
interrupt the boot process and select the kernel from the GRUB/Boot
menu you want to boot into by pressing the arrow keys.

Step 2 - Pressing ‘e’ from your keyboard will open the


editing menu.

Step 3 - In the editing menu, locate the “ro” kernel


parameter and replace it with “rw,” and add an additional
parameter “init=/sysroot/bin/sh”
Step 4 - Press Ctrl + X to enter into the single-user mode once
you are done with the previous step.

Step 5 - Now run the “chroot /sysroot” command to convert the


root file system in read and write mode

Step 6 – Set a new password for root, input the command


(Changing the password for user root)

Step 7 – Set a new password for root, input the command


Step 8 - SELinux
relabelling (to set the
permissions for files or
folders)
Step 9 – Exit from terminal

Step 10 – Hit reboot


How to create a tar backup
 tar -cvf backup.tar /home/shineincareer/.jar -c - Create the archive
-v - Show the process verbosely
-f - Name the archive

tar -cvfz backup.tar.gz /home/userLet’s


 create a tar.gz backup
-c - Create the archive
-v - Show the process verbosely
-f - Name the archive
-z - Compressed gzip archive file

 Exclude files when creating a tar tar --exclude file.txt --exclude file.sh -cvfz backup.tar.gz
backup

tar -xvfz backup.tar.gz /backup/directory/file.txt


 Extract content from a tar (.gz) backup
-x - Extract the content
-v - Show the process verbosely
-f - Name the archive
-z - compressed gzip archive file
Tuning of Linux Systems****
• yum install tuned  .repo  rehcelab/repo
The profiles provided with tuned are divided into two categories: • systemctl enable --now tuned
power-saving profiles, and performance-boosting profiles. The • yum install tuned-profiles-realtime
performance-boosting profiles include profiles focus on the following
• tuned-adm active (Verify that a TuneD profile is
aspects:
•low latency for storage and network active and applied)
•high throughput for storage and network tuned-adm verify
•virtual machine performance
•virtualization host performance
TuneD recommends the most suitable profile for your system
Create a Group
Need to create groups before creating any account otherwise we
have to use existing groups at your system

LINUX ADMINISTRATOR - TODAY

groupadd [-g gid [-o]] [-r] [-f] groupname


Create an Account
$ sudo useradd -d homedir -g groupname -m -s shell -u userid accountname.
Praveen Singampalli. - connect

Linux – Roshan access (Linux System Admin)

Praveen also need to that system

Useradd Praveen

Grouapadd tester
Passwd roshanUserdel praveen

Useradd –g tester praveen


SELINUX SELinux stands for Security Enhanced Linux, which
is an access control system that is built into the Linux
kernel. It is used to enforce the resource policies that
define what level of access users, programs, and
services have on a system.
SELINUX=enforcing|permissive|disabled — Defines the top-
level state of SELinux on a system.
•enforcing — The SELinux security policy is enforced.
•permissive — The SELinux system prints warnings but does
not enforce policy.
•disabled — SELinux is fully disabled. SELinux hooks are
disengaged from the kernel and the pseudo-file system is
unregistered.

SELINUXTYPE=targeted|strict — Specifies which policy


SELinux should enforce.
•targeted — Only targeted network daemons are protected.

•strict — Full SELinux protection, for all daemons. Security


contexts are defined for all subjects and objects, and every
action is processed by the policy enforcement server.
Status of SELinux

Enable SELinux

Change SELinux Mode


Cron Job Time Format

Send email to ShineIncareer team at every 5 PM


(mail.sh)
CRON  TO RUN A SCRIPT AT A PARTICULAR
TIME (crontab -e)
• * * * * sh /apps/opt/mail.sh
* * 8-14,22-30 * *
crontab –e
Edit the crontab File
Logical Volume Management. LDAP (USER MANAGEMENT)
************************* 1400 LDAP  JIRA/GIT/JENKINS
Logical Volume Management enables the combining of multiple
individual hard drives and/or disk partitions into a single volume
group (VG). That volume group can then be subdivided into
logical volumes (LV) or used as a single large volume.
1 TB PHD.
1. Install a new hard disk drive + 1 TB on
LINUX
2. Designate Physical Volumes
D PV1
pvcreate /dev/vda1
E PV2
C PV3
3. Manage Volume Groups F PV4
vgcreate vgname /dev/vda1 VG1
4. Manage Logical Volumes
LV1
The VG can be subdivided into one or more
Logical Volumes (LVs).
LV2
LV3
lvcreate -L size -n lvname vgname
LV%
LV^
lvcreate -L 10G -n shineincareer-lv vgname
SWAP PARTITION 82

The swap partition serves as overflow


space for your RAM. If your RAM fills up
completely, any additional applications
will run off the swap partition rather
than RAM.
Prioritization and Hibernation are the
end goals for using the SWAP
Create a swap partition
fdisk /dev/vda
mkswap /dev/vda3 [ To use the swap partition ]
Press n [ N for new ]
mount –a [To check for errors]
+512 M
vi /etc/fstab [For permanent mount]
t –> For type of partition 82 number is for SWAP
/dev/vda3 swap swap
w [quit]
swapon -s
partprobe /dev/vda3 [ To let the kernel know about partition ]
Logical volumes- 8e MAKE VFAT FILE SYSTEM
A virtual file allocation table (VFAT) is an extension to
the file allocation table (FAT) from Windows 95 and
Fdisk /dev/vda onward for creating, storing and managing files with
n long names.

500M
Mkfs.vfat /dev/test/new
t  8e
Vim /etc/fstab
:wq
/dev/test/new /mnt/storage vfat
Reboot the VM

pvcreate /dev/vdb

vgcreate –s 6 test /dev/vdb


/dev/test/new
lvcreate –l 30 –n new test

Mkdir /mnt/storage
SUBSRIBE TO THE CHANNEL IF YOU ARE LIKING
THE CONTENT AND DO SHARE THE CHANNEL
LINK WITH 5 OF YOUR FRIENDS 

INSTAGRAM/TELEGRAM/TWITTER –
SINGAM4DEVOPS

YOUTUBE/LINKEDIN - PRAVEEN SINGAMPALLIEN


SINGAMPALLI

23RD JULY 2022

You might also like