Professional Documents
Culture Documents
CH1 SNA Lecture
CH1 SNA Lecture
Network Administration
Presented by:
Getaneh T.
gdfdgdfdh
fhfjdfhjgfh
gfgjdfhgjd
hffkkfjgkfj
1
Background on Linux
Version of UNIX
Linus Torvalds – Creator of Linux
Open Source Operating System
Free Software
Source Code Available
2
Where is Linux Used?
3
How is Linux Used?
Personal Workstation
File and Print Server
Internet Service Provider
Three-tier Client/Server
4
Using Linux on Personal Computers
5
Linux Distributions
Corel Linux
Debian Linux
OpenLinux (Caldera)
Red Hat
Slackware
SuSE
TurboLinux
6
Configuring Linux System
1. Selecting a language
2. Choosing automatic or manual partitioning
3. Type of software to install
4. Choosing which drive to boot from
7
Configuring Linux (continued)
8
Why Use Linux?
Costs less
Stable
Reliable
Extremely powerful
9
LINUX VS WINDOWS
Financial Differences
Technical Differences
End-User Differences
10
Financial Differences
11
Linux vs. Windows
COST
LINUX WINDOWS
Online Downloads Free Not Available
Retail Price, CD $50 $300
12
Cost for Businesses
Companies have to spend millions for licenses for
ever individual windows computer
For Linux companies don’t have to spend
anything
13
Technical Differences
14
Linux vs. Windows
Keeping up to date
By Upgrading
Linux upgrades faster than Windows
Compatibility
Linux is Backward Compatible unlike
Windows
15
Linux vs. Windows
Features Provided
Both support Dynamic Caching
Both have Multi-user Support
16
Linux vs. Windows
• Application Differences
No commercial word processor for Linux,
which matches the quality for Windows
17
End-User Differences
18
• Proprietary vs. Open Source
Windows is a Proprietary Technology
Applications will only work on Windows
Linux – Open Source
19
Linux
20
Linux vs. Windows
21
In The Commercial Arena
System Administration – Most significant
difference
Linux – tougher environment
Linux requires learning multi-user issues built
into Unix-file permissions
windows – easier environment
windows requires less effort to get a starter
server up and running
But in windows you have to solve multi-user
issues for each and every subsystem
22
In The Commercial Arena
23
In The Commercial Arena
24
Conclusion
25
Booting and Shuting Down
26
Bootstrapping (simplified version)
BIOS Boot Loader Kernel Initialization
init
login login
27
BIOS
Basic Input/Output System
Contains information about the machine’s
configuration. Eg. IDE controller, NIC
PC knows which device to boot from via BIOS
PC tries to run code from the MBR, ie. 1st 512 bytes,
of the disk
MBR tells the PC to load the boot loader from
certain disk partition
The boot loader loads the kernel
28
Boot Loaders – LILO(LInux Loader)
Traditional and stable
/etc/lilo.conf
boot=/dev/hda
root=/dev/hda1
timeout=5
image=/boot/vmlinuz-2.6.20
label=Linux
read-only
other=/dev/hdb1
label=Windows
table=/dev/hdb
To install it
$ lilo
29
Boot Loaders – LILO (cont)
At LILO prompt
LILO: linux init=/sbin/init
LILO: linux init=/bin/bash
LILO: linux root=/dev/hda5
LILO: linux single
30
Boot Loaders – GRUB
GRand Unified Boot loader
Read configuration file at boot time
Understand filesystems and kernel executable formats
ie. Only need to know the device, disk partition and
kernel filename
GRUB device (hd0,0) → /dev/hda1 or /dev/sda1
To install GRUB (for the very first time)
$ grub-install ‘(hd0,0)’
Edit /boot/grub/grub.conf
31
Boot Loaders – GRUB (cont)
/boot/grub/grub.conf
default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-8.el5 ro root=LABEL=/
initrd /boot/initrd-2.6.18-8.el5.img
title Windows
rootnoverify (hd1,0)
chainloader +1
32
Boot Loaders – GRUB (cont)
33
Kernel Initialization
A program itself
/vmlinuz or /boot/vmlinuz
Two-stage loading process
initrd (init RAM disk)
A transient root filesystem in RAM before a real root
filesystem is available
Eg. It is used to install file system modules into the kernel
The real root filesystem
Device detection and configuration
You tell the kernel what to expect
The kernel probes the H/W itself
Kernel threads creation
Eg. init (a user process), kjournald, kswapd
34
Single-user mode
A manual mode after kernel initialization and before
running startup scripts
“single” is passed to init, sulogin is run instead
Most system processes are not running
Users can’t log in, except root
/ is mounted read-only
$ mount -o rw,remount /
Check/repair the disk if there are disk problems
$ fsck -y /dev/sda1
Run ‘exit’ to exit single-user mode
35
Startup/Init Scripts
36
Startup/Init Scripts (cont)
Startup scripts (rc files) are run based on run levels
0 the level in which the system is completely shut down
1 single-user mode
2 multiuser mode
3 full multiuser mode
4 unused
5 X11
6 reboot level
Starts with run level 0 to the default run level (usually 3)
/etc/inittab tells init what to do at each level
To find out which run level the system is current in
$ runlevel
37
Startup/Init Scripts (cont)
init runs the scripts from /etc/rc.d/rc[0-6].d/
/etc/rc.d/rc0/K25sshd → /etc/init.d/sshd
/etc/rc.d/rc3/S55sshd → /etc/init.d/sshd
Each server/daemon provides a master script
Stored in /etc/init.d
Understands the arguments: start, stop, restart
/etc/init.d/sshd start
run level 0 → 3
/etc/rc.d/rc3/S* start
run level 3 → 0
/etc/rc.d/rc0/K* stop
38
Startup/Init Scripts (cont)
39
Reboot & Shutdown
To reboot
$ shutdown -r now
$ reboot
$ telinit 6
To halt
$ shutdown -h now
$ halt
$ telinit 0
$ poweroff
40
Reboot & Shutdown (cont)
To shutdown gracefully
$ shutdown -h +15 “Shutdown in 15 mins”
41
Kernel image
The kernel is the central part in most computer operating
systems because of its task, which is the management of
the system's resources and the communication between
hardware and software components
Kernel is always store on memory until computer is tern
off
Kernel image is not an executable kernel, but a
compress kernel image
zImage size less than 512 KB
bzImage size greater than 512 KB
42
Task of kernel
Process management
Memory management
Device management
System call
43
Major functions flow for Linux kernel boot
44
Init process
The first thing the kernel does is to execute init
program
Init is the root/parent of all processes executing on
Linux
The first processes that init starts is a script
/etc/rc.d/rc.sysinit
Based on the appropriate run-level, scripts are
executed to start various processes to run the system
and make it functional
45
The Linux Init Processes
46
System processes
Process ID Description
0 The Scheduler
1 The init process
2 kflushd
3 kupdate
4 kpiod
5 kswapd
6 mdrecoveryd
47
Inittab file
48
Runlevels
A runlevel is a software configuration of the
system which allows only a selected group of
processes to exist
The processes spawned by init for each of
these runlevels are defined in the /etc/inittab
file
Init can be in one of eight runlevels: 0-6
49
Runlevels
50
rc#.d files
51
init.d
52
Start/stop deamon
53
LINUX FILING SYSTEM
Getaneh T.
54
Introduction to Linux
LINUX Structure
55
Introduction to Linux
56
Introduction to Linux
File System
57
Introduction to Linux
File System
Each node is either a file or a directory of files,
where the latter can contain other files and
directories.
You specify a file or directory by its path name,
either the full, or absolute, path name or the one
relative to a location.
The full path name starts with the root, /, and
follows the branches of the file system, each
separated by /, until you reach the desired file,
e.g.:
/home/condron/source/xntp
58
Introduction to Linux
File System
A relative path name specifies the path relative to
another, usually the current working directory that
you are at. Two special directories :
. the current directory
.. the parent of the current directory
So if I'm at /home/frank and wish to specify the path
above in a relative fashion I could use:
../condron/source/xntp
This indicates that I should first go up one directory
level, then come down through the condron directory,
followed by the source directory and then to xntp.
59
Introduction to Linux
60
Introduction to Linux
61
Introduction to Linux
Structure of Standard Directories
in Linux
/sbin Essential system administrator tools, or
system binaries.
/tmp Temporary files.
/usr Subdirectories with files related to user tools
and applications.
62
Introduction to Linux
64
Introduction to Linux
Access Permissions
There are three permissions for any file, directory
or application program.
Access Permissions
Each of the three permissions are assigned to
three defined categories of users.
The categories are:
66
Introduction to Linux
Access Permissions
One can easily view the permissions for a file by
invoking a long format listing using the command
ls -l.
67
Introduction to Linux
Access Permissions
The permissions for this file are listed are listed at
the start of the line, starting with rwx.
68
Introduction to Linux
Access Permissions
This listing indicates that the file is readable,
writable, and executable by the user who owns the
file (user juan) as well as the group owning the file
(which is a group named student).
69
Introduction to Linux
$ ls –l
70
Introduction to Linux
Moving in Directories
cd try_it
Changes the directory to try_it
pwd
Prints present working directory (e.g.
/home/smith/try_it)
cd .. Move to superior directory
pwd : Prints /home/smith
cd /home The absolute path
pwd : Prints /home
cd The system is returned to the user home
directory
pwd : Print /home/smith
71
Introduction to Linux
Make Directory
72
Introduction to Linux
Remove Directory
73
Introduction to Linux
Copy File
74
Introduction to Linux
75
Introduction to Linux
Remove File
The command rm file_a
removes the file_a from the system
If you use wildcard. For example
rm h*c
you will remove all files beginning with h and
ending with c which are in working directory.
If you write
rm *
you will erase all files from your working directory.
76
Introduction to Linux
77
Introduction to Linux
Access Permission of
File/Directory
The #'s can be:
0 = Nothing
1 = Execute
2 = Write
3 = Execute & Write (2 + 1)
4 = Read
5 = Execute & Read (4 + 1)
6 = Read & Write (4 + 2)
7 = Execute & Read & Write (4 + 2 + 1)
78
Introduction to Linux
Assignment
Login as guest (password is guest)
Find the present Directory
Write the root directory structure
Write a few commands available in /bin and /sbin directory
Find the guest directory
Write the permissions of guest directory
Create a new Directory test in guest directory
Copy the file /etc/resolv.conf in test directory
Rename the test directory to testing
Delete the testing directory
Change the permissions of guest directory to 700
Change the permissions of /tmp directory to 700
79