Red Hat System Administration I (RH124 Brief)
Red Hat System Administration I (RH124 Brief)
Administration I
RH124
PRESENT AT ION BY:
M OHAM ED EL ERAKY
Agenda
o1. Introduce Linux and the Red Hat Enterprise Linux
ecosystem
o Filesystem Hierarchy
Standard (FHS)
Linux History brief
In 1984, Richard Stallman, an American software engineer, had a
goal to create an operating system a completely free UNIX-compatible
open source (non-proprietary)
The initiative was called the GNU Project (GNU’s Not Unix), Richard
wants to make an open-source Operating system.
TEACH A COURSE 4
Linux History brief
Around the same time, The computer science student Linus
with the GNU software that Richard had created before, So They’re
created a compatible OS called GNU/Linux, Linux operating system, or
simply Linux.
Linux was released under the GNU General Public License (GPL).
Initially written to run on Intel x86-based computers, the first
version (0.01) was released in September 1991
TEACH A COURSE 5
Linux History brief
The GPL license is to ensure that the code is published as an open
source.
The Linux kernel, and the operating system in general, has been
enhanced with contributions from tens of thousands of software
TEACH A COURSE 6
Filesystem Hierarchy Standard
(FHS)
The Linux directory structure follows the Filesystem Hierarchy Standard (FHS),
which prov ides a consistent organization and naming scheme for
directories in a Linux-based operating system.
On Windows machines you access your data with the driv e letter then the
path for date. on Linux machines it’s the quite opposite.
Linux world hav e a wide Rule called Everything is a file. So, The Disk
appears as a special file under /dev And you’re mount This disk file to any
path on the system in order to access it.
Linux machine hav e the / path, it’s the main path for the system this path
include all your system paths.
So, on Linux machines you access the data with the path then the mounted
disk un-like windows.
7
Filesystem Hierarchy Standard
(FHS)
Let’s discover the Linux directory structure:
8
Filesystem Hierarchy Standard
(FHS)
- /bin - Binaries
The /bin directory contains the executable files of many basic commands
like ls, cp, cd, etc.
This similar to /bin howev er it’s contains the executable binary commands
that can run only by the root
This directory only contains special files that are related to the dev ices,
these are v irtual files, physically on the disk. All system dev ice files
The /etc directory contains The core configuration files of the system, use
primarily by the administrators and serv ices
TEACH A COURSE 9
Filesystem Hierarchy Standard
(FHS)
- /usr - User binaries and program data
The /usr contains all the executable files, libraries, and sources for most of
the system programs, because of that most of the files are read-only. In
fact, most of the files under /bin and /lib and /lib64 are Linked “shared
under” /usr.
The home directory for users, personal directories for the users.
The directory holds the libraries needed by the binaries in /bin and /sbin
directories.
As the name suggests, this directory holds temporary files of the applications
TEACH A COURSE 10
Filesystem Hierarchy Standard
(FHS)
- /media – mount point for removable media
when you connect a remov able media such as a USB or DVD, a directory is
created automatically.
Created for you for locally mount, This is similar to the /media directory but
instead of automatically mount in the remov able media.
The /srv directory contains data for serv ices prov ided by the system. For
example, if you run a HTTP serv er, it’s a good practice to store the website
data in the /srv directory
TEACH A COURSE 11
Filesystem Hierarchy Standard
(FHS)
TEACH A COURSE 12
Run commands and view
shell environments.
We will cover these Topics
# calendar
cal
cal 2019 14
cal 9 2019
Linux basic command
ps
ps -u <username>
ps aux # get run-time process
# top Options
# - Press 1 to get how many of your processors
# - Press s to change the default refresh rate
# - press t CPU usage
# - press m memory usage
# - Press k to kill process
# - Press w to write "save"
# - SHIFT + M Sort by memory consumption
# - SHIFT + P Sort by process consumption
# - r for renice
# Renice values are from -20 to 19
15
Linux basic command
# help command
date –help
Man date
TEACH A COURSE 16
Manage, organize, and
secure files.
We will cover these Topics
cd / # change directory
cd ~ # go to your home dir
cd - # return to the last path
cd .. # return back on step | cd ../.. 2 step back
TEACH A COURSE 19
Linux basic command Let’s discover some advance stuff
tail file1
tail –n 5 file1
tail –f file1
head file1
22
Linux basic command | Permissions
23
Linux basic command | Permissions
# 2- user
# 3- service account
========================
# 1- super user
# 2- Normal user
su - <username> # login as
tail /etc/passwd
tail /etc/shadow
tail /etc/group
27
Manage users, groups
groupadd sales # add group
# Delete user
systemd will segregate the performance of CPU and memory on the services to start in
parallel.
systemctl list-units --type service --all # all active and inactive service
echo$? # print out the last command value if 0 the last command submitted
successfully if have any other value so it went through error
#There is some serviess depend on other services, Therefor if you stopped it The
other services will start it again
systemctl list-dependencies sshd # list servcies The depend on sshd || under sshd
# Any edit on the conf file must have reload | restart the service after 31
Configure remote access
“SSH”
ssh-keygen # Generate the pub and private keys on the client machine
- The file that ends with .pub it's the public key that should copied to the remote
- There's a file under the .ssh path on the remote serv er called known_hosts, its
automatically created when you login v ia SSH command on this serv er
# you can copy and past the pub key contenct to the remote
authorized_key file 33
Configure remote access “SSH”
- Note that .ssh dir crated on the remote and hav e a file called authorized_key hav e your
pub key.
- Now you can SSH on the remote serv er with out asking for password
sudo vim /etc/ssh/sshd_config # sshd service config file, any change in this file
must reload the service
34
Configure network
interfaces and settings.
ip addr show
ip a s
ip a s <NIC Name>
Nmtui # then down and up the NIC, and restart the service
Manage software using
DNF
38
Manage software using DNF
dnf list installed # it's the same if you use yum
dnf list installed | grep -i "python"
vim /var/log/yum.log
dnf update
▪ Linux wiki
▪ RHEL Book
▪ RH124
TEACH A COURSE 40
Thank you
Thank you, I Really appreciate your attendance
Contact me:
M ohamed-ibrahim2021@outlook.com