Sie sind auf Seite 1von 40

“RED HAT ENTERPRISES LINUX 5.

3”
A
Project Training Report
submitted
in partial fulfillment
for the award of the Degree of
Bachelor of Technology
in Department of Computer Science Engineering

Submitted to- Submitted by-


MISS RUCHI PATRIRA VINAY SONI
Lecturer PANKAJ KR. GUPTA
Dept. of Computer Engineering SATISH CHANDER BHATT

“COMPUTER SCIENCE ENGGINEERING’’


KAUTILYA INSTITUTE OF TECHNOLOGY & ENGINEERING JAIPUR

RAJASTHAN TECHNICAL UNIVERSITY, KOTA

SEPTEMBER, 2010

1
ACKNOWLEDGEMENTS
Exchange of ideas generates the new objects to work in a better
way whenever a person is helped co operate by others his heart
is bound to pay gratitude and obligation to them.

I would first like to thanks to Miss Ruchi Patira And


computer science faculty of ‘‘KAUTILYA INST. OF TECH. &
ENGG.’’

For providing me their continuous motivation for the project


and whole Hearted support in this endeavor, which proved
vital for the successful Completion of the summer training
2010.

I also acknowledge Mr. Gourav Saluja whose kind


inspiration, invaluable Guidance and encouragement from time
to time and have culminated in the Successful completion of
the summer training and the project work .

VIPIN KUMAR
VII SEM
CSE

2
TABLE OF CONTENTS

[1] Module I : Linux Essentials

[1.1] Introduction
[1.2] Linux Salient Feature
[1.3] Linux Installation
[1.4] Linux Architecture
[1.5] Linux File System

[2] Module II : Linux System Administration

[2.1] System Initialization


[2.2] File System Management
[2.3] User Management
[2.4] File Security
[2.5] File system Management
[2.6] User administration

[3] Module III : Network Services & Security

[3.1] Networking Commands


[3.2] Web Server
[3.3] NFS Server
[3.4] DNS Server
[3.5] DHCP Server
[3.6] FTP Server

[4] Bibliography

3
Module I
Linux Essentials

4
LINUX INSTALLATION

Before Linux installation, we need to know about what is hard


drive partitions. For Linux installation we need to insert the
installation CD of Red Hat Linux to CDROM and boot. Most
of the installers give you an option b/w text and graphical
install, we need to select ‘‘text’’ if your computer memory is
restricted.

Linux software comes in package. No metter what distribution


or version of Linux we have, the CD contain packages that
make the base operating system a rich selection of networking
‘‘client’’ and “server’’ with appropriate configuration and
monitoring tools , some end user text mode applications , base
x window system and at least one GUI desktop.

The installation program will ask several things to do like type


of boot loader configuration. it is better to select GRUB boot
loader configuration.

After this will be asked to select the type of doing partitions. it


is recommended to chooses disk druid type. In this, it will be
asked to do partitions available on free space. In Linux there all
file system concepts unlike window . the minimum required
file system for installation of Linux are / , /boot , /usr , swap.
After doing this partition the procedure will ask which package
to install. If you select “work station’’ the package normally
found on ever are omitted from your installation . if we select
server installation then the end user applications will not be
installed . we can also choose to install “everything’, best
options for installation on personal computer at your home for
new user. For expertise users there is an option of selecting
individual packages as per your requirements. Now installation
of Linux all in the form of packages starts and takes time

5
according to the packages selected. After completion the
system reboots and Linux will starts successfully.

Types of Installation Method

 CD- ROM

 NFS

 FTP

 KICK START

Types of Boot Loader

 GRUB

 LILO

Hard Disk Partition Methods

 DISK DRUID

 FDISK

Type of x window System(desktop)

 GNOME

o GNU Network Object Model Environment

 KDE

o K Desktop Environment

6
THE LINUX ARCHITECTURE

SHELL UTILITIES APPLICATION PROGRAMS

KERNEL

HARDWARE

KERNEL :-

The core of the Linux is the kernel – the operating


system. The kernel controls the resources of the computer,
allotting them to different users and tasks, it interact directly
with the hardware thus making the program easy. Since the
kernel communities directly with the hardware. The kernel
doesn’t deal directly with a user, until the login process starts
up separate, interactive program, called the SHELL, for each
user.

SHELL :-

Linux has a simple interface called the shell


that has the power to provide the services that a user
wants. It protects their user from having to know the
interface hardware details.

7
Feature of Shell

 Command Execution

 Redirection

 Background Processing

 History

 Aliases

 Variables

 File Name Expansion

 Command completion

Types of Shell in Linux

 BASH- “Bourne Again Shell”

 PDKSH- “Public Domain Korn Shell”

 TESH- “Tom’s C shell”

 ASH-“A Shell”

 ZSH-“Z Shell”

Linux Utilities and application Program

The Linux utilities or command are a collection of programs


that service day to day processing requirements. These
programs are invoked through the shell, which is itself another
utility.

8
THE LINUX FILE SYSTEM

A single fixed disk can store thousand of files. For organizing


data by grouping files on the disk, the operating system
provides a file system.

When UNIX was developed, it had feature that other


operating system at that time did not have. One such feature
was its file system. The UNIX file system has a hierarchical
structure and files can be stored under directories. Directories
DISK
are similer to drawer of a filing cabinet.

/ {root}

Bin Boot Home Etc Usr dev

Sunny Hemant

C
C C H
A P M
T O
D

9
Just as each drawer contains files, each of which contain
documents of a similer nature, so also the directories on the
disk can be crested to store files contain data of a similer
nature.

All file are stored on the disk under main directory called Root
directory. The root directory have been sub-devided into
directories- bin, boot, home, usr, etc, var and dev. In each
directory file containing related data can be stored. The
administrator of the Linux System mat place home directories
of the users under /home directories. For example, the sunny
directory is the home directory for user sunny.

In hierarchical, inverted tree like structure, the operating


system provide faster access to files because group of file are
isolated from each other. Only one directory has to be searched
to locate a file. On the other hand, if there were no sub
directory and all the files were stored under the root directory,
then locating the file would have meant searching through the
entire list of files till the required files were located.

The following are some of the directory under the /directory.


Each of these directories has been organized to store a specific
type of file.

/ The root directory . other directories are


below root in the FHS hierarachy. Unless
mounted partly, the contents of other
directories are in the root directory partition.
/bin Essential command line commands. Do not
mount this directory on a separate volume, or
else you may not be able to find these
commands when you use a rescue disk.
/boot Linux startup progrms. Normally includes the
Linux kernel. Separate /boot partitions are
common, the default size is currently 100MB.
/dev Linux device drivers. Do not mount this
directory on a separate partition. /etc basic

10
configuration files.
/home User home directories (except the root user)
/lib Program libraries. Do not mount this
directories on a separate partition.
/mnt Mount point for removable media (floppy
disks, CD drives).
/proc Running kernel processes.
/root Home directory for the root user. Do not
mount this directory separately.
/sbin System administration commands. Do not
mount this directory separately.
/tmp Temporary file default directory.
/usr Small programs.
/var Log files, print spools, and other variable-
sizes data.
/etc All configuration files.

11
Module II
Linux System Administration

12
FILE SECURITY

Users and groups are to control access to files and resources.


Users log in to the system by supplying their user name and
password. Every file on the system is owned by a user and
associated with a group . Every process has an owner and group
affiliation , and only accesses the resources its owner or group
can access.

Every file on the Linux system is owned by a user and users


can not change or even read each other files without being
permission . A user’s identity is established a login time when
the user gives a login name and password.

Because of this , and because unprivileged users not normally


operate with root level access , Linux is significantly less
susceptible to the viruses that plague other operating systems.

Users of the system with less rigorous security models operate


with system-level access , which allows malicious programs
free region.

 Users

 Every person that logs into the computer is


considered to be a user.

 Every user of the system is assigned a unique user


ID number (the uid).

 User’s names an uids are stored in /etc/passwd.

 Users are assigned a home directory and a program


that is run when they log in.

13
 Users can not read , write, or execute each others
files without permission.

Group

 Users are assigned to groups with unique group ID numbers


(the gid).

 Gids are stored in /etc/group.

 Each user is given their own private group.

 They can also be added to other groups to gain additional


access.

 All users in a group can share files that belong to the group.

The root user

 The root user: a special administrative account.

 Sometimes called the super user.

 An unlimited capacity to damage the system.

 You should not log in as root without a very good reason.

 Root has complete control over the system.

 Normal (“unprivileged”) users potential to do damage is


limited.

Linux file security

14
Linux is often appreciated for its security. Linux has
three distinct classes of users and their access permission for
each file, which are follows:-

 User:- Lists the access permissions for the owner.

 Group:- Lists the access permission for the group the


owner belong to. A group is a set of users who need to access
each others file based on these group permission.

 Others:- Lists the permissions for all the other users. Other
is any user who is neither the file owner nor a member of the
group but has access to the system.

Permission Types:-

 Four symbols are used when displaying permissions:

 r permission to read a file or list a directory’s contents.

 w permission to write into a file or create and remove files


from a directory.

 x permission to execute a program or change in to a


directory.

 - no permission (in place of the r,w,x)

15
USER MANAGEMENT

Linux is a very robust multi-user environment. It allows for


more than one user logon at a same point of time and sharing
the system hardware as well as the software resources.

Before a user can access these resources a user account must


exist with which each user will identify him or her to the
system. Each user typically has a username and a password
with which authentication on system can done.

User Defined Users and Groups:-

The super user can create and maintain users and groups
either through console commands or by using utilities like
Linuxconf or Userconf. Whether the administrator uses console
commands or utilities, the entries of any user or group is made
in some default files . The files involved in user management
are :-

16
/etc/passwd:-

This file stores the information about every user. Every user
has an entry in this file. The format is following:

Username:password:userid:groupid:comment:home-
directory:shell.Where:

 Username: specifies the name by which the user will


login.

 Password: specifies “x” if password is required.

 User-id: specifies user-id which is more than 500.


Values between 0-499 are reserved for system users.

 Group-id: specifies the id of group the users belong


to.

 Comment: any remark that is recorded.

 Home-directory: This is the directory made


available to the user when the users log in.

 Shell: specifies the default shell of the user.

/etc/shadow:-

This file stores the usernames and encrypted password of user.


This file contains the following information:

Username:password:last:must:warn:expire:disable:reserved

Where:

 Username: specifies the username.

 Passwd: specifies the encoded password.

17
 Last: specifies days before which password must be
changed.

 Must: specifies days after which password must be


changed.

 Warn: specifies days before which password expires


so that users are warned.

 Expire: specifies days after which password will


expire.

 Disable: specifies days since jan1,1970 that account


is disabled.

 Reserved: is a reserved field.

/etc/group:-

This files stores the information about specific group. Every


group has entry in this file. The format is following:-

 Group name : specifies the name of the group.

 Password: specifies the password.

 Group-id: specifies the group id of the group. The user


defined groups have an id greater than 500. Values between 0-
499 are reserved for system groups.

 Member-list: contains the names of the group

/etc/skel:-

This is the directory that contains a set of directories and files


that has to be copied by default to home-directories of all the
users.

Maintaining Groups from the console:-

18
Adding new groups:-

The groupadd command creates new group account using


the values specified on the command line. The syntax is
following:

# groupadd[-g gid] [-o] [-r] [-f]

Where:-

 -g gid: the numerical value of the groups ID. This


value must be unique , unless the option of –o is used.

 -r: this flag instructs groupadd to add a system


account.

 -f: this is force flag . This will make groupadd exit


with error when the group about to be already exists on the
system.

Modifying groups:-

The groupmod command modifies the system account files to


reflect the changes. The syntax is following:

# groupmod [-g gid [-o]] [-n groupname] groupname

Deleting groups:

The groupdel command modifies the system account files,


deleting all entries that refer to group. The syntax is following:

# groupdel groupname

Maintaning Users from the console:-

Adding new users:-

19
The useradd command creates a new account usng the values
specified on the command line and the default values specified
from the system. The syntax is following:

# Useradd [-u uid] [-g group] [-G group] [-d home] [-s shell] [-
c comment] [-m[-k template]] [-f inactive] [-e mm/dd/yy] [-p
password] name

Where:

 -u uid: specifies the unique user ID.

 -g group: specifies the group which the


user belongs to.

 -G group: specifies the alternative groups


that the user belongs to.

 -d home: specifies the home directory.

 -s shell: specifies the default shell for the user.

 -c comment: specifies any comment entry for user.

 -p password: specifies the password for the user.

 -m [-k directory]: specifies that the directories and


files from the /etc/skel directory to be copied into the user
home directory.

 -e expire date: specifies the date on which the user


account will expire.

 -f inactive_days: specifies the number of days after


the password expires.

Modifying users:-

20
The usermod command modifies the account using the values
specified on the command line. The syntax is following:

# Useradd [-u uid][-g group][-G group][-d home][-s shell][-e


comment][-m[-k template]][-f inactive][-e mm/dd/yy][-p
password][-L][-U] name

Where:

 -L: Locks the user account.

 -U: Unlocks the locked account.

Deleting users: The userdel command deletes the user account .


The syntax is following:

# userdel [-r] username

21
LINUX QUOTA SYSTEM

By default a user can consume all of the partition space so to


establish a limits on the amount of disk resources user can
consume we use Linux quota system. It can be implemented
only on a separate partition of a disk.

As soon as any file creation is done resource accounting is done


so it is implemented within kernel.

 Quota Initialisation

1. Edit file /etc/fstab , replacing default option by the usrquota


option to the /home partition. Default option indicates that the
partition is mounted in read write mode.

2. Remount the partition using command:

# mount –o remount /home

3. Create file /home/aquota.user


It is a database file which is used to keep all the necessary
information about each user quota.

4. For initialization or to update database use command

# quotacheck –c /home

 Turn on the quota using command


# quotaon /home

22
Editing user policies:

• # edquota user1 (implements policies for user1)

• Format of policy:-

File system blocks soft hard inodes soft hard

/dev/hda9 10 0 0 5 0 0

File system is the name of hard disk partition on which quota is


being implemented.

Blocks is the no. of blocks that the user is currently using.

Inodes indicates the no. of the inodes i.e. the no. of files.

Soft limit indicates that as soon as user crosses this limit a


warning message will shown to user .

Hard limit indicates that user can not cross this limit .

These edquota command creates a temporary file where we edit


the quota . As soon as we exit this file , the database file
aquota.user gets updated and this temporary file get deleted .

 Mimic user2’s policy from user1’s use command:


#edquota –p user1 user2 ()

 To establish grace period:


#edquota –t

Grace period:- after crossing soft limit if user don’t make any
modification with in the grace period then his soft limit
becomes hard limit. It is used to restrict the space for the
inactive users.

23
MODULE III

NETWORK SECURITY AND


SECURITY ADMINISTRAATION

24
NETWORKING COMMANDS

1. PING-
Measures connectivity and network latency between lacal
& Remote system. It uses ICMP echo packets.

Example:-ping 192.168.0.1

OR ping www.redhat.com

2. TRACEROUTE-
Shows network path between lacal and Remote System.
Useful for pinpointing network congestion.

Example:- traceroute www.redhat.com

3. NETSTAT-
List network statistics and parameters, including Network
Connection, Routing table, Interface statistics.

Example :- netstat –rn

25
OR netstat –a

4. IFCONFIG-
The ifconfig command is used to configure and display
network devices.

5. NETCONFIG-
The netconfig command is used to set the IP address.

APACHE WEB SERVER

 Apache is Red Hat’s standard web server.

 The term APACHE comes from the word patches that


means the collection of modules and application for different
type of scripts .

 APACHE support almost every type of scripts Like Perl,


PHP,JAVA, HTML etc.

26
 According to Netcraft web server survey Apache is the
most widely used web server. More then 50% sites are hosted
on apache web server.

 Apache provides very stable and scalable web server


platform.

 Apache also support virtual hosting.

VIRTUAL HOSTING

Virtual Hosting allows us to host more than one web site on the
same machine rather than having a separate machine for each
web site.

IP Address based Virtual Hosting:

It is more reliable because it doesn’t require any special feature


on the browser side. It require seprate IP for each Web Site in
the single machine.

This can be done either by installing additional network cards


or IP aliasing.

#Name VirtualHost 192.168.0.1

Listen 80

<VirtualHost 192.168.0.1>

DocumentRoot /home/yahoo/

ServerName yahoo.com

ServerAdmin admin@yahoo.com

</virtualHost>

27
<VirtualHost 192.168.0.2>

DocumentRoot /home/google/

ServerName google.com

ServerAdmin admin@google.com

</VirtualHost>

In this yahoo.com and google.com both have separate IP


address but both on same machine. If yahoo.com is listened on
IP 192.168.0.1 and google.com is listened on 192.168.0.2.

Apache Service Profile :

 Type: System V-launched service

 Packages: httpd

 Daemons: httpd

 Scripts: httpd

 Ports: 80/tcp(httpd), 443/tcp (https)

 Configuration: /etc/httpd/* , /var/www/*

 It also support for syntax checking of the httpd.conf file


using:

# service httpd configtest

/etc/hhttpd folder is the main configuration directory for


APPACHE.in this directory other sub directory are present
some important subdirectories are->

Modules -> In this directory all modules files are present.

28
Logs -> In this directory all log files are present.

Conf.d -> In this directory all supporting configuration files


are present.

Conf -> In this directory main configuration files are


present.

The main configuration file for APACHE is httpd.conf which is


in /etc/httpd/conf folder.

DOMAIN NAME SERVER

 Resolves hostnames into IP address (forward lookup)

 Resolves IP address into hostnames (reverse lookup)

 Allows machine to be logically grouped by name domains

DNS is the Domain Name System, which maintains a database


that can help your computer translate domain name such as
www.redhat.com to IP address such as 216.148.218.197. As
indivisual DNS server are not large enough to keep a database
for the entire Internet, they can refer requests to other DNS
server. This section address two basic DNS server
configuration: a caching-only server, and a primary DNS server
for a domain. The key configuration files to support such
servers include /etc/nsswitch.conf, /etc/resolve.conf,and
/etc/hosts, /etc/named.conf, /var/named/.

Types of DNS Server

29
1. Master DNS Server – contain the master copy of data for a
zone.

2. Slave DNS Server – provides an automatic backup to the


master name server.

3. Caching-only Server – When a request is make for a Web


page such as www.osborne.com , network asks the configured
DNS server for the associated IP address. This is usally known
as a name query. If the DNS server is outside your network,
this request can take time. If you have a caching-only name
server, these queries are stored locally,which can save
significant time while you or others on your network are
browsing the same sites on the Internet.

DOMAIN NAME SERVER

DNS root (Top-level Domain)

net us jp Com

30
Example.net Omoini.ny.us

www.omoini.ny.us

www.example.net

fox.trot.example.net

The DNS root has a small set of top level domains that rarely
changes. Some of them are as aero, com, net, edu, gov, info,
org, int, and name. In a domain name like www.example.net is
a first-level name within the root, example is a second level
name within net, and www is third level domain called fox.
Trot. The tree can extend to any number of levels, but in
generally it is not more then four levels deep.

Service Profile : DNS

 Type : System V-managed service

 Packages : bind, bind-utils, bind-shroot

 Daemons : named, rndc

 Scripts : named

 Ports : 53

 Configs : (under /var/named/chroot)

 /var/named/*, /etc/rndc.*

31
 Related : caching-nameserver, openssl

ROOT

CACHING MASTER SLAVE


DNS DNS DNS
208.164.186 208.164.186. 208.164.186
.2

INTERNAL NETWORK

192.168.1.0/24

32
DHCP SERVER

 DHCP: Dynamic Host Configuration Protocol,


implemented via dhcpd

 It assigns IP address for its clients

In a Network , A computer needs information like IP address,


dns server, gate way, subnetmask to communicate to computer.
This can be done via two ways:

 Manual assignment

 Dynamically

But if hundred of computers are there , manual assignment is


not a feasible approach and here dhcp comes into the picture.

DHCP provides the facility to centrally manage the address and


other n/w information for client coputers on a LAN.DHCP
automatically give all client computer on network the necessary
information to communicate.

DHCP server providers:

 I.P.address

 Netmask

 Dns server I.P.

33
 Router(gateway)

DHCP process:

1. Client broadcasts DISCOVER to the server.

2. Server reply with its IP.

3. Clients sends REQUEST for address on the received IP.

4. Server commits allocation & returns ACK containing IP,


Subnet Mask, DNS , Gateway etc.

Example: DHCP server provides ip address between

192.168.0.1/192.168.0.20

192.168.0.1( DHCP SERVER)

SWITCH

34
PC 1 PC 2 PC 3

192.168.0.18 192.168.0.20 192.168.0.19

DHCP provides methods for hosts on a TCP/IP network to


request and be granted IP addresses , and also to discover
information about their local network. One machine on an
Ethernet segment is designed the dhcp server and configured to
answer these requests. IP addresses are either dyanamically
assigned from a range or pool of address, or statiscally assigned
by MAC address.

Services Profile : DHCP

 Types : System V-managed service

 Packages : dhcp

 Deamons : dhcpd

 Scripts : dhcpd

 Ports : 67(bootps),68(bootcp)

 Configuration : /etc/dhcpd.conf, /var/lib/dhcpd.leases

 Related : dhclient

NETWORK FILE SERVICE(NFS)

 To share files and directories among users from different


systems

 Shared directories are access through the mount command

 NFS server translate nfs request on the local file system

35
Service Profile : NFS

 Type : System V-managed service

 Packages : nfs-utils

 Deamons : nfsd,lockd,rpciod

 Scripts : nfs,nfslock

 Ports : assigned by portmap(111)

 Configuration : /etc/exports

 Related : portmap

NFS Server

 Exported directories are defined in /etc/exports

 Each entry specifies the host to which the file system is


exported plus

 Assoiciated permission and options :-

 Options should be specified

 Default option : (ro, sync)

File system to be exported via NFS are defined in


/etc/exports . Here is an example :

/var/ftp/pub *.example.com (ro,sync)

Bigserver.redhat.com

36
/root/presentation server2.example.com (rw,sync)

/data
192.168.10.0/255.255.255.0(sync)

Client-side NFS

 Implemented as a kernel module

 /etc/fstab can be used to specify network mounts

 NFS server shares are mounted at boot time by


/etc/rc.d/init.d/netfs

 Autofs mounts NFS shares on demand and unmount them


when idle

To associate a shared directory on the network with the mount


point in your local file system, use mount. When you mount a
exported directory from an NFS server, you can access it as if it
was local to your machine. Shares can be mounted manually by
root, or automatically at root time.

/etc/fstab allow you to specify network directories to be


mounted at boot. Here’s a sample fstab entry that defines a
shared filesystem /var/ftp/pub on server to be mounted locally
as /mnt/pub.

37
Server1: /var/ftp/pub /mnt/pub nfs
defaults 00

NFS Server & Client:

NFS SERVER
(LINUX)

SWITCH

38
NFS CLIENT 1 NFS CLIENT 2
(LINUX) (UNIX)

BIBLIOGRAPHY

As per the need of my project of networking on


Linux operating system, I required information regarding
various tools used in networking. Therefore I have gone

39
through several books for above information’s. My project
coordinator has suggested me to go through some books whose
list is as follows:-

1. Red Hat Enterprise Linux Essential RH033.

2. Red Hat Enterprise Linux System Administartion


RH133.

3. Red Hat Network Services and Security Administation


RH253.

REFERENCES

Websites:-

1. www.redhat.com

2. www.linux.org

3. www.rpmfind.net

4. www.freshmeat.org

40

Das könnte Ihnen auch gefallen