Ch3 Linux Administration

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 78

Systems And Network

Administration

Bahir Dar University


Faculty of Computing
CHAPTER THREE
2. Linux Administration
2.1 Introduction to Linux
2.2 Linux Distributions
2.3 Linux VS Windows
2.4 Linux Installation
2.5 Managing Software
2.6 Managing Users
2.7 File System
Introduction to Linux
What is Linux?
Operating System
What is Operating System?
• Wikipedia: “the system software responsible for the
direct control and management of hardware and
basic system operations”.
Function of Operating system
Memory management
Process management
Network management
File management
I/O management
Introduction to Linux
Introduction to Linux
What is kernel?
A set of functions that make up the heart
of an OS
It is used to provide an application
interface between programs and physical
devices.
core of the system and manages the CPU,
memory, and peripheral devices
Services provided by the kernel:
Controls execution of processes.
Scheduling processes fairly for execution on
the CPU.
Allocating memory for an executing process.
Introduction to Linux
What is Shell?
Shell is the interface between the user
and the kernel.
Services provided by the shell:
It interprets all the commands to the
kernel
The kernel after processing the
commands gives back to the shell.
hiding complexity of kernel's
functions from users.
Takes commands from user and
executes kernel's functions
Introduction to Linux

Applicatio
n
What is Linux?
A fully-networked 32/64-Bit Unix-like
Operating System
Unix Tools Like sed, awk, and grep (explained later)
Compilers and tools Like C, C++, Fortran,
Smalltalk, Ada, JDK, Python,
Network Tools Like telnet, ftp, ping, traceroute

Multi-user, Multitasking, Multiprocessor


Has the X Windows GUI
Co-exists with other Operating Systems

Runs on multiple platforms

Includes the Source Code


History of Unix
MULTICS PROJECT
It was started in 1965 on Main frame GE
645 by the joint effort of
AT & T Bell Labs
Multics was written in Assembly
Language
In 1969 Multics project was dropped.
In 1969, Ken Thompson & Dennis
Ritchie at Bell Labs - AT&T redesigned
the Multics and introduced New OS
UNICS (Uniplexed Information &
computing system)
It is written in 80 percent of C language
and 20 percent assembly language.
Later on totally rewritten in C language
History of Linux
Linus Torvalds, a young man
studying computer science at the
university of Helsinki developed
academic version of Unix which is
named as Linux

What is POSIX?

 Portable
Operating
System
Interface
•standard designed
(POSIX)
to facilitate
application
portability
History of Linux
 Development started in 1991
 With the help of programmers around the world:
Linux 1.0 in 1994
Linux 2.2 in 1999
 GNU project started 1984 to produce a Unix-like Os by
Richard Stallman.
 Linux Combined with GNU(gov’t of national policy) to
make an GNU/Linux OS
 GNU/Linux, commonly referred to as “Linux”.
 GNU stands for “GNU’s Not Unix”
 First Distros:
 1992 - MCC Interim Linux
 1992 - Softlanding Linux System (SLS)
 1993 - Debian
Why Linux?
• Today Linux has joined the desktop
market.
• On the server side, Linux is well-
known as a stable and reliable
platform.
• Linux provides many applications
like:
– Databases (MySQL,Postgresql),
– Network services(Web Servers,DNS,
Proxy, firewall etc)
– Software development tools(C, Java,
Python,Perl etc.)
Why Linux?
There is excellent and free Internet support
and documentation available.
The graphical user interface (GUI) is similar in
design to that on any other system
A very powerful command line alternative is
also available.
Linux is user friendly.
Why Linux?
It is Open Source
Today, Linux is ready to accept the challenge of
a fast-changing world.

Linux is free:
If you want to spend absolutely nothing, you
don't even have to pay the price of a CD.
Linux can be downloaded in its entirety from the
Internet completely for free.
Why Linux?
Linux is portable to any hardware platform.
Linux was made to keep on running.
As with UNIX, a Linux system expects to run
without rebooting all the time.
Tasks can be scheduled to run at suitable times.

Linux is secure and versatile.


The security model used in Linux is based on
the UNIX idea of security which is robust.
It is less prone to virus attacks.
Linux is scalable
CHAPTER THREE
2. Linux Administration
2.1 Introduction to Linux
2.2 Linux Distributions
2.3 Linux VS Windows
2.4 Linux Installation
2.5 Managing Software
2.6 Managing Users
2.7 File System
Linux Distributions
Linux Distributions
• Some individual students or companies add some
applications and tools to Linux then they began to
distribute their own choice of packages bound around
Linux basic kernel.
• We call this individual sets as distributions.

• Today there are hundreds of different distributions


available popular Linux distributions include
■ SUSE Linux ■ TurboLinux
■ Fedora Linux ■ Mandrake Linux
■ Red Hat Enterprise Linux ■ Lycoris Linux
■ Debian Linux ■ CentOS
■ Linspire ■ ALT Linux
■ Gentoo Linux ■ Ubuntu
■Slackware Linux
CHAPTER THREE
2. Linux Administration
2.1 Introduction to Linux
2.2 Linux Distributions
2.3 Linux VS Windows
2.4 Linux Installation
2.5 Managing Software
2.6 Managing Users
2.7 File System
Linux VS MS Windows
Both offer some of the graphics capabilities
and include some networking capabilities.
But Linux networking is excellent.

Linux is multi-user, but Microsoft Windows


doesn’t support it except some such as
windows server 2000,2005,2008,2012,and
2016
Linux VS Windows NT(new
technology )
Linux needs 2MB RAM to try out, while NT needs
12 MB
Linux needs at least 15 MB disk space, while NT
needs 70 MB at least.
Both system support multitasking
Both system support multiprocessing.
Both system support dynamic cache.
Linux has full multi user support. Local users,
modem users, and network users can all
simultaneously run text and graphics programs.
This is a powerful feature for business
environments that is unmatched by NT.
Linux VS Windows NT
The issue of size is a great strength for
Linux. It was designed to be as small and
efficient as possible. NT’s most
important criterion was portability.
Linux was built on the Internet, and hence
has better support for networking than NT.
Most software packages that run on Linux
have their source code available,
security problems are found and
solved many times quicker than with
NT.
Linux VS Windows
Some network
Windows applications Linux
Microsoft Internet Explorer, Mozilla, Firefox, Galeon,
Firefox, Konqueror, Lynx,
Netscape, Opera, Chrome, etc. Epiphany, Nautilus, Netscape,
Opera,Chrome, etc.
Outlook Express, Outlook, Evolution, Kontact, Thunderbird,
Thunderbird, Pegasus, Lotus Sylpheed-Claws , Horde,
Notes
ICQ, MSN Messenger, AIM (AOL Gaim, Kopete, aMSN, KICQ,
Instant Messenger), Trillian, Gaim, Gabber,
skype Centericq , Skype, Pidgin,
Microsoft Netmeeting, Gnomemeeting
WS FTP, Bullet Proof FTP, CuteFTP GFTP, Kasablanca, KBear, FireFTP
Konqueror
Linux VS Windows
Some multimedia applications
Windows Linux
Adobe Photoshop, GIMP, GIMPShop
GIMP, GIMPShop
3D Studio MAX, Blender, K-3D
Blender
Windows Media Player, MPlayer, Xine, Totem, Kaffeine,
PowerDVD VLC
Winamp, Sonique XMMS amaroK, BMP, juke,
Windows Movie Maker noatun, RhythmBox, xine
Cinelerra, KDenlive, LiVES
Linux VS Windows
Some desktop publishing
Windows Linux
Microsoft Office, OpenOffice, KOffice, Siag Office
OpenOffice 7-zip, gzip, rar,
Winzip, 7-zip, winrar,
alzip
Netscape Composer, OOWeb, NVU, Quanta Plus,
Dreamweaver Bluefish, Mozilla, Screem
Quark, Quark Express, Scribus, OpenOfforg oodraw
Microsoft Publisher
Adobe Acrobat PDF Adobe Acrobat Reader, Xpdf,
Reader, foxit Ghostview, Evince
Adobe Acrobat PDF With Ghostscript, many Linux apps
Creator can print or export to PDF.,
OpenOffice.org, kprint -- can fax,
Linux VS Windows
Scientific, Engineering applications in Lin
Field Application
Mathematics GAMS, Maple, Mathematica, Matlab, Octave,
and Rlab, Scilab
Numerical
Anlysis
CAD and Polyray, POV-ray, BRL-CAD, GIG3DGO, Sced,
Graphics LinuxCAD,
MicroStation
Parallel NetSolve, PETSc, PIM, PLAPACK, ScaLAPACK
Computing
Electrical APLAC, FinSim, Chipmunk, interHDL, Magic,
Engineering Ocean, Spice,
Voyeur
Linux VS Windows

File System
Characteris Windows Linux
tics
File System NTFS, FAT ext2, ext3,ext4
Reference Root of Each partition will Each partitions
each partition be its own root is mounted
point Ex. C:, D:, F: under /
CHAPTER THREE
2. Linux Administration
2.1 Introduction to Linux
2.2 Linux Distributions
2.3 Linux VS Windows
2.4 Linux Installation
2.5 Managing Software
2.6 Managing Users
2.7 File System
Linux Installation
Linux Installation
Linux Installation
Linux Installation
Linux Installation
Linux Installation

Press “Cancel” to configure your network


manually.

Press “Continue” to continue.


Linux Installation
Linux Installation

It’s important that you


configure your clock for the
time zone of Bahir Dar.

If you choose another time zone


some of your server settings
will not be optimal – including
the locations where you obtain
additional software for your
installation.
Linux Installation
If you chose “Select
from worldwide list” in
the previous step, then
scroll down the screen
until you Ethiopia.
Highlight your choice
and press <ENTER> to
continue.
Linux Installation
Linux Installation
• In Windows, each drive is often a partition
– The C: drive often represents one hard drive
• In Linux, there are a minimum of two
partitions needed
– ‘/’ is the root partition, and can include all files
and directories
– A swap space is also needed, at least equal in
size to your RAM
– To make dual-boot system, use a separate
partition for linux.
Caution!
Make sure you manually
partition the hard-disk, most
Linux installers use the whole
disk as the default option. In
that case, you may lose all
your data, and your Windows
installation if you have one.
Linux Installation

Select “<Yes>” and press <ENTER> to continue.


Linux Installation
 You can use LVM (
Logical Volume Management) to group
partitions, disks,
or arrays into a single logical volume
 The volume can be expanded later, for
example, without reinstalling Ubuntu
 The /boot partition can’t use LVM
Linux Installation
ext3 (third extended filesystem)
Block size is 4 kB
Supports files up to 4 TB
Supports volumes up to 8 TB (some say
16 TB)
Supports 32- and 64-bit architectures
The ext3 or ext4 file system is required for the
/boot partition
Linux Installation
ext4
The ext4 file system was added to Linux in January
2009
It uses 64-bit addressing, and is noticeably faster
than ext3
Single files up to 16 TB
File system (volume) up to 1 EB (1 million TB)
Assignment!
What is block size?
How does a block size
affect the total size of a
disk?
What other parameters
affect the size of a storage
disk?
Linux Installation
Linux Installation

These should appear on your screen as Ubuntu


finishes its installation process.
Linux Installation
• Depending on your op. sys. choice,
you'll likely to get one of the
following desktop environments:
GNOME (Ubuntu) or KDE (Pardus).
• There are other desktop
environments (XFCE, Window
Maker, Fluxbox, IceWM etc.) But
GNOME and KDE are the most
popular.
• Both of them will look familiar with
a 'Start' menu, taskbar, system
Linux Installation

GNO
ME
Linux Installation

KD
E
CHAPTER THREE
2. Linux Administration
2.1 Introduction to Linux
2.2 Linux Distributions
2.3 Linux VS Windows
2.4 Linux Installation
2.5 Managing Software
2.6 Managing Users
2.7 File System
Managing Software
What is software package management?
A way to distribute software and
configuration
Eg.
.tar.gz or tgz (Slackware)
.rpm (Red Hat, Fedora, SUSE, …)
.deb (Debian, Ubuntu)
.exe or msi (Windows)
Meta-package managers
Locate packages on the Internet, download, install
and analyze inter-package dependencies. eg.
 yum (rpm)
 apt-get (deb and rpm)
Managing Software
– Debian binary package file names use the
following convention:
<foo>_<VersionNumber>-<DebianRevisionNumber>.deb

– A .deb file is a GNU archive file containing


several mandatory files:
• debian-binary (contains format version number)
• control.tar.gz (contains series of plain files, of
which the file control is mandatory and
contains the core control information)
• data.tar.gz (contains the files-system archive
of the items to be installed)
Managing Software
The Debian package system has a
range of package
"dependencies”:
– Package A depends on Package B if B absolutely
must be installed in order to run A.
– Package A recommends Package B, if the
package maintainer judges that most users
would not want A without also having the
functionality provided by B.
– Package A suggests Package B if B contains
files that are related to (and usually enhance)
the functionality of A.
– Package A conflicts with Package B when A will
not operate if B is installed on the system.
Managing Software
Tools:
– dselect – menu-driven package management
tool
– dpkg – install package (package-file centric)
• medium-level tool set to install, build, remove,
and manage Debian packages
– apt-get – install package (package-archive
centric)
– tasksel – install task (a set of packages)
– aptitude – install package (package & task)
– synaptic, gsynaptic – GUI APT alternatives
CHAPTER THREE
2. Linux Administration
2.1 Introduction to Linux
2.2 Linux Distributions
2.3 Linux VS Windows
2.4 Linux Installation
2.5 Managing Software
2.6 File System
2.7 Managing Users
File System
 What is a file?
 A collection of data;
 An object that can be written to, or

read from, or both. A file has certain


attributes, including access
permissions and type. (susv3)
 File structure
 Generally: byte stream, record
sequence, record tree
 In Linux: byte stream
File System
Filesystem is a method for storing and
organizing computer files and the data they
contain to make it easy to find and access.
Different operating systems normally use
different file systems.
Consists of files/directories and information
needed to locate/access those objects
Linux file system ext2 similar to ext3
 Major difference is that ext3 is a journaling file
system
File System
The file system in Linux stores
the kernel
the executable commands supported by the OS
configuration information
user data
and special files that are used to give controlled
access to system hardware and OS functions.
File System
Items stored in the files system are of
four types:
Ordinary files contain text, data, or
program information. Files can not contain
other files or directories.
Directories containers that hold files, and
other directories.
Devices are used in the same way as
ordinary files providing applications with
easy access to the hardware devices.
Links which is a pointer to another file
File System
File System
The system is laid out as a hierarchical tree
structure. The top-level directory is the 'root'
designated by a slash '/'.
Each directory can have many child
directories, but only one parent directory.
Physical devices are mounted on mount points
Floppy disks
Hard disk partition
CD-ROM drives
No drive letter like A:, C:, …
File System
File System
The path to a certain location can be
specified as:
Absolute path from root
e.g.
/root/home/will
Relative path
e.g.
Accessing play from user “zeb”
../will/play
File System
Direct Stands Content
ory for
/ root Top-level directory in the hierarchical tree
/bin Binarie Contains binaries used by both the system
s administrator and non-privileged user e.g.
command ‘ls’ is stored here
/dev Devices Contains hardware devices directories. It is a
virtual directory
/etc Et cetra Contains configuration files for running
applications
/home Contains user subdirectories
/lib Librarie Contains shared libraries e.g. C, Perl, Python
s general libraries
/mnt Mount
/proc Process Contains information about the system e.g.
es process that are running. It is a virtual directory
/root Default home directory for the system
File System

Direct Stands Content


ory for
/sbin Secure Contains secured binaries that are only
Binaries accessed by privileged users e.g. fdisk,
partitioning tool is kept here
/tmp Temporari Contains temporary files
es
/usr Unix Contains subdirectories such as /usr/doc which
System contains system documentations, /usr/local the
Resources local hosts directory
/var Variables Contains log and spool files
/boot Contains Linux kernel
CHAPTER THREE
2. Linux Administration
2.1 Introduction to Linux
2.2 Linux Distributions
2.3 Linux VS Windows
2.4 Linux Installation
2.5 Managing Software
2.6 File System
2.7 Managing Users
Manage users
Under Linux, every file and program must be
owned by a user.
Each user has a unique identifier called a user
ID (UID).
Each user must also belong to at least one
group ( collection of users established by the
system administrator).
Users may belong to multiple groups.
Like users, groups also have unique identifiers,
called group IDs (GIDs).
A running pro-gram inherits the rights and
permissions of the user who invokes it
Manage users
All user information is stored in straight text
files
enable you to edit user information using simple
text editor
enables administrators to develop user
management tools
Common user information files
/etc/passwd
/etc/shadow
/etc/group
Manage users
The /etc/passwd File
The /etc/passwd file stores the user’s login,
encrypted password entry, UID, default GID,
name, home directory, and login shell.
Manage users
The /etc/shadow File
 contains encrypted password for user accounts
 also contains optional password aging or expiration
information
 Each line represents a single user with fields:
Login name
Encrypted password
Days password was last changed
Days before password may be changed
Days after which password must be changed
Days before password is to expire that user is warned
Days after password expires that account is disabled
Days account is disabled
A reserved field

mmel:$1$HEWdPIJ.$qX/
RbB.TPGcyerAVDlF4g.:12830:0:99999:7:::
Manage users
The /etc/group File
contains a list of groups, with one group per
line
Each group entry in the file has four standard
fields, with each field colon-delimited
The fields are:
Group name -The name of the group
Group password-This is optional, but if set, it
allows users who are not part of the group to join
Group ID (GID)-The numerical equivalent of the
group name
bin:x:1:root,bin,daemon
Group members-A comma-separated list
Manage users
Command-Line User Management
useradd-As the name implies, useradd allows
you to add a single user to the system.
Manage users
usermod
The usermod command allows you to modify
an existing user in the system.
It works in much the same way as useradd.
Manage users
userdel
The userdel command does the exact opposite
of useradd—it removes existing users

usage: userdel [-r] username


Manage users
groupadd
The groupadd command adds groups to the
/etc/group file

usage: groupadd [-g gid [-o]] [-r] [-f] group


Manage users
groupdel
Even more straightforward than userdel, the
groupdel command removes existing groups
specified in the /etc/group file.

usage: groupdel group


Manage users
groupmod
The groupmod command allows you to modify
the parameters of an existing group.
The options for this command are

usage: groupmod [-g gid [-o]] [-n name] group

You might also like