Vous êtes sur la page 1sur 33

RHCE (Red Hat Certified Engineer)

Linux is an open source operating system made by Linus Benedict Torvalds, a


young man !o as in second year of computer science at t!e "niversity of
Helsin#i in $%%$&
T!e Linux operating system is ritten in t!e C programming language&
Linux is implementation of "'()&
Linux uses *'" tools, a set of freely available standard tools for !andling
Linux Distribution :
T!ere are more t!an $++ Linux distributions (distribution Companies) some of
t!em are,
Red Hat
-ebian Linux
.".E Linux
/andriva (former mandra#e soft)
0noppix, an operating system t!at runs from your C-1R2/
.lac# are Linux
"buntu Linux, an 2. t!at runs from C-R2/ (Live) and Hard -rive&
Topology, -esigned to run on top of /icrosoft 3indos does not need any
partition c!anges
4las! Linux, 5 distribution t!at can fit onto a 678 /B ".B flas! drive
Corel Linux, etc for more information about distribution visit,
!ttp,99en&i#ipedia&org9i#i9list:of:Linux:distributions
Red Hat Linux 9.0
Red Hat Linux is t!e production of Red Hat company !ic! !as stopped producing
it on 5pril ;+, 6++< t!e Red Hat company no produces to editions one fedora
Core !ic! is free, 5nd second Red Hat Enterprise Linux (RHEL) !ic! is for
business purpose&
$

RHCE (Red Hat Certified Engineer)
Red Hat Linux 9.0 Hardware Requirements:
Text Mode Graphical Mode
RM !Min" #$ M%s &'( M%s
RM !Rec" &9' M%s
)rocessor !Rec" '00 MH* !)entium
class"
$00 MH* !)entium '"
+mpartation Dis,
-pace
$G%
Linux Modes:
Text or .L+ !command Lin +nter/ace"
G0+ !Graphical 0ser inter/ace"
G0+ Modes:
0-E
*'2/E
.L+ Modes
C .!ell
Bas! (-efault)
Borne
0 .!ell
Linux +nstallation Modes
Text (CL() /ode installation (from t!ree C-s)
*rap!ical (*"() mode installation (from t!ree C-s)
6

RHCE (Red Hat Certified Engineer)
T!roug! 4T= installation
T!roug! HTT= installation
Red Hat Linux Has t!ree installation C-s !ic! includes all softare Built1in E&g&
proxy server, .>L server, -HC=, -'., /ail server& 2pen office &org&etc
Linux /ile s1stem !comparison with 2indows":
2indows Linux
45T $8 Ext6 (not in use no)
45T;6 Ext; (current file system)
'T4.
%oot Loaders:
Boot loader is used operating system selection
Boot loader is stored in /BR in t!e Hard -rive
Linux !as to boot Loaders
*rub Boot loader
Lilo Boot Loader
3indos !as one boot loader&
3indos !as one boot loader
3!en e install indos (t formats t!e /BR and remove every t!ing in it and
Linux doesn?t format t!e /BR it adds it Boot Loader t!ere&
T!erefore e s!ould first install indos t!en Linux&
)artition:
=artition layout and types,
T!ere are to #inds of ma@or partitions on a Linux system,
Data partition : normal Linux system data& (ncluding t!e boot partition
containing al t!e data to start up and run t!e system
-wap partition: Expansion of t!e computer As p!ysical memory & extra
memory on !ard dis#&
)artition Methods:
-uring t!e installation of Red Hat Linux you ill be as#ed to start !ic! partition
met!od&
utomatic:
Manual ! throu3h dis, druid"
;

RHCE (Red Hat Certified Engineer)
utomatic: t!is ill remove all data on your !ard drive and ill partition your
!ard drive & if you are selection t!is met!od be sure you !ave no saved data&
Manual !dis, druid": dis# druid is softare !ic! is used for manually partition&
Hard Dri4e
.: D: "n partition space <+++/Bs( depend
upon t!e pac#ages and users data)
)artitions:
5ame space Description
9 ;+++/Bs (B+C space) Root directory ( -rive C)
9boot $++ /Bs /ain directory ( 3indos folder)
9!ome 7++/Bs(depend upon users data "sers data and users -is# >uota
swap Tice of R5/ Dirtual /emory
Red Hat Linux 9.0 installation steps
$& (nsert C- $
6& Boot from C-
;& 5 text mode ill come press t!e enter button to start grap!ical mode
installation& To start text mode installation& 3riteE Linux textE and press
Enter button&
<& Clic# o# button of you ant to c!ec# C-s of don?t clic# on s#ip to cancel
C-s c!ec#&
7& Clic# on t!e next button or press f$6
8& .elect Language
F& 'ext
B& .elect 0eyboard
%& 'ext
$+&.elect /ouse
$$&'ext
$6&.elect custom Box
$;&'ext
$<&.elect manually partition it! dis# druid
$7&'ext
$8&partitionin3: .elect free space at t!e top clic# on ne select AE9E in t!e
mount point enter siGe for it e&g&;+++ /Bs clic# on o# clic# on o# clic# on
continue save procedure for 9 HbootE and H9!omeE for sap select free space
<

RHCE (Red Hat Certified Engineer)
at t!e top clic# on ne select sap in t!e file system type field enter siGe for
sap 2#& =artitions are madeI
&6.5ext
&(.5ext
&9.5ext
'0.select no /irewall at the top
'&.5ext
''.select lan3ua3e
'7.next
'$.select time settin3
'8.5ext
'#.9nter password /or root ccount ! dministrator ccount "
'6.5ext
'(.5ext
'9.5ext
70.-elect required so/tware !or select /irst tow pac,a3es and unchec, all
others below"
7&.5ext
7'.5ext
77.+nstallation will be started and required .Ds will be as,ed.
7$.+nstallation is completed:
Linux Terminals
Linux is a multi user operating system t!erefore it !as seven terminals so e can
logon to a Linux mac!ine t!roug! seven users accounts at a time .ix of t!em can
login to Text (CL()
/ode and one can login to *rap!ical (*L() mode&
Terminal ; users lo3on rea
Multi users <-
6 Terminals
#; Text !.L+" mode
&; Graphical !G0+" mode
7

Linux
RHCE (Red Hat Certified Engineer)
3e can c!ange terminal by pressing 5ltJCtrlJf$, f6&f;&f<, f7, f8,fF
5ltJCtrlJf$
5ltJCtrlJf6
5ltJCtrlJf;
5ltJCtrlJf<
5ltJCtrlJf7
5ltJCtrlJf8 Text (CL() mode
5ltJCtrlJfF *rap!ical (*"() /ode
Linux Director1 -tructure
5o 5ame Description
& =%oot T!e directory !ere t!e operating system boots from
' =root T!e administrative user?s !ome directory
7 =home Contains t!e !ome directories of normal user?s users?
dis# Kuota
$ =bin Contains executable programs
8 =sbin Contains executable programs
# =de4 Contains drivers for !ardare devices
6 =etc Contains important configuration files of several
program
( =4ar .torage for variable files and temporary files
created by users, suc! as log files t!e mail Kueue,
t!e print spooler area space for temporary files
donloaded from t!e internet, or to #eep an image
of a C- before burning it&
9 =lib Contains dynamic library modules
&0 =proc Contains information about system resources
&& =mnt Lou can access C-1R2/, 4loppy, indos
drives, flas! drives -igital camera drive and
netor# drive !ere&
&' =tmp Contains temporary files
&7 =user =rogram libraries, documentation etc& file all user1
related program&
&$ =opt 5 partition for t!ird party and extra sotare
Linux %asic .ommands
-hutdown
Command
(nit + .!utdon t!e system
8

RHCE (Red Hat Certified Engineer)
Halt .!utdon t!e system
.!utdon:1!:no .!utdon t!e system no
.!utdon:1!:7 .!utdon t!e system in 7 minutes

Restart
Command -escription
(nit 8 .!utdon t!e system
Reboot .!utdon t!e system
5ltJCtrlJ-el .!utdon t!e system
.!utdon:1r:7 .!utdon t!e system in 7 minutes
Lo3o//
Command -escription
Exit Logout t!e current user
Logout Logout t!e current user
CtrlJd Logout t!e current user
.lear screen
Command -escription
Clear Clear t!e screen
CtrlJl(L) Clear t!e screen
>ind
Command -escription
4ind91name fname .earc! for file named HfnameE inE 9Edirectory
4ind
91nameEMboo#M
.earc! for file containing text Hboo#EinE9Edirectory
*rep boo#9root .earc! for file containing t!e specified text in text
H9rootE directory
>ile =Director1 %asics
Command -escription
/#dir name /a#es a folder (directory)
Touc! name Creates a file
Touc! &fname Creates a !idden file
Rmdir name Remove an empty folder (directory)
Rm name Removes a file or an empty folder (directory)
Rm1rname Removes a file or an full folder (directory)it!
confirmation
Rm1rf name Removes a file or an full folder (directory)it!out
confirmation
/ore name 2pens t!e file read1only mode page by page
Cat name 2pens t!e file in read Nonly mode
F

RHCE (Red Hat Certified Engineer)
Cp fname9!ome Copy file named HfnameE to H9!omeE directory
Cp fname 9 !ome9a Copy file named HfnameE toE9!omeEdirectory it! ne
name HaE
Cp fname fnamel Copy file named HfnameEto t!e same directory it! ne
HfnamelE
Cp1r fname 9!ome Copy folder named HfnameE toE 9!omeE directory
/v fname9!ome Cut file or folder named HfnameE to H9!omeE directory
/v fname linux Rename file or folder named HfnameE to HlinuxE
(s .!os t!e contents of t!e current directory it! out
!idden files colors,3!iteOfile, BlueO folder, *reen
Ofull permission& Red Ocompressed files&
(s Na .!os !idden files it!in t!e current directory
(s N4 .!os t!e contents of t!e current directory it! files
types
(s1$ .!os files and directories it! permissions
=d (t s!o present or#ing directory
Cd&& C!ange directory one step bac#
Cal .!o calendar of t!e mont!
Cal 6++F more .!o calendar of t!e year page by page
Cd9!ome *o to H9!omeE directory
General .ommands
Command -escription
-ate (t s!o present date and time
"sers (t s!os current logged in users
3!o .!os current user
!oami .!os all logged in users
!istory .!os $+++ previously used commands
History1c Clears !istory
/an command .!os !elp about t!e specified command
Command1!elp .!os a s!ort !elp about t!e specified command
.tartx .tarts x indo system
updated "pdate t!e database of files on all file
.ystem attac!ed to t!e Linux root directory
)term 3!en you run t!is command at grap!ical terminal& (t
opens t!e blac# P !ite terminal
/ounting P "nmounting -rives
Mountin3 ? 0nmountin3 .DR<M Dri4e
B

RHCE (Red Hat Certified Engineer)
Command -escription
/ount9mnt9cdrom or
mount9dev9cdrom9mnt9cdrom
/ounts C-1R2/ -rive
/ount9mnt9cdrom$
2R
/ount9mnt9cdrom$9mnt9cdrom$
/ounts secondary C-1
R2/ drive
"nmount 9mnt9cdrom, umount9mnt9cdrom$ "nmounts C-1R2/ -rive
E@ect or e@ect Nt9dev9cdrom,
e@ect9mnt9cdrom,e@ect cdrom
E@ects C-1R2/
E@ect Nt or e@ect Nt9dev9cdrom,
E@ect1t9mnt9cdrom,e@ect Nt cdrom
Close C-1R2/ tray
"sermount Launc!es a grap!ical
application for mounting
5ote: you can use cdrom$,6, and ; instead of C-rom in t!e commands for
secondary and ot!er C-1R2/ drives&
Mountin3 ? 0nmountin3 >lopp1 Dri4e
Command -escription
/ount9mnt9floppy or
/ount9dev9fdo9mnt9floppy
/ount9mnt9floppy
/ounts floppy drive
4do (for drive 5)4d$ (for drive B,)
"mount9mnt9floppy "nmounts floppy drive
Mountin3 ? 0nmountin3 0-% dri4e
Command -escription
Cd9mnt
/#dir flas!
Create a directory in9mnt directory
mount9dev9sda or sdal9mnt9flas! /ount ".B drive to 9 mnt9flas! directory
"nmount9dev9sda or sdal "nmounts ".B drive
5ote. (f t!e ".B drive (flas! drive& -igital camera drive &etc) is in ".B pot $
mount it t!roug! sda& (f t!e it is in port 6 mount it t!roug! sda $&
Mountin3 ?0nmountin3 2indows >T dri4es
Command -escription
Cd9mnt /#dir cdrive Create a directory in9mnt directory
4dis#1$ .!os file system list
/ount9dev9!dc$9mnt9cdrive /ount !dc$ to9mnt9cdrive directory
"nmount9dev9!dc$ "nmounts !dc$
%

RHCE (Red Hat Certified Engineer)
5ote. Hdc$ contrary on t!e drive you ant to mount& (t mig!t be !dc6 for drive -&
you can see t!e file system list for information
utomount
(f you ant you Linux 29. to automatically mount your indos 45T drive so do
t!e folloing open 9etc9fstab file and rite t!e first command at t!e end or t!e file
9dev9!dc$ 9mnt9c auto defaults $$
9dev9cdrom 9 mnt9cdrom auto defaults $$
To amount cdrom use t!e second command&
@+ 9ditor
T!is is one of t!e L('") standard text editors t!e text editors or# as indos
notepad
T!ere are t!ree text editors in Linux,
D(
Dim, t!is stands for D( improved, it is D( but it! an ) interface& (t is still
poerful but menus, (C2' and buttons ma#e it easier to use&
Emacs, t!is editor !as become a standard next to D( it is also very complex
but !as a ) interface so it is easier to learn it can broser t!e eb send and
c!ec# e1mail
@i editor commands
Command -escription
Di abc To create and open a ne file in vi editor or to edit in a
created file9
( To go to insert mode (editing mode)
E.C To Kuite insert mode&
) Clic# under t!e c!aracter and press x to delete it&
< x Lines x to delete specified letters& (&e & < x
- Lines x to delete a complete ord&
< d Lines d to delete specified ord (&e&<
-d To delete a complete line
< dd Lines dd to delecte specified lines &(&e&<dd
-e To delete t!e coming text of t!e ord
9linux To searc! forard
Qlinux To searc! bac#ard
' To searc! again
CtrlJg .!o t!e name of current file being edited
$+

RHCE (Red Hat Certified Engineer)
ggD* .elect all
" To "ndo
< s!ift Jg Line number s!iftJg to go t!e specified line&(&e&< s!iftJg
Ly Lines yy to copy current line
< yy Lines yy to copy specified lines (&e&<yy
= To paste copied lines
,K To save and exit
, .aves t!e file
,KI To exit t!e file it!out saving
0ser ccount ? 3roup Mana3ement
0ser accounts ? 3roup t1pes
.uper user account P group (Built Nin user 5ccount P groups)
'on built1in user accounts P groups
.ystem user account P group
-uper user accounts ? 3roups
.uper user account P groups are t!ose !ic! are automatically created&
Root O 5dministrator
'obody O *uest
5on %uiltAin user accounts ? Groups
'on built Nin user accounts P groups are t!ose !ic! e manually create (&e&ali,
5!mad
-1stem user accounts ? Groups
.ystem user accounts P groups are t!ose !ic! are automatically generated it!
installation of different services
R+Ds
"ser accounts P *roups R(-s
Root +
'obody %%
.ystem user accounts $1<%%
'on built1in user accounts 7++187,+++
0sers and 3roups /iles
$$

RHCE (Red Hat Certified Engineer)
4ile -escription
9etc9passd .!os all created users it! t!eir R(-s
9etc9s!ado .!os all created users it! encrypted passords
9etc9group .!os all created groups it! t!eir R(-s
9etc9s#el T!is is li#e t!e all users folder in indos
3!en you open9etc9passd file t!e user record ill be save as t!e folloing,
5li,x,7++,comment,9!ome9ali,bin,bas!
5liO"95,)Opassord exist, 7++ O "(-, 7++ O *(-, comment, 9!ome9aliOprofile,
To remove a user passord @ust remove t!e x from user record
0ser account ? 3roup commands
Command -escription
"seradd a!mad Creates user named a!mad&
3!en an user is created it creates a group it! t!e
same name and member t!e user of t!e group
=assd a!mad To give passord to user named a!mad
=assd To c!ange passord of current logged in user&
"serdel a!mad -eletes user named a!mad
"sermod1$ ali a!mad
L (login)
-eletes user named a!mad
*roupadd abc Creates group named abc
*roupdel abc -eletes group named abc
"seradd1g root abc Creates user named abc and ma#e it member of
root and nobody groups
"sermod1g root abc /oves user named abc to root group
"sermod1* root,nobody abc /oves user named abc to root and nobody
groups
*roups abc .!o user As group members!ip
=assd1$ Gabee! To loc# a usern account
=assd1 u Gabee! To unloc# an user account
0ser Dis, Buota
"ser dis# Kuota is used to set a limited amount of dis# to user&
$6

RHCE (Red Hat Certified Engineer)
-is# Kuota is divided into to parts,
Hard >uota
.oft >uota
Hard dis# >uota is used to set a limited amount of -is# to a user
-is# Kuota is divided into to parts,
Hard >uota
.oft >uota
Hard Buota
Hard Kuota is limited and can not be exceeded
-o/t quota
Limited, but can be exceeded
-teps /or settin3 dis, Buota
$& open t! fstab file Hvi9etc9fstabE
6& riteE,usrKuota Hnear defaults,
L5BELO9!ome 9!ome ext; defults, usrKuota
;& *o to H9!omeE directory and created a file name HaKuota&userE& RC-9!ome
Rtouc! aKuota&user O file !ere t!e Kuota information ill be saved in
encrypted form
<& mount1o rmount9!ome O refres! information in fsttab
7& >outac!ec#1auv O scan and updates Kuota set on users
8& edKuota1u a!mad OTo set Hard or soft Kuota on user a
F& edKuota1t O To set grace time Executed it! t!e
command edKuto1fE&grace period is a time limit before t!e soft limit is enforced for
a file system it! Kuota enabled time units of sec(onds), min(utes), !our(s), day(s),
ee#(s), and mont! (s) can be used to set grace time rite time, min or time
minutes under t!e grace E&g& $,min&$+& minutes

B& Kuotaon1 auv O To turn on dis# >uota
>uotaoff Nauv O To turn off dis# >uota&
RepKuota N a O .!o report about -is# >uota
>uota O 3!en a user is logged on t!e Kuota
Command s!os t!e current user dis# Kuota limit, used dis# Kuota by user and
grace time&
Red Had )ac,a3e Mana3ement
.ommand Description
$;

RHCE (Red Hat Certified Engineer)
Rpm Niv! pac#agename&rpm To install t!e pac#age
Rpm Niv! N nodeps
pac#age&rpm
-on?t do a dependency c!ec# before installing
Rpm1iv! Noldpac#age
name&rpm
5llo an upgrade to replace a neer pac#age
it! an older one
Rpm N"v! N oldpac#age
name&rpm
To upgrade t!e pac#age
Rpm1Ka .!o all installed pac#ages
Rpm NKa gGip C!ec# pac#age !et!er installed or not
Rpm1Ka grep Gip .!o pac#ages contains Gip
Rpm1Ka1list .!o all installed pac#ages (order by last
installed pac#age)
Rpm1Ks #udGu -isplay t!e states of file in t!e pac#age t!e
state of eac! file is one of normal, not installed
or replaced&
Rpm1Ki Gip To s!o information about t!e pac#age
Rpm NKl gGip .!o all installed files
Rpm N Kd bGip6 .!o document file
Rpm N Kc named .!o configuration file
Rpm Ne #udGu To remove t!e pac#age
Rpm NeSnodeps #udGu To remove t!e pac#age by forexe
5ote: &rpm (Red Hat pac#age manager) is t!e Binary pac#age in Red Hat Linux
)ac,a3in3 and compression
)ac,a3in3 so/tware
Tar
Tip(bot! pac#age and compress t!e file)
.ompression so/tware
*Gip
BGip6
Tip(bot! pac#age and compress t!e file)
)ac,a3in3
$<

RHCE (Red Hat Certified Engineer)
Command -escription
Tar cvf abc,tar $ 6 ; < 7 8 =ac#age files named $ 6 ; < 7 8 in abc&tar
Tar tvf abc&tar Die contents of t!e file named abc&tar
(f e ant to use gGip and bGip6 compression t!e files first s!ould be pac#aged
using tar&
G*ip compression
command -escription
*Gip&abc&tar Compress t!e pac#age named abc&tar using gGip
BunGip6 ac&tar&gG "ncompress t!e file named abc&tar&gG
%*ip' compression
.ommand Description
%*ip' abc.tar Compress t!e pac#age name abc&tar using bGip6
%un*ip abc.tar.3* "ncompress t!e file named abc&tar&bG6
*ip pac,a3in3 and compression
.ommand Description
Tip xyG&Gip $ 6 ; < 7 8 Compress and pac#age t!e file named $ 6 ; < 7 8
it! a name xyG Gip softare
"nGip xyG&Gip "ncompress t!e file named xyG&Gip
-i*e chec,in3
.ommand Description
-u #!an s!os siGe of file or directory named #!an
-u1! #!an
-is# usage
.!os siGe of file or directory named #!an on 0Bs,
/Bs, *Bs
-u N! 9bin .!o siGe of 9bin directory on 0Bs, /Bs, *Bs
-f N! 9 !ome
-is# free
.!o fie system, total& "sed and free space of 9!ome
directory
Run Le4els
T!ere are F run levels in Linux
Run levels -escription
9etc9rc&d9init + .!utdon mode
9etc9rc&d9init $ .ingle user mode (passord recovery ,etc)
9etc9rc&d9init 6 Text mode it!out netor#ing
9etc9rc&d9init ; Text mode it! netor#ing
9etc9rc&d9init < "ndefined (empty)
9etc9rc&d9init 7 *"( mode
9etc9rc&d9init 8 Reboot mode
$7

RHCE (Red Hat Certified Engineer)
Eac! of t!em could be accessed from CL( mode by riting simply initUor
complete line9etc9rc&d9init +&
3!en e start t!e Linux it starts t!e *"( mode automatically if you ant to
c!ange it to CL( mode& 2pen9etc9inittab file and searc! for id,7, initdefault and
t!en c!ange t!e 7 to ; to start CL( mode automatically&
-er4ices Mana3ement
Mana3in3 ser4ices
.ommand Description
C!#config Nlist more s!o service disabled or enable in modes
C!#config Nlist grep #udGu .!os specific service
C!#configS#udGu on 2n service in all modes
C!#config #udGu off 2ff service in all modes
C!#config N level ;7 #udGu
on
2n t!e service in specific modes (Run Levels)
C!#configSlevel ;7 #udGu
off
2ff t!e service in specific modes (Run Levels)
.ervice netor# start
9stop9restart
.tart stop or restart a service in t!e current
mode temporarily
9etc9init&d9#udGu start
9stop9restart
.tart stop or restart a service in t!e current
mode temporarily
-in3le 0ser Mode
.ingle user mode is used !en a service causes starting t!e 29. and you ant to
stop t!e service or recovery your rootAs passord &etc
(f t!e Bind service causes to start t!e 29. turn it off as t!e folloing,
Cch,con/i3 named o//
)assword reco4er1
(f you lost your root account passord you can recovery it t!roug! t!e folloing
ay&
$& start t!e computer select Red Hat Linux in grub and press HEE
6& .elect second line (#ernel9) and press HEE again
;& press t!e space button and rite single t!e press t!e enter button and press
HBE to boot into single user mode (init6)
<& !en t!e single user mode starts rite passd press t!e enter button and
rite ne passord and confirm passord
-hA'.08C passwd
$8

RHCE (Red Hat Certified Engineer)
The password has been reco4er1:
)rocess Mana3ement !)s and Dill .ommands"
.ommand Description
Top .!os all running tas#s live it! =(-,/emory
usage ,C=" usage etc
CtrlJc to close it
ps .!o a snaps!ot current terminal As processes
pstree .!o a snaps!ot all terminals? processes it! a
tree s!ape
=s 1aux .!o a snaps!ot all terminals processes it! user
=(- memory usage, C=" usage& =rocess name etc
0ill ;$%+ To stop t!e ;$%+ process (end tas#)
0ill K ;6$% To stop t!e ;6$% process immediately
5etwor, .ommands
.ommand Description
netconfig to assign t!e primary (= to t!e =C
'etconfig 1 1 device et!+, $,6, etc To assign more (=s to t!e computer
9etc9init&d9netor# start
9stop9restart
T!e stacdard command for start, stop or
restarting a service
(fconfig .!o on (= address
(fconfig et!+ $+&+&+&$ netor#
677&+&+&+ up
To assign t!e primary (= to t!e =C and
start t!e netor# service
=ing $+&+&+&6 To ping a computer
(fdon9up et!+ To disable or enable t!e L5' card
(fdon et!+,$,6, etc To disable secondary (=s
9etc9sysconfig9netor#1
scripts9iffg et!+
T!e (=, sudnet mas# and gateay are save
!ere
9etc9resolv& conf Contains -'. information
9etc9!osts T!e !ostname& 4>-', and (= of t!e =C
are c!anged from !ere
!ostname .!o current !ostname
Hostname corvit To c!ange t!e !ostname
$F

RHCE (Red Hat Certified Engineer)
nsloo#up To c!ec# -'. server
Traceroute &ya!oo&com .!os (= of t!e ya!oo ebsite
'etstat Nan .!os =orts and (=s
-ource compilation
Red Hat for t!e first time created executable pac#ages called&rpm file as t!e &exe of
indos most of t!e softare doesn?t come in t!is type executable file &you ill
find most of t!e Linux softare in source code(C or CJJ code)compiling source is
called source compilation
Compiling source code !as t!ree steps&
Requirements
*cc
*libc1devel
*cc1cJJ
LibstdcJJ1devel
ma#e
#ernel1!eaders
.ompilation
.ource code comes it! a compressed pac#age so uncompress t!e pac#age and
t!en go to t!e uncompressed directory and follo t!e bello commands&
Runnin3 E.on/i3ureF
/ost of t!e pac#ages comes it! a HconfigureE script !ic! c!ec#s if t!e program
can be compiled on t!e current system if an t!ing is missing it ill inform you
about t!at& Lou can run t!is script by typing t!e folloing command in t!e
directory of a source code&
R&9configure (ta#es a fe minutes)
Runnin3 Ema,eF
(f t!e HconfigureE script as successful you can go a!ead by typing t!e ma#e
command in t!e source codes? directory for compiling t!e code&
Rma#e (ta#es a fe minutes)
Rma#e install (ta#es a fe minutes)

$B

RHCE (Red Hat Certified Engineer)
for uninstalling t!e program go to t!e source codes? folder and rite t!e folloing
command&
Rma#e uninstall (ta#es a fe minutes)

>iles and >olders )ermission
'umerical /et!od
Read O <
3rite O 6
Execute O $
To 3i4e /ull permission add all o/ the them. 9.3. $G'G&;6
To show /ile t1pe and permissions set on users. 0se is Hl
Cis A&
<wner -ame Group 0sers
D rwx rwx rwx
4ile type ot!er users
To set permission on a file or folder use c!mod command&
2t!ers
Rc!mod F 7 7 file or folder
2ner
*roup
<J6J$OF means full permission&
<J$O7 means t!e rite and executes permissions&
.ymbolic /et!od
Read O r
3rite O
Execute O x
To set /ull permission write all to3ether .9.3. rwx
$%

RHCE (Red Hat Certified Engineer)
2ner O o
2t!er users O u
*roup O g
To set permission on a /ile /older use chmod command.
To set permission on can be o u.
Cchmod 3Grwx /ile or /older

>ull permission
Cchmod Gx /ile or /older
.an be r w
Ma,e the /ile or /older executable to all users.
<wnership
To ta#e or give oners!ip of a file or folder to a user e use t!e folloing
command
T!e user to !ic! you ant to give oners!ip of t!e file or folder&
Rc!on ali,guest fileorfolder
5 group to !ic! you ant to give oners!ip too&
(f you donVt specify group t!e oners!ip ill be given to t!e specified user and t!e
group !ic! t!e user is member of&
Rclon ali fileorfolder
0ser account !password" policies
T!e passord policies could be accessed in t!e belo files&
9etc9login&defs
T!ere are four passord policies,
=5..:/5):-5L.
=5..:/(':-5L.
=5..:/(':LE'
=5..:35R':5*E
6+

RHCE (Red Hat Certified Engineer)
=5..:/5):-5L.O /aximum passord age&
=5..:/(':-5L.O /inimum days alloed beteen passord c!anges,
=5..:/(':LE'O /inimum passord lengt! to be accepted&
=5..:35R':5*EOnumber of days !en t!e 2. starts arning before a
passord expires&
@->T)
(Dery .ecured 4ile Transfer =rotocol)
D.4T= is t!e 4T= server of Linux&
=ac#age
DsftpdUUUU&rpm
T!e pac#age is in C-;
Configuration 4ile
9etc9vsftpd&conf
(t contains all configuration of D.4T=-
-efault file storage Location
9var9ftp
T!is is t!e default location for 4T= file storage&
.teps for installation P configuration
$& insert C-; and install D.4T=-UU&rpm pac#ages
6& *o to9var9ftp and put files
;& .tart 4T= service
Rservice vsftpd start
To start t!e vsftpd service temporarily
Rc!#config vsftpd on
3!en computer start t!e vsftpd service automatically starts&
5ccessing 4T=
6$

RHCE (Red Hat Certified Engineer)
To access 4T= server go to explorer in Linux or eit!er in indos mac!ine and
rite&
ftp,99ip of ftp server
e&g& ftp,99$+&+&+&$
Linux so/tware Router
T!e softare to router is used for @oining different subnets
Configuration
$& 5ssign (=s from every subnet to t!e computer
6& 2pen t!e configuration file& Rvi9etc9sysctl&conf and c!ange t!e Gero to one
net&ipv<:forardO + $
;& (f you ant to prevent restarting t!e =C to ta#e effect& T!en open anot!er
configuration file Rvi9proc9sys9net9ip:forard and c!ange t!e Gero to one&
<& 2n client sides give t!e (= of server of same range as t!e client in getay&
66

RHCE (Red Hat Certified Engineer)
-amba ser4er
.amba server is used for Linux to indos files and !ardare s!aring
=ac#ages
.amba&&&rpm
.amba1commonUrpm
.amba1clientUrpm
T!e pac#ages are in C- $
Configuration file
9etc9samba9smb&conf
.teps for installation P Configuration
$& insert C- $ and install .amba pac#ages sambaUrpm, samba1commonU
rpm, samba1clientUrpm
6& 2pen t!e configuration file and configure t!e samba as folloing,
Rvi9etc9samb9samb&conf
6;

2or, 3roup;wor,3roup
Rsearc! for security and c!ange user s!are
.ecurityOs!are
Rsearc! for WtmpX
Y WtmpX
Y =at! O 9tmp
Y read only O no
Y public O yes
Rremove all semicolons from tmp and belo text
Rt!e tmp directory !as been s!ared& 'o !en you put a folder in t!e tmp directory it
ill be s!ared&
To s!are C-R2/ and floppy @ust searc! for mnt&and remove t!e semicolons&
To s!are your on folder from a specific location,
W=cX Rs!are name
=at! O9!ome9pc Rlocation of t!e folder
Read onlyO no R not read1only
=ublic Oyes R alloed to everyone
3ritable1yes Rrites permission
RRemember, a folder in t!e root directory cannot be s!ared&
Rsave t!e file
,K
RHCE (Red Hat Certified Engineer)
;& .tart t!e .amba service& Rservice smb start
<& accessing Linux s!ared folders from indos
RunZ [[$+&+&+&$ R(= of Linux mac!ine
7& 5ccessing indosip1" administrator R s!o indos s!aring enter
passord of t!e
5dministrator account
Rsumclient 99indosip9folder1" administrator R2pen s!ared folder enter
passord of
T!e administrator account
5>-
!5etwor, /ile s1stem"
'4. server is used for Linux to Linux files and Hardare s!aring&
=ac#ages
'fs1utilsUrpm
Red!at1config1nfsUrpm(for *"( /ode)
T!e pac#ages are in C- $
Configuration file
9etc9exports
-teps /or installation ? con/i3uration
(nsert C- $ and install '4. pac#ages nfs1utilsUrpm and red!at1config1nfsUrpm
;& 2pen t!e configuration file and configure t!e '4. as folloing,
Rvi9etc9exports
6<

4or s!aring C-R2/ and 4loppy,
9mnt9cdrom $+&+&+&+9B (ro)
9mnt9floppy $+&+&+&+9B (r)
$+&+&+&+9B t!e netor# (= for !ic! t!e s!are is alloed 9B is prefix
/as# means t!e netor# Bits in class 5& 9$8 for class B& 96< for class c&
(r) read and rite permissions&(ro) read only permission
4or s!aring a specific folder
9tmp9info $+&+&+&+9B (r)
9!ome9info $+&+&+&$9B (ro) Rt!e s!are is available to t!e specific (= only
Remember: if you don not specify t!e (= class or specific (= s!are ill
be available to every one& 5nd a folder in t!e root directory cannot be
s!ared
Rsave t!e file
,K
RHCE (Red Hat Certified Engineer)
6& .tart t!e '4. service& Rservice nfs start
;& .tart t!e '4. service on client& Rservice nfs strat
<& accessing ot!ers s!aring
Rs!omount Ne $+&+&+&$ Rs!os s!aring of $+&+&+&$
Rmount Nt nfs $+&+&+&$,9mnt9cdrom a!mad Rmount (map) remote
C-R2/ to folder named a!mad
Rumount $+&+&+&$,9mnt9cdrom Runmounts t!e remote C-R2/
Rmount $+&+&+&$,9tmp9info aa Rmounts (map) remote folder to aa
D5- !%ind"
(-omain 'ame .ystem) *"L
-'. is a very ell #non protocol& (t is used for resolving Hostnames and
-omain names to (= addresses
=ac#ages
Bind1utiles1%U&rpm
Bind1%U&rpm
Red!at1config1bindU&rpm
T!e first t!ree pac#ages are in C- $ and t!e Last pac#age is in C-6
Configuration file
4ile -escription
9etc9resolv&conf .etting files for client
9etc9named&conf .etting files for -'. server
-tep /or installation ? con/i3uration
67

RHCE (Red Hat Certified Engineer)
$& (nstall Bind (-'.) pac#ages
6& .et (= to your computer& E&g& $%6&$8B&+&$
;& C!ange computer name&
R!ostname Linux
T!e open t!is fileY9etc9!osts\&
3rite (=, 4>-' and Hostname of your computer
(=\$%6&$8B&+&$\ N 4>-B \Linux&red!at&com\ N Hostname \Linux\
<& Configuration
-'. (Bind) can be configured bot! from text mode and *rap!ical mode e
are going to configure it from *rap!ical mode&
$& Clic# on Red Hat /ain menu and select system settings& .elect server
settings clic# on -omain name service
6& 2r RunZ bindconf
Mar,in3 >orward Loo,up Ione !/orward Master Ione"
$& Clic# on t!e ne button
6& .elect master loo#up Tone and rite t!e Gone name\red!at&com\ and clic#
o#
;& (n .25 field rite \]\ and clic# edit
<& clic# add in name server field and rite t!e !ostname \Linux\
7& Clic# 20 and again clic# 20
8& Clic# 5dd go to !ost tab rite !ostname in !ost field and (= 5ddress in
5ddress field& Host name \Linux\ &(= address \$%6&$8B&+&$\& and clic# 20
F& Clic# add go to 5lias tab and rite 5lias \\ t!en rite !ostname in
second field \Linux\
B& Clic# 20 and again clic# 20
Mar,in3 re4erse Loo,up Ione ! Re4erse Master Ione"
$& Clic# on t!e ne button& .elect reverse master Gone rite t!ree
octets of (=\$%6&$8B&+\ clic# 20
6& (n .25 field rite\]\
;& Clic# add in servers field riter t!e Hostname \Linux\ and Clic#
20
<& Clic# 5dd in reverse address table field rite 4>-' and (= address
4>-' \Linux&red!at&com\ (= address \$%6&$8B&+&$\
7& Clic# 2# and again Clic# 20
8& Clic# .ave to save t!e -'. configuration and Close t!e 3indo
8& .tart t!e -'. service
Rservice named start
Rc!#config named on
68

RHCE (Red Hat Certified Engineer)

F& C!ec#ing -'.
-'. could be c!ec#ed t!roug! several commands t!e best t!e dig &
Rnsloo#up
Z&linux&com or (=
3rite \nsloolup\ and t!en rite t!e 4>-' or (=
Rdig &linux &com
R!ost &linux&com or (=

DH.) -er4er
(-ynamic Host Configuration =rotocol)
-HC= allos bosts on a TC=9(= netor# to reKuest and be assigned (= addresses,
and also to discover information about t!e netor# to !ic! t!ey are attac!ed
)ac,a3e
-!cp1;UUUUrpm
T!e pac#age is in C-6
.on/i3uration /ile
9etc9d!cpd&conf
3e ill created t!e configuration file it ouldnVt be available before e create it
9usr9s!are9docs9d!cp1;&+p$$9d!cpd&conf&sample
(s t!e ready made -HC= configuration file
-tep /or installation ? .on/i3uration
$& insert C- 6 and install d!cp1;U& Rpm pac#ages,
6& 2pen configuration file and configuration t!e -HC= server it! t!e
folloing Code
;& Rvi9etc9d!cpd&conf
6F

-ns1update1style interimY
(gnore client NupdatesY
.ubnet $+&+&+&+ netmas# 677&+&+&+
^
R2ptional
2ption routers $+&+&+&$Y
2ption domain1name1server $+&+&+&$
2ption subnet1mas# 677&677&677&+
2ption domain1name1server \saif#!an&com\

RRange -efining
Range dynamic1bootp $+&+&+&6 $+&+&+&$++Y
-efault1lease1time 6$8++Y
/ax1less1time <;6++Y
Rreservation
Host max^
R Client /5C address
Hardare Et!ernet ++,$$,+7,B+,f<,;T
4ixed1address $+&+&+6
_
_
R .ave t!e 4ile
, 3K
RHCE (Red Hat Certified Engineer)
<& .tart t!e -HC= service
Rservice -HC=- start
Rc!#config service d!cpd on
To c!ec# t!e list of assigned (=s by -HC=
R vi9var9lib9d!cp9d!cp&leases
-amba )D.
!)rimar1 Domain .ontroller"
.amba =-C is used for to indos client9server (Linux as server and indos as
client of Linux)&
6B

RHCE (Red Hat Certified Engineer)
=ac#ages
.ambaUrpm
.amba&1commonUrpm
.amba1client Urpm
T!e pac#ages are in C- $
Configuration 4ile
9etc9samba9smb&comf
.tep for installation P configuration
$&(nsert C- $ and install samba pac#ages samba U& Rpm, samba1 common U
rpm, samba1client U&rpm
6&2pen t!e configuration file and configure t!e samba as folloing,
Rvi9etc9samba9smb&conf
6%

3or#group O pc&comR rite t!e name of -omain in front of or#group
'etbios name O pc R rite nebios nameO netbios name
R searc! for encrypted and c!ange no to yes
Encrypted passord O yes
R .earc! for security and ensure it is user
.ecurity Ouser
R .earc! for local master and c!ange no to yes
Local master O yes
R .earc! for domain master and c!ange no to yes
-omain master O yes
R .earc! for preferred master and c!ange no to yes
=referred master Oyes
R .earc! for so and c!ange it to 677
.o level O677
R .earc! for domain logon and c!ange no to yes
-omain logon O yes
R .earc! for WnetlogonX
YWnetlogonX
YE)5/=LE
YE)5/=LE
YE)5/=LE
YE)5/=LE
RRemove all semicolons from 'etlogon and belo text
99 .earc! for WrmpX
YWtmpX
YE)5/=LE
YE)5/=LE
YE)5/=LE
YE)5/=LE
Rremoves all semicolons from tmp and belo text
R .ave t!e file
,K

RHCE (Red Hat Certified Engineer)
;& .tart t!e samba service& Rservice smb start
<& Registering 3indos client on Linux mac!ine
Ruseradd pc6` Oclient computer name it! a ` sign
Rsmbpassd1am pc$ O client =C account it!out ` sign
7& C!anging Local Root to -omain root
Rsmdpassd N a root
T!en enter t!e ne passord for domain root account
8& Creating -omain "sers
Ruseradd Gabee!
Rsmbpassd N a Gabee!
Enter t!e passord
F& "pdate t!e database
Rupdated b
B& /a#e t!e indos mac!ine member of Linux -omain and restart t!e =C
3indos is no client of Linux domain, but you canVt login as Linux user&
%& 5llo login on indos client
;+

RHCE (Red Hat Certified Engineer)
RunZregeditZ
H0EL:L2C5L:/5CH('E[.L.TE/[CurrentControl.et[service[netlogn
[parameters
2pen t!e string Dalue named reKuiresignorseal and c!ange t!e $ to +clic#
20
5ow 1ou can lo3in s Linux 0ser:
pache 2eb -er4er
5pac!e eb server is used for !osting eb sites it!in a L5' as ell on t!e
internet
=ac#ages
Httpd16 U rpm
T!e pac#age is in C-$
Configuration file
9etc9!ttpd9conf9!ttpd&conf
.teps for installation P configuration
8& insert C- $ and install 5pac!e pac#age !ttpd16 Urpm
F& 5ssign different (=s to t!e computer for Dirtual and (= based Hosting&
B& C!ange t!e computer 'ame& R!ostname pc$ open t!e folloing file and rite
(=, Hostname and 4>-'& Rvi9etc9!osts
%& put or create t!e eb sites in folloing location& 9var99!tml
To vreate an Html file rite Rvi index&!tml
$+& 2pen t!e configuration file and configure t!e 5pac!e as folloing,
Rvi9etc9!ttpd9conf9!ttpd&conf
;$

RHCE (Red Hat Certified Engineer)
;6

.earc! for B+& *o to t!e start of t!e line and remove R& T!en remove
local!ost&localdomain& rite your system 4>-' for example
&pc$&com,B+
*o to t!e end of t!e file to add entries
Dirtual Hosting
'ame virtual !ost $+&+&+&6
avirtualHostZ
.erver name &ya!oo&com
-ocument Root \9var99!tml9ya!oo\
a9DirtualHostZ
,'ame Dirtual Host $+&+&+&6
(= Based !osting
'ame virtual !ost $+&+&+&; R (t can be accessed by bot! (= and name
aDirtual Host $+&+&+&;Z
.erver 'ame &Linux&o&g
-ocument root \9var99!tml9Linux\
a9Dirtual!ostZ
Rsave t!e file
Hosting 4T= on 5pac!e 3eb server
5fter installing and configuration 4T= open t!e apac!e configuration file
'ame virtual !ost $+&+&+&6
avirtual !ost $+&+&+6Z
.erver name fres!rpns&net
-ocument root \9var9ftp\
a9virtual HostZ
Rsave t!e file
5dd -'. entry fro 4T= .ite&
T!e 4T= site could be accessed as,
4T=,99fres!rpm&net
RHCE (Red Hat Certified Engineer)
8& -'. Configuration
2pen -'. and configuration t!e -'. normal& 5dd forard /aster Gone for
eac! sit& (n Gone name rite site name&i&e urf&net
F& .tart t!e 5pac!e and -'. services
Rservice named start R-'.
Rservice !rrpd start R apac!e
T!e sites are no accessible on t!e netor#I
+nstallin3 new hardware
To install a ne !ardare e use t!e #udGu command t!e !ardare li#e ".B are
automatically detected no installation is needed for t!em
4or installation of a ne device use t!e folloing command
R#udGu
5nd t!en select t!e configure button
4or mouse and printer configuration use t!e Rsetup command&
4or device information in gnome go start Jsystem toolsJ !ardare broser
;;

Vous aimerez peut-être aussi