Professional Documents
Culture Documents
Linux Help: For Professionals Students and Hobbyists
Linux Help: For Professionals Students and Hobbyists
com/
Linux Topics
Li n u x i s g r owi n g . I t i s n ow u sed i n m an y ever yd ay g ad g ets su ch as cel l p h on es, PDAs, M P3 p l ayer s, TVs, p r i n ter s, p or tab l e
GPS system s an d cam er as. I t' s n o l on g er j u st for system s ad m i n i str ator s. J oi n th e wave! Th i s si te cover s top i cs n eed ed for Li n u x
softwar e cer ti fi cati on exam s, su ch as th e RH CE , an d m an y com p u ter tr ai n i n g cou r ses. Th er e i s al so a com p an i on Ci sco PDF for
h om e / b r an ch offi ce con fi g u r ati on s.
Web H osti n g Wi th Th e Ap ach e Web S er ver Cen tr al i zed Li n u x Log i n s Wi th LDAP An d RADI U S
M on i tor i n g S er ver Per for m an ce - S N M P / M RTG M od i fyi n g Th e Ker n el To I m p r ove Per for m an ce
1 of 24 07/20/2009 08:20 PM
Quick HOWTO: Linux Home Networking and Linux... http://www.linuxhomenetworking.com/
Web Si te
I n tr od u cti on
Ou r N etwor k
Fi g u r e 1 -1 : Wi r el ess h om e n etwor k top ol og y
Al ter n ati ves To I n -H ou se Web H osti n g
Vi r tu al H osti n g
Ded i cated H osti n g
Factor s To Con si d er B efor e H osti n g You r sel f
Tab l e 1 -1 Th e Pr os an d Con s of Web H osti n g I n -H ou se
I s I n -H ou se H osti n g Pr efer r ed ?
H ow to M i g r ate fr om an E xter n al Pr ovi d er
I n -H ou se S er ver Con si d er ati on s
Con cl u si on
I n tr od u cti on
Th e OS I N etwor ki n g M od el
Tab l e 2 -1 : Th e S even OS I Layer s
An I n tr od u cti on to TCP/I P
TCP I s a Con n ecti on -Or i en ted Pr otocol
H ow TCP E stab l i sh es A Con n ecti on
U DP, TCP' s " Con n ecti on l ess" Cou si n
TCP an d U DP Por ts
Th e TCP/I P " Ti m e To Li ve" Featu r e
Th e I CM P Pr otocol an d I ts Rel ati on sh i p to TCP/I P
H ow I P Ad d r esses Ar e U sed To Access N etwor k Devi ces
Pr i vate I P Ad d r esses
Th e l ocal h ost I P Ad d r ess
N etwor k Ad d r ess Tr an sl ati on ( N AT) M akes Pr i vate I Ps Pu b l i c
Por t For war d i n g wi th N AT Faci l i tates H om e-B ased Web si tes
DH CP
H ow DN S Li n ks You r I P Ad d r ess To You r Web Dom ai n
I P Ver si on 6 ( I Pv6 )
H ow S u b n et M asks Gr ou p I P Ad d r esses i n to N etwor ks
Cal cu l ati n g Th e N u m b er of Ad d r esses Assi g n ed to a S u b n et
Tab l e 2 -2 : Th e " Dotted Deci m al " An d " S l ash " S u b n et M ask N otati on s
Cal cu l ati n g th e Ran g e of Ad d r esses on You r N etwor k
M an u al Cal cu l ati on
Cal cu l ati on U si n g a S cr i p t
S u b n et M asks for th e Typ i cal B u si n ess DS L Li n e
Th e Ph ysi cal an d Li n k Layer s
N etwor ki n g E q u i p m en t Ter m i n ol og y
N etwor k I n ter face Car d s
Th e M ean i n g of th e N I C Li n k Li g h t
Du p l ex E xp l ai n ed
Th e M AC Ad d r ess
H ow ARP M ap s th e M AC Ad d r ess to You r I P Ad d r ess
Com m on ARP Pr ob l em s Wh en Ch an g i n g A N I C
Th e Two B r oad Typ es Of N etwor ki n g E q u i p m en t
Data Ter m i n al E q u i p m en t
Data Com m u n i cati on s E q u i p m en t
2 of 24 07/20/2009 08:20 PM
Quick HOWTO: Linux Home Networking and Linux... http://www.linuxhomenetworking.com/
I n tr od u cti on
H ow to Con fi g u r e You r N I C' s I P Ad d r ess
Deter m i n i n g You r I P Ad d r ess
Ch an g i n g You r I P Ad d r ess
Fi g u r e 3 -1 - Fi l e for m ats for n etwor k-scr i p ts
H ow DH CP Affects th e DN S S er ver You U se
M u l ti p l e I P Ad d r esses on a S i n g l e N I C
I P Ad d r ess Assi g n m en t for a Di r ect DS L Con n ecti on
S om e I m p or tan t Fi l es Cr eated B y ad sl -setu p
S i m p l e Tr ou b l esh ooti n g
I P Ad d r ess Assi g n m en t for a Cab l e M od em Con n ecti on
H ow to Acti vate/S h u t Down You r N I C
H ow to Vi ew You r Cu r r en t Rou ti n g Tab l e
H ow to Ch an g e You r Defau l t Gateway
H ow to Con fi g u r e Two Gateways
Ad d i n g Tem p or ar y S tati c Rou tes
Ad d i n g Per m an en t S tati c Rou tes
H ow to Del ete a Rou te
Ch an g i n g N I C S p eed an d Du p l ex
U si n g m i i -tool
S etti n g You r N I C' s S p eed Par am eter s wi th m i i -tool
U si n g eth tool
S etti n g You r N I C' s S p eed Par am eter s wi th eth tool
A N ote Ab ou t Du p l ex S etti n g s
H ow to Con ver t You r Li n u x S er ver i n to a S i m p l e Rou ter
Con fi g u r i n g I P For war d i n g
Con fi g u r i n g Pr oxy ARP
Con fi g u r i n g You r /etc/h osts Fi l e
Th e l oop b ack I n ter face' s l ocal h ost E n tr y
Deb i an / U b u n tu N etwor k Con fi g u r ati on
Th e /etc/n etwor k/i n ter faces Fi l e
Th e au to S tan za
Th e m ap p i n g S tan za
Th e i face S tan za
Cr eati n g I n ter face Al i ases
Ad d i n g Per m an en t S tati c Rou tes
A com p l ete /etc/n etwor k/i n ter faces fi l e
Con cl u si on
I n tr od u cti on
S ou r ces of N etwor k S l own ess
S ou r ces of a Lack of Con n ecti vi ty
Doi n g B asi c Cab l e an d Li n k Tests
Testi n g You r N I C
Vi ewi n g You r Acti vated I n ter faces
3 of 24 07/20/2009 08:20 PM
Quick HOWTO: Linux Home Networking and Linux... http://www.linuxhomenetworking.com/
4 of 24 07/20/2009 08:20 PM
Quick HOWTO: Linux Home Networking and Linux... http://www.linuxhomenetworking.com/
I n tr od u cti on
sysl og
Tab l e 5 -1 S ysl og Faci l i ti es
Th e /etc/sysl og .con f Fi l e
Acti vati n g Ch an g es to th e sysl og Con fi g u r ati on Fi l e
H ow to Vi ew N ew Log E n tr i es as Th ey H ap p en
Log g i n g sysl og M essag es to a Rem ote Li n u x S er ver
Con fi g u r i n g th e Li n u x S ysl og S er ver
Con fi g u r i n g th e Li n u x Cl i en t
S ysl og Con fi g u r ati on an d Ci sco N etwor k Devi ces
Log r otate
Th e /etc/l og r otate.con f Fi l e
S am p l e Con ten ts of /etc/l og r otate.con f
Th e /etc/l og r otate.d Di r ector y
Acti vati n g l og r otate
Com p r essi n g You r Log Fi l es
sysl og -n g
Th e /etc/sysl og -n g /sysl og -n g .con f fi l e
Fi g u r e 5 -1 A S am p l e sysl og -n g .con f Fi l e
I n stal l i n g sysl og -n g
Con fi g u r i n g sysl og -n g Cl i en ts
S i m p l e sysl og S ecu r i ty
Con cl u si on
I n tr od u cti on
Wh er e to Get Com m on l y U sed Packag es
Packag es on You r I n stal l ati on CDs
M an u al l y Down l oad ed Packag es
Tab l e 6 -1 Pop u l ar Packag e Down l oad S i tes
Au tom ated Packag e Down l oad
H ow to Down l oad S oftwar e
Getti n g S oftwar e U si n g Web -B ased FTP
Getti n g RPM s U si n g Com m an d -Li n e An on ym ou s FTP
Tab l e 6 -2 FTP Com m an d s
Getti n g S oftwar e U si n g wg et
I n stal l i n g S oftwar e Fr om RPM Fi l es
H ow To I n stal l RPM s M an u al l y
U si n g Down l oad ed Fi l es
U si n g CD-ROM s
H ow to I n stal l S ou r ce RPM s
RPM I n stal l ati on E r r or s
Fai l ed Dep en d en ci es
S i g n atu r e Keys
H ow to Li st I n stal l ed RPM s
Li sti n g Fi l es Associ ated wi th RPM s
Li sti n g Fi l es for Al r ead y I n stal l ed RPM s
Li sti n g Fi l es i n RPM Fi l es
Li sti n g th e RPM to Wh i ch a Fi l e B el on g s
U n i n stal l i n g RPM s
Wh i ch RPM s Wi l l S tar t U p At B oot Ti m e?
Au tom ati c U p d ates wi th yu m
Con fi g u r i n g yu m
H ow to Au tom ate yu m
Cr eati n g You r Own yu m S er ver
H ow to Au tom ate yu m
Keep i n g You r S ystem cu r r en t wi th Yu m
E xam p l e of a yu m Packag e I n stal l ati on
Rem em b er Th e Fol l owi n g Yu m Facts
I n stal l i n g S oftwar e Fr om DE B Fi l es
H ow To I n stal l DE B s M an u al l y
5 of 24 07/20/2009 08:20 PM
Quick HOWTO: Linux Home Networking and Linux... http://www.linuxhomenetworking.com/
U si n g Down l oad ed Fi l es
U si n g CD-ROM s
DE B I n stal l ati on E r r or s
Fai l ed Dep en d en ci es
H ow to Li st I n stal l ed DE B s
Tab l e 6 -3 Col u m n For m atti n g for th e d p kg com m an d
Li sti n g Fi l es Associ ated wi th DE B s
Li sti n g Fi l es for Pr evi ou sl y I n stal l ed DE B s
Li sti n g Fi l es i n DE B Fi l es
Li sti n g th e DE B Packag e to Wh i ch a Fi l e B el on g s
U n i n stal l i n g DE B s
Wh i ch DE B s Wi l l S tar t U p At B oot Ti m e?
Au tom ati c DE B U p d ates wi th ap t-g et
Con fi g u r i n g APT
Keep i n g You r S ystem cu r r en t wi th APT
E xam p l e of an ap t-g et Packag e I n stal l ati on
Rem em b er Th e Fol l owi n g APT Facts
I n stal l i n g S oftwar e U si n g tar Fi l es
I n stal l i n g Per l M od u l es
M an u al I n stal l ati on of Per l M od u l es
Au tom ati c I n stal l ati on of Per l M od u l es
Con cl u si on
I n tr od u cti on
Th e Li n u x B oot S eq u en ce
Fi g u r e 7 -1 S am p l e g r u b .con f fi l e
Tab l e 7 -1 Li n u x Ru n l evel s
Deter m i n i n g th e Defau l t B oot r u n l evel
Getti n g a GU I Con sol e
Get a B asi c Text Ter m i n al Wi th ou t E xi ti n g th e GU I
U si n g a GU I Ter m i n al Wi n d ow
U si n g Vi r tu al Con sol es
S ystem S h u td own an d Reb ooti n g
H al t/S h u t Down Th e S ystem
Reb oot Th e S ystem
E n ter i n g S i n g l e-u ser M od e
S wi tch i n g to S i n g l e-u ser M od e
E n ter i n g S i n g l e-u ser M od e At Th e Gr u b S p l ash S cr een
Rever ti n g To You r Defau l t r u n l evel Fr om S i n g l e U ser M od e
Root Passwor d Recover y
S tar ti n g an d S top p i n g Daem on s
S tar ti n g a Daem on
S top p i n g a Daem on
Restar ti n g a Daem on
Th e ser vi ce com m an d
U si n g ch kcon fi g to S tar t Daem on s at E ach r u n l evel
ch kcon fi g E xam p l es
U se Ch kcon fi g to Get a Li sti n g of sen d m ai l ' s Cu r r en t S tar tu p Op ti on s
S wi tch Off sen d m ai l S tar ti n g U p i n Level s 3 an d 5
Dou b l e-ch eck th at sen d m ai l Wi l l N ot S tar t U p
Tu r n On sen d m ai l Ag ai n
U si n g ch kcon fi g to I m p r ove S ecu r i ty
Fi n al Ti p s on ch kcon fi g
U si n g sysv-r c-con f to S tar t Daem on s at E ach r u n l evel
I n stal l i n g sysv-r c-con f
Li sti n g th e r u n l evel s for Daem on s
S etti n g th e r u n l evel s for Daem on s
Con cl u si on
6 of 24 07/20/2009 08:20 PM
Quick HOWTO: Linux Home Networking and Linux... http://www.linuxhomenetworking.com/
I n tr od u cti on
Down l oad an d I n stal l th e DH CP Packag e
Th e /etc/d h cp d .con f Fi l e
H ow to Get DH CP S tar ted
DH CP S er ver s wi th M u l ti p l e N I Cs
Tem p or ar y S ol u ti on
Per m an en t S ol u ti on
Con fi g u r i n g Li n u x Cl i en ts to U se DH CP
Con fi g u r i n g Wi n d ows Cl i en ts to U se DH CP
U si n g a S i n g l e DH CP S er ver to S er ve M u l ti p l e N etwor ks
S i m p l e DH CP Tr ou b l esh ooti n g
DH CP Cl i en ts Ob tai n i n g 1 6 9 .2 5 4.0.0 Ad d r esses
Oth er DH CP Fai l u r es
Con cl u si on
I n tr od u cti on
Wh o I s th e S u p er U ser ?
H ow To Ad d U ser s
H ow to Ch an g e Passwor d s
H ow to Del ete U ser s
H ow to Tel l th e Gr ou p s to Wh i ch a U ser B el on g s
H ow to Ch an g e th e Own er sh i p of a Fi l e
U si n g su d o
S i m p l e S u d o E xam p l es
Tem p or ar i l y Gai n i n g r oot Pr i vi l eg es
B ecom i n g r oot for a Com p l ete Log i n S essi on
Down l oad i n g an d I n stal l i n g th e su d o Packag e
Th e /etc/su d oer s Fi l e
Tab l e 9 -1 For m at of th e /etc/su d oer s Fi l e
S i m p l e /etc/su d oer s E xam p l es
Gr an ti n g Al l Access to S p eci fi c U ser s
Gr an ti n g Access To S p eci fi c U ser s To S p eci fi c Fi l es
Gr an ti n g Access to S p eci fi c Fi l es as An oth er U ser
Gr an ti n g Access Wi th ou t N eed i n g Passwor d s
U si n g Al i ases i n th e su d oer s Fi l e
Oth er E xam p l es
U si n g sysl og To Tr ack Al l su d o Com m an d s
Con cl u si on
I n tr od u cti on
Down l oad an d I n stal l Packag es
H ow to Get S am b a S tar ted
Th e S am b a Con fi g u r ati on Fi l e
Tab l e 1 0-1 : Fi l e For m at - sm b .con f
H ow S WAT M akes S am b a S i m p l er
Fi g u r e 1 0-1 S am b a S WAT M ai n M en u
B asi c S WAT S etu p
Con tr ol l i n g S WAT
E n cr yp ti n g S WAT
Cr eate An stu n n el U ser
Cr eate Th e Cer ti fi cates
M od i fy Cer ti fi cate Fi l e Per m i ssi on s
Cr eate An /etc/stu n n el /stu n n el .con f Con fi g u r ati on Fi l e
Cr eate A N ew /etc/xi n etd .d Fi l e For S ecu r e S WAT
Di sab l e S WAT i n th e /etc/xi n etd .d /swat Fi l e
E d i t Th e /etc/ser vi ces fi l e To cr eate a S ecu r e S WAT en tr y
Acti vate swat-stu n n el
7 of 24 07/20/2009 08:20 PM
Quick HOWTO: Linux Home Networking and Linux... http://www.linuxhomenetworking.com/
S tar t stu n n el
Test S ecu r e S WAT
Test Th e S ecu r e S WAT Log i n
Tr ou b l esh ooti n g S ecu r e S WAT
H ow To M ake S WAT Ch an g es I m m ed i ate
Cr eati n g A S tar ter Con fi g u r ati on
Th e [ Gl ob al ] S ecti on
Tab l e 1 0-2 : sm b .con f M i n i m u m S etti n g s, " Gl ob al " S ecti on
U si n g Th e S WAT Wi zar d
Th e [ h om es] S ecti on
Tab l e 1 0-3 : sm b .con f M i n i m u m S etti n g s, " H om e" S ecti on
Th e [ n etl og on ] an d [ p r ofi l es] S h ar e S ecti on s
Th e [ p r i n ter s] S h ar e S ecti on
S h ar es For S p eci fi c Gr ou p s Of U ser s
S am b a Passwor d s
H ow To Cr eate A S am b a PDC Ad m i n i str ator U ser
H om e E n vi r on m en t
Cor p or ate E n vi r on m en t
H ow To Ad d Wor kstati on s To You r S am b a Dom ai n
Cr eate S am b a Tr u st Accou n ts For E ach Wor kstati on
M an u al Cr eati on Of M ach i n e Tr u st Accou n ts ( N T On l y)
Dyn am i c Cr eati on of M ach i n e Tr u st Accou n ts
M ake You r PC Cl i en ts Awar e Of You r S am b a PDC
Wi n d ows 9 5 /9 8 /M E an d Wi n d ows XP H om e
Wi n d ows N T
Wi n d ows 2 00x an d Wi n d ows XP Pr ofessi on al
H ow To Ad d U ser s To You r S am b a Dom ai n
Ad d i n g Th e U ser s I n Li n u x
Cr eate th e u ser
Gi ve th em a Li n u x Passwor d
M ap p i n g Th e Li n u x U ser s To An sm b p asswor d
M ap p i n g A Pr i vate Wi n d ows Dr i ve S h ar e
M ap p i n g U si n g " M y Com p u ter "
M ap p i n g fr om th e Com m an d Li n e
Dom ai n Gr ou p s An d S am b a
H ow To Del ete U ser s Fr om You r S am b a Dom ai n
H ow To M od i fy S am b a Passwor d s
Tab l e 1 0-4 : sm b .con f S etti n g s, E n ab l i n g On l i n e Passwor d Ch an g es
Con cl u si on
I n tr od u cti on
Ad d i n g A Pr i n ter To A S am b a PDC
Ad d i n g Th e Pr i n ter To Li n u x
Fi g u r e 1 1 -1 Pr i n ter Con fi g u r ati on S cr een
M ake S am b a Awar e of th e Pr i n ter
Con fi g u r e Th e Pr i n ter Dr i ver On Th e Wor kstati on s
Cr eati n g Gr ou p S h ar es i n S AM B A
Cr eate Th e Di r ector y An d U ser Gr ou p
Con fi g u r e Th e S h ar e I n S WAT
M ap Th e Di r ector y U si n g " M y Com p u ter "
S h ar i n g Wi n d ows Dr i ves U si n g a Li n u x S AM B A Cl i en t
Wi n d ows S etu p
For Wi n d ows 9 8 /M E
For Wi n d ows 2 000
For Wi n d ows XP
Test You r Wi n d ows Cl i en t Con fi g u r ati on
Cr eate A CD-ROM Dr i ve M ou n t Poi n t On You r S am b a S er ver
Passwor d Pr om p t M eth od
N o Pr om p t M eth od
U si n g Th e sm b m ou n t Com m an d M eth od
Au tom ati n g M ou n ti n g Wi th Li n u x S AM B A Cl i en ts
Con cl u si on
8 of 24 07/20/2009 08:20 PM
Quick HOWTO: Linux Home Networking and Linux... http://www.linuxhomenetworking.com/
I n tr od u cti on
Testi n g Th e sm b .con f fi l e
S am b a an d Fi r ewal l S oftwar e
Li n u x i p tab l es
Wi n d ows-b ased Zon e Al ar m
Th e Wi n d ows XP B u i l t I n Fi r ewal l
Testi n g B asi c Cl i en t / S er ver N etwor k Con n ecti vi ty
Testi n g S am b a Cl i en t / S er ver Con n ecti vi ty
Ch ecki n g th e S am b a Log s
S am b a N etwor k Tr ou b l esh ooti n g
B asi c S am b a S ecu r i ty
Con cl u si on
I n tr od u cti on
Wi r el ess Li n u x Com p ati b l e N I Cs
Com m on Wi r el ess N etwor ki n g Ter m s
Wi r el ess Access Poi n ts
S er vi ce S et I D
E n cr yp ti on
Wi r ed E q u i val en t Pr i vacy
Wi -Fi Pr otected Access
N etwor ki n g Wi th Li n u x Wi r el ess-Tool s
U si n g i wcon fi g For wi r el ess-tool s Con fi g u r ati on
Per m an en t wi r el ess-tool s Con fi g u r ati on
Fed or a / Red H at
Deb i an / U b u n tu
WE P E n cr yp ti on Con fi g u r ati on
WE P E n cr yp ti on Con fi g u r ati on
# 1 .1 WE P Key Gen er ati on
Tab l e 1 3 -1 B yte Cou n t to WE P Key Len g th Con ver si on
# 1 .2 WE P Key Con fi g u r ati on for Fed or a / Red H at
# 1 .3 WE P Key Con fi g u r ati on for Deb i an / U b u n tu
WPA E n cr yp ti on
I n stal l i n g WPA S u p p l i can t
Th e wp a_ su p p l i can t.con f Fi l e
Fu r th er WPA Con fi g u r ati on S tep s - Fed or a / Red H at
Fu r th er WPA Con fi g u r ati on S tep s - Deb i an / U b u n tu
Con fi g u r i n g Li n u x wi th I n com p ati b l e Wi r el ess N I Cs
U si n g b cm 43 xx-fwcu tter wi th B r oad com Wi r el ess Ch i p s
H ow to tel l i f you h ave a B r oad com 43 XX Ch i p set
I n stal l i n g you r B r oad com 43 XX fi r m war e
Con fi g u r i n g you r B r oad com N I C
U si n g n d i swr ap p er
I n stal l i n g an d Con fi g u r i n g n d i swr ap p er
N etwor ki n g Wi th Li n u x-WLAN
Li n u x-WLAN Pr ep ar ati on
I d en ti fyi n g Th e Cor r ect RPM s
Deter m i n e Th e Ker n el Typ e
Deter m i n e Th e OS Ver si on
Deter m i n e Th e Ker n el Ver si on
I n stal l i n g th e RPM s
Li n u x-WLAN Post I n stal l ati on S tep s
Con fi g u r e Th e N ew wl an 0 I n ter face
Di sab l e You r E xi sti n g E th er n et N I C
S tar t Li n u x-WLAN
PCI Car d s - I n stal l ed U si n g RPM s
PCM CI A Car d s
9 of 24 07/20/2009 08:20 PM
Quick HOWTO: Linux Home Networking and Linux... http://www.linuxhomenetworking.com/
Testi n g Li n u x-WLAN
Li n u x-WLAN WE P E n cr yp ti on For S ecu r i ty
De-acti vati n g E n cr yp ti on
Tr ou b l esh ooti n g You r Wi r el ess LAN
Ch eck Th e N I C S tatu s
Th e i wcon fi g Com m an d
Th e i wl i st Com m an d
Th e i wsp y Com m an d
Ch eck For I n ter r u p t Con fl i cts
Ker n el E r r or s
Can ' t Pi n g Defau l t Gateway
" U n kn own Devi ce" E r r or s
H er m es Ch i p set E r r or s
n d i swr ap p er E r r or s
CON FI G_ 4KS TACKS er r or s Du r i n g I n stal l ati on
I n cor r ect Dr i ver
N I Cs th at ar e I n com p ati b l e wi th n d i swr ap p er
A Com m on Pr ob l em Wi th Li n u x-WLAN An d Fed or a Cor e 1
Wi r el ess N etwor ks I n B u si n esses
Con cl u si on
I n tr od u cti on
Wh at I s i p tab l es?
Down l oad An d I n stal l Th e I p tab l es Packag e
H ow To S tar t i p tab l es
Deter m i n i n g Th e S tatu s of i p tab l es
Packet Pr ocessi n g I n i p tab l es
Tab l e 1 4-1 Pr ocessi n g For Packets Rou ted B y Th e Fi r ewal l
Fi g u r e 1 4-1 I p tab l es Packet Fl ow Di ag r am
Tar g ets An d J u m p s
Tab l e 1 4-2 Descr i p ti on s Of Th e M ost Com m on l y U sed Tar g ets
I m p or tan t I p tab l es Com m an d S wi tch Op er ati on s
Tab l e 1 4-2 Gen er al I p tab l es M atch Cr i ter i a
Tab l e 1 4-4 Com m on TCP an d U DP M atch Cr i ter i a
Tab l e 1 4-5 Com m on I CM P ( Pi n g ) M atch Cr i ter i a
Tab l e 1 4-6 Com m on E xten d ed M atch Cr i ter i a
U si n g U ser Defi n ed Ch ai n s
Tab l e 1 4.7 Cu stom Qu eu es E xam p l e Li sti n g
S avi n g You r i p tab l es S cr i p ts
Fed or a' s i p tab l es Ru l e Gen er ator
Recover i n g Fr om A Lost S cr i p t
Load i n g Ker n el M od u l es N eed ed B y i p tab l es
S am p l e i p tab l es S cr i p ts
B asi c Op er ati n g S ystem Defen se
Ad van ced i p tab l es I n i ti al i zati on
Al l owi n g DN S Access To You r Fi r ewal l
Al l owi n g WWW An d S S H Access To You r Fi r ewal l
Al l owi n g You r Fi r ewal l To Access Th e I n ter n et
Al l ow You r H om e N etwor k To Access Th e Fi r ewal l
M asq u er ad i n g ( M an y to On e N AT)
Por t For war d i n g Typ e N AT ( DH CP DS L)
S tati c N AT
Tr ou b l esh ooti n g i p tab l es
Ch ecki n g Th e Fi r ewal l Log s
i p tab l es Won ' t S tar t
Con cl u si on
I n tr od u cti on
10 of 24 07/20/2009 08:20 PM
Quick HOWTO: Linux Home Networking and Linux... http://www.linuxhomenetworking.com/
FTP Over vi ew
Typ es of FTP
Fi g u r e 1 5 -1 Acti ve An d Passi ve FTP I l l u str ated
Acti ve FTP
Passi ve FTP
Reg u l ar FTP
An on ym ou s FTP
Pr ob l em s Wi th FTP An d Fi r ewal l s
Cl i en t Pr otected B y A Fi r ewal l Pr ob l em
Tab l e 1 5 -1 Cl i en t Pr otected b y Fi r ewal l - Req u i r ed Ru l es for FTP
S er ver Pr otected B y A Fi r ewal l Pr ob l em
Tab l e 1 5 -2 ou tl i n es th e g en er al r u l es n eed ed to al l ow FTP ser ver s th r ou g h a fi r ewal l .
H ow To Down l oad An d I n stal l VS FTPD
H ow To Get VS FTPD S tar ted
Testi n g th e S tatu s of VS FTPD
Th e vsftp d .con f Fi l e
Oth er vsftp d .con f Op ti on s
FTP S ecu r i ty I ssu es
Th e /etc/vsftp d .ftp u ser s Fi l e
An on ym ou s U p l oad
FTP Gr eeti n g B an n er
U si n g S CP As S ecu r e Al ter n ati ve To FTP
Tr ou b l esh ooti n g FTP
Tu tor i al
FTP U ser s wi th On l y Read Access to a S h ar ed Di r ector y
S am p l e Log i n S essi on To Test Fu n cti on al i ty
Con cl u si on
I n tr od u cti on
M an ag i n g xi n etd Pr og r am s
Con tr ol l i n g xi n etd
Con tr ol l i n g xi n etd -M an ag ed Ap p l i cati on s
Tel n et
U si n g Th e Tel n et Cl i en t
I n stal l i n g Th e Tel n et S er ver S oftwar e
S etti n g U p A Tel n et S er ver
Red h at / Fed or a
Deb i an / U b u n tu
B asi c Tel n et S ecu r i ty
Let Tel n et Li sten On An oth er TCP Por t
Let Tel n et Al l ow Con n ecti on s Fr om Tr u sted Ad d r esses
TFTP
I n stal l i n g Th e TFTP S er ver S oftwar e
Con fi g u r i n g Th e TFTP S er ver
Red h at / Fed or a
Deb i an / U b u n tu
Pr ep ar i n g TFTP S er ver Fi l es
S avi n g Ci sco Con fi g u r ati on s To Th e TFTP S er ver
Ci sco PI X fi r ewal l
Ci sco S wi tch Ru n n i n g CATOS
Ci sco Rou ter
Ci sco CS S 1 1 000 " Ar r owp oi n ts"
Ci sco Local Di r ector
U p l oad i n g Ci sco Con fi g u r ati on s Fr om Th e TFTP S er ver
S am p l e U p l oad Con fi g u r ati on Fi l e
Pr oced u r e To U p l oad A Con fi g u r ati on Fi l e
U si n g TFTP To Restor e You r Rou ter Con fi g u r ati on
Con cl u si on
11 of 24 07/20/2009 08:20 PM
Quick HOWTO: Linux Home Networking and Linux... http://www.linuxhomenetworking.com/
I n tr od u cti on
A Qu i ck I n tr od u cti on To S S H E n cr yp ti on
S tar ti n g Op en S S H
Testi n g Th e S tatu s of S S H
Th e /etc/ssh /ssh d _ con fi g Fi l e
S S H Ver si on s 1 an d 2
H ow To Ch an g e Th e TCP Por t On Wh i ch S S H Li sten s
U si n g S S H To Log i n To A Rem ote M ach i n e
Wh at To E xp ect Wi th You r Fi r st Log i n
S S H Fai l u r es Du e To Li n u x Rei n stal l ati on s
Deacti vati n g Tel n et After I n stal l i n g S S H
E xecu ti n g Rem ote Com m an d s on Dem an d wi th S S H
S S H Tu n n el i n g
Local For war d i n g
Rem ote For war d i n g
Con fi g u r i n g For war d i n g wi th GU I Cl i en ts
Tr ou b l esh ooti n g S S H Por t For war d i n g
S CP: A S ecu r e Al ter n ati ve to FTP
Cop yi n g Fi l es To Th e Local Li n u x B ox
Cop yi n g Fi l es To Th e Rem ote Li n u x B ox
S FTP: An oth er S ecu r e Al ter n ati ve to FTP
U si n g S S H an d S CP wi th ou t a p asswor d
Con fi g u r ati on : Cl i en t S i d e
Con fi g u r ati on - S er ver S i d e
Con cl u si on
I n tr od u cti on
I n tr od u cti on to DN S
DN S Dom ai n s
B IND
DN S Cl i en ts
Au th or i tati ve DN S S er ver s
H ow DN S S er ver s Fi n d Ou t You r S i te I n for m ati on
Wh en To U se A DN S Cach i n g N am e S er ver
Wh en To U se A S tati c DN S S er ver
Wh en To U se A Dyn am i c DN S S er ver
H ow To Get You r Own Dom ai n
B asi c DN S Testi n g of DN S Resol u ti on
Th e H ost Com m an d
Th e n sl ooku p Com m an d
Down l oad i n g an d I n stal l i n g th e B I N D Packag es
H ow To Get B I N D S tar ted
Red h at / Fed or a
Deb i an / U b u n tu
Th e /etc/r esol v.con f Fi l e
Tab l e 1 8 .1 Keywor d s I n /etc/r esol v.con f
Con fi g u r i n g A Cach i n g N am eser ver
I m p or tan t Fi l e Locati on s
Red H at / Fed or a
Tab l e 1 8 .2 Di ffer en ces I n Fed or a An d Red h at DN S Fi l e Locati on s
Deb i an / U b u n tu
Con fi g u r i n g A Reg u l ar N am eser ver
Con fi g u r i n g r esol v.con f
Pr ep ar i n g n am ed .con f
Tab l e 1 8 .3 Th e Pr i m ar y B I N D Con fi g u r ati on Fi l es
Con fi g u r i n g n am ed .con f
Con fi g u r i n g Th e Zon e Fi l es
Ti m e to Li ve Val u e
DN S Resou r ce Recor d s
Th e S OA Recor d
Tab l e 1 8 .4 Th e S OA Recor d For m at
12 of 24 07/20/2009 08:20 PM
Quick HOWTO: Linux Home Networking and Linux... http://www.linuxhomenetworking.com/
N S , M X, A An d CN AM E Recor d s
Tab l e 1 8 .5 N S , M X, A, PTR an d CN AM E Recor d For m ats
TXT Recor d s
S am p l e For war d Zon e Fi l e
S am p l e Rever se Zon e Fi l e
B I N D Vi ews Wh en U si n g N AT An d DN S
Th e I n ter n al Vi ew
Th e E xter n al Vi ew
Th e l ocal h ost_ r esol ver Vi ew
Load i n g You r N ew Con fi g u r ati on Fi l es
M ake S u r e You r /etc/h osts Fi l e I s Cor r ectl y U p d ated
Con fi g u r e You r Fi r ewal l
Fi x You r Dom ai n Reg i str ati on
Tr ou b l esh ooti n g B I N D
Con fi g u r ati on Tr ou b l esh ooti n g S tep s
N etwor k Tr ou b l esh ooti n g S tep s
M i g r ati n g You r Web S i te I n -H ou se
DH CP Con si d er ati on s For DN S
S i m p l e DN S S ecu r i ty
Zon e Tr an sfer Pr otecti on
S el ecti vel y Di sab l i n g Recu r si on
N am i n g Con ven ti on S ecu r i ty
Con cl u si on
I n tr od u cti on
Dyn am i c DN S Pr ep ar ati on
Testi n g I S P Con n ecti vi ty For You r Web si te
S etu p
Testi n g Fr om Th e I n ter n et
Test Por t For war d i n g
Reg i ster i n g DDN S
I n stal l a DDN S Cl i en t On You r S er ver
Dyn am i c DN S An d N AT Rou ter /Fi r ewal l s
DDN S Cl i en t S oftwar e - S OH O Rou ter / Fi r ewal l s
DDN S Cl i en t S oftwar e - Li n u x DDcl i en t
Th e /etc/d d cl i en t.con f fi l e
H ow to Get DDcl i en t S tar ted
Fi n d i n g DDcl i en t H el p
Testi n g You r Dyn am i c DN S
Con cl u si on
I n tr od u cti on
Down l oad an d I n stal l Th e Ap ach e Packag e
H ow To Get Ap ach e S tar ted
Red h at / Fed or a
Deb i an / U b u n tu
Con fi g u r i n g DN S For Ap ach e
DH CP an d Ap ach e
Gen er al Con fi g u r ati on S tep s
Wh er e To Pu t You r Web Pag es
Th e Defau l t Fi l e Locati on
Fi l e Per m i ssi on s An d Ap ach e
S ecu r i ty Con texts For Web Pag es
Tab l e 2 0-1 S E Li n u x S ecu r i ty Con text Fi l e Lab el s
S ecu r i ty Con texts For CGI S cr i p ts
N am ed Vi r tu al H osti n g
N am ed Vi r tu al H osti n g E xam p l e
I P-B ased Vi r tu al H osti n g
13 of 24 07/20/2009 08:20 PM
Quick HOWTO: Linux Home Networking and Linux... http://www.linuxhomenetworking.com/
I n tr od u cti on
Con fi g u r i n g S en d m ai l
H ow S en d m ai l Wor ks
I n com i n g M ai l
Ou tg oi n g M ai l
S en d m ai l M acr os
I n stal l i n g S en d m ai l
S tar ti n g S en d m ai l
H ow To Restar t S en d m ai l After E d i ti n g You r Con fi g u r ati on Fi l es
Th e /etc/m ai l /sen d m ai l .m c Fi l e
H ow to Pu t Com m en ts i n sen d m al .m c
Con fi g u r i n g DN S for sen d m ai l
Con fi g u r e You r M ai l S er ver ' s N am e I n DN S
Con fi g u r e Th e /etc/r esol v.con f Fi l e
Th e /etc/h osts Fi l e
H ow To Con fi g u r e Li n u x S en d m ai l Cl i en ts
Con ver ti n g Fr om a M ai l Cl i en t to a M ai l S er ver
A Gen er al Gu i d e To U si n g Th e sen d m ai l .m c Fi l e
Th e /etc/m ai l /r el ay-d om ai n s Fi l e
Th e /etc/m ai l /access Fi l e
Th e /etc/m ai l /l ocal -h ost-n am es Fi l e
Wh i ch U ser S h ou l d Real l y Recei ve Th e M ai l ?
Th e /etc/m ai l /vi r tu ser tab l e fi l e
Th e /etc/al i ases Fi l e
S en d m ai l M asq u er ad i n g E xp l ai n ed
Con fi g u r i n g m asq u er ad i n g
Testi n g M asq u er ad i n g
Oth er M asq u er ad i n g N otes
U si n g S en d m ai l to Ch an g e th e S en d er ' s E m ai l Ad d r ess
Tr ou b l esh ooti n g S en d m ai l
Testi n g TCP con n ecti vi ty
Fu r th er Testi n g of TCP con n ecti vi ty
Th e /var /l og /m ai l l og Fi l e
Com m on E r r or s Du e To I n com p l ete RPM I n stal l ati on
I n cor r ectl y Con fi g u r ed /etc/h osts Fi l es
14 of 24 07/20/2009 08:20 PM
Quick HOWTO: Linux Home Networking and Linux... http://www.linuxhomenetworking.com/
Fi g h ti n g S PAM
U si n g Pu b l i c S PAM B l ackl i sts Wi th S en d m ai l
S p am assassi n
Down l oad i n g An d I n stal l i n g S p am assassi n
S tar ti n g S p am assassi n
Con fi g u r i n g p r ocm ai l for sp am assassi n
Con fi g u r i n g S p am assassi n
Testi n g sp am assassi n
S tar tu p sp am assassi n
Tu n i n g sp am assassi n
Th e Ru l es d u J ou r S p am assassi n Tool
Th e /etc/r u l esd u j ou r /con fi g Con fi g u r ati on Fi l e
I n stal l i n g Ru l es d u J ou r
U si n g Gr eyl i sti n g
Down l oad i n g an d I n stal l i n g m i l ter -g r eyl i st
Con fi g u r i n g m i l ter -g r eyl i st
Con fi g u r i n g m i l ter -g r eyl i st
A S i m p l e PE RL S cr i p t To H el p S top S PAM
Con fi g u r i n g You r POP M ai l S er ver
I n stal l i n g You r POP M ai l S er ver
S tar ti n g You r POP M ai l S er ver
Th e /etc/d ovecot.con f Fi l e
H ow To Con fi g u r e You r Wi n d ows M ai l Pr og r am s
Con fi g u r i n g S ecu r e POP M ai l
H ow to h an d l e over l ap p i n g em ai l ad d r esses.
Tr ou b l esh ooti n g POP M ai l
Con cl u si on
15 of 24 07/20/2009 08:20 PM
Quick HOWTO: Linux Home Networking and Linux... http://www.linuxhomenetworking.com/
Th e vm stat Com m an d
Th e fr ee U ti l i ty
Con cl u si on
CHAPTER 23 - Advance d MRTG (CPU, Me mo ry, Dis k and TCP Co nne ctio ns
M on i tor i n g )
I n tr od u cti on
Locati n g An d Vi ewi n g Th e Con ten ts Of Li n u x M I B s
Testi n g You r M I B Val u e
Di ffer en ces I n M I B An d M RTG Ter m i n ol og y
Th e CPU An d M em or y M on i tor i n g M I B
Tab l e 2 3 -1 I m p or tan t Ob j ects I n Th e U CD-S N M P-M I B M I B
Th e TCP/I P M on i tor i n g M I B
Tab l e 2 3 -2 I m p or tan t Ob j ects I n Th e TCP-M I B M I B
M an u al l y Con fi g u r i n g You r M RTG Fi l e
Par am eter For m ats
Leg en d Par am eter s
Op ti on s Par am eter s
S cal i n g Par am eter s
Defi n i n g Th e M I B Tar g et Par am eter s
Tab l e 2 3 -3 M ap p i n g M I B s To Th e Gr ap h Leg en d s
Pl otti n g On l y On e M I B Val u e
Ad d i n g M I B Val u es Tog eth er For a Gr ap h
S am p l e Tar g et: Total CPU U sag e
S am p l e Tar g et: M em or y U sag e
S am p l e Tar g et: N ewl y Cr eated Con n ecti on s
S am p l e Tar g et: Total TCP E stab l i sh ed Con n ecti on s
S am p l e Tar g et: Di sk Par ti ti on U sag e
Defi n i n g Gl ob al Var i ab l es
I m p l em en ti n g Ad van ced S er ver M on i tor i n g
A Com p l ete S am p l e Con fi g u r ati on
Testi n g Th e Con fi g u r ati on
Cr eati n g A N ew M RTG I n d ex Pag e To I n cl u d e Th i s Fi l e
Con fi g u r i n g cr on To U se Th e N ew M RTG Fi l e
M on i tor i n g N on Li n u x M I B Val u es
S cen ar i o
Testi n g Th e OI Ds
S p eed i n g u p M RTG wi th RRDtool
S cen ar i o
I n stal l i n g RRDtool
S tor i n g th e M RTG Data i n RRDtool For m at
Th e M RTG / RRDtool I n teg r ati on S cr i p t
Tr ou b l esh ooti n g
Con cl u si on
I n tr od u cti on
Down l oad an d I n stal l Th e N TP Packag e
Th e /etc/n tp .con f Fi l e
H ow To Get N TP S tar ted
Ver i fyi n g N TP i s Ru n n i n g
Doi n g An I n i ti al S yn ch r on i zati on
Deter m i n i n g I f N TP I s S yn ch r on i zed Pr op er l y
You r Li n u x N TP cl i en ts can n ot S yn ch r on i ze Pr op er l y
Fed or a Cor e 2 Fi l e Per m i ssi on s
Con fi g u r i n g Ci sco Devi ces To U se An N TP S er ver
Ci sco I OS
CATOS
N TP S ecu r i ty
Fi r ewal l s an d N TP
16 of 24 07/20/2009 08:20 PM
Quick HOWTO: Linux Home Networking and Linux... http://www.linuxhomenetworking.com/
N TP Au th en ti cati on
Con fi g u r i n g A Wi n d ows N TP Cl i en t
Con cl u si on
I n tr od u cti on
S etti n g U p Th e I n stal l ati on S er ver
B asi c Pr ep ar ati on
Cr eate Th e I n stal l ati on Di r ector i es
Cop yi n g Th e Fi l es
H TTP & FTP Pr ep ar ati on
N FS Pr ep ar ati on
S etu p You r Web ser ver
S etu p You r FTP S er ver
Cr eate A S p eci al FTP U ser
S etu p You r N FS S er ver
Con fi g u r e You r DH CP S er ver
Cr eati n g A B oot CD
Th e N etwor k I n stal l ati on
I f You S el ected Th e N FS M eth od
I f You S el ected Th e H TTP M eth od
I f You S el ected Th e FTP M eth od
Tr ou b l esh ooti n g Th e N etwor k I n stal l ati on
Au tom ati n g I n stal l ati on Wi th Ki ckstar t
H ow To Cr eate N ew Ki ckstar t Con fi g u r ati on Fi l es
Ad d i n g Post I n stal l ati on Com m an d s
A N ote Ab ou t U si n g an acon d a-ks.cfg
H ow To Ru n A Ki ckstar t I n stal l ati on
U si n g a N FS S er ver
U si n g a Web S er ver
B ooti n g Wi th You r Ki ckstar t Fi l es
Con cl u si on
I n tr od u cti on
RAI D Typ es
Li n ear M od e RAI D
RAI D 0
RAI D 1
Fi g u r e 2 6 -1 RAI D 0 An d RAI D 1 Op er ati on
RAI D 4
RAI D 5
Fi g u r e 2 6 -2 RAI D 5 Op er ati on
B efor e You S tar t
I DE Dr i ves
S er i al ATA Dr i ves
S CS I Dr i ves
S h ou l d I U se S oftwar e RAI D Par ti ti on s Or E n ti r e Di sks?
B acku p You r S ystem Fi r st
Con fi g u r e RAI D I n S i n g l e U ser M od e
Con fi g u r i n g S oftwar e RAI D
RAI D Par ti ti on i n g
Deter m i n i n g Avai l ab l e Par ti ti on s
U n m ou n t th e Par ti ti on s
Pr ep ar e Th e Par ti ti on s Wi th FDI S K
U se FDI S K H el p
S et Th e I D Typ e To FD
M ake S u r e Th e Ch an g e Occu r r ed
S ave Th e Ch an g es
Rep eat For Th e Oth er Par ti ti on s
17 of 24 07/20/2009 08:20 PM
Quick HOWTO: Linux Home Networking and Linux... http://www.linuxhomenetworking.com/
Pr ep ar i n g th e RAI D S et
Cr eate th e RAI D S et
Con fi r m RAI D I s Cor r ectl y I n i ti tal i zed
For m at Th e N ew RAI D S et
Cr eate th e m d ad m .con f Con fi g u r ati on Fi l e
Cr eate A M ou n t Poi n t For Th e RAI D S et
E d i t Th e /etc/fstab Fi l e
M ou n t Th e N ew RAI D S et
Ch eck Th e S tatu s Of Th e N ew RAI D
Con cl u si on
I n tr od u cti on
Ad d i n g Di sks To Li n u x
S cen ar i o
Deter m i n i n g Th e Di sk Typ es
Pr ep ar i n g Par ti ti on s on N ew Di sks
Ver i fyi n g You r N ew Par ti ti on
Pu tti n g A Di r ector y S tr u ctu r e On You r N ew Par ti ti on
M i g r ati n g Data Over To you r N ew Par ti ti on
E xp an d i n g Par ti ti on s Wi th LVM
Con fi g u r i n g LVM Devi ces
B acku p You r Data
U n m ou n t you r /h om e fi l esystem
Deter m i n e Th e Par ti ti on Typ es
S tar t FDI S K
S et Th e I D Typ e T o 8 e
M ake S u r e Th e Ch an g e Occu r r ed
S ave Th e Par ti ti on Ch an g es
Defi n e E ach Ph ysi cal Vol u m e
Ru n VGscan
Cr eate A Vol u m e Gr ou p For th e PVs
Cr eate A Log i cal Vol u m e Fr om Th e Vol u m e Gr ou p
For m at Th e Log i cal Vol u m e
Cr eate A M ou n t Poi n t
U p d ate Th e /etc/fstab Fi l e
M ou n t Th e Vol u m e
Restor e You r Data
Get Ou t Of S i n g l e U ser M od e
Con cl u si on
I n tr od u cti on
S etti n g U p Qu otas
E n ter S i n g l e-U ser M od e
E d i t You r /etc/fstab Fi l e
Rem ou n t Th e Fi l esystem
Get Ou t of S i n g l e-u ser M od e
Cr eate Th e Par ti ti on Qu ota Con fi g u r ati on Fi l es
I n i ti al i ze Th e Qu ota Tab l e
E d i t Th e U ser ' s Qu ota I n for m ati on
Testi n g
Oth er Qu ota Top i cs
E d i ti n g Gr ace Per i od s
E d i ti n g Gr ou p Qu otas
Getti n g Qu ota Rep or ts
Con cl u si on
18 of 24 07/20/2009 08:20 PM
Quick HOWTO: Linux Home Networking and Linux... http://www.linuxhomenetworking.com/
I n tr od u cti on
N FS Op er ati on Over vi ew
Gen er al N FS Ru l es
Key N FS Con cep ts
VFS
S tatel ess Op er ati on
Cach i n g
N FS An d S ym b ol i c Li n ks
N FS B ackg r ou n d M ou n ti n g
H ar d an d S oft M ou n ts
N FS Ver si on s
I m p or tan t N FS Daem on s
I n stal l i n g N FS
S cen ar i o
Con fi g u r i n g N FS on Th e S er ver
Th e /etc/exp or ts Fi l e
S tar ti n g N FS on th e S er ver
Con fi g u r i n g N FS on Th e Cl i en t
S tar ti n g N FS on th e Cl i en t
N FS An d DN S
M aki n g N FS M ou n ti n g Per m an en t
Th e /etc/fstab Fi l e
Tab l e 2 9 .1 Possi b l e N FS M ou n t Op ti on s
Per m an en tl y M ou n ti n g Th e N FS Di r ector y
M an u al l y M ou n ti n g N FS Fi l e S ystem s
Acti vati n g M od i fi cati on s To Th e /etc/exp or ts Fi l e
N ew E xp or ts Fi l e
Ad d i n g A S h ar ed Di r ector y To An E xi sti n g E xp or ts Fi l e
Del eti n g , M ovi n g Or M od i fyi n g A S h ar e
Th e N FS Au tom ou n ter
Au tom ou n ter M ap Fi l es
Di r ect M ap s
I n d i r ect M ap s
Th e S tr u ctu r e Of Di r ect An d I n d i r ect M ap Fi l es
I n d i r ect M ap Fi l e E xam p l e
Di r ect M ap Fi l e E xam p l e
Wi l d car d s I n M ap Fi l es
U si n g th e Am p er san d Wi l d car d
U si n g th e Aster i sk Wi l d car d
S tar ti n g Au tom ou n ter
Au tom ou n ter E xam p l es
Tr ou b l esh ooti n g N FS
Tab l e 2 9 .2 S om e Com m on N FS E r r or M essag es
Th e sh owm ou n t Com m an d
Th e " d f" Com m an d
Th e n fsstat Com m an d
Tab l e 2 9 .3 E r r or Th r esh ol d s For Th e " n fsstat" Com m an d
Oth er N FS Con si d er ati on s
S ecu r i ty
N FS H an g i n g
Fi l e Locki n g
N esti n g E xp or ts
Li m i ti n g r oot Access
Restr i cti n g Access to th e N FS ser ver
Fi l e Per m i ssi on s
Con cl u si on
I n tr od u cti on
S cen ar i o
Con fi g u r i n g Th e N FS S er ver
Con fi g u r i n g Th e N FS Cl i en t
19 of 24 07/20/2009 08:20 PM
Quick HOWTO: Linux Home Networking and Linux... http://www.linuxhomenetworking.com/
Con fi g u r i n g Th e N I S S er ver
I n stal l th e N I S S er ver Packag es
E d i t You r /etc/syscon fi g /n etwor k Fi l e
E d i t You r /etc/yp .con f Fi l e
S tar t Th e Key N I S S er ver Rel ated Daem on s
Tab l e 3 0-1 Req u i r ed N I S S er ver Daem on s
I n i ti al i ze You r N I S Dom ai n
S tar t Th e yp b i n d an d yp xfr d Daem on s
M ake S u r e Th e Daem on s Ar e Ru n n i n g
Ad d i n g N ew N I S U ser s
Con fi g u r i n g Th e N I S Cl i en t
Ru n au th con fi g
S tar t Th e N I S Cl i en t Rel ated Daem on s
Ver i fy N am e Resol u ti on
Test N I S Access To Th e N I S S er ver
Test Log i n s vi a Th e N I S S er ver
Log g i n g I n Vi a Tel n et
Log g i n g I n Vi a S S H
N I S S l ave S er ver s
Con fi g u r i n g N I S S l ave S er ver s
Tab l e 3 0-2 N I S M aster / S l ave /etc/h osts Fi l es
Tab l e 3 0-3 N I S M aster / S l ave /etc/yp .con f Fi l es
Con fi g u r i n g N I S Cl i en ts Wi th S l aves
Ch an g i n g You r N I S Passwor d s
Wh en Th er e I s On l y An N I S M aster
U ser s Ch an g i n g Th ei r Own Passwor d s
U ser " Root" Ch an g i n g Passwor d s
Wh en Th er e I s A N I S M aster / S l ave Pai r
Possi b l e Passwor d E r r or s
S eg m en tati on Fau l ts
Daem on E r r or s
Con si d er ati on s For A N on N FS E n vi r on m en t
N I S Tr ou b l esh ooti n g
Con cl u si on
I n tr od u cti on
Th e LDAP Di r ector y S tr u ctu r e
S cen ar i o
Down l oad i n g An d I n stal l i n g Th e LDAP Packag es
Req u i r ed LDAP S er ver RPM S
Req u i r ed LDAP Cl i en t RPM S
Con fi g u r i n g Th e LDAP S er ver
Cr eate a d atab ase d i r ector y
Cr eate an LDAP " r oot" p asswor d
E d i t th e sl ap d .con f fi l e
S tar t th e LDAP d aem on
Con ver t th e /etc/p asswd fi l e to LDI F for m at
Cr eate th e l d ap u ser test accou n t
E xtr act th e d esi r ed r ecor d s fr om /etc/p asswd
Fi n d th e con ver si on scr i p t
Con ver t th e " .l d ap u ser " fi l e
M od i fy th e LDI F fi l es
E d i t th e u ser LDI F fi l e
Cr eate an LDI F fi l e for th e " exam p l e.com " d om ai n
I m p or t th e LDI F fi l es i n to th e d atab ase
Test th e LDAP d atab ase
Con fi g u r i n g Th e LDAP Cl i en t
E d i t th e l d ap .con f con fi g u r ati on fi l e
E d i t th e /etc/n sswi tch fi l e
Cr eate H om e Di r ector i es On Th e LDAP Cl i en t
Ch eck i f l d ap u ser i s M i ssi n g Fr om th e /etc/p asswd fi l e
Cr eate Th e H om e Di r ector y For l d ap u ser On Th e LDAP Cl i en t
20 of 24 07/20/2009 08:20 PM
Quick HOWTO: Linux Home Networking and Linux... http://www.linuxhomenetworking.com/
Testi n g
Con fi g u r i n g E n cr yp ted LDAP Com m u n i cati on
U si n g Tr an sp or t Layer S ecu r i ty ( TLS ) E n cr yp ti on
H ow TLS Com m u n i cati on Wor ks
Con fi g u r i n g th e TLS S er ver
Con fi g u r i n g th e TLS Cl i en t
TLS M ai n ten an ce
U si n g stu n n el E n cr yp ti on
Con fi g u r i n g th e stu n n el LDAP cl i en t
Con fi g u r i n g th e stu n n el LDAP ser ver
Tr ou b l esh ooti n g LDAP Log i n s
Ch eck You r /var /l og /m essag es fi l e
Testi n g B asi c Con n ecti vi ty
Testi n g U si n g l d ap sear ch
U se S S H or th e Li n u x con sol e
U se th e tcp d u m p Com m an d
Testi n g Reg u l ar LDAP
Testi n g S ecu r e LDAP
LDAP Wor ks b u t n ot Wh en I S wi tch to LDAPS
S tu n n el Doesn ' t Ap p ear To Wor k
LDAP_ B I N D E r r or s
Possi b l e stu n n el E r r or s i n Fed or a Cor e 2
Com m on LDAP Ad m i n i str ati ve Tasks
S tar ti n g an d S top p i n g LDAP
LDAP u ser s ch an g i n g th ei r own p asswor d s
M od i fyi n g LDAP u ser s b y u ser " r oot"
Th e M od i fy LDAP U ser S cr i p t
Ad d i n g n ew LDAP u ser s
Cr eate an LDAP Ad d U ser S cr i p t
Ad d th e U ser to th e Datab ase
Del eti n g LDAP u ser s
LDAP Web M an ag em en t Tool s
Con fi g u r i n g RADI U S for LDAP
H ow To Down l oad an d I n stal l Th e Fr eeRADI U S Packag es
S tar ti n g an d S top p i n g Fr eeRADI U S
Con fi g u r i n g Th e /etc/r ad d b /r ad i u sd .con f Fi l e
Con fi g u r i n g Th e /etc/r ad d b /u ser s Fi l e
Con fi g u r i n g Th e /etc/r ad d b /cl i en ts.con f Fi l e
Tr ou b l esh ooti n g An d Testi n g RADI U S
S er ver S etu p
Li n u x Cl i en t S etu p
Ci sco Cl i en t S etu p
E r r or s Wi th Fed or a Cor e 2
Con cl u si on
I n tr od u cti on
Down l oad an d I n stal l Th e S q u i d Packag e
S tar ti n g S q u i d
Th e /etc/sq u i d /sq u i d .con f Fi l e
Th e Vi si b l e H ost N am e
Access Con tr ol Li sts
Restr i cti n g Web Access B y Ti m e
Restr i cti n g Access to sp eci fi c Web si tes
Restr i cti n g Web Access B y I P Ad d r ess
Passwor d Au th en ti cati on U si n g N CS A
For ci n g U ser s To U se You r S q u i d S er ver
M aki n g You r S q u i d S er ver Tr an sp ar en t To U ser s
S q u i d Tr an sp ar en t Pr oxy Con fi g u r ati on
Con fi g u r i n g i p tab l es to S u p p or t th e S q u i d Tr an sp ar en t Pr oxy
M an u al l y Con fi g u r i n g Web B r owser s To U se You r S q u i d S er ver
S q u i d Di sk U sag e
Tr ou b l esh ooti n g S q u i d
21 of 24 07/20/2009 08:20 PM
Quick HOWTO: Linux Home Networking and Linux... http://www.linuxhomenetworking.com/
Con cl u si on
I n tr od u cti on
Tab l e 3 3 -1 : Ker n el s Fou n d On Fed or a I n stal l ati on CDs
Th e Pr os An d Con s Of Ker n el U p g r ad es
Th e Ker n el S ou r ces Packag e
I n stal l i n g Ker n el S ou r ces
Ker n el M od u l es
Reason s For Ker n el M od u l es
H ow Ker n el M od u l es Load Wh en B ooti n g
M od u l es An d Th e g r u b .con f Fi l e
Load i n g Ker n el M od u l es On Dem an d
Cr eati n g A Cu stom Ker n el
M ake S u r e You r S ou r ce Fi l es Ar e I n Or d er
Th e " .con fi g " Fi l e
B acku p You r Con fi g u r ati on
Cu stom i zi n g Th e " .con fi g " Fi l e
Tab l e 3 3 -2 S cr i p ts For M od i fyi n g Th e .con fi g Fi l e
Tab l e 3 3 -3 Ker n el Op ti on Ch oi ces
Tab l e 3 3 -4 Ker n el Con fi g u r ati on Op ti on s
Con fi g u r e Dep en d en ci es
E d i t Th e M akefi l e To Gi ve Th e Ker n el A U n i q u e N am e
Com p i l e A N ew Ker n el
B u i l d Th e Ker n el ' s M od u l es
Cop y Th e N ew Ker n el To Th e /b oot Par ti ti on
U p d ati n g GRU B
Ker n el Cr ash Recover y
H ow To Cr eate A B oot CD
U p d ati n g Th e Ker n el U si n g RPM s
Con cl u si on
I n tr od u cti on
Pr ep ar i n g M yS QL For Ap p l i cati on s
I n stal l i n g M yS QL
S tar ti n g M yS QL
Th e /etc/m y.cn f Fi l e
Th e Locati on of M yS QL Datab ases
Cr eati n g a M yS QL " r oot" Accou n t
Accessi n g Th e M yS QL Com m an d Li n e
Gr an ti n g Pr i vi l eg es to U ser s
Ru n n i n g M yS QL S cr i p ts To Cr eate Data Tab l es
Vi ewi n g You r N ew M yS QL Datab ases
Li sti n g Th e Data Tab l es I n You r M yS QL Datab ase
Vi ewi n g You r M yS QL Datab ase' s Tab l e S tr u ctu r e
Vi ewi n g Th e Con ten ts Of A Tab l e
Con fi g u r i n g You r Ap p l i cati on
Tab l e 3 4.1 Req u i r ed PH P an d Per l RPM s for M yS QL S u p p or t
Recover i n g / Ch an g i n g You r M yS QL Root Passwor d
M yS QL Datab ase B acku p
M yS QL Datab ase Restor ati on
M yS QL Tab l e B acku p an d Restor ati on
Ver y B asi c M yS QL N etwor k S ecu r i ty
B asi c M yQL Tr ou b l esh ooti n g
Con n ecti vi ty Testi n g
Test Datab ase Access
A Com m on Fed or a Cor e 1 M yS QL S tar tu p E r r or
Con cl u si on
22 of 24 07/20/2009 08:20 PM
Quick HOWTO: Linux Home Networking and Linux... http://www.linuxhomenetworking.com/
I n tr od u cti on
VPN Gu i d el i n es
S cen ar i o
Fi g u r e 3 5 -1 Op en swan Top ol ol og y Di ag r am
Down l oad An d I n stal l Th e Op en swan Packag e
H ow to g et Op en swan S tar ted
H ow to fi x com m on S tatu s er r or s
I P for war d i n g
Op p or tu n i sti c E n cr yp ti on DN S Ch ecks:
VPN Con fi g u r ati on S tep s ( U si n g RS A Keys)
Th e /etc/i p sec.con f fi l e
Tab l e 3 5 -1 Par am eter s of th e /etc/i p sec.con f fi l e
Ob tai n i n g RS A Keys
Cr eati n g You r Own Keys
Get Th e Left Pu b l i c Key
Get Th e Ri g h t Pu b l i c Key
S om e I m p or tan t N otes Ab ou t Th e /etc/i p sec.con f Fi l e
Restar t Op en swan
I n i ti al i ze Th e N ew Tu n n el
Testi n g Th e N ew Tu n n el
Possi b l e Ch an g es To I P Tab l es N AT/M asq u er ad e Ru l es
H ow To E n su r e Op en swan S tar ts Wh en Reb ooti n g
U si n g Pr e-S h ar ed Keys ( PS K)
Tr ou b l esh ooti n g Op en swan
Deter m i n e th e Tu n n el S tatu s
Testi n g VPN Con n ecti vi ty
Ch eck Th e Rou tes
U si n g TCPd u m p
Pr otected I n ter face TCPDU M P Ou tp u t Fr om " vp n 2 "
U n p r otected I n ter face TCPDU M P Ou tp u t Fr om " vp n 2 "
Ch eck S ysl og E r r or M essag es
" I n val i d Key" M essag es
Con cl u si on
I n tr od u cti on
Fed or a Cor e 3
Li n u x S ecu r i ty Wi th TCP Wr ap p er s
Th e TCP Wr ap p er s Fi l e For m at
Deter m i n i n g th e TCP Daem on ' s N am e
Ad d i ti on al TCP Wr ap p er s H el p
Ad j u sti n g Ker n el Par am eter s
Ru n n i n g Li n u x Wi th ou t A M on i tor
Pr ep ar i n g To Go " H ead l ess"
Con fi g u r ati on S tep s
Tab l e I .1 H ow Ph ysi cal COM Por ts M ap To Li n u x TTYS Devi ces
M ake You r Li n u x B ox E m u l ate A VT1 00 Du m b Ter m i n al
Con fi g u r ati on S tep s
VPN Ter m s an d M eth od s
Fi g u r e I .1 Tr an sp or t m od e AH p acket for m at
Fi g u r e I .2 Tr an sp or t m od e AH / E S P p acket for m at
Fi g u r e I .3 Tu n n el m od e AH p acket for m at
Fi g u r e I .4 Tu n n el m od e AH / E S P p acket for m at
Au th en ti cati on an d E n cr yp ti on m eth od s
I n ter n et Key E xch an g e ( I KE )
Pu b l i c E n cr yp ted Keys
Pr i vate S h ar ed keys
I KE ' s r ol e i n cr eati n g S ecu r i ty Associ ati on s
VPN S ecu r i ty An d Fi r ewal l s
23 of 24 07/20/2009 08:20 PM
Quick HOWTO: Linux Home Networking and Linux... http://www.linuxhomenetworking.com/
S u b n et Cal cu l ator S cr i p t
Ap ach e Fi l e Per m i ssi on s S cr i p t
S en d m ai l S PAM Fi l ter S cr i p t
I Ptab l es B asi c I n i ti al i zati on S cr i p t
I Ptab l es Fi r ewal l As A Web ser ver S cr i p t
I Ptab l es I P M asq u er ad i n g S cr i p t
I Ptab l es Por t For war d i n g S cr i p t
I Ptab l es Com p l ex scr i p t
DN S Zon e Fi l e For m y-si te.com
DN S Zon e Fi l e For m y-oth er -si te.com
For war d Zon e Fi l e For A H om e N etwor k U si n g N AT
Rever se Zon e Fi l e For A H om e N etwor k U si n g N AT
S en d m ai l S am p l e /etc/m ai l /access Fi l e
S en d m ai l S am p l e /etc/al i ases Fi l e
S en d m ai l S am p l e /etc/m ai l /l ocal -h ost-n am es Fi l e
S en d m ai l S am p l e /etc/m ai l /sen d m ai l .m c Fi l e
S en d m ai l S am p l e /etc/m ai l /vi r tu ser tab l e Fi l e
I n tr od u cti on
Ci sco Rou ter s
Catal yst CAT S wi tch es r u n n i n g CATOS
Ci sco Local Di r ector
Tab l e I V-1 S ysl og Faci l i ty an d S ever i ty N u m b er i n g S ch em e for Local Di r ector s
Ci sco PI X Fi l ewal l s
Tab l e I V-2 S ysl og Faci l i ty an d S ever i ty N u m b er i n g S ch em e for PI X Fi r ewal l s
Ci sco CS S 1 1 000 ( Ar r owp oi n ts)
Th e S am p l e Ci sco sysl og .con f Fi l e
LXer
Oth er S i tes
24 of 24 07/20/2009 08:20 PM