You are on page 1of 98

Prepared by : Ashish Tyagi

Division : GIS
Team : Motorola

Prepared by :

Date :

Page Number : 1

Training Agenda
Start times

DAY 1
Introduction to Linux
(Expectations, Pre-Quiz)

10:00-10:30

Day 2
Recap of Day 1,

Package Management

10:30-11:30

File system Basics

11:30-11:45

Tea Break

Tea Break

11:45-12:30

Users & Groups

Filesystem Management

12:30-13:00

Bash Shell, Text Processing


and Vi

System Services and kernel


modules

Network Configuration

13:00-14:00

Lunch Break

14:00-15:45

Basic System
Configuration Tools

15:45-17:30

System Initialization
and shutdown process

NFS, FTP, Troubleshooting

17:30-18:00

Conclusion (Post Quiz,


Review of
Expectations, Feedback)

Conclusion (Post Quiz, Review


of
Expectations, Feedback)

Prepared by : Your name

Date :

Page Number : 2

Lunch Break

Installation

Purpose

To understand Linux Basics

Prepared by : Your name

Date :

Page Number : 3

Program Objectives
At the end of this course, you will be able to:

Understand Basics of RedHat Enterprise Linux


Manage a Linux based system

Prepared by : Your name

Date :

Page Number : 4

Ground Rules
In order to ensure the productivity of our training, we will
need to be.
- Punctual..
- Put mobile on vibration and do not receive calls within the
training room..
- Not dropout from the training without
permission..
- Be more interactive.

Prepared by : Your name

Date :

Page Number : 5

CONTENTS

LESSON 1
LESSON 2
LESSON 3
LESSON 4
LESSON 5
LESSON 6
LESSON 7
LESSON 8
LESSON 9
LESSON 10

Prepared by : Your name

Linux Basics
File system Basics
Users & Groups
Bash Shell
Text Processing and Vi
Basic System Configuration Tools
System Initialization and shutdown process
System Services and kernel modules
Package Management
File system Management

Date :

Page Number : 6

Contents

LESSON 11
LESSON 12
LESSON 13
LESSON 14

Prepared by : Your name

Date :

Network Configuration
Installation
NFS & FTP
Troubleshooting

Page Number : 7

Lesson 1

Linux Basics

Prepared by : Your name

Date :

Page Number : 8

Linux Basics
Lesson Objectives
At the end of this lesson, you will be able to
Understand Linux Basics

Prepared by : Your name

Date :

Page Number : 9

Linux Origins
1984: The GNU Project and the Free Software Foundation
Creates open source version of UNIX utilities
Creates the General Public License (GPL)
1991: Linus Torvalds creates open source, UNIX-like kernel,
released under the GPL

Ports some GNU utilities, solicits assistance online

Prepared by : Your name

Date :

Page Number : 10

Different Distributions

Linux distributions are OS based on the Linux kernel


Red Hat Enterprise Linux
Suse Linux
Fedora (Open Source project supported by RedHat)

Prepared by : Your name

Date :

Page Number : 11

Linux principles

Everything is a file (including hardware)


Small, single-purpose programs
We can chain programs together to perform complex
tasks
Configuration data stored in text files

Prepared by : Your name

Date :

Page Number : 12

Logging in to a Linux System

Two types of logins are possible text-based and graphical


logins
By default Linux system run six virtual consoles and one
graphical console

Server systems often have only virtual consoles


Desktops and workstations typically have both

You can Switch among virtual consoles by typing: Ctrl-AltF[1-6]


To Access the graphical console Press Ctrl-Alt-F7
Login name and password is required to access
Each user has a home directory for personal file storage

Prepared by : Your name

Date :

Page Number : 13

The X Window System is Linux's graphical subsystem


Xorg is the particular version of the X Window System used
by Red Hat
Look and behavior depends on the desktop environment used
Two desktop environments are provided by Red Hat
GNOME and KDE
Log into a virtual console and run startx to manually start
The X server appears on Ctrl-Alt-F7

Prepared by : Your name

Date :

Page Number : 14

The root user

The root user is a special administrative account,


also called the superuser
root has allmost complete control over the system
Do not login as root unless necessary

Normal (unprivileged) users' potential to do damage is


more limited

Su can be used to switch to root user as required.


sudo command runs command as root
id shows information on the current user

Prepared by : Your name

Date :

Page Number : 15

Running Commands
Commands have the following syntax:
command options arguments
Each item is separated by a space
Options modify a command's behavior
Single-letter options usually preceded by

Can be passed as -x -y -z or -xvz

Full-word options usually preceded by -EX. --help

Prepared by : Your name

Date :

Page Number : 16

Getting Help on commands


man and info pages can be used to get help on
commands
man date : will show a help page on date command
info date : will provide more details on command
command --help or h
/usr/share/doc/ directory contains good documents
for some commands.

Prepared by : Your name

Date :

Page Number : 17

Prepared by : Your name

Date :

Page Number : 18

Lesson 2
File system Basics

Prepared by : Your name

Date :

Page Number : 19

File system Basics

Files and directories are organized into a singlerooted tree structure


File system Hierarchy begins at the root directory,
represented by / character.
Names are case-sensitive
Paths are delimited by /
Each shell and system process has a current
working directory(cwd), which is shown by pwd
command
Names may be up to 255 characters

Prepared by : Your name

Date :

Page Number : 20

All characters are valid, except the forward-slash


Absolute pathnames Begins with a forward slash
Relative pathnames do not begin with a slash and
specify location relative to your current working
directory

Prepared by : Your name

Date :

Page Number : 21

Some Important Directories

Home Directories: /root,/home/username


User Executables: /bin, /usr/bin, /usr/local/bin
System Executables: /sbin, /usr/sbin, /usr/local/sbin
Other Mount points: /media, /mnt
Configuration: /etc
Temporary Files: /tmp, /var/tmp
Log files: /var/log/
Kernels and Boot loader: /boot
System Information: /proc, /sys
Libraries: /lib, /usr/lib, /usr/local/lib

Prepared by : Your name

Date :

Page Number : 22

Some Commands

cd changes directories
cd /home/
To a directory one level up
cd ..
To your home directory
Cd
ls can be used to list the directory contents.
-l, -ld, -a
cp copy files and directories
cp file1 file2 destination
-r, -f, -v
mv moves files and directories from one location to other
mv file destination

Prepared by : Your name

Date :

Page Number : 23

touch - create empty files or update file timestamps


rm - remove files
rm [options] <file>
-r, -f, -v, -i
mkdir creates directories
rmdir removes empty directories
rm -r recursively removes directory trees
Determining File Content
file <filename>

Prepared by : Your name

Date :

Page Number : 24

Hard Links

A hard link adds an additional pathname to reference


a single file

One physical file on the file system


Each directory references the same inode number
Increments the link count

The rm command decrements the link count


File exists as long as at least one link remains
When the link count is zero, the file is removed

Cannot span drives or partitions

Syntax:

ln filename [linkname]

Prepared by : Your name

Date :

Page Number : 25

Symbolic or Soft Links

A symbolic link points to another file

ls -l displays the link name and the referenced file

lrwxrwxrwx 1 u1 u1 11 Sep 25 18:02 sl -> /etc/passwd

l for symbolic link

Syntax:

ln -s filename linkname

Prepared by : Your name

Date :

Page Number : 26

Prepared by : Your name

Date :

Page Number : 27

Lesson 3

Users and groups

Prepared by : Your name

Date :

Page Number : 28

Users and groups

Every user is assigned a unique User ID number (UID)


UID 0 identifies root

Users' names and UIDs are stored in /etc/passwd


Users are assigned a home directory and a shell
Users cannot read, write or execute each others' files without
permission
Users are assigned to groups
Each group is assigned a unique Group ID number (gid)
GIDs are stored in /etc/group

Prepared by : Your name

Date :

Page Number : 29

Each user is given their own private group

Can be added to other groups for additional access

All users in a group can share files that belong to the group
User names are case sensitive
To add a new user
useradd options <username>
Options are
-d home_dir
-c comment
-g initial_group
-G Secondry Group
-m user's home directory will be created if it does not exist.
-s shell

Prepared by : Your name

Date :

Page Number : 30

Groups are logical expressions of organization, tying users


together for a common purpose.
Users within the same group can read, write, or execute files
owned by the group.
Groups are assigned GIDs which are stored in /etc/group
To add a group
groupadd options <Group Name>
-g gid
When user accounts are created, a private group is also
created with the same name
Users are assigned to this private group
User's new files affiliated with this group

Prepared by : Your name

Date :

Page Number : 31

File Security

Every file is owned by a user and a group


If UID matches, user permissions will apply
if GID matches, group permissions will apply
If neither match, other permissions will apply
Four symbols are used when displaying permissions:
r: permission to read a file or list a directory's contents
w: permission to write to a file or create and remove files from
a directory
x: permission to execute a program or change into a directory
and do a long listing of the directory
-: no permission (in place of the r, w, or x)

Prepared by : Your name

Date :

Page Number : 32

File permissions may be viewed using ls -l


$ ls -l /var/log/xyz
-rwxr-xr-x 1 root root 152147 Jan 1 11:30 /var/log/xyz
File type and permissions represented by a 10character string
Only root can change a file's owner
Only root or the owner can change a file's group
Ownership is changed with chown

chown [-R] user_name file|directory

Group-Ownership is changed with chgrp

chgrp [-R] group_name file|directory

Prepared by : Your name

Date :

Page Number : 33

To change permission of a file use chmod command


chmod mode <file>
-R option for recursive mode
Where mode can be one of the following:
u for user,g for group and o for other
+ for grant and - for deny
r, w or x for read, write and execute
Examples:
ugo+r: Grant read access to all
o-wx: Deny write and execute to others

Prepared by : Your name

Date :

Page Number : 34

A numeric method can also be used


first digit specifies owner's permissions
second digit specifies group permissions
third digit represents others' permissions
Permission are denoted by
4 (for read)
2 (for write)
1 (for execute)
e.g.: chmod 755 datafile.dbf

Prepared by : Your name

Date :

Page Number : 35

Lesson 4
Bash Shell

Prepared by : Your name

Date :

Page Number : 36

What is a shell

a shell is a macro processor that executes


commands and provides the user interface to the
other commands.
Shells also provide a small set of built-in commands
(builtins) implementing functionality impossible or
inconvenient to obtain via separate utilities. For
example, cd, break, continue, and exec)
A shell provides access to the services of a kernel
and works as a interface between Kernel and user
programs.

Prepared by : Your name

Date :

Page Number : 37

Bash Shell

There are many shells available for Linux


- sh, csh, ksh, zsh, bash etc.
Bash is an acronym for `Bourne-Again SHell'
The Bourne shell is the traditional Unix shell originally written
by Stephen Bourne. All of the Bourne shell builtin commands
are available in Bash
The improvements offered by BASH include:
Command line editing
Unlimited size command history
Job Control
Shell Functions and Aliases

Prepared by : Your name

Date :

Page Number : 38

Using Bash Shell

* - matches zero or more characters


? - matches any single character
Type Tab to complete command lines:
For the command name, it will complete a command
name
For an argument, it will complete a file name
bash stores a history of commands you've entered,
which can be used to repeat commands
Use history command to see list of "remembered"
commands

Prepared by : Your name

Date :

Page Number : 39

Use the up and down keys to scroll through previous


commands
use Ctrl-r to search for a command in command history.
To recall last argument from previous command
Esc .
Alt .
A commands output can be redirected to a file
> Redirect STDOUT to file
2> Redirect STDERR to file
&> Redirect all output to file
Pipes (the | character) can connect 2 or more commands
command1 | command2

Prepared by : Your name

Date :

Page Number : 40

Aliases let you create shortcuts to commands


$ alias dir='ls -laF'
Use alias by itself to see all set aliases

Prepared by : Your name

Date :

Page Number : 41

Lesson 5

Text processing and Vi editor

Prepared by : Your name

Date :

Page Number : 42

Text processing

To view file Contents use less, more and cat


/text searches for text
n/N jumps to the next/previous match
To view some lines from starting or end use head and tail
tail f to read subsequent additions to the file
Use -n to change number of lines displayed
To find a keyword in a file use grep
grep user1 /etc/passwd
Use -i to search case-insensitively

Prepared by : Your name

Date :

Page Number : 43

Use wc to count numbers of lines and word in a file


cat /etc/passwd | wc l
Use -w for word count
Use sort to sort contents to STDOUT
sort options file
Common options
-r performs a reverse (descending) sort
-n performs a numeric sort
-f ignores (folds) case of characters in strings
-u (unique) removes duplicate lines in output

Prepared by : Your name

Date :

Page Number : 44

Vi Editor

Vi is the standard Unix text editor


Three main modes:
Command Mode : Move cursor, cut/paste text,
change mode
Insert Mode: Modify text
Ex Mode: Save, quit, etc
Esc exits current mode
Pressing Esc 2 times returns to command mode

Prepared by : Your name

Date :

Page Number : 45

To start Vi execute..
vi <filename>
If the file exists, the file is opened and the contents are
displayed
If the file does not exist, vi will create it when the edits are
saved for the first time
i begins insert mode at the current cursor position
a begins in append mode
A append to end of line
I insert at beginning of line
o insert a new line below
O insert a new line above

Prepared by : Your name

Date :

Page Number : 46

Enter Ex Mode by pressing : in command mode

Creates a command prompt at bottom-left of screen

Common write/quit commands:


:w writes the file contents to disk
:wq writes and quits
:q! quits without saving the changes.
To search text in a file
/<text>, n for forward search, N for backward
search
To copy a line press yy, to delete dd, to paste p in
command mode

Prepared by : Your name

Date :

Page Number : 47

Lesson 6

Basic System Configuration Tools

Prepared by : Your name

Date :

Page Number : 48

To set system's Date and Time from cli


date [MMDDhhmm[YYYY][.ss]]
To check current date and time
date
To find files based on a pattern:
Locate & Find
Locate queries a pre-built database of paths to files
on the system. Use updatedb to update the
database
locate <filename>
-i performs a case-insensitive search

Prepared by : Your name

Date :

Page Number : 49

Use find to find files based on a criteria


find [directory...] [criteria...]
Searches directory trees in real-time
Slower but more accurate than locate
CWD is used if no starting directory given
Ex. find / -name myfile.txt
find / -iname myfile.txt
find /var -user user2 group staff
Criteria are ANDed together by default.
Can be OR'd or negated with -o and -not
find -user joe -o -user jane

Prepared by : Your name

Date :

Page Number : 50

A non GUI web browser


Links http://www.csc.com
wget can be used to retrieve files through http and ftp.
wget ftp://example.com/file1.doc
ssh is a Secure replacement for older remote-access tools
like rsh and telnet.
ssh l <user> <hostname>
ssh root@hostname
Scp is Secure replacement for rcp, used to copy files from
one host to onther over ssh
scp source destination
scp /var/users.txt root@hostname:/root
-r can be used to recursively copy directories

Prepared by : Your name

Date :

Page Number : 51

Rsync can also be used to copy files from one host


to another. Faster than scp - copies differences in
like files
rsync /var/users.txt root@hostname:/root
lftp is a cli based ftp client
lftp ftp.csc.com
Sftp provide ftp like access over SSH protocol

Prepared by : Your name

Date :

Page Number : 52

Lesson 7

System Initialization and shutdown process

Prepared by : Your name

Date :

Page Number : 53

Boot Sequence Overview

BIOS Initialization
Boot Loader
Kernel initialization
init starts and enters desired run level by executing:

/etc/rc.d/rc.sysinit
/etc/rc.d/rc and /etc/rc.d/rc?.d/
/etc/rc.d/rc.local
X Display Manager if appropriate

Prepared by : Your name

Date :

Page Number : 54

Boot Loader Components

Boot Loader
1st Stage - small, resides in MBR or boot sector
2nd Stage - loaded from boot partition
Minimum specifications for Linux:
Label, kernel location, OS root filesystem and location of the initial
ramdisk (initrd)
GRUB the GRand Unified Bootloader
Command-line interface available at boot prompt
Boot from ext2/ext3, ReiserFS, JFS, FAT, minix, or FFS file
systems
Configurtion file is /boot/grub/grub.conf
Changes to grub.conf take effect immediately
If MBR on /dev/hda is corrupted, reinstall the first stage bootloader
with:
/sbin/grub-install </dev/hda>

Prepared by : Your name

Date :

Page Number : 55

Boot Process

Kernel boot time functions


Device detection
Device driver initialization
Mounts root file system read only
Loads initial process (init)
init reads its configuration file /etc/inittab and start
other processes as configured.

Prepared by : Your name

Date :

Page Number : 56

Run Levels

init defines run levels 0-6, S, emergency


The run level is selected by either

To check current and previous run levels


runlevel
Default run level is specifies in /etc/inittab
id:3:initdefault
Run level defines which services to start
Each run level has a corresponding directory:

the default in /etc/inittab at boot


passing an argument from the boot loader
using the command init <new run level>

/etc/rc.d/rcX.d

The System V init scripts reside in:

/etc/rc.d/init.d

Prepared by : Your name

Date :

Page Number : 57

Shutting down the system

Use Init 0 to switch to run level 0


Shutdown h now to shut down system immediately
-r to reboot the system
a time can also be given
shutdown h hh:mm to shutdown at aspecific time
shutdown h +m to shutdown after m minutes

Prepared by : Your name

Date :

Page Number : 58

Lesson 8

System Services and kernel modules

Prepared by : Your name

Date :

Page Number : 59

What is a Process

A process is a set of instructions loaded into memory


Numeric Process ID (PID) used for identification
UID, GID determines file system access
Normally inherited from the user executing the command
View Process information with ps command
ps ef
-e shows extended information
-f shows PPID
-u print process owner
Use Top command to see real time process information

Prepared by : Your name

Date :

Page Number : 60

Sending Signals to Processes

To send signal by PID


kill [signal] pid
Most common signals are
-1, -HUP send signal to process to reread its configuration file
-9 Kill a process forcefully
-15 send signal to process to end it.
Run a process in the background
Append an ampersand to the command line firefox &

Prepared by : Your name

Date :

Page Number : 61

Cron

Cron is used to schedule process to run at a specific


time.
Crontab entries are saved in a file
Entry consists of five space-delimited fields followed
by a command line
One entry per line, no limit to line length
Fields are minute, hour, day of month, month, and
day of week
Comment lines begin with #
Crontab e to edit crontab.

Prepared by : Your name

Date :

Page Number : 62

Managing Services

Commonly referred to as "System V" or "SysV services


Several configuration files are often used
Most services start one or more processes
Services are managed by scripts, found in /etc/init.d/
Examples:
/etc/init.d/httpd status
service httpd status
Chkconfig command is used to switch on or off a service at a
particular runlevel.
Does not modify current run state of System V services
chkconfig httpd on ( will switch on httpd service in runlevel 2,3,4
and 5)
Chkconfig --list httpd ( will display current status at different
runlevels)

Prepared by : Your name

Date :

Page Number : 63

xinetd Managed Services

Less frequently used services are managed by the


xinetd service
Incoming requests are listened by xinetd
Configuration files: /etc/xinetd.conf,
/etc/xinetd.d/<service>
Services can be controlled with chkconfig command
chkconfig tftp on

Prepared by : Your name

Date :

Page Number : 64

Linux Kernel

The kernel constitutes the core part of the Linux operating system. It
interacts with hardware and provide resources to application.
Some features are
System initialization: detects hardware resources and boots up the
system.
Process scheduling: determines when processes should run and for how
long.
Memory Management: allocates memory on behalf of running processes.
Security: Constantly verifies filesystem permissions and firewall rules.
Implements standard network protocols and filesystem formats.
Architectures supported are x86, x86_64, IA64/Itanium etc.
Kernels are installed under /boot/vmlinuz-*

Prepared by : Your name

Date :

Page Number : 65

Kernel Modules

Modules are small kernel extensions that may be


loaded and unloaded as required
These Can implement drivers, filesystems, firewall,
and more
Modules Are located under /lib/modules/$(uname -r)/
Compiled for a specific kernel version and are
provided with the kernel RPM.
Third party modules may be added as per
requirement

Prepared by : Your name

Date :

Page Number : 66

lsmod provides a list of loaded modules


modprobe can load and unload modules
modinfo displays information about any available
module
/etc/modprobe.conf used for module configuration
The initial RAM disk provides modules loaded early
in the boot process.
This file is located under /boot/initrd-$(uname -r).img

Prepared by : Your name

Date :

Page Number : 67

Hardware Devices

Files under /dev used to access drivers


Block Devices

/dev/hda, /dev/hdc - IDE hard disk, CDROM


/dev/sda, /dev/sdb - SCSI, SATA, or USB Storage
/dev/md0, /dev/md1 - Software RAID

Character Devices

/dev/tty[0-6] - virtual consoles


/dev/null, /dev/zero - software Devices
/dev/random, /dev/urandom - random Numbers

Prepared by : Your name

Date :

Page Number : 68

Kernel Configuration using /proc

/proc is a virtual file system which contains information


regarding running system.
Any modification is not persistent across reboot
It can be used to display process information, memory
resources, hardware devices, kernel memory, etc
Can be used to modify network and memory subsystems or
modify kernel features
Modifications apply immediately
sysctl adds persistence to /proc/sys settings
Statements added to /etc/sysctl.conf automatically reflected
under /proc after a reboot

Prepared by : Your name

Date :

Page Number : 69

Lesson 9

Package Management

Prepared by : Your name

Date :

Page Number : 70

There are two ways to add software to Red Hat Linux


- Through source code compilation
- Using RPM command
RPM command can be used to install/remove, query and
verify installed software.
RPM files have a .rpm extension for naming convention
Primary RPM options includes
Install: rpm -i, --install
Upgrade: rpm -U, --upgrade
Freshen: rpm -F, --freshen
Erase: rpm -e, --erase

Prepared by : Your name

Date :

Page Number : 71

To install a rpm use


rpm -i <rpm name>
use -v for verbose installation
use -h to print hash mark to show installation progress
rpm -ivh httpd-doc.i386.rpm
To remove a rpm use
rpm e <rpm name>
To query a rpm use
rpm q <rpm name>
rpm qi <rpm name> will show information about a particulat
package
rpm -qa lists installed packages
rpm qa | grep <rpm name> will show whether a particular
rpm is installed or not.

Prepared by : Your name

Date :

Page Number : 72

To upgrade a installed rpm


rpm U <rpm name>
Kernel RPM are never upgraded using U option
To install a kernel rpm first install the rpm
To verify a installed package for integrity
rpm -V <package_name>
rpm Vp <package file> to verify a package before
installation

Prepared by : Your name

Date :

Page Number : 73

Lesson 10

File system Management

Prepared by : Your name

Date :

Page Number : 74

a file system is a method for storing and organizing


computer files and the data they contain to make it
easy to find and access them.
File systems use a data storage device such as a
hard disk or CD-ROM.
More formally, a file system is a special-purpose
database for the storage, organization, manipulation,
and retrieval of data.
Linux provides many types of file systems like ext2,
ext3, reseirfs, Vfat etc.
Ext3 is the default filesystem for RedHat Linux.
Ext3 is journaling based filesystem.

Prepared by : Your name

Date :

Page Number : 75

Adding New Filesystems

Identify Device
Partition Device
Make File system
Label File system
Create entry in /etc/fstab
Mount New Filesystem

Prepared by : Your name

Date :

Page Number : 76

Disk Partitioning

Total maximum number of partitions supported by the kernel


are
63 for IDE drives
15 for SCSI drives
Why should we partition drives
containment, performance, quotas, recovery
Partitions can be created using fdisk command.
fdisk <device name>
fdisk l to display current partition table on all the devices
Run partprobe command to reinitializes the kernel's inmemory version of the partition table

Prepared by : Your name

Date :

Page Number : 77

Use mkfs to make a new filesystem


mkfs [ -V ] [ -t fstype ] [ fs-options ] <device>
mkfs V t ext3 /dev/hda1
mount the device to a mount point to make it usable
mount t o <device> <mount point>
-t to specify filesystem type
-o to specify mounting options
mount /dev/hda1 /mnt/
Add the filesystem to /etc/fstab to make the mount
persistent across reboot.

Prepared by : Your name

Date :

Page Number : 78

Use umount to unmount a mounted filesystem.


Use the remount option to change a mounted
filesystem's options
mount -o remount,ro /data

Prepared by : Your name

Date :

Page Number : 79

Lesson 11

Network Configuration

Prepared by : Your name

Date :

Page Number : 80

Drivers for network interface cards are built as modules


/etc/modprobe.conf maps logical names to specific modules:
alias eth0 3c59x
interface names for Ethernet cards are eth0, eth1 and so on
Loopback adapter is named as lo
Display network interfaces by using
ifconfig a
Enable interface with ifup ethX
Disable interface with ifdown ethX
Device configuration is stored in text files
/etc/sysconfig/network-scripts/ifcfg-ethX

Prepared by : Your name

Date :

Page Number : 81

Global Settings are stored in /etc/sysconfig/network


NETWORKING=yes
HOSTNAME=server1.example.com
GATEWAY=192.168.2.254
Domain Name Service translates hostnames to
network addresses
DNS Server address is specified by dhcp or in
/etc/resolv.conf
search example.com cracker.org
nameserver 192.168.0.254
nameserver 192.168.1.254

Prepared by : Your name

Date :

Page Number : 82

Device Aliases

We can Bind multiple IP addresses to a single NIC


eth1:1
eth1:2
Make a separate configuration file for each virtual interface
ifcfg-ethX:x
Aliases must be configured to use static IPs, they can not be
configured using DHCP
To verify network connectivity use
ping <IP>
/etc/hosts is a local database of hostname to IP address
mappings
/etc/nsswitch.conf sets precedence of DNS versus /etc/hosts

Prepared by : Your name

Date :

Page Number : 83

Lesson 12

Installation

Prepared by : Your name

Date :

Page Number : 84

Anaconda is the Red Hat Enterprise Linux Installer


Consists of two stages:
First stage starts the installation
Second stage performs the installation
The first stage consists of a installation kernel and an
initrd.img
Tasks of the First Stage:
Initializes the Installer
Parses command line arguments
Autodetects hardware
Loads additional drivers
Selects language, keyboard layout and installation method
Sets up networking if required for installation

Prepared by : Your name

Date :

Page Number : 85

Task of second stage installer are


Language and keyboard selection
Installation Key
Disk partitioning
Bootloader configuration
Network and time zone configuration
Package selection
Installation can be done in graphical mode or text mode
Available Installation Methods are
Local CDROM
Hard drive
NFS image
FTP
HTTP

Prepared by : Your name

Date :

Page Number : 86

Partitioning layout must contain / and swap partition


Other partitions may be created like /var, /home etc.
Partitions can use software RAID and LVM
A default set of packages is automatically installed
Select Customize now to change the default set of
packages
Packages can also be added after system is installed

Prepared by : Your name

Date :

Page Number : 87

Lesson 13

NFS and FTP

Prepared by : Your name

Date :

Page Number : 88

File Transfer Protocol

File Transfer Protocol (FTP) is a network protocol used to


transfer data from one computer to another through a network
such as the Internet.
FTP is a file transfer protocol for exchanging and manipulating
files over a TCP computer network. An FTP client may
connect to an FTP server to manipulate files on that server.
FTP sites are typically used for uploading and downloading
files to a central server computer, for the sake of file
distribution
In order to download and upload files to an FTP site, you
need to connect using a FTP client program.

Prepared by : Your name

Date :

Page Number : 89

vsftpd - the default Red Hat Enterprise Linux ftp


server
Allows system, anonymous or user access
/etc/vsftpd/vsftpd.conf is the main configuration file
It is a SystemV-managed service
Package required for FTP is vsftpd
Daemon is /usr/sbin/vsftpd
Script is /etc/init.d/vsftpd
FTP uses Port 21 (ftp) and 20 (ftp-data)
Configuration files are /etc/vsftpd/vsftpd.conf
/etc/vsftpd.ftpusers /etc/pam.d/vsftpd

Prepared by : Your name

Date :

Page Number : 90

NFS

Network File System (NFS) is a network file system


protocol originally developed by Sun Microsystems in
1984.
It allows a user on a client computer to access files
over a network
The server implements NFS daemon processes in
order to make its data generically available to clients
The client machine can requests access to exported
data, typically by issuing a mount command.

Prepared by : Your name

Date :

Page Number : 91

Exports are listed in /etc/exports


Each entry specifies the hosts to which the filesystem is
exported plus associated permissions and options
Server notified of changes to exports list with exportfs -r or
service nfs reload
The NFS server is an RPC service and thus requires
portmap
It is a System V-managed service
Package required is nfs-utils
Daemons are rpc.nfsd, rpc.lockd, rpciod, rpc.mountd,
rpc.rquotad, rpc.statd
Use showmount -e hostname to show available exports on a
server.

Prepared by : Your name

Date :

Page Number : 92

/etc/exports syntax is
/some/directory
Host(options)
When specifying hostnames, use the following methods
single host Where one particular host is specified with a
fully qualified domain name, hostname, or IP address
wildcards Where a * or ? character is used to take into
account a grouping of fully qualified domain names that match
a particular string of letters.
*.csc.com
IP networks Allows the matching of hosts based on their IP
addresses within a larger network. For example,
192.168.1.0/24
Default options are ro, sync, root_squash

Prepared by : Your name

Date :

Page Number : 93

Lesson 14

Troubleshooting

Prepared by : Your name

Date :

Page Number : 94

Filesystem Recovery

Filesystem recovery may be needed after crash or


improper shutdown
journal indicates if recovery is needed
only need to check files recorded in journal
/etc/rc.d/rc.sysinit runs fsck on filesystems marked
in /etc/fstab
fsck is a front end to other programs
A failed fsck must be run manually

Prepared by : Your name

Date :

Page Number : 95

Rescue Environment

Required when root filesystem is unavailable


Boot from CDROM (boot.iso or CD #1)
Type Linux rescue at the installation prompt
Anaconda will ask if filesystems should be mounted
Currently installed environment will be mounted
under /mnt/sysimage
Run chroot /mnt/sysimage to access currently
installed environment.
Type exit when done to reboot the system.

Prepared by : Your name

Date :

Page Number : 96

END

Thank you for your attention!!

Any Questions?

Prepared by : Your name

Date :

Page Number : 97

Trainer Contacts
Seat No: SA 77
Ext. no. 709363
Mobile no. 9310470605
Training material will be uploaded on TPD
(Training Process Database IN-NDA02)

Prepared by : Your name

Date :

Page Number : 98

You might also like