0% found this document useful (0 votes)
33 views104 pages

Linux Operating System Notes

The document provides an introduction to the Linux operating system, covering its history, features, file systems, and installation procedures. It details the development of Linux by Linus Torvalds, compares Linux with Unix, and describes various Linux distributions and file systems such as ext2, ext3, and ext4. Additionally, it outlines the directory structure of Linux and includes practical instructions for installing Fedora 30 Server in a dual-boot configuration with Windows.

Uploaded by

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

Linux Operating System Notes

The document provides an introduction to the Linux operating system, covering its history, features, file systems, and installation procedures. It details the development of Linux by Linus Torvalds, compares Linux with Unix, and describes various Linux distributions and file systems such as ext2, ext3, and ext4. Additionally, it outlines the directory structure of Linux and includes practical instructions for installing Fedora 30 Server in a dual-boot configuration with Windows.

Uploaded by

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

LINUX OPERATING SYSTEM

LECTURER: DAVID KANYI

Chapter 1
Introduction

1.1
AREAS TO BE ADDRESSED:
HISTORY OF LINUX

FEATURES OF LINUX OS

FILE SYSTEM OF LINUX

PRACTICALS:

INSTALLATION

LINUX COMMANDS

SYSTEM ADMINISTRATION

LINUX SERVER ADMINISTRATION

1.2
HISTORY OF LINUX

1. Linus Torvalds created Linux when he


was a student at the University of
Helsinki studying computer science.
2. In early 1991 he purchased an IBM-
compatible personal computer that
came with the MS-DOS operating
system.
3. Linus wasn’t satisfied with MS-DOS
and wanted to use a UNIX operating
system like he was accustomed to at
1.3
HISTORY OF LINUX

1. When he set out to obtain a copy of


UNIX for his personal use, he found
that the least expensive UNIX he could
buy was about $5,000 USD. Driven by
the desire to run a UNIX-like operating
system on his personal computer, he
set out to create Linux.
2. Linus and over 100 developers worked
on Linux over the next couple of years
and in March of 1994, version 1.0 of
1.4
the Linux kernel was released.
LINUX DISTRIBUTIONS

1. Here are some popular Linux


distributions:
 RedHat Enterprise Linux (RHEL)
 Fedora
 Ubuntu
 Debian
 SuSE Linux Enterprise Server (SLES)
 OpenSuSE
 Linux Mint
1.5
MORE ON LINUX

1. Linux is free. Not only is the source


code freely available, but you can run
Linux on your hardware without having
to be pay a licensing fee in many
cases.

1.6
UNIX OPERATONG SYSTEM

1. The UNIX OS was born in the late


1960s. AT&T Bell Labs released an
operating system called Unix written in
C, which allows quicker modification,
acceptance, and portability.
2. Unix is a proprietary operating system.

1.7
Features of Unix OS
 Multi-user, multitasking operating
system
 It can be used as the master control
program in workstations and servers.
 Hundreds of commercial applications
are available
 In its heydays, UNIX was rapidly
adopted and became the standard OS
in universities.

1.8
Features of Linux
 Support multitasking
 Programs consist of one or more
processes, and each process have one or
more threads
 It can easily co-exists along with other
Operating systems.
 It can run multiple user programs
 Individual accounts are protected
because of appropriate authorization
 Linux is a replica of UNIX but does not
1.9
Linux vs. Unix

Basis of Difference Linux Unix


Cost Linux is freely Different flavors of
distributed, Unix have different
downloaded through pricing depending
magazines, Books, upon the type of
website, etc. There vendor.
are paid versions also
available for Linux.
Development Linux is Open Source, Unix systems have
and thousands of different versions.
programmer These versions are
collaborate online and primarily developed
contribute to its by AT&T as well as
development. other commercial
vendors.
User Everyone. From home The UNIX can be used
users to developers in internet servers,
and computer workstations, and
1.10
Linux vs. Unix

Basis of Difference Linux Unix


Text made BASH is the Linux Originally made to
interface default shell. It offers work in Bourne Shell.
support for multiple However, it is now
command compatible with many
interpreters. others software.
GUI Linux provides two Common Desktop
GUIs,viz., KDE and Environment and also
Gnome. Though there has Gnome.
are many alternatives
such as Mate, LXDE,
Xfce, etc.

1.11
Linux vs. Unix
Basis of Difference Linux Unix
Viruses Linux has had about 60- There are between 80
100 viruses listed to to 120 viruses reported
date which are currently till date in Unix.
not spreading.
Threat detection Threat detection and Unix users require
solution is very fast longer wait time, to get
because Linux is mainly the proper bug fixing
community driven. So, if patch.
any Linux user posts
any kind of threat, a
team of qualified
developers starts
working to resolve this
threat.
Architectures Initially developed for It is available on PA-
Intel's x86 hardware RISC and Itanium
processors. It is machines.
1.12 available for over
Linux vs. Unix
Basis of Difference Linux Unix
Usage Linux OS can be The UNIX operating
installed on various system is used for
types of devices like internet servers,
mobile, tablet workstations & PCs.
computers.
Versions Different Versions of Different Versions of
Linux are Redhat, Unix are HP-UX, AIS,
Ubuntu, OpenSuse, BSD, etc.
Solaris, etc.

Supported file type The Filesystems The Filesystems


supported by file type supported by file types
like xfs, nfs, cramfsm are zfs, hfx, GPS, xfs,
ext 1 to 4, ufs, devpts, vxfs.
NTFS.
1.13
Linux vs. Unix
Basis of Difference Linux Unix
Portability Linux is portable and is Unix is not portable
booted from a USB Stick

Source Code The source is available The source code is not


to the general public available to anyone.

1.14
Limitation of Linux
 There's no standard edition of Linux
 Linux has patchier support for drivers which

may result in malfunctioning of the entire


system.
 Linux is, for new users at least, not as easy to

use as Windows.
 Many of the programs we are using for

Windows will only run on Linux only with the


help of a complicated emulator. For example.
Microsoft Office.
 Linux is best suitable for a corporate user. It's

1.15much harder to introduce in a home setting.


LINUX FILE SYSTEM
1. ext2, ext3 and ext4 are all filesystems
created for Linux.
2. Ext2
 Ext2 stands for second extended file
system.
 It was introduced in 1993. Developed by
Rémy Card.
 This was developed to overcome the
limitation of the original ext file system.

1.16
LINUX FILE SYSTEM
 Ext2 does not have journaling feature—
check next slide
 On flash drives, usb drives, ext2 is
recommended, as it doesn’t need to do
the over head of journaling.
 Maximum individual file size can be from
16 GB to 2 TB
 Overall ext2 file system size can be from
2 TB to 32 TB

1.17
LINUX FILE SYSTEM
1. A journaling filesystem keeps a
journal or log of the changes that are
being made to the filesystem during
disk writing that can be used to rapidly
reconstruct corruptions that may occur
due to events such a system crash or
power outage.

1.18
LINUX FILE SYSTEM
1. Ext3
 Ext3 stands for third extended file
system.
 It was introduced in 2001.
 Developed by Stephen Tweedie.
 Starting from Linux Kernel 2.4.15 ext3
was available.
 The main benefit of ext3 is that it allows
journaling.

1.19
LINUX FILE SYSTEM
1. Ext3
 Maximum individual file size can be
from 16 GB to 2 TB
 Overall ext3 file system size can be
from 2 TB to 32 TB
1. You can convert a ext2 file system to
ext3 file system directly (without
backup/restore).

1.20
LINUX FILE SYSTEM
1. Ext4
 Ext4 stands for fourth extended file
system.
 It was introduced in 2008.
 Starting from Linux Kernel 2.6.19 ext4
was available.
 Supports huge individual file size and
overall file system size.
 Maximum individual file size can be
from 16 GB to 16 TB
1.21
LINUX FILE SYSTEM
1. Ext4
 Overall maximum ext4 file system size
is 1 EB (exabyte). 1 EB = 1024 PB
(petabyte). 1 PB = 1024 TB (terabyte).
 Directory can contain a maximum of
64,000 subdirectories (as opposed to
32,000 in ext3)
 You can also mount an existing ext3 fs
as ext4 fs (without having to upgrade
it).
1.22
LINUX FILE SYSTEM
1. Ext4
 Several other new features are
introduced in ext4: multiblock
allocation, delayed allocation, journal
checksum. fast fsck, etc.
 All you need to know is that these new
features have improved the
performance and reliability of the
filesystem when compared to ext3.
 In ext4, you also have the option of
1.23 turning the journaling feature “off”.
LINUX DIRECTORIES
 /bin
 Bin is an abbreviation of Binaries. It's
just a directory where a user of an
operating system can expect to find
applications.
 /boot
 The /boot directory contains files
required for starting the system.

1.24
LINUX DIRECTORIES
 /dev
 /dev contains device files. Many of these
are generated at boot time or even on
the fly. For example, if you plug in a new
webcam or a USB pendrive into your
machine, a new device entry will
automagically pop up here.
 /etc
 /etc is where configuration files
and directories are located.
1.25
LINUX DIRECTORIES
 /home
 /home is where you will find the users'
personal directories.
 /lib
 /lib is where libraries live. Libraries are
files containing code that applications
can use. They contain snippets of code
that applications use to draw windows on
the desktop, control peripherals, or send
files to the hard disk.
1.26
LINUX DIRECTORIES
/media
The /media directory is where external
storage will be automatically mounted
when you plug it in and try to access it.
/mnt
The /mnt directory, however, is a bit of
remnant from days gone by. This is where
you would manually mount storage
devices or partitions. It is not used very
often nowadays.
1.27
LINUX DIRECTORIES
 /proc
 /proc, like /dev is a virtual directory. It

contains information about your


computer, such as information about
your CPU and the kernel your Linux
system is running.
 /root

 /root is the home directory of the super

user (also known as the "Administrator")


of the system. It is separate from the
1.28rest of the users' home directories.
LINUX DIRECTORIES
 /run
 /run is another new directory. System

processes use it to store temporary data.


 /sbin

 /sbin is similar to /bin, but it contains

applications that only the superuser


(hence the initial s) will need. You can
use these applications with
the sudo command that temporarily
concedes you superuser powers on many
1.29distributions.
LINUX DIRECTORIES
 /usr
 The /usr directory was where users' home
directories were originally kept back in
the early days of UNIX. However,
now /home is where users kept their stuff
as we saw above. These
days, /usrcontains a mish-mash of
directories which in turn contain
applications, libraries, documentation,
wallpapers, icons and a long list of other
stuff that need to be shared by
1.30
LINUX DIRECTORIES
 /srv
 The /srv directory contains data for
servers. If you are running a web server
from your Linux box, your HTML files for
your sites would go
into /srv/http (or /srv/www). If you were
running an FTP server, your files would
go into /srv/ftp.

1.31
LINUX DIRECTORIES
 /sys
 /sys is another virtual directory
like /proc and /dev and also contains
information from devices connected to
your computer.
 /tmp
 /tmp contains temporary files, usually
placed there by applications that you are
running.

1.32
LINUX DIRECTORIES
 /var
 /var contains things like logs in
the /var/log subdirectories. Logs are files
that register events that happen on the
system.

1.33
Standard Linux filesystem hierarchy

1.34
INSTALLING FEDORA 30 SERVER(DUAL BOOT)
 FOR THIS CLASS WE WILL INSTALL
FEDORA 30 SERVER.
 DUAL BOOT MEANS WE WILL LEAVE
WINDOWS OS INTACT---IN OTHER
WORDS WE WILL HAVE 2 OS IN THE
SAME HDD.
 NEXT IS SCREEN SHOTS OF
INSTALLATION PROCEDURE.

1.35
INSTALLING FEDORA 30 SERVER(DUAL BOOT)

1. WE WILL INSTALL THE OS USING DVD.


2. PROCEDURE:
3. INSERT DVD INTO DRIVE
4. REBOOT THE COMPUTER
5. FOLLOW THE SCREEN SHOT IN THE
SUBSEQUENT SLIDES---THIS IS FOR
FEDORA 27…INSTALLATION IS SIMILAR
TO 30

1.36
INSTALLING FEDORA 30 SERVER(DUAL BOOT)

1. On the first installation screen, select Install


Fedora Workstation Live 27 and press [enter] key to
continue.

1.37
INSTALLING FEDORA 30 SERVER(DUAL BOOT)
1. On the next screen, select the language that will
be used during the installation process and hit
on Continue button.

1.38
INSTALLING FEDORA 30 SERVER(DUAL BOOT)
1. The next screen will present you Fedora Installation
Summary menu. First, click on Keyboard menu, choose your
system keyboard layout and hit on top Done button to complete
this step and go back to main menu, as illustrated in the below
images.

1.39
INSTALLING FEDORA 30 SERVER(DUAL BOOT)

1. Next, hit on Time and Date menu and select your region and
city from the provided map. When you finish, hit on Done button
to return to main installer menu…..THIS interface is different for
fedora 30

1.40
INSTALLING FEDORA 30 SERVER(DUAL BOOT)

1. Next, click on Installation Destination menu, check your


machine hard disk and select Advanced Custom (Blivet-
GUI) option to configure the storage. Again, hit on Done button
to enter Blivet GUI Partitioning program.---here care should be
taken to select the HDD partition to install Fedora 30!!!

1.41
INSTALLING FEDORA 30 SERVER(DUAL BOOT)
 In this step, select the disk partition you want to resize in order to
create a new partition that will be used for installing Fedora 27 in
dual-boot with Windows 10.
 To resize the partition, right-click on the desired partition and
select Edit -> Resize from the menu.

1.42
INSTALLING FEDORA 30 SERVER(DUAL BOOT)
 On the new screen prompt, use the value bar to shrink the
Windows partition to your own desired size and click
on Resize button to apply changes.

1.43
INSTALLING FEDORA 30 SERVER(DUAL BOOT)
 The free space resulted after shrinking the Windows partition will
be used for installing Fedora server. Select the free space and hit
on the + button to create a new partition.

1.44
INSTALLING FEDORA 30 SERVER(DUAL BOOT)
 On partition settings window, enter the size of the partition, select a file system type,
such as the robust ext4 file system to format the partition, add a label for this partition
and use /(root) as the mount point of this partition.
 When you finish hit OK button to apply the new configuration. Use the same procedure
to create the swap partition or other partitions for your system.—this screen shot has no
swap!!!

1.45
INSTALLING FEDORA 30 SERVER(DUAL BOOT)
 After you’ve created the partitions, review partition table and press the
top Done button twice to confirm configuration and hit on Accept Changes button
from the pop-up Summary of Changes window to apply storage partition
configurations and return to main menu.

1.46
INSTALLING FEDORA 30 SERVER(DUAL BOOT)
 The next step is this: confirm your partitions before Linux proceeds to install itself!!!

1.47
INSTALLING FEDORA 30 SERVER(DUAL BOOT)
 To start the installation process, just hit on Begin Installation button, as
illustrated in the following image.

1.48
INSTALLING FEDORA 30 SERVER(DUAL BOOT)
 After the installation process starts, click on Root Password menu
from User settings window and setup a strong password for your
system root account. When you finish, hit the Done button to
apply root password and return to initial screen.

1.49
INSTALLING FEDORA 30 SERVER(DUAL BOOT)
 Configuring the root password----this is access credentials for the
root user(super admin who can access and edit the root directory
of Linux)

1.50
INSTALLING FEDORA 30 SERVER(DUAL BOOT)
 Next, click on User Creation menu, add the name of a new user
and setup a strong password for the new account. To allow root
privileges to this user, make sure you check Make this user
administrator. Also, check the box with Require a password to use
this account and hit on Done button to complete this step.

1.51
INSTALLING FEDORA 30 SERVER(DUAL BOOT)
 Wait for the installation process to finish and hit on Quit button to
complete the installation and close the window.

1.52
INSTALLING FEDORA 30 SERVER(DUAL BOOT)
 After the installation completes, eject Fedora installation media
and reboot the machine. After reboot, you will be directed to
GRUB menu, where for 5 seconds you can choose what operating
system you want the machine to boot from: Fedora or Windows.

1.53
INSTALLING FEDORA 30 SERVER(DUAL BOOT)
 the Fedora 30 is now installed and the journey begins!!!!!!

1.54
DNF Command Examples for Package Management in
Fedora Linux
 DNF or Dandified YUM is a fork of YUM package manager. It
was introduced in fedora 18 & on fedora 22, it has now become
default package manager for handling the RPM(Red Hat Package
Manager) packages.
 DNF resolves all the problems that has been associated with yum,
like poor performance, high memory usage, slowness for
dependency resolution. DNF can be termed as the next major
version of the YUM package manager. Currently, the most stable
version of DNF is version 2.6.3
 DNF is the built in utility to help you download and install
packages in fedora linux

 The Yellowdog Updater, Modified (YUM) is a free and open-source


command-line package-management utility for computers
running the Linux operating system using the RPM Package
Manager.
 Yum helps to download, install and update packages in Linux
1.55
DNF Command Examples for Package Management in
Fedora Linux
 Example:1) List enabled repositories(online storage)
 To list all the enabled repositories on the system, run:
 $ sudo dnf repolist----sudo means super user do-- that allows
users to run programs with the security privileges of another
user, by default the superuser.
 Example:2) List all repositories (enabled as well as disabled)
 $ sudo dnf repolist all----should see something like this:

1.56
DNF Command Examples for Package Management in
Fedora Linux
 Example:3) Installing a package
 Like yum, we use ‘install‘ option followed by package name with
dnf to install, Let’s suppose we want to install web server
package (httpd)
 $ sudo dnf install httpd----you will see something like this after
running the command:

1.57
DNF Command Examples for Package Management in
Fedora Linux
 Example:4) Removing a package
 To remove a package, execute the following from terminal:
 $ sudo dnf remove httpd
 Or
 sudo dnf erase httpd
 Output of above command would be something like below:

1.58
DNF Command Examples for Package Management in
Fedora Linux
 Example:5) Update a package
 Run the following command to update a single package on the
system,
 Syntax: dnf update {pkg-name}
 $ sudo dnf update httpd
 Example:6) Check for full system update
 For a system wide update check, execute the following command,
 $ sudo dnf check-update----you will something like this:

1.59
DNF Command Examples for Package Management in
Fedora Linux
 Example:7) Upgrade all system packages
 To upgrade all system packages, run the following:
 $ sudo dnf upgrade---you will something like this:

1.60
DNF Command Examples for Package Management in
Fedora Linux
 Example:8) List all group packages
 Use the following to list all group packages:
 $ sudo dnf grouplist----to see packages that are grouped together
e.g desktop packages
 Example:9) Installing Group packages
 Similar packages are grouped together & can be installed from
single command, rather than using separate commands. To
install a group, run:
 $ sudo dnf groupinstall “Network Servers“
 Example:10) Removing group packages
 To remove a complete group of packages from system, run the
following dnf command,
 Syntax: dnf groupremove ‘group_name’
 $ sudo dnf groupremove “Network Servers"

1.61
DNF Command Examples for Package Management in
Fedora Linux
 Example:11) Search for packages
 To look for a particular package from the repositories, execute
 Syntax: dnf search {package_name}
 Let’s suppose I want to search net-tools package
 $ sudo dnf search net-tools
 Example:12) Download (don’t not install) a package
 There can some scenarios where we require to download the
packages but don’t wish to install. Use the following command to
download package like samba
 Syntax : dnf download package_name
 $ sudo dnf download samba

1.62
DNF Command Examples for Package Management in
Fedora Linux
 Example:13) Show all available packages
 To get list of all available packages from repositories, open
terminal & run beneath dnf command
 $ dnf list available | more---|(pipe)- redirection that is used
in Linux to send the output of one program to another program
for further processing.
 Use ctrl + C to terminate

1.63
DNF Command Examples for Package Management in
Fedora Linux
 Example:14) Show only installed packages
 Now, if we only require a list of installed packages on the system,
we can get it by executing following command,
 $ dnf list installed----you will something like this:

1.64
DNF Command Examples for Package Management in
Fedora Linux
 Example:15) Show all installed as well as available packages
 To get list of all packages i.e. installed as well as available, run
the following command
 $ dnf list---you will see something like this:

1.65
DNF Command Examples for Package Management in
Fedora Linux
 Example:16) Removing orphan packages
 Orphan packages are those packages that were once installed to
satisfy dependency for some other package but are not required
now. To remove such packages, run:
 $ sudo dnf autoremove----what happens next is like this:

1.66
DNF Command Examples for Package Management in
Fedora Linux
 Example:17) Synchronize all the packages to latest stable
releases
 Run the following command in order to synchronize all the
packages to latest stable releases:
 $ sudo dnf distro-sync

1.67
DNF Command Examples for Package Management in
Fedora Linux
 Example:18) Reinstall a package
 To reinstall a package, if need be, run the following command:
 $ sudo dnf reinstall postfix(Mail Transfer Agent (MTA) that can be
used to route and deliver email on aLinux system.)
 Example:19) Get list of all DNF commands and options
 To get a list of all the available options that can be used with
DNF, run:
 $ dnf help----you will get this help:

1.68
BASIC LINUX COMMANDS

COMMAND EXPLANATION
man This command brings up the online Unix
manual. Use it on each of the commands
below.
For Example: man pwd --You will see the
manual for the pwd command.
Pwd(print Shows what directory (folder) you are in.
working In Linux, your home directory is
Directory) /home/particle

Cd(change Changes directories.


Directory)
cd .. Moves up one directory (yes, include the
two little dots)

cd ~ Takes you back to your home directory


mkdir [dirName Creates a directory with the name you give
]
1.69
BASIC LINUX COMMANDS

COMMAND EXPLANATION
rmdir [dirName ] Removes a directory with the name you gave
ls Lists files.
Ls- al(list all) You'll see a huge list of files that you can't see
with the 'ls' command alone and lots of details.
Cp(copy files) copies a file
Most used options are:
-r copies directories (recursively)-p preserves
permissions, ownership, and timestamps-i prompt
before overwrite-v verbose, show filenames as they are
being copied
Examples:
Makes a copy of file 'debian' and call it 'Debian'
(assuming 'Debian' is not already a directory) $ cp -i
debian Debian
Same as the previous command (the filename defaults
to be the same). $ cp -i debian /tmp
Create a directory called happy and another one called
1.70 sad. Copy the happy directory together with its contents
BASIC LINUX COMMANDS

COMMAND EXPLANATION

Mv(move or move and/or rename files


rename) Examples:
Rename file 'unix' to 'Unix' (assuming "Unix" is not a
directory) $ mv -i unix Unix
Move file Unix from your home directory to /tmp. $
mv -i ~/Unix /tmp/Unix
Same as the previous command (the filename
defaults to be the same). $ mv -i ~/Unix /tmp
Move file Unix from your home directory to /tmp, and
rename it to 'unix'. $ mv -i ~/Unix /tmp/unix

1.71
BASIC LINUX COMMANDS

COMMAND EXPLANATION
rm deletes a file from the filesystem, like the "del"
command in DOS.
-d, --directory unlink FILE, even if it is an empty
directory (some systems let superuser unlink non-
empty directories too)-f, --force ignore nonexistent files,
never prompt-i, --interactive prompt before any
removal-P (*BSD only) overwrite file before deletion-r, -
R, --recursive remove the contents of directories
recursively (the force option must often be used to
successfully run rm recursively)-v, --verbose
Example:
To remove a file whose name starts with a `-', for
example `-foo', use one of these commands:
$ rm -- -foo
$ rm ./-foo

1.72
BASIC LINUX COMMANDS

COMMAND EXPLANATION
touch lets you change the date on a file. Can also be used
to create a blank file.
Example:
Change directory to directory happy
Then create a blank file by:
$ Touch tuk

df reports the amount of free disk space available on


each partition.
Reports disk usage in human readable format with
block-sizes in Kilo,Mega,Gigabytes use this command
$ df -h

1.73
BASIC LINUX COMMANDS

COMMAND EXPLANATION
du Shows disk usage. Run this command
$du – h

chmod chmod changes permissions of files. One must be


familiar with Unix file permissions to understand this
command. There are three permissions: read ("r"),
write ("w"), and execute ("x"). There are three sets
of permissions: for the owning user of the file ("u"),
for the group of the file ("g"), and for other users
("o").
chgrp Changes the group ownership of files.

1.74
Useful Commands to Get CPU Information on Linux
 Get CPU Info Using cat Command
 You can simply view the information of your system CPU by
viewing the contents of the /proc/cpuinfo file with the help of cat
command as follows:
 $ cat /proc/cpuinfo
 lscpu Command – Shows CPU Architecture Info
 The command lscpu prints CPU architecture information
from sysfs and /proc/cpuinfo as shown below:
 $ lscpu
 How to find fedora 30 server kernel version-use the below
command:
 cat /proc/version
 To view memory usage:
 Run the top command
 $top
1.75
Commands for creating users
 Step 1: Add the User
 It’s just one simple command to add a user. In this case, we’re
adding a user called tuk:
 $sudo adduser tuk---creating a new user called tuk
 Now set the password for the new user “tuk”
 $sudo passwd tuk----assigning a password
 Step 2: Grant Root Privileges to the User
 We will need to use vim editer to edit a configuration file
 Vim modes
 Insert Mode- The shortcut is: "i" (insert text where the cursor is)
or "o" (insert text at the beginning of the following line).
 After editing the file press esc
 To save-:x
 To quit without saving-:q!

1.76
Commands for creating users
 Run the following command to launch vim editor and make user
tuk a root user
 $sudo visudo
 Find the following code:
 ## Allow root to run any commands anywhere
root ALL=(ALL) ALL
 Click i to get into insert mode
 Below that line
 Write:
 Tuk ALL=(ALL) ALL

 To save and quit..press esc and then type :x and enter

1.77
Get a List of All Users using the /etc/passwd File
 Local user information is stored in the /etc/passwd file. Each line
in this file represents login information for one user. To open the
file you can either use cat or less:
 Type the command:
 $sudo cat /etc/passwd
 From the output notice the following:
 User name
 Encrypted password (x means that the password is stored in
the /etc/shadow file)
 User ID number (UID)
 User’s group ID number (GID)
 User home directory
 Login shell (defaults to /bin/bash)

1.78
INSTALLING AND CONFIGURING SERVER
PACKAGES
 In this section we will begin installing and configuring server
packages
 Installing and configuring MYSQL database(mariadb)
 The latest MYSQL comes as mariadb
 To install the database package run the following command:

 $ sudo dnf -y install mariadb-server mariadb


 -y(means assume yes…in other words it will install without

prompting you to respond)


 After installing MariaDB server, start the service and set it to start

at boot.
 Run the following commands:

 sudo systemctl start mariadb.service

 sudo systemctl enable mariadb.service

 Server packages services have a d at the end---it is

1.79daemon(running in the background without users intervention)


INSTALLING AND CONFIGURING SERVER
PACKAGES
 Step 3: Secure MariaDB Installation
 After installation, MariaDB server is not hardened and can easily

be accessed without authentication.


 Secure your database by running the following script.

 $ mysql_secure_installation

 Then hit enter once prompted for a root password(initially no

password)
 For the rest of the questions answer y for yes

 When done, test access using the root user – without a password.

 Run this command:

 $ mysql -u root

 Notice that you have been denied entry without a password

 As seen, you need to authenticate to access database console as

a root user as follows:


 $ mysql -u root -p (-u is username root and p is to prompt for
1.80password)
INSTALLING AND CONFIGURING SERVER
PACKAGES
 Install Apache on Fedora 30
 If you would like to use Fedora 30 server to host your web sites
using Apache Web server, follow through this guide to get Apache
installed.
 Apache web server is provided by the httpd package on Fedora
30.
 It can be installed by executing the command below:
 Next, proceed to do some basics to verify that it is actually
working.
 Allow Apache HTTP service on Firewall
 Firewalld is running by default on Fedora 30.
 To test whether the firewall is running run this command:
 $sudo firewall-cmd --state
 The response will be running
 Therefore, if firewalld is running, you need to allow HTTP service
through it to allow external access to the web server.
1.81
INSTALLING AND CONFIGURING SERVER
PACKAGES
 Run the following command to allow access to the webserver
 $sudo firewall-cmd --permanent --add-port=80/tcp
 After that you will need to Reload Firewalld using this command:
 $sudo firewall-cmd --reload
 To view the firewall settings run this command:
 $sudo firewall-cmd --list-all
 Check whether port 80 is allowed through the firewall
 Running Apache web server
 To start and enable Apache to run on system boot run the
commands:
 $Sudo systemctl start httpd
 $sudo systemctl enable httpd

1.82
INSTALLING AND CONFIGURING SERVER
PACKAGES
 Verify Apache Web server
 Apache ships with a default test page which you can use to verify
if Apache is ready to serve the web content. It is accessed via the
URL, http://<hostname or web-server-host-IP>. Hence, if
everything is fine, when you access the URL above via the
browser, you should land on Fedora Apache test page.
 To see the IP address of the fedora server run the command:
 $ ifconfig
 THE TEST PAGE IS AS SHOWN NEXT

1.83
INSTALLING AND CONFIGURING SERVER
PACKAGES

1.84
ASSIGNMENT 1
 INSTALL AND CONFIGURE SAMBA
SERVER PACKAGE
 ACCESS IT USING YOUR WINDOWS
MACHINE.
 LET ME HAVE THE SCREEN SHOT AS
EVIDENCE
 Write the commands you have used to
install and configure samba package
 MARKS=20

1.85
Installing and configuring
phpMyAdmin
 Before phpMyAdmin is installed the
following must be installed:
 Php-installed together with apache
 To check the php version run this
command:
 $php –v

1.86
Installing and configuring
phpMyAdmin
 We will need to configure timezone in
the php configuration file by using
vim editor
 This is the command:
 Sudo vi /etc/php.ini
 Look for this line and set the zone as
shown:
 date.timezone = Africa/Nairobi

1.87
Installing and configuring
phpMyAdmin
 Install and configure phpMyAdmin on
Fedora 30 server
 Run this command to download and
install phpMyAdmin:
 $ sudo dnf -y install phpMyAdmin
 To check the version of installed
phpMyAdmin run this command:
 $ rpm -qi phpMyAdmin

1.88
Installing and configuring
phpMyAdmin
 Limit access to phpMyAdmin to your
only trusted networks
 Run ifconfig command to check your
network address
 Then use vim editor to edit this file:
 $ sudo vi
/etc/httpd/conf.d/phpMyAdmin.conf
 Edit the Require ip lines – both on
Line 17 and 34 of the file.

1.89
Installing and configuring
phpMyAdmin
 Require ip 127.0.0.1 [192.168.18.0/24]-
classful ip of the address to access the
server
 Save the changes and restart httpd
service:
 $ sudo systemctl restart httpd
 Step 3: Access phpMyAdmin interface
 Access [http://(your hostname or IP
address)/phpmyadmin/] from your
favorite web browser and network
whitelisted.
1.90
Installing and configuring
phpMyAdmin
You will see such a log in window

1.91
Installing and configuring sendmail
 Sendmail is a general purpose email
routing facility used for email transport
over the Internet.
 It includes SMTP (Simple Mail Transfer
Protocol) for the mail-transfer and email
delivery. Most of the system
administrators preferred to use Sendmail
server as MTA than other MTAs. You can
also use Sendmail server to send
the email via external SMTPservers like
Gmail, Amazon SES, MailChimp etc.

1.92
Installing and configuring sendmail
 Install Sendmail
 use the following command to install
Sendmail with other required
packages using yum package
manager:
 $ sudo dnf install sendmail sendmail-
cf

1.93
Installing and configuring sendmail
 Configure Sendmail on Fedora 30
server
 Before starting configuration you
must know about various Sendmail
configuration files that exist in
/etc/mail directory:
 access — Allow/Deny other systems
to use Sendmail for outbound emails.
 domaintable — Used for domain
name mapping for Sendmail.
1.94
Installing and configuring sendmail
 local-host-names — Used to define
aliases for the host.
 mailertable — Defined the
instructions that override routing for
particular domains.
 virtusertable — Specifies a domain-
specific form of aliasing, allowing
multiple virtual domains to be hosted
on one machine.

1.95
Installing and configuring sendmail
 Comment out below line
in /etc/mail/sendmail.mc to allow
receiving email from anywhere.
 To comment a line in sendmail.mc,
just put dnl at start of line.
 To open the file issue this command:
 $sudo vi /etc/mail/sendmail.mc
 dnlDAEMON_OPTIONS(`Port=smtp,Ad
dr=127.0.0.1, Name=MTA')dnl

1.96
Installing and configuring sendmail
 Add this line also in sendmail.mc
above ‘MAILER’ option
 FEATURE(`relay_hosts_only')dnl
 The above feature ensures that your
MTA does not become an open relay
to all other hosts within your DNS
domain
 Restart Sendmail service
 $ sudo systemctl restart sendmail

1.97
Installing and configuring sendmail
 test the sendmail:
 You have to be a root user to do
this:
 To change to root user:
 Su –
 Then run this command and
check your email address inbox
or spam folder:
 #sendmail –s “test mail”
[email protected] </dev/null
1.98
Installing and configuring sendmail
 test the sendmail:
 You may create a file with email
content:
 In your home directory create this
file by using this command:
 $ vi email.txt
 Once open in the vim editor> click i
to insert text into the file
 Subject: Terminal Email send
 This is a test email from my sendmail
 Just learning the process!
1.99
Installing and configuring sendmail
 switch user to root by command
 Su –
 Then send the test mail by
issuing this command:
 #sendmail [email protected]
< /home/dkanyi/email.txt
 Check your inbox/spam

1.100
Assignment 2- (30 marks)
 install and configure postfix MTA.
 Let me have a screen shot of the
configuration and installation
 Send yourself a test email and
let me have a screen shot of the
sent email from your inbox

1.101
Assignment 3- (30 marks)
 we have used CLI-command line
interface for our fedora 30 server
practical classes.
 I need you to install GNOME
desktop Environment.
 Launch the Fedora GNOME
desktop(GUI)
 Let me have a screen shot of
your desktop as evidence

1.102
Assignment 4- (20 marks)
 Attach a USB drive to the machine
bearing fedora 30.
 From your putty mount and
access your usb drive
 Let me have the screen shots
 This is the final assignment
 Please note all assignments
amount to 100%

1.103
END OF COURSE
 THANK YOU
 HOPE YOU LEARNT AND ENJOYED

1.104

You might also like