You are on page 1of 614

/

. )(

)(
.

((
)

2013

. )(

. )(

.UAB

.UAB

.UAB

.UOC

(
)

.
.KDE

:


.
2013


GNU FDL 1.2


.

" ."GNU FDL
saf1 .
.
Copyright 2013, Abdalrahim Fakhouri & Linux Arabs Community.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2
;or any later version published by the Free Software Foundation
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
Texts. A copy of the license is included in the section entitled "GNU
Free Documentation License".
The design of the cover belongs to the member saf1 in Linux Arabs Community.
All trademarks and copyrights refer to their respective owners.

.
Free Technology

Academy /

.
!




23/3/2013

10 1434



.
ICT

. Free Software Open

Source Libre Software .

.

.

) (

. ) Free Technology Academy (FTA


FTA .
.


/

) IRC #linuxac .(freenode.net


.http://www.linuxac.org

FTA
.

.
.
.


2008 LLP

Free Knowledge Institute ) Open Universiteit Nederland :(

) Universitat Oberta de Catalunya( ) University of Agder(.


Open Educational
Resources copyleft .
.


Universitat Oberta de Catalunya

LibreSoft .Universidad Rey Juan Carlos 2008


" SELF

. 2009 .


/ .


) (
/ .

. .

.
:

.http://ftacademy.org/materials/fsm/2

.http://ftacademy.org :

. .
!



Wouter Tebbens

11

68

107

156

209

293

359

419

454

519

556

594

) GNU FDL (

607

/ ) (8 1991

. ) (kernel .

FSF 1984 GNU .

) (FSF ) (source code

.
/ .

FSF / )
(... HP IBM Sun /
.

/ . .

40.



:
) (
(1
.

(2 : )(code
.

(3

(
(4 )

.
.

. " "
.1997
. " "
1

FSF

. /

:

"" ./ .

.

free "" ) ( ""


) ( .

: ! .

. :

1 " " .
http://www.catb.org/esr/writings/cathedral- :
.
bazaar/cathedral-bazaar/ar01s03.html

.
.

) ( .

.
.

. / 1997

/ Open Source Initiative OSI

.
.


.
:

.

(1
(2

.
.

.
(3
.

(4 patch


.
. .

(5 . .


(6 .

.
.

.
(7
(8 .

.
.

(9

) (
.

.
(10 .

.
FTP .


.

.

OSI .

GNU General Public License GPL


.


GPL


.
. LGPL

Linux C LGPL GPL


LGPL .

: ) (BSD ) MPL NPL ... (Netscape .


GPL

(1 :

) ( )

( ) (

.
(2 .

(3
.

(4 .
(5
.

(
)

Sony VHS
)

MicroChannel PC .(IBM :

) ( ....

(6

%70-60


.
)( .

(7

.
( .
)


2
/ .

) (


PC .

/ /

.
/ ) TOP500 (http://top500.org MareNostrum

10240 CPU PowerPC IBM /


. /

.%75

1969 Bell Telephone Labs


BTL AT&T . MULTICS

BLT General Electrics .MIT

BTL MULTICS
DEC PDP7 )
2 2009 ) / (2012
462 %92.4

.(Loading Program ) ( ) (



. .


) ( . )

( )
( .PDP11

1969 30

.
RAM

. ) (.
) Troff .(man pages

BTL BTL
.

:
.
.

/ 1971

. )/ (1972 ) V2

.V5
1973 .

. AT&T
.

USENIX users of
.
.
.UNIX 1974

. 1975 .
) Sun Microsystems

( .

EX

VI . .
.BSD

BSD : .

.BSD


vi


TERMCAP

. 1977

PDP Interdata .IBM

V7 1979 . awk, lint, make, :

400 .
uucp 400

C BTL .

C .

) (bourne shell .find, cpio, expr :


: Xenix

Intel
SCO
) 8086 IBM( BSD ...

V7
AT&T
.

.
.




1991
AT&T Minix
.

BSD )

(4.1 SUN Microsystems BSD 4.2

SUN SunOS .1983
: IBM AIX DEC Ultrix HP

HPUX SCO ... Xenix . 1980

AT&T " " UNIX System V . SV


3


.BSD 4.x SV

System V AT&T BSD .


SV BSD

. IEEE POSIX
UNIX97 FHS.
System V AT&T BSD

. .

AT&T )
(

: 1990 Open Software Foundation

3 SysV

OSF UNIX International UI UNIX Systems Laboratory USL

BSD
. SCO

OSF SCO .
SCO IBM SCO


SCO

. SCO

IBM
. .

:1

1991 ) 1995

(1999
.


. /
4

/ .

.
:
: SUN (1 ) .(SunOS BSD
5

System V BSD SPARC Sun


64 . Sun /
.

: .

.
OpenSolaris

. 2006
6

GPL .OpenJDK

4 1991 1999 .
Sun Oracle .
5
6 OpenIndiana OpenSolaris .Sun


:BSD (2 BSD

FreeBSD NetBSD ) OpenBSD ( trustedBSD


.
. /

BSD 4.4 Apple


.MacOS X
(3 : /
/ . ) (1980 Xenix
7

AT&T

SCO Xenix 1987 SCO UNIX .1989

SCO .

SCO
.IBM 2006
) SuSE (OpenSuse

.
/ .

UniSys

"" )

.FreeBSD
( .

7 VirtualPC .DotNet

/.

3 /
.
Microsoft DOS .

. .

Minix - 1984

Minix Intel 8086

.IBM
(C
)
. .

FSF GNU

HURD .

/ 1991

0.0.1 . Intel 386

GPL .
.


(1 :
GPL .

(2 ) ( : ) (

GCC GNU .
C

/ x86 : IA86 x86

x86_64 AMD Sun MIPS Silicon powerPC


IBM S390 m68k Vax ARM ... HPPArisc




(3 :Monolithic
. Microkernel

) (Mach )( .
)

( .
.
) (modules
(4 ) (modules :
) ( .

.

8


8 hybrid
.

) (.
(5 )( :
) (

. .

FSF

GCC ) Xfree (X Window



KDE .Gnome MySQL

PostgreSQL /

/ . /
.

/ ) (

.
/

/ .
FSF

.
.

/ .

.


1991

. HURD
/ ) " " (.

/ %28 %3
.
/:
C++

) Emacs .(GNU Emacs

postscript .ghostscript

C GNU C Library .glibc

makefile

GNU assembler

GNU Linker

Bash

gdb

GNU make
gas

gld

BSD .
/

MacOS X .

/.

4


.

: .

.
. :

CAD
.

.
.
.

) (

.
.


.
)

)
( .
( .
.


... .



.


.


.
) ( :
... .



. ) /( )

) /(
( .

. ) (

.
.
:

) ( .

(1
.

(2 /

.

.
(3
.

(4 ) (
.
(5 /
.

) (.

( )(
)

switches bridges
hubs .
.

) (
.



(1
.

)
(2
( . 3 5.

(3 . TCP/IP ftp, telnet, ssh, http,


9

... nfs, nis, ldap.

9 : protocol

(4 shell :
10

scripts Perl TCL Python C C++

.
(5

(6
.

(7 ) /( Solaris, AIX, AT&T System


V, BSD.
(8 :
9x/NT/2000/Vista/Se7en Mac OS VMS IBM.

(9
. )( .
(10 :
.

(11 SQL.
(12 / .

10 script(ing) languages interpreter


.

5
/ ) ( :
. / ) (


.

.

) ((:
(1

] [
:

(2

.
:

.

.

(3

(4

: )

( .

(5

:
) (

) ( .
.
(6

(7


.
(8

.
) ( ] [
crontab at.

(9

:
.

(10

) (modem :
:

) (modems ) ISP

(
.

/
Ctrl Alt .F1 F12
(11

:log

.

.
(12

: .

(
)
.

(13


: . /


(1

DSL ] ISDN .[3G


.

(2

(3

)( .

.
(4

: .

) ( . DNS DHCP LDAP


...

(5

:NIS .

.
. NIS NIS+ LDAP
.
(6


:NFS


) ( .

. ) (NFS

.
(7

.
r remote rcp, rlogin, rsh, rexec :
.

(8

11

:
) telnet ( ) FTP ( .
: telnet FTP ... web.

(9

:
. .

(10

.


.

.
/

11 r / ssh s
.

(11

: X Window / ) (
.

. X

. X

) ( .

6 /:
/ .

/ :

(1 : .
.
(2 : FSF
emacs ) (gcc .


(3 : .

X Window ... .
.

. /
.

)(
)(

/ . /

:
X Window
.
/
.
/

) (
.
:
12

:

.1 :
x 26, 3x )
.(x

.2 X Window
/ Xorg ) (2003
.[Xorg
Wayland
]
.3 : 3x
.4xy
36 34
34 .48

.

:


(1 : X.Y.Z X
Y :

. Z

12

X.Y .

. ) 2.4 (2.6

)
) (2.6
( .

Z ) ( .
)
.

( ) rc ( mm

git snapshot .
.

(2 : .


. RPM DEB tar.gz


.

.

(3 : " / ) (

./ ) ( FHS

) ( .

(4 : / ) shell

(scripts )(

. SysV ) BSD

.
(

)
( . ) ( SysV

) ( BSD

. ) Upstart ( .

13

) (
(5 :
. ) (libxxx.a

) .(libxxx.so

.

) ( . C ) .(glibc


.
glibc

glibc

.


glibc 2.0

13 systemd SysV
. Upstart

bsd systemd .

2x .

glibc

) .(package-xxx-glibc2.rpm :

(6 :X Window X Window / . MIT


1984 . /
] Xfree86 [ .Xorg X Window


.
.

) ( : (gtk+) +

) (QT .

XFCE, Motif, Enlightenment, BlackIce, :


FVWM .

(7 : )
( .

) 50
DVD .(BlueRay
.

) (

6.1

:2
.
1993 / .

.
" "
.


" /"

.
.

: .

/
...
.

14

14 .

= =

. .

) ( . .
.

) ( . :
. ) (

) (

) (CD, FTP, web APT


.

.DEB ]) ( [:
(1

Etch

(2

Lenny

(3

Sid

Sarge 3.1r6 .Woody 3.0 2007


/ .Etch 4.0 . ]

[ Sid )( )

( / .

10 20 ) (.
Etch

) ( .

.
) :
(1

)( 53 1 ) 8 (DVD

) (

) (netinstall CD

. )
( debian.org .

(2


.ATP

(3

: 26x 3x

3x .

) (.
(4

: .APT
.DEB APT

. APT .CD, FTP, web :


(5

) (APT sources
APT

) (debian.org .

(6

eglibc .Xorg

(7

) 36( .48 379 .410

(8

/
gcc
:Sid ) emacs (xemacs
.

(9

.KOffice

(10

./etc/

(11

grub-legacy .grub2

(12

TCP/IP inetd

) .(/etc/inetd.conf

.
xinetd
(13

/
. Knoppix
) (

/
Linex .
.

) (

:

. linex
.
.

:3 Sid 2.14

6.2

Red Hat Inc /


. Bob Young Marc Ewing .1994

.
) :( )
( ) Enterprise (.

.

:4

.
) (

) (2003 ) (9x

.
/

) ( .


. .
) ( ) freespire .(Linspire

) (

.
.
)(

BlueCurve )
(.

.
.

.(Red Hat Enterprise WS, ES & AS


:

(1 .

. .DVD

(2 : 3x rpm yum )


( .
.

(3 : RPM Redhat Package Manager


rpm ) yum ( RPM .

) DEB ( . RPM
rpm

)(

. RPM

(4 ) System V
(.

15

(5 Xorg : glibc.

15 systemd System V . systemd

System V.

(6 )( .
(7

gcc
/ : ) (emacs

/ .
(8 .KOffice
(9 ) yum ( APT
RPM .

(10 Grub .
(11 TCP/IP xinetd ) inetd
(/etc/inetd/conf . xinetd

) .(/etc/xinetd.d

(12 kudzu .
API HAL

udev .

(13

:(Mandrake

) ( .

) ( ) Scientific Linux

( . RPM
.SuSe

:5

:

(1
. /.

.
(2
.
(3 RPM

yum .

16

(4 ) ( .

16 .

7 ...
"" /
/.

/ .


. .

.
:

(1

/

/ :

(2
. /
.
/ .

(3
.

(4 " " .

.
(5

.
(6
/ .

(7
/
.

(8 / .

.


.
(9 /

.
(10

) (

. /

:
(1 :
http://www.debian.org/social_contract
(2 : linex .
www.distrowatch.com

. ISO

:
.

] [LDP The Linux Documentation Project LDP


/.

] [ODSb .
] [Sla .
] [New] [Bar .Open source News
] [Fre] [Sou .
] [Dis / . ISO
/.

] [His][Bul][LDP .
] [Mag03][Jou03 /.


/
. /

. /

/.
/ .

/ .

1 :
/

:
.

(1 : .
.
(2 :
.

(3 : render
CAD.
(4 : .
/ .

/ :

"
"" "

. /
.

Sharp Zaurus

) ( .
) .(POS GP2X
Playstation .Sony
moblin .

/.

(1

.
Sun SPARC IBM RISC ) Silicon Graphics(
.

) Silicon (Sun ) IBM .(Sun


) (
/ .

(2

. )
(
10

. ) (

) (

) (
.



) SMP

(.
) ( )( :
: .
.

:
.
: )
(.

:
.
: .
: ) ( .
:

.

:
.

.
:
.

.
:
.

: .
1

(3 )
(.

) / (:
: :
Calligra
.
) Koffice ( Gnumeric AbiWord
) (.
: konqueror epiphany.
) USB .(...
. .udev )

( . / :
) Gimp ( Sodipodi, Xine, Mplayer, gphoto .

) ( . /
TCP/IP FTP telnet X Window
( VNC
) rdesktop

) (.

1 : .filtering

2 /
.
/
/
) (:
(1 : /

TCP/IP rlogin telnet


.ssh / .

X Window .

VNC . /
) Servlets (Tomcat JSP, PERL, PHP, xml,

webservices . BEA Weblogic IBM Websphere


) Jboss( /.

(2 : FTP
NFS .

(3 : / /

MySQL PostgreSQL Oracle IBM DB2K

(4 : TCP/IP .CIFS/

(5 : ) POP3 (IMAP

) (MTA ) Sendmail ( Exim

SMTP .
(6 : http] .[httpd
Tomcat servlets .... JSP

(7 : NIS +NIS LDAP


.
.
(8 : DNS IP Bind
) (.

(9 : .
Xwindow : VNC
rexec, rsh, ssh.

(10 : DHCP TCP/IP IP


) ( .
(11 : ) ( .
.
. / .Squid

.
.PPP

(12 : .
.
/ ipchains ) iptables( .

3
/ .
/ :
(1 :
/
.

:/ .

.

.


.

. .

Ethernet .

NFS .

ISP

: PPP .
.
winModems . )

) ( )(.

:ADSL PPP
.EoPPP : .USB


ADSL :
.ADSL

.
FTP

telnet .

) ( ) ssh, telnet, FTP, X

Window, VNC(

IP .
.
2

.
(2 : .
(
) LAN

)
.

( .
2 Dynamic DNS .
.


) ( .


. NFS / )

.
(3 :
NIS NIS+ LDAP

) .(TCP/IP

4
/ .
/

) (.

.
.

/
.
:

. .
/ :
(1 : . /

(
)


1500 3000

/ .

/
. / )

(
.

Total Cost of Ownership TCO


.
(2 : /


/
)
./
Howto(

.
.

( .
) (


/

4.1


. / .
/


.
. .

(.
/

/ ) (.

. " "
) server message block SMB NetBios
.(NetBEUI ) CIFS (common Internet file system
( .
) SMB
) ( )
( . NFS
.TCP/IP
NetBios ) NetBEUI
NetBios (TCP/IP
.
/
.
.

) SMB/CIFS (

) ( )NTLM,
(NTLMv2, Kerberos .Active Directory
) .(Active Directory


/ .
) (
)winbind, kerberos,
(nss_ldap ) .(OpenLDAP

4.2

:

(1 .
.
.


/ .


. )
(.

) ( /

Microsoft IIS
:ASP

.
. / ) (
ASP ) Perl Visual Basic C#
(Javascript ASP .
.
) ( .PHP
) Mono ( .NET /
API .NET C# .ASP.NET
.NET .
DotGNU FSF GPL.


: Microsoft SQL Server
.
Oracle ) DB2 (IBM
. PostgreSQL MySQL
.
) ( /
:
servlets applets EJP LAMP
/ MySQL .PHP

(2 :

) ( . )

( / )
(.

3 portability ) (
.

(3 : /

) (
.
.

) ( : .

. ) (
.

X Window

/ : . )

%95 (.
/ .

.
4

:
:
/

: :

4 .

. .

. /
) ( .

. /
.

( .
) ( .


) (

: / ) (daemons
ASCII .

.
:
.

) ( )( ) ( .

) ( .

) RTF (

) XML (XML PDF

) (

ISO .

)( Office 2007 .OpenXML

. .
) ( /

5 LibreOffice The Document Foundation


.
ODF 2010 .

) (Intel x86 MS-DOS


.

/.

/ Linex
.

5 :

) (.
:
(1 /.
(2 .
(3 /.

5.1

/.

/ .

:
.

.
)( /.


.
" " ) (

. /

/
) CD/DVD BIOS ( .

/ )

( .

][ /
/ .

FAT32 )

( .
.
) NTFS (

/.
/ )

( . /


. .
6

(
. :

6
. .

) ( .

.
(4 :
mtools MS-DOS
MS-DOS . MS-DOS
mcd, mcopy, mdir, mdel, mformat, mtype :.
" m

(5 : .

/ FAT FAT32 ) NTFS


ntfs-3g ( .


/mnt/Windows/

. ASCII
: )

( ) ( )

.(13
. emacs /
) .(duconv, recode, dos2UNIX, UNIX2dos

(6 : MS-DOS ) ( ./
MS-DOS Dosemu DosBox .

(Internet Explorer
)

.
Win4Lin CrossOver

.Cedega
VMWare VirtualBox
VMWare . VirtualBox

/ /
/ . Qemu

KVM .Bochs
VMWare Xen OpenVZ Vserver

)
( .

) / ( /
.


Office ) Koffice ( Gnumeric ) AbiWord( .
. Xine

.Mplayer /.

5.2

) ( :

" " . :
) (.

: ME, NT, XP ,98

) ++(.

) (TCP/IP

.

CD

Sun Microsystem's SPARC Solaris

) (Sun .
NFS NIS+

/
.

) ( .

:
(

(7 .
) (SCSI .

. ) (:
/ . SPARC

. /

.
Sun
/ .

(8
.

/ .

gcc
++ ++
IDEs ) Kdevelop Anjuta(

Sun / ) IBM's Eclipse


.(NetBeans

(9 /

/ . :

) Thunderbird
Kmail Evolution ( .

.
/ .

(10 ) TCP/IP (
.

(11 / .
.

(12 .
.

5.3

.

/.
.
GROUP PRINTER DATA

D . IP
192.168.1.254 192.168.1.1 )

192168xx (.
SMB/CIFS /.

.
/ / .

) ( smbd .nmbd

smbd . nmbd
) NetBIOS .(IBM )

NT/2000/XP NetBios .(TCP/IP nmbd WINS

NT/Server DNS

: IP
DHCP .

DHCP ) NetBios : (
WINS NetBios WINS

IP . nmbd /.

.
.

/ )

(smbfs . cifs
2.6.20 smbfs . cifs
) CIFS .(SMB smbfs cifs

) mount -t smbfs .(mount -t cifs


cifs smbfs .

smbfs ) (smb.conf

.(mount
cifs )

. .samba, samba-common, smbclient, smbfs :

swat . /
D ) (
/home/DATA/ FTP
.

/ .

(1

) host ( :

smbmount //host.carpeta /mnt/windows

(2

:
/mnt/windows/

(3

:
smbumount /mnt/windows

:
smbclient -L host

smbclient //host/folder .ftp


mount
) smbxxxx( smbfs ) cifs (

) / (
.

. ) ( /etc/smb.conf ./etc/samba/smb.conf

.
.

. )

(.
9x
.smb.conf :

(1 ) General (.
(2 ) Browser (.
(3 ) Share (
) .(man smb.conf

) ' '# ';' : ';'


';' (:
workgroup = GROUP

.
)Server string = %h server (Samba %v

. h v

. v
.
Hosts allow = 192.168.1

192.168.1.1 .192.168.1.255

printcap name = /etc/printcap

printcap /
.
guest account = nobody

/.

Log file = /var/log/samba/log.%m

. ) m (.
Encrypt password = true

. 98 NT.
/etc/samba/smbpasswd .

.smbpasswd UNIX password sync


) ( .
:Share definitions
][homes

. ';'

.
".yes

) partition (

) ] .([cdrom

DATA /home/DATA/
D
.

.
) /(
:

) / .(/var/spool/samba/PRINTER printable = yes


. ) (.

. :
/etc/init.d/samba restart


(1 /

(2 ) (

(3 VMWare Workstation VirtualBox


. www.vmware.com

.www.virtualbox.org ) ( /
) ( .

(4
/ .



] [LDP
.
/
] [Mor03
.


/ .

.
.

.

. /
/ . ) LSB (Linux Standard Base FHS

) (Filesystem Hierarchy Standard


/

) shell scripts (

) ( .
.

) ( .

.
/ .

.
.

/ . " "

) ( .

/ .


: /
..



.
/ )

( . .
.

/ .


. :
.1 .
.2 .

.3 "
".

.4 .
.

.5
.

.6
.

.7 ) ( :

!

.8 .
)

( .
) (

2
/

/ FHS
) ( LSB

.
FHS " /

. - -

. /
.
.
:
:/bin/ .1
) /bin/ls ( ) (/bin/bash .

:/boot/ .2 ./boot/vmlinuz
:/dev/ .3
. /dev/console /dev/modem /dev/mouse

/dev/cdrom /dev/floppy
/dev/mouse : /dev/psaux PS2

/dev/cdrom /dev/hdc IDE .

IDE /dev/hdx /dev/sdx x .

/
) hotplug (udev /dev/
.

:/etc/ .4 .
/etc/passwd : .

) /home/ .5( : .

:/lib/ .6 ) (a. ) .(so.


libc.so .libc.a
)( ./lib/modules

/mnt/cdrom/ :
:/mnt/ .7 mount
.

:/media/ .8 .

:/opt/ .9 ]
[ ./usr/local/

/sbin/fsck :
:/sbin/ .10 . ) ( .
.

:/tmp/ .11 .
.

:/usr/ .12 .
) (/usr/share/ )/

.(/usr/share/doc /usr/local/ ]

[.

:/var/ .13 / .
/var/log/ /var/spool/mail/
./var/spool/lpd

FHS /usr/ /

/var / )
.(FHS

/ FHS .
/usr/ ./var/ /etc/ /opt/ /usr/local/

. ./etc/

) LSB ( .
.
LSB . /.

3
.

man .1 . /
.

:
man command

.2 .

.
:

man n command

n .
xman tkman

. apropos
man ) (.

Info .3 . .
.

.4 : man
. /

)
) /usr/share/doc (/usr/doc/

(.

.5 .

HTML .PDF .

./usr/doc/
dwww dhelp . .

.6 X
) devhelp

(.

4
shell
""

/ . .

)( .

/ .


.X

: . /


) xdm : (X Window ) gdm( ) kdm(

. X Window ] [
. .
.

telnet, rlogin, ssh .X Window


:1

4.1

:
.1

.3

/ "| )&(.

.5

wildcards * ? $.

.2

.4



) while

for(.
.

:
.1

.2


:2

handles .

: ) ( 0
.1
) (.

.2 : .1

.3 : .2

.

:
/
.1 :
.
.

/ .
0 1

.2 : .
.pipeline

.3 :
.
.
/:
.1 : .
::
command op file

op ) (:
.
< :
> : .
>> : ) > (.
.2 : :

command1 | command2 | command3

.3

) :(.

.4 : &

. ps

.
: kill -p PID PID PID .
.ps

4.2

) ( .

.1 ) Bash .(Bourne-Again Shell / .


.2 ) Bourne Shell .(sh
. )( . / Bash


AT&T .

') '$ .(#

.3 ) Korn shell .(ksh ) (


) AT&T ( C

. .$

.4 ) .(csh

) (alias.

' .'%
.

) (.

.5 .

Bourne Again Shell Bash / .


. ) (
. .

1 zsh .

$SHELL

echo $SHELL
:

.1

( )
)

.2

. . .

( .


) /( .
/etc/passwd .chsh -l
) .(/etc/shells

.3
.4

/bin/ / ) .(/usr/bin/

) ( . man

) (man bash

.5

) (

.6


) ( H

.7

cut, sort, cat, more, echo, grep, wc, awk, sed, :


,mv, ls, cp

) (
. .sh, bash, csh, ksh

..


:
/ ) . ( .

) .(sh sh csh .ksh

: sh ksh ) .profile . (
csh ) .login
ksh .kshrc

(.
( ) .logout ( ) .cshrc .profile
.bashrc .bash_profile /etc/profile

. . )

(/etc/skel/ ) " ( .
) (sh

. /
.
file file sciptname

#!/bin/name name bash, sh, csh, ksh


( .
)

) :(
.

4.3

(
) echo

HOME

/home/abdo/

)(

LONGNAME

Abdalraheem

PATH

/usr/local/bin:/usr/bin:/bin/

) (

SHELL

/bin/bash/

PS1

) (

MAIL

/var/mail/abdo/

TERM

Xterm

PWD

/home/abdo/

:
.env

2 .. .

$ env
SSH_AGENT_PID = 598
MM_CHARSET = ISO-8859-15
TERM = xterm
DESKTOP_STARTUP_ID =
SHELL = /bin/bash
WINDOWID = 20975847
LC_ALL = es_ES@euro
USER = juan
LS_COLORS = no = 00:fi = 00:di = 01;34:ln = 01;
SSH_AUTH_SOCK = /tmp/ssh-wJzVY570/agent.570
SESSION_MANAGER = local/aopcjj:/tmp/.ICE-unix/570
USERNAME = juan
PATH=/soft/jdk/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games MAIL =
/var/mail/juan
PWD = /etc/skel
JAVA_HOME = /soft/jdk
LANG = es_ES@euro
GDMSESSION = Gnome
JDK_HOME = /soft/jdk
SHLVL = 1
HOME = /home/juan
GNOME_DESKTOP_SESSION_ID = Default
LOGNAME = juan
DISPLAY = :0.0
COLORTERM = gnome-terminal
XAUTHORITY = /home/juan/.Xauthority
_ = /usr/bin/env
OLDPWD = /etc

4.4

[Bas ].[Coo

:
#!/bin/bash

:

.1

chmod +x script

.2

:
/bin/bash script

4.4.1
:
variable = value

:
echo $variable

' '$ .
) ( .

.

:
.1

.2

var = value
export var

export var = value

:
:N$ $1 .1 .
:$0 .2 0 .
:$* .3 1 N .

:$ .4 ) ( : .
:status :$? .5 . 0
.

.6 .
.7 .

.8 ) (`command` :

. .

` var = `ls ) (ls .$var

4.4.2
test expressions ] [expression.
:
.1 -eq, -ge, -gt, -le, -lt, -ne : ) ( : "="
.

.2 := : =! -n -z : 0
.

.3 .-d, -f, -r, -s, -w, -x : :


.

.4 -a, -o ,! : ) NOT( ) AND (-a ) OR .(-o

4.4.3
:
.1 .
.2 ) .(man bash :

.3 ) for while( .
:
.1

if then : .
]If [expression
then
commands
fi

.2

if then else command1

:command2

] if [expression
then
command1
else
command2
fi

.3

if then else if else if:


] if [ expression
then
commands
] elif [ expression2
then
commands
else
commands
fi

.4

case select

case string1 in
str1)
commands;;
str2)
commands;;
*)
commands
esac

: for

.5

: while

.6

: until

.7

:functions

.8

for var1 in list


do
commands
done

while [ expression ]
do
commands
done

until [ expression ]
do
commands
done

fname ( ) {
commands
}

:
fname2 ( arg1, arg2, argN ) {
commands
}

fname2 p1 p2 p3 pN fname :

) (

) http .(ftp

: . :base
) (

) ( . . : . :

: ... . :
. .

:
.1 ) ( : ) (
)( .

) (
.2
.

.3 :
...

) RPM (DEB

) (.tgz .
.

5.1

TGZ

TGZ . /

) ( . tar

.tar gzip .tgz . .tar.gz

.tar.bz2 gzip bzip2 .

.
/ .

) (

BSD /.

) 1.4 ] [(:
mozilla-i686-pc-linux-gnu-1.4-installer.tar.gz

mozilla ) i686 Pentium II (


i386 i586 i686 ) k6 (amd k6 ) k7 (amd athelon amd64

) x86_64 AMD64 64bit (em64t ) ia64

(Itanium ... ,sparc, powerpc, mips, hppa, alpha :

. PC 1.4.
:

mozilla-source-1.4.tar.gz
source ""

:/Solaris,

Irix, BSD

:
(:
)
(1
tar -zxvf file.tar.gz
) (.tgz

x v f
tar z

z
gnuzip file.tar.gz
) (tar
tar -xvf file.tar.gz

(2 tgz

readme install .

.

) ( .

) cp -r ( ) (mv .

. .

.
) autoconf autoconfiguration ( )
(:

.
:./configure .1
'= ) '--prefix ( .

:make .2 .

:make install .3
.

makefile/


tgz
:
.
compact
"dir ) tar -cvf dir.tar dir : c
dir (dir.tar ) gzip dir.tar ( :
tar -cvzf dir.tgz dir

.dir.tgz
) tar

(.

/ : RPM

5.2

RPM
.

.
RPM :
package-version-rev.arq.rpm

package version rev RPM

arq i386, i586, i686,


x86_64, em64t, ia64 AMD ... alpha, sparc, ppc noarch

src .
rpm .
RPM:
.1 : -q ) -p
.(rpm -q


.-qa
:

RPM

rpm -ql

rpm -qi

rpm -qR

.2 : rpm -i package.rpm http ftp

http:// ftp:// .
.

rpm . rpm )
( --force --nodeps
.

) (rpm : . ..

. .

. .RPM
.3 : rpm -U
package.rpm .

.4 : . rpm

. rpm -V package

.
rpm -Va

.5 : ) RPM -e (--erase
.


rpm -i ftp://site/directory/package.rpm

ftp .

md5
. .
3

) GPG (PGP .

RPM
.RPM

GPG

) ( .

) ( PGP .

RPM :
$ rpm --import GPG-KEY-FILE

GPG-KEY-FILE GPG
md5 . :
$ rpm -qa | grep ^gpg-pubkey

:
$ rpm -qi gpg-key-xxxxx-yyyyy

:
RPM
$ rpm --check-sig -v <package>.rpm

:
$ rpm -K <package.>.rpm

. RPM

3 " " "" hash "" .


.

RPM ) ( RPM

. ) DEB (

) RPM rpm( . RPM

RPM DEB
alien
.

YUM
) (
RPM . YUM
) (/etc/yum.conf .
4

YUM:
/etc/yum.conf 5

/etc/yum


(
)
.gpg

/etc/yum.repos.d

yum:

>Yum install <name

>Yum update <name

4 YUM /etc/yum.repos.d/

yum
. /etc/yum.conf
.

5 . /etc/yum.config /etc/yum.conf 11 .


) !(




>Yum remove <name


>Yum list <name
>Yum search <name
>Yum provides <name
Yum update
Yum upgrade

YUM pup

.pirutas yumex yum.

5.3

: DEB

tasksel :

X dselect )

( . .APT
dpkg ) (rpm

DEB dpkg -i package.deb .


.

) YUM ( ) APT .(apt-xxx

APT
. ) (HTTP .FTP .

APT /etc/apt/ /etc/apt/sources.list

deb http://http.us.debian.org/debian stable main contrib non-free


debsrc http://http.us.debian.org/debian stable main contrib non-free
deb http://security.debian.org stable/updates main contrib non-free

"" ) (

. ) (web/FTP

) ( )

(.

) .(sources.list

.
apt-get

. apt-get

aptitude apt-get ) apt-get

( aptitude . aptitude
.
:apt-get
.1 :
apt-get install package

.2 :
apt-get remove package

.3 :
apt-get update

.4 :
apt-get update
apt-get upgrade
apt-get list-upgrade

. apt-spy netselect

. ) (apt-setup
. ) ( )

.(http://www.apt-get.org :
(/etc/sources.list )
) (


(/var/cache/apt/archive/
) cache ( )
apt-get clean apt-get autoclean
.

APT SecureAPT md5

) .(GPG apt-get

. :
# apt-key list

GPG :
apt-get install debian-archive-keyring

sources.list . ) (

) .

( . apt-key add

# gpg --import file.key


gpg --export --armor XXXXXXXX | apt-key add -

X - )

(.

APT apt-cache


apt-cache :
.1 :
apt-cache search name

.2 :
apt-cache show package

.3 :
apt-cache depends package

APT :
:apt-show-versions ) .(-u
.dpkg

dpkg -L package

:
dpkg -l

(:
)
dpkg -S file

apt-file .
APT synaptic gnome-apt

aptitude .dselect
kpackage adept
6

: ) APT (dpkg
gnome-
6 synaptic

packagekit kpackagekit ...

: Linex

][ .

6
.

. ) (:
7

:Linuxconf .1
/
.

) ] [ (.
8

:webmin .2 .
) (

.3 cPanel . ISPConfig
9

" "

10

7 . 2009 .

8 18/1/2005
/ !

9 cPanel
Webmin

10 chkconfig
system-config-xxxxx gtk
. !

/ )

( ) (
) X Window

( . .

) (

) ( ) ( system-
config-xxxxx : .

:3 .

7
.

:
.1

grep, awk, sed, find, diff, gzip, bzip2, cut, sort, df, du, cat, more, :

.2

vi :

... file, which

Vim . vi /

Emacs . ) (

.Xemacs Joe Wordstar

.3

: Perl

)/ ( PHP . . .


.4

(++ ) gdb(
) GNU gcc :
) xxgdb X (gdb ) ddd (.


.1 FHS
.

.2 .[Bas] [Coo] :
.3 RPM
.

.
.

.4 .APT
.5 ) (.

.6 Linuxconf Webmin .



] [Bas] [Coo ) ( .
] [Qui01 / .

] [Deb02] [Bai03 /.
] [Stu /.


/ ) ( :


1991

. .

)(

.
.

1 /

. :

. :
.1 :


.2 :

.3 ) :(I/O .

.4 : .
.5 : .

:1

""

""

"" ) (.


.
.







/ .


.
) (.

1991
) ( :

) Minix UNIX ( .Intel 386

Linux 1.0 / ) (3 1994 i386

. 1.2 1995

. 1996 2.0
1

.SMP 2.2 1999 SMP


3

. 2.4 2001 SMP

USB ) PC PCMCIA ( ) PnP

SMP
(plug and play RAID . 2.6 ) (12/2003


.
64

) 1991 (0.01

)(

) ( .

2.0 .1 David Weinehall

) Alan Cox (
2.2 .2
2.4 .3 Marcelo Tosatti

2.6 .4 Andrew Morton .


Alpha 1 Sparc .Mips
2 : //.
3 : .

. )(
:

)((

0.01

1991 09

10

1.0

1994 03

176

1.20

1995 03

311

2.0

1996 06

649

2.2

1999 01

1800

2.4

2001 01

3378

2.6

2003 12

5930

.2003

)
5

(26


2.6
) (2.6 ) (2003 Open Source
2008 ) 2012 3.2
4
/( tom's hardware

%50 39 .

5 .

2.6

. 2.6 .

2.4 2.6 2.6 .3

/
Development Laboratory OSDL

) /HP, IBM, Sun, Intel, Fujitsu, Hitachi, :


.( Toshiba, Red Hat, SuSE, Transmeta OSDL

)( )( 2.6 .

.The Linux Foundation


. OSDL


) (.
.


) ( )
( .

.
:
.1 2.6 :

1.3 2.1 2.5


"" ) Experimental
( ) production 1.2 2.0 2.2 2.4


( .

.
) (.

) (

. /

2.6 :
.2

X.Y.Z X Y
6


: Y

Z X.Y
.

) 2.4 (2.6

) (2.6 ) X.Y

(
)

(2.6


6 3.0 2.6
2.6 .

Z )

( . .
( ) -rc
)


(release candidate -mm

-git snapshots .

.3 ) (http://www.kernel.org
.
.

:
: .
.1
.2 / modules
.


.3 :

. 2.6
.

.4 :

/

.5 : ) (
.
.

.
2.6

) ( .
7

.6 .symmetric multiprocessing SMP


64 .

) (
.
. ] [

.
SMP .2.6

SMP

VFS
.7 :
7 .

.
Virtual File System

ext2, MSDOS, VFAT, NTFS :

ext3, ReiserFS, JFS (IBM), XFS (Silicon), NTFS, ISO9660 (CD), UDF :
.

) (:

.1 :
/ .
] [
.

.2 : GPL )
(.

386 RAM
.3
) 4MB (.

.4 : .

.5 : / .
.6 : 1.44MB )
8

(.

.7
8 1.44MB .
.

.

) MSDOS Windows BSD Xenix( .x86

.8 :
.
.

.
) (NVIDIA, ATI ) (Epson, HP
.

2
/ .
/

. generic IDE
SCSI .
.

2.6
.

) ( .
9

) ( .

H .


:
.1 .
.2 .

.3 .
9 2.6 .

.4 .
.5 .

.6 ] [ .

.7
.

.8 .
.9 .

.10

:
.
:

.1 : .

.

.

.

.

)
( .
kernel.org

.
.

.2 ) ( .
" " .

" ) (kernel.org
"
.

.

) (


(
)

) (.

10

.
. :

.1 2.4

11

.2 2.6
.3 2.6 .

.4 ) (.
] 2.4 2.6 [

12

10 Parted Magic .

11 .

12
2.6 .

) (2.4

3.1

2.4

Intel x86 )

(:

.1 : ) http://www.kernel.org FTP (
. . /

/ ) (
) ( .


.http://www.kernel.org

.2 : /usr/src/
.
:bzip2
bzip2 -dc linux-2.4.0.tar.bz2 | tar xvf


gz gzip .bzip2
kernel .

gcc

make . modutils

)
ncurses ] menuconfig [(.

) (

. README

Documentation/Changes .Documentation/00-INDEX



(.
) make mrproper

.config ( . :

y ) n
: make config

yes no ( .
)

(.

)
: make oldconfig
.config (


.



: make menuconfig
.make config

: make xconfig .X Window

.
tcl/tk
/ .
)

( . ) make config (make menuconfig


. .

:2 ) (make xconfig X Window


) (.config .

] [ )
( .

(.
)

)

( .

:

:

(
)
.modules

) (
(.
)

. ext2

) ext3 ( ) VFAT (ME/95/98 .

NTFS NT/XP :

. ) (
.

.3
.make

) (:

make dep
make bzImage

:
make modules

.4
:
make modules_install

) /usr/src/linux-version/ (:
cp arch/i386/boot.bzImage /boot/vmlinux-2.4.0
cp system.map /boot/system.map-2.4.0

./boot/
bzImage

/boot/ vmlinuz .

.

.
system.map
initrd

RAID
.

initrd .
initrd .

initrd .

initrd ) mkinitrd man

( ./boot/

.5 :

Lilo MBR
):(/etc/lilo.conf :
image = /boot/vmlinuz-2.4.0
label = 2.4.0

image label .


.
. /etc/lilo.conf .
. default = label

)
. root = /dev/
' ('/ ) /dev/hda (ide /dev/hdb

/dev/sdx ) SCSI ( root = /dev/hda2 ''/


13

13 SCSI iSCSI SATA USB

IDE . " = append .

initrd /boot/initrd-kernelversion
"= .initrd Lilo .

/sbin/lilo -v


lilo.conf .
.Grub
.grub Lilo

) (/boot/grub/menu.lst .

...SD/MMC/MicroSD .

3.2

2.6

2.6 .
:


.1 . )
/etc/modules (/etc/modules.conf .

.2 : make gconfig GTK

) ( . . make xconfig

) QT (.

.3 )
.gcc
Documentation/Changes ( .

.4 ) module-init-tools modutils .(2.4


2.6 .

udev ) hotplug( )
.5 devfs

/dev/ .

.6 2.6
kernel-images/source/headers .linux-images/source/headers

.7 ) (SATA /dev/hdX

./dev/sdX /etc/fstab ) lilo (grub

.8 / .

X-Window
) .(psmouse .Alsa
OSS Alsa.

.9 2.6

( . ) i386 :(AMD

32 ) 486 (
) i686 pentium pro( k7

) AMD Athelon ( 64 AMD 64 bit


em64t 64 Xeon .

IA64 64 .Intel Itanium SMP

) SMP
-smp (.

.10 initrd ) (2.6.12 mkinitrd


initramfs .yaird initrd
) (.

3.3

2.6

:
2.6
2.6

# make clean mrproper

) .config ( .

) (:

make

# make menuconfig

:
# make dep
# make bzImage

) (:
# make modules

)(/lib/modules/version/
# make modules_install

:
# cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.x.img

initrd )
( . Lilo Grub .
) vmlinuz system.map (initrd /boot/ :

# make install


./boot/

initrd / .install
) mkinitrd 2.6.12( mkinitramfs

update-initramfs ) vmlinuz-version :(/boot/


'# update-initramfs -c -k 'version

3.4

) (

" .

) (:
kernel-package, ncurses-dev, fakeroot, wget, bzip2

) x :(2.6
# apt-get install linux-source-2.6.x
$ tar -xvjf /usr/src/linux-source-2.6.x.tar.bz2

) .(/usr/src/

:
# apt-get install build-essentials fakeroot

:
# apt-get build-dep linux-source-2.6.x

)
(:
$ cd linux-source-2.6.x
$ fakeroot debian/rules binary

) (.

) (make menuconfig :

)
:(kernel.org
# apt-get install linux-source-2.6.x
$ tar xjf /usr/src/linux-source-2.6.x.tar.bz2
$ cd linux-source-2.6.x

.config
( ,xconfig, gconfig
)
$ make menuconfig

initrd initrd )

initrd (:
$ make-kpkg clean
$ fakeroot make-kpkg revision=custom.1.0 kernel_image

initrd ) (
$ make-kpkg clean
$ fakeroot make-kpkg initrd revision=custom.1.0 kernel_image

:
# dpkg -i ../linux-image-2.6.x_custom.1.0_i386.deb


. module-assistant .
) (linux-headers-version

. module-assistant

.
) m-a :(module-assistant
# m-a prepare
# m-a auto-install module_name

.

.module-assistant

4
.

patch ASCII

. ) (man patch
) .(/usr/src/

)( . )
( .

.
) bz2 bunzip2

gzip (.gz :

patchxxxx-2.6.21-pversion.bz2

xxxx 2.6.21

pversion .
) /usr/src/linux/ (.
readme


) (

(
). /usr/src/linux-2.6.21

cd /usr/src/linux

bunzip2 patch-xxxxx-2.6.21-version.bz2
patch -p1 < patch-xxxxx-2.6.21-version

.
. )(http://www.kernel.org

http://www.linuxhq.com . ) (

"" . ) (
) NVIDIA (.

/ )/ (

) / ( .


14

14 .

5
)( )

) ( .
1.2 ( .
.

) kmod 2.0 (kerneld modprobe

/etc/modules.conf

/lib/modules/version_kernel/modules.dep

(
. ) /lib/modules/version_kernel

insmod version_kernel .uname -r

./lib/modules/version_kernel
/ .
) modutils

module-init-tools :(2.6

: lsmod .1 )
.(/proc/modules ) ] [(

: modprobe .2 .
: insmod .3 .
: depmod .4 .
: rmmod .5 .
.6 modinfo
ksyms ) (2.4 )
.(/proc/ksyms

insmod
:
. DMA .IRQ
insmod soundx io = 0x320 irq = 5

2.6 .
.

.
) (2.4 :
15

.1 IEEE POSIX
.

.2 : USB SCSI
16

17

.3 ) UDF (
(
] [ Reiser IBM ext3 )
.

.4 4 ) (1.2
128 ) (.

.5 ./proc/ /proc/
.

.6 : Alsa .

.
15
16 Plug and Play : .PnP

17 Parallel Port .

RAID .LVM1
.7

2.6 ) :(2.6
]
.1 SMP
[.

.2 .
.3 . NGPT IBM
NPTL ) .(NPTL

.4 ] USB 2.0 . [USB 3.0


18

.5 Alsa .
) AMD x86_64 (amd64
.6 64
PowerPC 64 ) IA64 (.

.7 JFS : ) JFS2 (IBM ) XFS .(Silicon Graphics


.8 / .

.9 TCP/IP ) NFSv4 (.

.10 :
.

.11 ) (.
18 USB 3.0 / 2009
.

.12 User Mode Linux UML


.
) (

.13 :

Xen Virtual Server


. Vserver
19

.14 .LVM2

.15 /sys/ /
/proc .

.16 FUSE ) . (NTFS


20

:
21

.1
.

.2 ) SMP ( 64 ) Intel Itanium AMD


(Opteron .

.
.3
19 OpenVZ Xen KVM ...
20 FUSE Filesystem in User Space NTFS
ssh sshfs

smb/cifs .

.
21

) PDA .(
.4
.5 .POSIX

.6 2.6

.
FSF GNU

. 1991

/ .

. . Hurd
/ . /.

1990

] . [ 1991

/ . .

.
Mach

) ( University of Carnegie

Mellon .Utah

.Mach

.
.Apple MacOS X

) ( . /
/.

/ /

) SCO (IBM
. . .

7 :

uname -r

. :

) (

.
.
:
.1 . .
.2 .

.3 ) ( .
.

7.1

.APT

APT ) synaptic ] gnome-apt .( [PackageKit

apt-get ) apt
( ./etc/apt/sources.list :
.1 .
# apt-get update

.2 :
# apt-cache search linux-image

.3

) 386/486/686 k6 k7 AMD
64 amd64 AMD ia64 ( .

. kernel-2.6.21-4-k7 : AMD Athelon

.4

2.6.21 .

) ( . apt-cache

.

module-assistant .

.5

) Linux-source-version 2.6.21
:
(

.

.6

: :
# apt-get install linux-image-version
) ((

# apt-get install xxxx-modules-version

# apt-get install linux-source-version-generic


# apt-get install linux-headers-version

.7


Lilo )

Grub-legacy Grub2 ( .
22

initrd ) lilo (/etc/lilo.conf


23

lilo:
)initrd = /initrd.img-version (or /boot/initrd.img-version

lilo fragment initrd.img vmlinuz


:

22 . Grub2 grub-legacy
Lilo .

23 grub-legacy /boot/grub/grub.cfg ./boot/grub/menu.lst grub2


Grub2 )( .

default = Linux
image = /vmlinuz
label = Linux
initrd = /initrd.img
# restricted
# alias = 1
image = /vmlinuz.old
label = LinuxOLD
initrd = initrd.img.old
# restricted
# alias = 2


. lilo

/etc/lilo.conf
.
/sbin/lilo ./sbin/lilo -v

7.2

.up2date

/ ) ] [

(.

/

.
. .

10
:

:3 ) up2date (
yum

# yum install kernel kernel-source

. grub

grub-egacy ) /boot/grub/grub.conf (/boot/grub/menu.lst


.

# file grub.conf
default = 1
timeout = 10
splashimage = (hd0,1)/boot/grub/splash.xpm.gz
)title Linux (2.6.20-2945
)root (hd0,1
kernel /boot/vmlinuz-2.6.20-2945 ro root = LABEL = /
initrd = /boot/initrd-2.6.20-18.9.img
)title LinuxOLD (2.6.20-2933
)root (hd0,1
kernel /boot/vmlinuz-2.4.20-2933 ro root = LABEL = /
initrd = /boot/initrd-2.4.20-2933.img

.

.initrd
) lilo grub ( / )

/etc/lilo.conf ./sbin/lilo


/usr/src/linux-version .

) (

7.3

. ) /usr/src/

( . linux .

) ( .

.
www.kernel.org )
) /usr/src/
( .

( . )
4.4 (.

.1 ) (:
make clean mrproper

.2 make menuconfig ) xconfig gconfig .(oldconfig


4.3 .

:4
.3 :
make dep

.4 : .make bzImage zImage


bzImage .

bzImage zImage .

. :

./usr/src/directory-sources/arch/i386/boot/

.5 .make modules .
.

.6

) 2.2

(2.4 )
2.4 (.

) (

) ( :

cd /lib/modules
tar cvzf old_modules.tgz versionkernel-old/

.tgz
:
make modules install

.7

:
24

# cd /usr/src/directory-sources/arch/i386/boot
# cp bzImage /boot/vmlinuz-versionkernel
# cp System.map /boot/System.map-versionkernel
# ln -s /boot/vmlinuz-versionkernel /boot/vmlinuz
# ln -s /boot/System.map-versionkernel /boot/System.map

.8

) (system.map .

lilo grub-legacy

Grub2 . Lilo

.9

/sbin/lilo ./sbin/lilo -v

) (.

24 make install .
.


.1 . ) (apt
/ ) .(yum

) pcmcia
.2 .

) lilo grub-legacy .(grub2
(
) ( .


.3 ) (http://www.kernel.org

.
.

(
.4 )
.


:
] [ kerb .
][ kera] [lkm .
.

] [ Dbo 2.4
. 2.2 2.6.

] [ Pra 2.6 .
] [ Ker] [Mur .
] [ Bac86] [Vah96] [Tan87
.
] [ Skoa] [Zan01] [Kan] [Pro Lilo .Grub
::
" " . Linux in a Nutshell
.Greg Kroah-Hartman
" .Grub 2


. / .
1

/
.

)( .

.
.



1 Free Technology Academy GNU/Linux Basic :
.http://ftacademy.org/materials/fsm/13#1

.
.


1 :
( )/
)

( .
/ :

) Grub 2 (Grand Unified Boot Loader


. Grub 2
Grub-Legacy

.Lilo


.
./etc/alternatives/ .

/etc/xinetd.d/
TCP/IP xinetd

TCP/IP ./etc/xinetd.conf
inetd /etc/inetd.conf
inted xinetd .

/etc/profile.d/ : /etc/xinetd.d/

/etc/sysconfig/ /etc/cron.*/
) (crontab /etc/pam.d/

PAM /
:PAM
2 Grub 2 " .Grub 2


/etc/logrotate.d )

(. .

)
kudzu

( .

Hal API .
3

:
DEB dpkg, apt-get, :
.dselect, tasksel

FHS /etc//etc/default/ :
/etc/network/ /
/etc/dpkg /etc/apt/ /etc/alternatives/

) ( .

.dpkg-reconfigure:
dpkg-reconfigure gdm

X:
dpkg-reconfigure X-window-system

.X

TCP/IP inetd /etc/inetd.conf update-


inetd .


/etc/cron.*/ :

3 .

) (crontab /etc/pam.d/ PAM .

2
runlevels

) (.

)
(.
. /etc/

./etc/init.d/
. :

/etc/init.d/service start

/etc/init.d/service stop
/etc/init.d/service restart

/etc/init.d/service status

/
innit .
.
52
LSB :

4 . service service-name start service service-name stop


service service-name status service service-name restart service service-name

reload . ) Upstart ( ) systemd (

Halt


Single user mode

)( .
.

.X window

.3

(.
3 X )

. .

52

) .(LSB

/ ) ( ] [ : BSD


) System V .(SysV System V

/ ) (Slackware .BSD
System V init
/etc/inittab . ) (initdefault

) 5 2 (
.
/etc/rcn.d/ n

) (
. .
.

5

)
S K

(start S ] [ ) (kill K .
:

/etc/init.d/
.

telinit .

) telinit 1

] S 1 S "" ([Single
telinit 3 .

init telinit .

sync init 6 sync


.6

shutdown ) (halt, h ) (reboot, r .


. .

wall .
. shutdown.

pidof . ps
kill .
:
/ : 4 . /etc/rcn.d/

/etc/rc.d/ . /etc/rc.d/rcn.d/ :

. 5 .X
sysvinit .initscripts


./etc/sysconfig/ /etc/rc.d/rc.sysinit

/etc/rc.d/rc.local

./etc/rc.d/init.d/ ./etc/init.d/
/sbin/service :

/sbin/chkconfig S K

update-rc.d
invoke-rc.d

2 X Window System /etc/inittab


) gdm ] kdm [( .2

3
)(

) .(.

.

3.1


.
.


.
:
:dmesg .
:/var/log/messages )
/var/log/ .syslog

:uptime .

:/proc/ ) (procfs .
:/sys/ ) (sysfs 2.6
.

3.2

: /proc/

/proc/

.
. /proc/
) (.
/proc/

/proc/

/proc/<process PID>/
.

. ps top
. ) /proc/

.(procps

./proc/
:

/proc/bus PCI .USB

/proc/cmdline Kernel startup line


/proc/cpuinfo CPU
/proc/devices
/proc/drive
/
proc/filesystems
/proc/ide IDE
/proc/interrupts ) (IRQ
/proc/ioports / .I/O ports

/proc/meminfo
/proc/modules
/proc/mounts
/proc/net
/proc/scsi SCSI IDE SCSI
/proc/sys )(.
/proc/version
2.6 ) procfs (/proc/ ) sysfs (/sys/

) ( ./sys/

3.3

: /sys/

sys

APIs ) ( .

HAL udev .

(
sys )

) sysfs (.

sysfs )

( . / ) /sys/devices/

( . /sys/bus/
. /sys/classes/ network

/sys/block .

/sys/ /proc/

) (

/proc/ /sys/ .
./sys/

3.4

. :
: ) ""
(daemons .

( )
)

( .

. ) lp, bin, www, mail(


.

:
.

: .

:

:ps

. ) ps -ef (ps -ax



) .(man ps

:top .

.

:kill kill -9 pid_of_process


) 9 (SIGKILL .

.
.man 7 signal

3.5

) (logs

/var/log/

.syslogd
./var/log/messages/ syslogd )

(/etc/syslog.conf

) ( / ) (:
alarm, warning, error, critical.

/var/log/ kern.log, :

,mail.err, mail.info .

) /etc/syslog.conf
.

/dev/tty8 /dev/xconsole ( .

.

) (:

tail -f /var/log/messages

.
:
. .
:uptime

:last ) (/var/log/wtmp .
last ) .(/var/log/lastlog

) ( :

logwatch ) logckeck ( ) loganalysis (

3.6

:( .(

. ) (
) 4 32( . swap
.


swap
. :
:/etc/fstab ) swap ( . fdisk )
.(/proc/swaps

:ps .
:top ps .
.

:free . .
:vmstat .

dstat ) swap(
) .(top

3.7

/ .

) (

.SCSI
) (dmesg /dev/hdx IDE /dev/sdx

USB

SCSI .

. IDE

( .
6


fdisk

) .(cfdisk, sfdisk ide :

6 . ) Intel/IBM/PC/DOS(
primary
4 ) 4 :

(extended ) (extended )
.(logical partitions Apple Sun Sparc gpt

20 ) (

NTFS ) Linux-type * (Boot

NT/2000/XP/Vista / .

) (.

) (:
.
/etc/fstab
.

.umount

.mount )
.(/proc/ ./etc/mtab

.df -k .
.

df -k

.
(/

10 %15 )

) ( .

:

. /tmp/ /var/tmp/
. /tmp/

:logs ) (syslogd
.
.

cron .logrotate

:( :

( :

quota ( cache

:(

4
/ .


: " /
.

""
.swap
) (

:
swap

/var/

/usr/

/tmp/

/opt/

/home/

/boot/

) ( .

)
.
.(/home/
etc2
Linux swap /

) (2.4 ext3 ext4 ext2


7

.
journaling

Reiser XFS .

/home/
: / swap /home/
.
.Btrfs

7

/ ) /bin/ /sbin/ (/usr/


) /var/ /tmp/ (/opt/

/opt/ .

) (:
/ ext2 ext3 ext4


)
(.

/ MSDOS, VFAT, NTFS : FAT16


FAT32 .NTFS

] .[NTFS ) FUSE

( / NTFS-3g
. HFS .HFSplus

CDs/DVDs ISO9660 .UDF


)
( ) JFS2 (IBM ) XFS (SGI .ReiserFS

) ( NFS : ) smbfs (cifs


.

: GFS .Coda

) procfs (/proc/ ) sysfs .(/sys/


( /
)

4.1

/ ) (/usr/, /var/, /temp/, /home /

.


/ ) lilo

(grub .

( /

/
/ ext2 ext3 MSDOS FAT
Windows98/ME/XP Home ) FAT32 VFAT( NT/2000/XP/Vista
) NTFS NTFS( ) FAT32 (VFAT .


/ ) (

NTFS ] [


NTFS NTFS2 .
.

FUSE ) (2.6.11
" (.
) FUSE"
FUSE NTFS

) (FUSE ) NTFS-3ghttp://www.ntfs- :

(3g.org .ntfsprogs

) / :
root /cdrom/, /win/, /floppy/ : /mnt/
. FHS

/mnt/cdrom /mnt/floppy/ (... /media/

.
/mnt/ /media/

:


mount -t filesystem-type device mount-point

MSDOS (FAT), VFAT (FAT32), NTFS (NTFS read) : ISO9660


) (CD-ROM ) (.
/dev/ IDE /dev/hdxy x

( ] [y
) a, b, c, d master slave

3 2 1
a, b, c, d, e )
) SCSI (/dev/sdx x
.( 5 4

:
mount -t iso9660 /dev/hdc /mnt/cdrom

) CD-ROM IDE IDE Secondary


(Master ./mnt/cdrom/

mount -t iso9660 /dev/cdrom /mnt/cdrom

CD-ROM /dev/cdrom ) (

.
mount -t vfat /dev/fd0H1440 /mnt/floppy

./dev/fd0H1440 A ) 1.44(

./dev/fd0

mount -t ntfs /dev/hda2 /mnt/winXP

IDE ) NTFS ] C: [()



.(XP
) (

:/etc/fstab

/dev/hda2

/dev/hdb3 ) proc ( . USB


( . .auto

)
. noauto

) (.

:

) .(noauto

mount /mnt/cdrom
mount /dev/fd0

.
:
( umount
)
umount /mnt/cdrom
umount /dev/fd0

) ( eject
:
eject /dev/cdrom

eject :
eject

mount umount . /etc/mtab

mount .

4.2

rwxrwxrwx : ][ ] rwx

[ ] [ .

read r write w .execute x x

(.
) cd
:

:chown .

:chgrp .

:chmod ) (rwx.

-R .

5
(
/ )

. [

) (.

:
root .
.

.
.


:

) (/tmp/

: lp, news, wheel, www-data


.
.

) (.
) (

/etc/passwd
/etc/shadow
/etc/group
/etc/gshadow

:/etc/passwd
juan:x:1000:1000:Juan Garcia,,,:/home/juan:/bin/bash
root:x:0:0:root:/root:/bin/bash

:: :
:juan .
:x x ./etc/shadow
:1000 .

:1000 . ./etc/group
:Juan Garcia .
:/home/juan/ .

:/bin/bash

. . /etc/passwd


cracks

) /(.

/etc/shadow :

": :
1/1/1970 .
) 0 (.

) (.
.

. 1/1/1970 .

.
/etc/group :
jose:x:1000:

: ) x( :
group-name : group-password : group-identifier : list-of-users

/etc
/passwd ./etc/group

" ., ) (
shadow./etc/gshadow :


/etc/skel/

. " skeletons

.skel

(:

:useradd .

:userdel .
:usermod .

:groupadd, groupdel, groupmod .

:newusers, chpasswd
newusers

) .(chpasswd

:chsh .
:chfn ./etc/passwd

:passwd . .
)

( .

.
:su .
) su :

( . ) su username username
( . ) su username mandate

(.

" " Network Information Systems NIS NIS+ LDAP



(
. )
.

/ /
.

NIS compat
/etc/nsswitch.conf nis nisplus .


.
NFS

NIS NIS+ passwd


) yppasswd (NIS ) nispasswd (NIS+


passwd .

6
/ BSD ) LPD line printer

.
.(daemon
.
LPD ) BSD ( .

LPD . LPD
.
LPD Ghostscript

postscript .


. ) (:
.LPD

postscript
) (

. /

postscript .
postscript

Ghostscript postscript
. postscript

.
" .
"

) LPD (BSD ) System V

.(System V

. /

LPD System V .

) ( lpr
) BSD (System V
BSD lp .System V
/

. CUPS .LPRng CUPS


.
/
) CUPS (LPRng


BSD System V
) ( . .

LPRng CUPS .

/ . ][

BSD LPD : / .CUPS

Print switch CUPS


: .
.
) CUPS LPRng (

system-config-printer .
Print switch :

BSD LPD ) CUPS (


8

8 BSD BSD Hurd


CUPS systemd .

.LPRng )

( .
:

:BSD LPD
LPRng CUPS .BSD LPD LPD

LPD

:LPRng
.

:CUPS BSD .

.CUPS
) .(LPRng CUPS

.System V

/ :
BSD : LPRng .CUPS

)( : .

USB .

) HP (BSD LPD
.

)
: TCP/IP
TCP/IP ) IPP (CUPS
(
HP LPD

) JetDirect (HP .

.
:

: / CUPS

) HP (Epson Gimp
Foomatic ) CUPS LPD


LPRng( Ghostscript .

) BSD
(:
) ( lpd
:lpr

.

lp

PRINTER

) (.

:lpr
lpr -P epson data.txt

data.txt ".epson

:lpq .


:
# lpq -P epson
Size

Total

Job Files

Owner

Rank

74578 bytes

data.txt

15

juan

1st

12394 bytes

fpppp.F

16

marta

2nd

lpr

:lprm .

lprm -P epson 15

15 .

lpc
) (BSD
)

(.


System V
.BSD lp, lpstat, cancel : lpadmin, accept, reject, lpmove, enable, :
.disable, lpshut


.

) (.

6.1

BSD LPD

BSD LPD :

/etc/printcap ./etc/hosts.lpd

BSD LPD
./etc/hosts.lpd

:
# file hosts.lpd
second
first.the.com
192.168.1.7
+@groupnis
-three.the.com

DNS .IP

) NIS groupnis (
).(-

/etc/printcap

. .
:

lp = /dev/lp0 : .
: lp =
LPD ) LPD (HP

. IP : rm =
.

.rm : rp =
:
# Local printer input lp|epson|Epson C62:\
:lp=/dev/lp1:sd=/var/spool/lpd/epson:\
:sh:pw#80:pl#72:px#1440:mx#0:\
:if = /etc/magicfilter/StylusColor@720dpi-filter:\filter
:af = /var/log/lp-acct:lf = /var/log/lp-errs:
# Remote printer input
hpremote|hpr|remote hp of the department|:\
:lp = :\
:rm = server:rp = queuehp:\
:lf = /var/adm/lpd_rem_errs:\log file.
:sd = /var/spool/lpd/hpremote:local associated spool

6.2

LPRng

LPRng BSD

/etc/printcap .
:

/etc/lpd.perms lpd.perms

./var/spool/lpd/queue-name/

lpd-perms :
DEFAULT ACCEPT
DEFAULT REJECT
*] *]ACCEPT [ key = value [,value
*] *]REJECT [ key = value [,value


. .IP

() P () Q (lpq M
) X :

) (lprm ) C (lpc :
ACCEPT SERVICE = M HOST = first USER = jose
ACCEPT SERVICE = M SERVER REMOTEUSER = root
REJECT SERVICE = M

first

.
) (localhost

LPRng .

:
ACCEPT SERVICE = X SERVER
REJECT SERVICE = X NOT REMOTEIP = 100.200.0.0/255

.(100.200.0.254 100.200.0.0

.BSD
) lprngtool .(LPRng

lprngtool :1

:
LPRng

lprng lpr/lpd printer spooling system


lprng-doc lpr/lpd printer spooling system (documentation)
lprngtool GUI front-end to LPRng based /etc/printcap
printop Graphical interface to the LPRng print system.

6.3

CUPS

CUPS BSD LPD

. CUPS ) IPP (http


.CUPS CUPS PPD

CUPS ) HP .(Epson

] [ /etc/cups/cupsd.conf :

/etc/cups/printers.conf /etc/cups/classes.conf

/etc/cups/cupsd.conf .

: allow
IP.

: AuthClass .

: BrowseXXX

) (browsing on
. . BrowseAll


.
CUPS

) cups-lpd
LPD LPRng

.(cupsys-bsd CUPS LPD LPRng )

cupsd.conf CUPS )

(.
cups LPD System V

System V .lpadmin

gnome-cups-manager gtklp
CUPS .http://localhost:631

:2 CUPS

: ( ) CUPS
cupsys - Common UNIX Printing System(tm) - server
cupsys-bsd - Common UNIX Printing System(tm) - BSD commands
cupsys-client - Common UNIX Printing System(tm) - client programs (SysV)
cupsys-driver-gimpprint - Gimp-Print printer drivers for CUPS
cupsys-pt - Tool for viewing/managing print jobs under CUPS
cupsomatic-ppd - linuxprinting.org printer support - transition package
foomatic-db - linuxprinting.org printer support - database
foomatic-db-engine - linuxprinting.org printer support - programs
foomatic-db-gimp-print - linuxprinting - db Gimp-Print printer drivers
foomatic-db-hpijs - linuxprinting - db HPIJS printers
foomatic-filters - linuxprinting.org printer support - filters
foomatic-filters-ppds - linuxprinting - prebuilt PPD files
foomatic-gui - GNOME interface for Foomatic printer filter system
gimpprint-doc - Users' Guide for GIMP-Print and CUPS
gimpprint-locals - Local data files for gimp-print
gnome-cups-manager - CUPS printer admin tool for GNOME
gtklp - Front-end for cups written in gtk

7
:
:IDE :
/dev/sda

/dev/sdb
/dev/sdc
/dev/sdd

:SCSI /dev/sda ... /dev/sdb . .SCSI

: /dev/fdx x ) ( .

1.44 A ./dev/fd0H1440

/dev/hda1 IDE dev/sdc2 SCSI .

IDE primary .

/dev/hdaN N 4

N .5
:
. fdisk ) cfdisk .(sfdisk
: ) fdformat : (
) superformat (MSDOS ) mformat

MSDOS(.

.mkfs
mkfs.ext2 mkfs.ext3 mkfs.ntfs :

mkfs.vfat mkfs.msdos mkfs.minix . mkisofs

) ISO9660 joliet (rock ridge

CD DVD cdrecord
.CD/DVD mkswapfs

swapon .swapoff
: mount .umount

: .fsck
.


) (

) (.
fsck.ext2 : fsck.ext3 fsck.vfat

... fsck.msdos . fsck

.

) (/

)
init .(telinit

: tar

cpio cpio tar

dd

: :

badblocks dumpe2fs

tune2fs ext2 ext3


.

RAID .

7.1

RAID

RAID

RAID )

( .

) ( RAID

) (RAID .


) ( )

( . )

RAID array (RAID disk matrix ) ( .

100 )

100( 30 .70

) (.
)

(:

: RAID 0


. RAID
.

: RAID 1 )( ) ( .

) (

) (

. RAID 1

) (724 . )
( .
.

: RAID 2 )
(bit ] .[parity


) 32 39(.

: RAID 3 ) (bytes ) .(parity blocks

RAID 4 .

)(


.
: RAID 5

RAID 0 RAID 1

) RAID 0+1 : (01

. RAID 0
RAID 0.

) RAID 10 : (RAID 1+0 RAID 1 .RAID 0

RAID 1 .

)
.

(.

RAID :
RAID

RAID )
( . .

. .
.


RAM

.
.



. RAID ) (

/ RAID

RAID . .

(
) /

RAID

/.

/ Multiple Device md

) (RAID 10
.RAID RAID 0145 RAID
)


IDE .SCSI
( .

RAID RAID md

RAID modconf ( . RAID RAID

.mdadm .

) SCSI /dev/sda ... /dev/sdb


RAID(:
:

# mdadm --create --verbose /dev/md0 --level=linear --raid-devices=2 /dev/sda1 /dev/sda2

sda sdb /dev/md0

) /media/diskRAID(:

# mkfs.ext2fs /dev/md0
# mount /dev/md0 /media/diskRAID

RAID 0 RAID 1 ) (--level RAID 0 .RAID 1


mdadm --detail /dev/md0 . mdstat

/proc/ . )
1 (5 /proc/mdstat ) (.
mdadm RAID )

.(man mdadm
RAID

RAID
.

7.2

LVM

.
.
Logical Volume Manager LVM

) HP-UX .(HP LVM2


.
LVM )( :

: Physical Volumes PV
) RAID (.

: Logical Volumes LV .

LV ) ( ) /home/

( )

stock marketing hda6 .(sda3

: Volume Groups VG .
LV .PV
.
LV .VG

7 )
( ) /usr/ .(/home/

:7 LVM

)
(

.
:

.
) LVM1 / .(LVM2
) ( .

RAID 0 .

1 5 RAID LVM )

( RAID

LVM .

) LVM

(1 : .PV (2 VG

( .
(3 .
(1 : :
# dd if=/dev/zero of=/dev/hda1 bs=1k count=1
# dd if=/dev/zero of=/dev/hda2 bs=1k count=1
# dd if=/dev/zero of=/dev/hdb1 bs=1k count=1
# pvcreate /dev/hda1
Physical volume /dev/sda1 successfully created
# pvcreate /dev/hda2
Physical volume /dev/sda2 successfully created
# pvcreate /dev/hdb1
Physical volume /dev/sdb1 successfully created

(2 VG :
# vgcreate group_disks /dev/hda1 /dev/hda2 /dev/hdb1
Volume group group_disks successfully created

(3 ) LV 1( ) VG
-n (:
# lvcreate -L1G -n logical_volume group_disks
lvcreate doing automatic backup of group_disks
lvcreate doing logical volume /dev/group_disks/ logical_volume successfully
created

) :(ReiserFS

# mkfs.reiserfs /dev/group_disks/logical_volume


# mkdir /mnt/backup
# mount -t reiserfs /dev/group_disks/logical_volume /mnt/backup

: RPM / )( . .rpm
. ) yum up2date
(.

: DEB
. ,dselect, tasksel, dpkg, apt-get :

TAR ) tgz :(tar.gz

tar ) gzip ( .
)( .

Kpackage : RPM Synaptic


Gnome-apt DEB TGZ Kpackage ) ( .

. alien RPM .DEB



.

: :
(1 .

.
(2 apt-get yum
) (

.
(3 .
(4 .
.

(5 .
(6 .

) (

: nohup

. nohup

: at
) (hh:mm .:
at 10pm task

.

at 2am tomorrow task

: cron

/etc/crontab : ) (

)
9

( . :

9 0 .6

25 6 * * * root test -e /usr/sbin/anacron || run-parts --report /etc/cron.daily


47 6 * * 7 root test -e /usr/sbin/anacron || run-parts --report /etc/cron.weekly
52 6 1 * * root test -e /usr/sbin/anacron || run-parts --report /etc/cron.monthl

: )* " "( ) (

) ( . crontab cron

anacron
.

anacron
.

cron.allow cron.deny .cron

crontab

./var/spool/cron/crontabs /etc/cron.d/

) ( ./etc/crontab

10

. . )

( /
) ( . Pentium 4 GHz 2.66 RAM
MB 768 CD DVD

.
:

# uptime
17:38:22 up 2:46, 5 users, load average: 0.05, 0.03, 0.04

.
) ( . who .

) (dmesg )

(:
)Linux version 2.6.20-1-686 (Debian 2.6.20-2) (waldi@debian.org
(gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)) #1 SMP Sun Apr
15 21:03:57 UTC 2007

BIOS-provided physical RAM map:

)BIOS-e820: 0000000000000000 - 000000000009f800 (usable


)BIOS-e820: 000000000009f800 - 00000000000a0000 (reserved

)BIOS-e820: 00000000000ce000 - 00000000000d0000 (reserved

)BIOS-e820: 00000000000dc000 - 0000000000100000 (reserved


)BIOS-e820: 0000000000100000 - 000000002f6e0000 (usable

)BIOS-e820: 000000002f6e0000 - 000000002f6f0000 (ACPI data


)BIOS-e820: 000000002f6f0000 - 000000002f700000 (ACPI NVS
)BIOS-e820: 000000002f700000 - 000000002f780000 (usable

)BIOS-e820: 000000002f780000 - 0000000030000000 (reserved


)BIOS-e820: 00000000ff800000 - 00000000ffc00000 (reserved
)BIOS-e820: 00000000fffffc00 - 0000000100000000 (reserved
0MB HIGHMEM available.

759MB LOWMEM available.


: 2.6.20-1-686 2.6

20 ) 686 x86 32( .

GNU gcc 4.1.2 .



)( / BIOS 759
1 760 .
Kernel command line: BOOT_IMAGE=LinuxNEW ro root=302 lang=es
acpi=force

Initializing CPU#0
Console: colour dummy device 80x25

Memory: 766132k/777728k available (1641k kernel code, 10968k reserved,


)619k data, 208k init, 0k highmem

Calibrating delay using timer specific routine.. 5320.63 BogoMIPS


)(lpj=10641275

) lilo
25 80 ) ( . BogoMIPS
.(grub
. MHz

. .
CPU: Trace cache: 12K uops, L1 D cache: 8K
CPU: L2 cache: 512K
CPU: Hyper-Threading is disabled
Intel machine check architecture supported.
Intel machine check reporting enabled on CPU#0.
CPU0: Intel P4/Xeon Extended MCE MSRs (12) available
CPU0: Intel(R) Pentium(R) 4 CPU 2.66GHz stepping 09

: cache cache
L1 TraceCache ) Pentium 4 (cache
L2 cache .

PCI: PCI BIOS revision 2.10 entry at 0xfd994, last bus=3


Setting up standard PCI resources
...
NET: Registered protocol
IP route cache hash table entries: 32768 (order: 5, 131072 bytes)
TCP: Hash tables configured (established 131072 bind 65536)
checking if image is initramfs... it is
Freeing initrd memory: 1270k freed
fb0: VESA VGA frame buffer device
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled
serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
00:09: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize
PNP: PS/2 Controller [PNP0303:KBC0,PNP0f13:MSE0] at 0x60,0x64 irq 1,12
i8042.c: Detected active multiplexing controller, rev 1.1.
serial: i8042 KBD port at 0x60,0x64 irq 1
serial: i8042 AUX0 port at 0x60,0x64 irq 12
serial: i8042 AUX1 port at 0x60,0x64 irq 12
serial: i8042 AUX2 port at 0x60,0x64 irq 12
serial: i8042 AUX3 port at 0x60,0x64 irq 12
mice: PS/2 mouse device common for all mice

(com1 ) ttyS0 .
. PS2 RAM .(com2 )ttyS1

ICH4: IDE controller at PCI slot 0000:00:1f.1


ide0: BM-DMA at 0x1860-0x1867, BIOS settings: hda:DMA, hdb:pio
ide1: BM-DMA at 0x1868-0x186f, BIOS settings: hdc:DMA, hdd:pio
Probing IDE interface ide0...
hda: FUJITSU MHT2030AT, ATA DISK drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
Probing IDE interface ide1...
hdc: SAMSUNG CDRW/DVD SN-324F, ATAPI CD/DVD-ROM drive
ide1 at 0x170-0x177,0x376 on irq 15
SCSI subsystem initialized
libata version 2.00 loaded.
hda: max request size: 128KiB
hda: 58605120 sectors (30005 MB) w/2048KiB Cache, CHS=58140/16/63<6>hda:
hw_config=600b
, UDMA(100)
hda: cache flushes supported
hda: hda1 hda2 hda3
kjournald starting. Commit interval 5 seconds
EXT3-fs: mounted file system with ordered data mode.
hdc: ATAPI 24X DVD-ROM CD-R/RW drive, 2048kB Cache, UDMA(33)
Uniform CD-ROM driver Revision: 3.20
Addinf 618492 swap on /dev/hda3.

]hdc hda : PCI IDE IDE


) Samsung CD DVD (fujitsu) : [

. .( Combo
10

. swap ext3

DVD CD combo 10
BlueRay .

.DVD CD

usbcore: registered new interface driver usbfs


usbcore: registered new interface driver hub
usbcore: registered new device driver usb
input: PC Speaker as /class/input/input1
USB Universal Host Controller Interface driver v3.0
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
uhci_hcd 0000:00:1d.1: UHCI Host Controller
uhci_hcd 0000:00:1d.1: new USB bus registered, assigned bus number 2
uhci_hcd 0000:00:1d.1: irq 11, io base 0x00001820
usb usb2: configuration #1 chosen from 1 choice
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 2 ports detected
hub 4-0:1.0: USB hub found
hub 4-0:1.0: 6 ports detected

8 ) ) ( USB
.( USB

parport: PnPBIOS parport detected.


parport0: PC-style at 0x378 (0x778), irq 7, dma 1
[PCSPP,TRISTATE,COMPAT,EPP,ECP,DMA]
input: ImPS/2 Logitech Wheel Mouse as /class/input/input2
ieee1394: Initialized config rom entry 'ip1394'
eepro100.c:v1.09j-t 9/29/99 Donald Becker
Synaptics Touchpad, model: 1, fw: 5.9, id: 0x2e6eb1, caps: 0x944713/0xc0000
input: SynPS/2 Synaptics TouchPad as /class/input/input3
agpgart: Detected an Intel 845G Chipset
agpgart: Detected 8060K stolen Memory
agpgart: AGP aperture is 128M
eth0: OEM i82557/i82558 10/100 Ethernet, 00:00:F0:84:D3:A9, IRQ 11.
Board assembly 000000-000, Physical connectors present: RJ45
e100: Intel(R) PRO/100 Network Driver, 3.5.17-k2-NAPI
usbcore: registered new interface driver usbkbd
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
lp0: using parport0 (interrupt-driven).
ppdev: user-space parallel port driver

(IEEE1394 ) FireWire :

.VGA i845 ( )
( USB ) USB intel pro 100
11

dmesg

./var/log/messages

. syslogd
dmesg
.... 11

) (:
# tail 200 /var/log/messages

:
shutdown[13325]: shutting down for system reboot
kernel: usb 4-1: USB disconnect, address 3
kernel: nfsd: last server has exited
kernel: nfsd: unexporting all file systems
kernel: Kernel logging (proc) stopped.
kernel: Kernel log daemon terminating.
exiting on signal 15
syslogd 1.4.1#20: restart.
kernel: klogd 1.4.1#20, log source = /proc/kmsg started.
Linux version 2.6.20-1-686 (Debian 2.6.20-2) (waldi@debian.org) (gcc version 4.1.2
20061115 (prerelease) (Debian 4.1.1-21)) #1 SMP Sun Apr 15 21:03:57 UTC 2007
kernel: BIOS-provided physical RAM map:

/proc/

Syslogd

/proc/ dmesg
.dmesg

lsmod

) (:

# lsmod Module Size Used by


nfs 219468

nfsd 202192

17

exportfs 5632

1 nfsd

lockd 58216

3 nfs,nfsd

nfs_acl 3616

2 nfs,nfsd

sunrpc 148380

3 nfs,nfsd,lockd,nfs_acl

ppdev 8740

lp 11044

button 7856

ac 5220

battery 9924

md_mod 71860

dm_snapshot 16580 0
dm_mirror 20340

dm_mod 52812

2 dm_snapshot,dm_mirror

i810fb 30268

vgastate 8512

1 i810fb

eeprom 7184

thermal 13928

processor 30536

1 thermal

fan 4772

udf 75876

ntfs 205364

usb_storage 75552

hid 22784

usbkbd 6752

eth1394 18468

e100 32648

eepro100 30096

ohci1394 32656

ieee1394 89208

2 eth1394,ohci1394

snd_intel8x0 31420

snd_ac97_codec 89412

1 snd_intel8x0

ac97_bus 2432

1 snd_ac97_codec

parport_pc 32772

snd 48196

6 snd_intel8x0,snd_ac97_codec,snd_pcm,snd_timer

ehci_hcd 29132

ide_cd 36672

cdrom 32960

1 ide_cd

1 snd

soundcore 7616

psmouse 35208

uhci_hcd 22160

3 ppdev,lp,parport_pc

parport 33672

intelfb 34596

serio_raw 6724

pcspkr 3264

1 shpchp

pci_hotplug 29312

6 dvb_usb,usb_storage,usbkbd,ehci_hcd,uhci_hcd

usbcore 122312

intel_agp 22748

5 i810fb,drm,intelfb,intel_agp

agpgart 30504

ext3 121032

1 ext3

jbd 55368

ide_disk 15744

ata_generic 7876

ata_piix 15044

2 ata_generic,ata_piix

libata 100052

2 usb_storage,libata

scsi_mod 133100

]0 [permanent

generic 4932

]0 [permanent

piix 9540

5 usb_storage,ide_cd,ide_disk,generic,piix

ide_core 114728

.
.

( .

) ps " " (process status



) (:

# ps -ef
TIME CMD

TTY

STIME

PPID C

PID

UID

( PID
UID )

] [

.init PPID ID . STIME

.
TTY ) ( CMD
]root 1 0 0 14:52 ? 00:00:00 init [2
]root 3 1 0 14:52 ? 00:00:00 [ksoftirqd/0
]root 143 6 0 14:52 ? 00:00:00 [bdflush
]root 145 6 0 14:52 ? 00:00:00 [kswapd0
]root 357 6 0 14:52 ? 00:00:01 [kjournald
root 477 1 0 14:52 ? 00:00:00 udevd --daemon
]root 719 6 0 14:52 ? 00:00:00 [khubd

kswapd . )

.(bdflush ) (kjournald ) USB .(khubd udev

. d k
.

1567 1 0 14:52 ? 00:00:00 dhclient -e -pf ...

root

1653 1 0 14:52 ? 00:00:00 /sbin/portmap

root

1829 1 0 14:52 ? 00:00:00 /sbin/syslogd

root

1839 1 0 14:52 ? 00:00:00 /sbin/klogd -x

root

1983 1 0 14:52 ? 00:00:09 /usr/sbin/cupsd

root

2178 1 0 14:53 ? 00:00:00 /usr/sbin/inetd

root

][ dhclient DHCP IPSyslogs .


. cups . inetd

" superserver .

00:00:00 /usr/sbin/rpc.mountd

? 2154 1 0 14:53

root

00:00:00 /usr/sbin/sshd

? 2241 1 0 14:53

root

00:00:00 /usr/bin/xfs -daemon

? 2257 1 0 14:53

root

00:00:00 /usr/sbin/atd

? 2573 1 0 14:53

root

00:00:00 /usr/sbin/cron

? 2580 1 0 14:53

root

00:00:00 /usr/sbin/apache

? 2675 1 0 14:53

root

00:00:00 /usr/sbin/apache

? 2684 2675 0 14:53

www-data

00:00:00 /usr/sbin/apache

? 2685 2675 0 14:53

www-data

telnet . (FTP
sshd )
12

XFS ) ( .X Window atd cron

. Apache .
00:00:00 /usr/sbin/gdm

? root 2499 2493 0 14:53

00:09:18 /usr/bin/X :0 -dpi 96 ...

root 2502 2499 4 14:53 tty7

00:00:00 /sbin/getty 38400 tty2

root 2848 1 0 14:53 tty2

00:00:00 /sbin/getty 38400 tty3

root 2849 1 0 14:53 tty3

00:00:00 -bash

root 3941 2847 0 14:57 tty1

root 16453 12970 0 18:10 pts/2 00:00:00 ps -ef

GDM ) (

getty ) ) Alt+Fx Ctrl+Alt+Fx


13

(( X . X Window System .
) (bash ps .

12 ssh ) (

scp ssh-

... tunneling .



...

13 Fx X ... F1, F2, F3

ps

man
) .

.(ps top ps
.

free vmstat
:
# free
cache

buffers

457612

89564

shared
0

total

free

used

22504

745232

Mem: 767736

569680

198056

-/+ buffers/cache:

616760

1732

swap: 618492
# vmstat

procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu----cs us sy id wa st

in

bo

si so bi

cache

buff

free

r b swpd

457640

22444

1732

1 0

71 28 508 614 12 3 83 2 0

free swap 600

22 )

( . ) (2.4

1.4 .
] [ .


(1 .



(2 : / .
/home/

(3 CUPS CUPS .

CUPS


(4 / .cron

(5 ) ( .


:
] [Wm02] [Fri02] [Smi02 /
.
] [Gt
.
.http://www.linuxprinting.org

][Hin] [Koe

:
" " .


) /( .

) UUCP Unix-to-Unix CoPy (

. ) LAN

WAN ) 56Kb/s

] 1Gb/s[(
) TCP/IP / Transport Control Program .(Internet Protocol

1 ) TCP/IP (TCP/IP
.
TCP/IP

TCP/IP
.TCP, UDP, IP, ICMP, ARP
TCP/IP ) Telnet

(SSH ) (NFS ) FTP


.(HTTP

4.1

TCP/IP

TCP/IP :
: FTP .

) ( ""

anonymous . NFS

) netbios TCP/IP ""

netbeui(
.

)( : telnet .

. SSH



telnet

"" . SSH ) (
.

:Email .

)( .


. .
. :TCP/IP

:
) ( " " ][
.FTP

. ) (
"" .

: .
: . :
) (rsh, ssh, rexec ) RPC (Remote Procedure Call

. RPC
Xerox Courier ) Sun RPC (.

. Yellow Pages ) Sun NIS Sun(


. DNS


) .(IP
: telnet .
) (.
) ( :
. .X Window

4.2

TCP/IP

TCP/IP .
TCP )(
) OSI/ISO

(.
.
TCP
.
IP
. OSI/ISO

) (.

TCP ) UDP (User Datagram Protocol )

(datagrams . )

( TCP ) (.
) ICMP Internet Control Message

.(Protocol ICMP .
. ICMP

. ICMP UDP ) (datagrams UDP


)

(.

) OSI/ISO OSI open systems


(International Standards Organization
interconnection reference model ISO

. ] [.

SMTP .

telnet FTP

TCP, UDP .

IP .

.
. .

,Ethernet, ADSL .

TCP/IP TCP, IP, UDP

Berkley Sun .

) ( ) .(Internet Protocol Suit IPS TCP/IP

.IPS ) RFC 1011 ]


.(RFC [IET IPv6 ) Ipng IP

]
(next generation .IPv4
) ( [( .

4.3

) (

) (OSI ][

LAN ) Ethernet FastEthernet .(GigaEthernet )10


100 1000 ( .

.
) (

) .(RJ45 10baseT
) 100baseT ( repeaters hubs .

(routers
Ethernet ) hubs switches
. Ethernet LAN

) FDDI
(Fiber Distributed Data Interface

Ethernet ) FDDI (.


) ATM (Asynchronous Transfer Mode LAN

.

/ : Frame Relay
) X.25 WAN

( ) Packet Radio AX.25 NetRom (Rose

)
RDSL, DSL, ADSL( .

SLIP .PPP TCP/IP

) ( .
.

/ Ethernet ) ethX X
( ) pppX (PPP ) slX (SLIP fddiX .FDDI

.
/ ) (


][ make menuconfig
][ ) ][ (.
/dev/ )

( .

2 TCP/IP
:

/ : " intranet ) (

.

/ ) (www .

) :(node )( )

.. CD(
/ .

) Ethernet Address :(MAC Address 48 ):


00:88:40:73:AB:FF
0000 0000 1000 1000 0100 0000 0111 0011 1010 1011 1111 1111

)
)( ) (
(.

: .

32 )] a-z, A-Z, 0-9 ([


'.'#

: Internet Address IP 255 0 )

(192.168.0.1 . IP

DNS ) ( ) IP

.(named

: port )] [ TCP
) (UDP telnet 23


FTP .21
.

)( : ) ( .

: Domain Name System DNS

) ( ) COM
EDU GOV MIL ) ( ORG

CAT Catalan( .

) www.uoc.edu
.(nteum@pirulo.remix.es ) ( uoc.edu remix.es

) ( ) SRI-NIC
][.

:DHCP, bootp ) IP( .


:ARP, RARP ) IEEE 802 LAN ( IP


ARP
:
.RARP ARP ) MAC (OSI

) .(IP RARP )

( RARP .
.

:Socket Library TCP/IP )

/(.

API .
TCP/IP ) Berkeley Socket Library

.(Winsocks ) (socket )

(bind ) ,connect, listen, accept, send, sendto, recv, recvfrom


(

. ) (AT INET

) .(AF UNIX / C
libc AF_INET AF_UNIX ) AF_IPX (Novell ) AF_X25

(X.25 AF_ATMPVC ) AF_ATMSVC (ATM AF_AX25 AF_NETROM


) AF_ROSE .(amateur radio

3 IP
.
. ) 0 255

32 4( .
) ( .

) 0 : (0.0.0.0 : ) 127 :

(127.0.0.1 ) local loopback (local host 0 )

(192.168.0.0 255 broadcast ) .(192.168.255.255

) A :(network.host.host.host
( .
1.0.0.1 ) 126.254.254.254 126 16
7 + 0 : 24 + .

) B :(net.net.host,host 128.1.0.1
(
16) 191.255.254.254 65
. 14 + 10 16 + .

) C :(net.net.net.host 192.1.1.1 ) 223.255.255.254


254( . 21 + 110 8 + .
D ) E :(net.net.net.host 224.1.1.1 255.255.255.254

) (multicast.
)

( . A 10.0.0.0
10.255.255.255 B 172.31.0.0 172.16.0.0 C 192.168.0.0
.192.168.255.0

)
broadcast

( . ) datagrams (

. ARP IP
.

IP .

.
.

IP A B C

32 ) .(IP

) (AND .

B 172.17.0.0 .255.255.0.0
) ( . 20

) 172.17.1.0 ( 172.17.1.0 .172.17.20.0

) (backbone : .172.17.1.0


IP

) .(255.255.255.0

.
] [ :
(1 ) .(172.17.2.0
(2 ) .(172.17.4.0
(3 ) .(172.17.6.0
(4 ) FFDI .(172.17.1.0

.FFDI :

(1 172.17.2.1 : .172.17.1.1
(2 172.17.4.1 : .172.17.1.2
(3 172.17.6.1 : 172.17.1.3
.
TCP/IP
. ) (Purchases0

) .(HumanResources3 .

Purchases0 HumanResources3
.HumanResources3


) (.

:1

.0.0.0.0 32
:
.

172.17.1.0

255.255.255.0

fddi0

172.17.4.0

255.255.255.0

172.17.1.2

fddi0

172.17.6.0

255.255.255.0

172.17.1.3

fddi0

0.0.0.0

0.0.0.0

172.17.2.1

fddi0

172.17.2.0

255.255.255.0

eth0

" .

"" ) ( .
.


172.17.2.4 172.17.2.6:

172.17.2.4 AND 255.255.255.0 = 172.17.2.0
172.17.2.6 AND 255.255.255.0 = 172.17.2.0

. 172.17.2.4

172.17.6.6 172.17.2.1 ) eth0 (ffdi0 172.17.1.1


172.17.1.2 ) ffdi0 (eth0 .172.17.6.6

.
. route

) ( Routing

Information Protocol RIP External Gateway Protocol EGP

.Border Gateway Protocol BGP .gated


: IP IP
.DNS

( : 192.168.110.23 255.255.255.0 192.168.110

23 192.168.110.0 .192.168.110.255

4.1

/ init /etc/inittab
. inittab si::sysinit:/etc/init.d/boot : .

/etc/init/network
S ) /etc/rc2.d/
.
(/etc/initd/ K .
) (/etc/init.d/
.
] eth[0...n

.
.
:

. ) ifconfig .(interface configure :

ifconfig eth0 192.168.110.23 netmask 255.255.255.0 up

eth0 IP 92.168.110.23 .255.255.255.0

up ) (ifconfig eth0 down

. C 192.168.110.23

.192.168.110.255

ifup ifdown

/etc/network/interfaces ) man interfaces (.

(
)
ifup ifdown ./etc/network/interfaces
.
eth0 ] [ ) man

interfaces 5 (:

ifdown eth0

eth0

vi /etc/network/interfaces
ifup eth0

eth0

eth0 IP 192.168.0.123

.192.168.0.1 /etc/network/interfaces :

iface eth0 inet static


address 192.168.0.123
netmask 255.255.255.0
gateway 192.168.0.1

resolvconf .DNS :
iface eth0 inet static
address 192.168.0.123
netmask 255.255.255.0
gateway 192.168.0.1
dns-search remix.org
dns-nameservers 195.238.2.21 195.238.2.22

dns-search dns-nameservers

.resolv.conf remix.org dns-search resolv.conf

) ( 195.238.2.21 195.238.2.22 dns-nameserver

nameserver ) resolv.conf .(man resolv.conf


) ip ifconfig (route )
.
tunnels (

4.1.1

./etc/sysconfig/network :

NETWORKING=yes
HOSTNAME=my-hostname
FORWARD_IPV4=true

hostname
true NAT

false .
) (

GATEWAY=XXX.XXX.XXX.YYY

DHCP GATEWAY .

NIS NISDOMAIN=NISProject1 :

eth0 :/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
BROADCAST=XXX.XXX.XXX.255
IPADDR=XXX.XXX.XXX.XXX
NETMASK=255.255.255.0
NETWORK=XXX.XXX.XXX.0

ONBOOT= yes

:
TYPE=Ethernet
HWADDR=XX:XX:XX:XX:XX:XX
GATEWAY=XXX.XXX.XXX.XXX
IPV6INIT=no
USERCTL=no
PEERDNS=yes

:DHCP
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=dhcp


DHCP BOOTPROTO=dhcp .BOOTPROTO=none
) service network restart .(/etc/init.d/network restart
:
(1 hostname new-name
(2 /etc/sysconfig/network .HOSTNAME=new-name
(3 ) (:

) service network restart .(/etc/init.d/network restart

init 3 .init 5

./etc/hosts
sysctl -w kernel.hostname=newname

4.1.2
) wireless-tools ifconfig .(ip
1

iwconfig ./etc/network/interfaces
: ) (:

) Intel Pro/Wireless 2200BG


.( Dell Hp :
modprobe
. ) ( . module-assistant
)
( .. ) . (ipw2200
m-a .module-assistant
)

( apt-get install module-assistant


m-a -t update
m-a -t -f get ipw2200
m-a -t --build ipw2200
m-a -t install ipw2200

. ) ((
. . 1.8 2.0.4
:
http://ipw2200.sourceforge.net/firmware.php

:
tar xzvf ipw2200fw2.4.tgz C /tmp/fwr/
cp /tmp/fwr/*.fw /usr/lib/hotplug/firmware/

) ipw2200-bss.fw ipw2200-ibss.fw (ipw2200-sniffer.fw


modprobe ipw2200 : | dmesg
grep ipw )
:(lsmod
ipw2200: Intel(R) PRO/Wireless 2200/2915 Network Driver, git1.0.8
ipw2200: Detected Intel PRO/Wireless 2200BG Network Connection
...

iwconfig

1
/ ) iw .(man iw

apt-get iwconfig :
"ESSID:"Name-of-the-Wifi

IEEE 802.11b

Frequency:2.437 GHz

eth1

Mode: Managed

Access Point: 00:0E:38:84:C8:72


TxPower=20 dBm

Bit Rate=11 Mb/s


Security mode: open
...

] [ gedit /etc/network/interfaces

eth1 :
2

iface eth1 inet dhcp


" pre-up iwconfig eth1 essid
pre-up iwconfig eth1 key open XXXXXXXXXX

pre-up iwconfig .

) DHCP IP ( . DHCP static


) (:
address 192.168.1.132
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.1.1

:
iface eth1 inet dhcp
" wireless-essid
wireless-key 123456789e

ifup eth1 .
2 .
eth0, eth1, ...ethN ,wifi0, wifi1 ,wlan0, wlan1
.

) ( iwlist scan

iwconfig .

4.2

pirulo.remix.com .192.168.110.23

/etc/resolv.conf . ) ( .

) domain : () search ( ) name server IP


.(DNS

/etc/resolv.conf
domain remix.com
search remix.com piru.com
name server 192.168.110.1
name server 192.168.110.65

. ) (pppd IP ) (dhclient

resolv.conf
. resolvconf .

resolvconf

. :

http://packages.debian.org/unstable/net/resolvconf

/etc/host.conf .

. DNS

).(/etc/hosts
/etc/hosts

order hosts,bind
multi on

DNS ) (

./etc/hosts /etc/hosts

.DNS

.loopback
/etc/hosts
loopback

localhost

127001

pirulo

pirulo.remix.com

19216812

.IP

loopback )

( . 127001
) telnet 127001 ( . )

(.

loopback
ifconfig lo 127001
route add host 127001 lo

/ .host.conf
.

/etc/nsswitch.conf .

IP DNS
) /etc/resolv.conf IP (DNS

) .(/etc/hosts nis nisplus

. ) ][( :
hosts xfn nisplus dns [NOTFOUND = return] files
DNS
. "! :
hosts dns [!UNAVAIL = return] files

4.3

. . )
( ) Ethernet, PPP,

.( ,SLIP :

IP .

route .

. .
C 1921681100

.1921681103 :
19216811023
:

ifconfig eth0 19216811023 netmask 2552552550 up

* 1921680 :
route add -net 1921 ethernetmask 2552552550 eth0

-net .-host 1921681103


) (1921
.
default route .

route add default gw 1921681103 eth0

) gw IP (.
:
ifconfig eth0 inet down
ifconfig lo
Link encap:Local Loopback
) eth0 (
route
) (

IP :

\ ifconfig eth0 inet up 1921680111


netmask 25525500 broadcast 192168255255
\ route add -net 10000 netmask 255000
gw 19216801 dev eth0

.:
)\(
ifconfig
ifconfig
eth0 Link encap:Ethernet HWaddr 08:00:46:7A:02:B0
inet addr:192.168.0.111 Bcast: 192.168.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
...
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
...
route
Kernel IP routing table
Flags Metric Ref Use Iface

Genmask

Gateway

Destination

eth0

25525500

19216800

eth

UG

255000

19216801

10000

) ifconfig (8 ).route (8

4.4

inetd


. .IP:port

: ) ( .inetd

inetd /etc/inetd.conf

3 .man

.
/etc/services : ./etc/inetd.conf

. /etc/services name port/protocol


aliases

. .
) /etc/services # (:
4

4 .

4.5

inetd

/etc/inetd.conf ) .(inetd server daemon

service socket_type proto flags user server_path server_args : service


/etc/services socket_type ) stream, dgram, raw,

(rdm, seqpacket proto ) (/etc/services flags


) wait inetd
nowait inetd ( user

server_path server_args .
#) /etc/inetd.conf # (:

telnet stream tcp nowait root /usr/sbin/tcpd /usr/sbin/in.telnetd


ftp stream tcp nowait root /usr/sbin/tcpd /usr/sbin/in.ftpd
# fsp dgram udp wait root /usr/sbin/tcpd /usr/sbin/in.fspd
shell stream tcp nowait root /usr/sbin/tcpd /usr/sbin/in.rshd
login stream tcp nowait root /usr/sbin/tcpd /usr/sbin/in.rlogind
# exec stream tcp nowait root /usr/sbin/tcpd /usr/sbin/in.rexecd...

inetd ) xinetd (
) /etc/xinetd.conf ( . inetd ) /etc/init.d/inetd.real start

) (/etc/rcX.d ( . inetd

)
xinetd

(:

:ssh telnet ) /etc/ssh/ssh_config(

.( )/etc/ssh/sshd.conf
: (multi transfer agent MTA) :Exim

./etc/mail-addresses /etc/aliases /etc/mailname /etc/exim/exim.conf

./etc/fetchmailrc :[ ] POP3 :Fetchmail


.~/.procmailrc :Procmail
:Tcpd
](wrappers )
./etc/hosts.deny /etc/hosts.allow :[
( )/etc/dhcp3/dhclient.conf ( )( )IP :DHCP
.( )/etc/dhcp/dhcpd.conf ( )/etc/default/dhcp3-server

./etc/cvs-pserver.conf /etc/cvs-cron.conf :CVS


./etc/exports :NFS
./etc/samba/smb.conf :Samba
.(CUPS lpr )/etc/printcap :Lpr
./etc/apache2/* /etc/apache/* :Apache2 Apache
./etc/squid/* :( ):Squid

4.6

: :

. /etc/protocols

.
/etc/protocols
#

IP

ip

# Hop-by-Hop ipv6

HOPOPT

#hopopt

ICMP

icmp

/etc/networks /etc/hosts

IP ) route (.
/etc/networks
loopnet 127000
localnet 19216800
amprnet 44000 ...

4.7

# .
/etc/inetd.conf

/etc/ftpusers FTP.

/etc/securetty ) ( tty1, tty2, tty3, tty4 :


root .
.

.tcpd ) (wrapper

/etc/inetd.conf . tcpd :
/etc/hosts.allow ./etc/hosts.deny

FTP

inetd.conf.ftp stream tcp nowait root /usr/sbin/tcpd/usr/in.ftpd :

tcpd /etc/hosts.allow ./etc/hosts.deny /etc/hosts.deny


. ALL:ALL
/etc/hosts.allow.

/etc/hosts.equiv .
equivalent . .rhosts
/etc/security/access.conf

. " : ::
. + ) ( /

.
user@host

access.conf

:tty1
ALL EXCEPT root:tty1

u1, u2, g1 ] [ : .remix.com


+:u1 u2 g1 .remox.com:ALL

4.8

IP

.
./proc/sys/net/ipv4 1 0.

ip_forward :
echo 1 > /proc/sys/net/ipv4/ip_forward

ip_forward : IP Masquerading

ip_default_ttl ) 64 ( ip_bootp_agent

) ( ZERO.b.c.d broadcast .multicast

4.8.1
:
ifconfig
cat /proc/pci
cat /proc/interrupts
dmesg | more

) netkit-ping, traceroute,

dnsutils, iptables, net-tools(:

ping uoc.edu

# verifies the Internet connection

traceroute uoc.edu

# scans IP packets

ifconfig

# verifies the host configuration

route -n

# verifies the routing configuration

dig [@dns.uoc.edu] www.uoc.edu # verifies the registries in


# on the dns.uoc.edu server.
iptables -L -n |less

# verifies packet filtering (kernel >=2.4)

netstat -a

# shows all the open ports

netstat -l --inet

# shows all the listening ports

netstat -ln --tcp

# shoos the listening tcp ports (number)

5 DHCP
DHCP .Dynamic Host Configuration Protocol

DHCP
. ) dhcp3-client : Internet

(Software Consortium ) dhcpcd ( ) pump(

/etc/network/interfaces
dhcp ) dhcp
.( iface eth0 inet dhcp

) DHCP
.

.
(
255255255255 / . :

route add -host 255255255255 dev eth0

255255255255:Unknown : :/etc/hosts

host :

255255255255 dhcp :

route add -host dhcp dev eth0

DHCP ) linuxconf ( ./etc/dhcpd.conf

# Example of /etc/dhcpd.conf:
;default-lease-time 1200
;max-lease-time 9200
;"option domain-name "remix.com
;deny unknown-clients
;deny bootp
;option broadcast-address 192.168.11.255
;option routers 192.168.11.254
;option domain-name-servers 192.168.11.1,192.168.168.11.2
subnet 192.168.11.0 netmask 255.255.255.0
;{ not authoritative
range 192.168.11.1 192.168.11.254
{ host marte
;hardware ethernet 00:00:95:C7:06:4C
;fixed address 192.168.11.146
;"option host-name "marte
}
{ host saturno
;hardware ethernet 00:00:95:C7:06:44
;fixed address 192.168.11.147
;"option host-name "saturno
}
}

192168111 19216811254 .

} { . 1200
) 9200 (.

/var/state/dhcp/dhcpd.leases )

.(touch /var/state/dhcp/dhcpd.leases ) /usr/sbin/dhcp :


( . /usr/sbin/dhcpd -d -f

.
not authoritative ] [

dhcp .

6 IP
.

ISPs ) (FTP .

Network Aliasing .IP aliasing


.
.
eth0:0 ppp0:8

. :

ifconfig eth0 192.168.110.23 netmask 255.255.255.0 up


route add -net 192.168.110.0 netmask 255.255.255.0 eth0
ifconfig eth0:0 192.168.10.23 netmask 255.255.255.0 up
route add -net 192.168.10.0 netmask 255.255.255.0 eth0:0

19216811023 1921681023 .
) .(ifconfig eth0:0- 0
.

LAN LAN 1921680x/24


IP DHCP .
/etc/network/interfaces :
iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.0
network 192.168.0.0

broadcast 192.168.0.255
iface eth0:0 inet dhcp

eth0 .
eth0:0

IP masquerade 7
IP Masquerade .

(192168101
)
IP.
) (talk

) PASV (passive ) .(FTP telnet IRC .

: TCP/IP IP: forwarding/gatewaying .IP: Masquerading


SLIP PPP )

RFC 1918 ) (IP/Mask


( .
10000/255000 : 1721600/25524000

.19216800/25525500 masquerade .

. :

IP :19216810/2552552550
route add -net 192.168.1.0 netmask 255.255.255.0 eth0

:
route add default ppp0

1921681/24 masqerade:
ipchains -A forward -s 192.168.1.0/24 -j MASQ

iptables 24:
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

ipchains .iptables

NAT 8 2 2
NAT IP Masquerade /

. TCP/IP/ 22 NAT .
CONFIG_IP_ADVANCED_ROUTER : CONFIG_IP_MULTIPLE_TABLES
.CONFIG_IP_ROUTE_NAT

) NAT ( :
CONFIG_IP_FIREWALL .CONFIG_IP_ROUTE_FWMARK
) ip

.(/ftp://ftp.inr.ac.ru/ip_routing :

>ip add route nat <extaddr>[/<masklen>] via <intaddr

) ext-addr ( int-addr

) ( . .
. :
ip route add nat 24001134 via 19210902
ip route add nat 24001132/27 via 19210900

19210902 .24001134

19210900/31 .24001132/63 D

E * 2400* . ) 24011034
(24001132/63 .

9 DialUP PPP
PPP / . ) PPP

( ) /
winmodems

(.

: init-string )
ATZ init-strings

(.

:ISP ) ( .
DNS .pppd
. echo > /dev/ttyS

. ttyS1 .

/
. cat /proc/pci .PCI
) kppp * kde-network-ppp *.(ppp

./usr/bin/kppp :

Accounts
' 'PAP/CHAP Dial
Store Password yes
IP Dynamic IP Address
Autoconfigure hostname No
Gateway

Gateway Assign the Default Route


DNS Configuration Automatic Disable existing DNS
)Device ttyS1(com1) o ttyS2 (com2
) Modem (ttySx

) ping www.google.com

( . kppp linuxconf .gnomeppp

pppd pppconfig .
pppconfig .wvdial pppd

wvdial pppd .
wvdial .
PPP my_isp

/etc/network/interfaces ) ifup ifdown pon poff


:(ppp
iface ppp0 inet ppp
provider my_isp

ifup ppp0 :
pon my_isp

ifup .PPP pon pppd


ifup PPP .

/etc/ppp/ip-up ./etc/ppp/ip-up.d/

PPP

ATM/ . PPP over Ethernet PPPoE

PPP PPPoE
PPP . .my_ISP
.my_isp pppoeconf pppoeconf .

/etc/network/interfaces :

iface eth0 inet ppp


provider my_isp

PPPoE ) maximum transmit unit



(MTU DSL DSL-HOWTO .

/ PPPoE .

10

hotplug

) ( .
hotplug

) PCMCIA ( discover
. hotplug .

hotplug . hotplug

/etc/hotplug/ ./etc/hotplug.d/ ./etc/hotplug/net.agent


PCMCIA eth0 .
/etc/hotplug/net.agent:
ifup eth0=hotplug

hotplug /etc/network/interfaces
. eth0 :/etc/network/interfaces
mapping hotplug
script echo

hotplug eth0 grep echo :


mapping hotplug
script grep
map eth0

ifplugd .

.Wi-Fi ifplugd

ifup ifdown . ifplugd .hotplug


/etc/hotplug.d/net/ifplugd.hotplug ifplug .

ifplugd ifup .
Wi-Fi WEP . ifplugd

ifup ifup

] [ . waproamd

WEP . man

waproamd .

11

VPN
Virtual Private Network VPN
.

VPN ] [

] ) (VPN [ .

. VPN SSH (SSL), CIPE,


IPSec, PPTP ) VPN PPP-SSH HOWTO VPN-
HOWTO . (.
OpenVPN SSL VPN

VPN WiFi

. OpenVPN OSI SSL/TSL


OpenVPN .
.
OpenVPN OpenVPN

VPN .
) Public Key Infrastructure PKI ( X509 .VPN



5 .https://en.wikipedia.org/wiki/VPN :

.11.1

VPN 10801 .10802

UDP 1194 .OpenVPN )


(http://openvpn.net/install.html :

openvpn --genkey --secret static.key

static.key ) ssh scp ( .


openVPN_server :
dev tun
ifconfig 10801 10802
secret static.key

openVPN_client
remote myremote.mydomain
dev tun
ifconfig 10802 10801
secret static.key

VPN UDP 1194


tun0 OpenVPN . %90
OpenVPN .

OpenVPN
][ :
]openvpn [server config file

Sun Feb 6 20:46:38 2005 OpenVPN 2.0_rc12 i686-suse-linux [SSL] [LZO] [EPOLL]
built on Feb 5 2005
Sun Feb 6 20:46:38 2005 Diffie-Hellman initialized with 1024 bit key
Sun Feb 6 20:46:38 2005 TLS-Auth MTU parms [ L:1542 D:138 EF:38 EB:0 ET:0
EL:0 ]
Sun Feb 6 20:46:38 2005 TUN/TAP device tun1 opened
Sun Feb 6 20:46:38 2005 /sbin/ifconfig tun1 10.8.0.1 pointopoint 10.8.0.2 mtu 1500
Sun Feb 6 20:46:38 2005 /sbin/route add -net 10.8.0.0 netmask 255.255.255.0 gw
10.8.0.2
Sun Feb 6 20:46:38 2005 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:23
ET:0 EL:0 AF:3/1 ]
Sun Feb 6 20:46:38 2005 UDPv4 link local (bound): [undef]:1194
Sun Feb 6 20:46:38 2005 UDPv4 link remote: [undef]
Sun Feb 6 20:46:38 2005 MULTI: multi_init called, r=256 v=256
Sun Feb 6 20:46:38 2005 IFCONFIG POOL: base=10.8.0.4 size=62
Sun Feb 6 20:46:38 2005 IFCONFIG POOL LIST
Sun Feb 6 20:46:38 2005 Initialization Sequence Completed

:
openvpn [client config file]

. ping 10801 ping 10802

.http://openvpn.net/howto.html

:
comp-lzo

DNS IP NAT

keng-timer-rem
persist-tun
peepalive 10 60
pirsist-key

: nobody

user nobody
group nobody
Daemon

12

) ( )

( ) ( .

) (
.
:

TCP/IP : sysctl

. /proc/sys/

.sysctl -a ./etc/sysctl.conf
:

/etc/init.d/networking restart

) ( )
(:

net.ipv4.icmp_echo_ignore_all = 1

ICMP ping .DoS


net.ipv4.icmp_echo_ignore_broadcasts = 1

.broadcast
net.ipv4.conf.all.accept_source_route = 0
net.ipv4.conf.lo.accept_source_route = 0

net.ipv4.conf.eth0.accept_source_route = 0
net.ipv4.conf.default.accept_source_route = 0

.(
) IP
net.ipv4.tcp_syncookies = 1
net.ipv4.conf.all.accept_redirects = 0

SYNC DoS
.

net.ipv4.conf.lo.accept_redirects = 0
net.ipv4.conf.eth0.accept_redirects = 0
net.ipv4.conf.default.accept_redirects = 0

) ( ICMP
.

net.ipv4.icmp_ignore_bogus_error_responses = 0

.
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.lo.rp_filter = 1
net.ipv4.conf.eth0.rp_filter = 1
net.ipv4.conf.default.rp_filter = 1

: IP
net.ipv4.tcp_fin_timeout = 40, By default, 60.
net.ipv4.tcp_keepalive_time = 3600, By default, 7.200.
net.ipv4.tcp_window_scaling = 0
net.ipv4.tcp_sack = 0
net.ipv4.tcp_timestamps = 0, By default, all at 1 (enabled).

( 24 )/ :Iptables
.(ipchains) iptables .netfilter

DoS IP MAC . 24
" " network
) ipfilters

packet filtering ] [CONFIG_NETFILTER ( .

) /etc/init.d/ rc(

) (:
6

iptables -A Type -i Interface -p protocol -s SourceIP --source-port Port -d


DestinationIP --destination-port Port -j Action

(
:GnuPG )
) (RFC2440

) (PGP 20 IDEA .RSA /


. http://www.gnupg.org )
7

( gpg --gen-key .

(
./root/ )
/ .
8

gpg --export -ao UID .UID

gpg --import )

6 . "\
.

7 . GnuPG
.

8 .

( gpg --sign-key
.UID gpg --verify file/data/ gpg

-sear file gpg -d file .


:Logcheck ) (

/ .

) (
. .

/ .
PortSentry :TripWire . PortSentry
(
)
9

. TripWire

)( .

) (

. / .

:Xinetd inetd .tcp-wrappers xinetd


DoS
)( . Xinetd )

FTP SSH (

.
) (spam
9

/ ) /etc/xinetd.conf : (Xinetd

) /etc/rc.d/init.d/xinet.d .(xinetd defaults :

services .Xinetd
:

# xinetd.conf
# The default configuration options that are applied to all the
# servers may be modified for each service
defaults
{
instances = 10
log_type = FILE /var/log/service.log
log_on_success = HOST PID
log_on_failure = HOST RECORD
}
# The name of the service must be located in /etc/services to obtain
# the right port
# If the server/Port is not a standard one, use "port = X"
service ftp
{
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/sbin/proftpd
}
#service telnet
#{
# socket_type = stream
# protocol = tcp
# wait = no
# user = root
# no_access = 0.0.0.0
# only_from = 127.0.0.1
# banner_fail = /etc/telnet_fail
# server = /usr/sbin/in.telnetd
#}
service ssh
{

socket_type = stream
protocol = tcp
wait = no
user = root
port = 22
server = /usr/sbin/sshd
server_args = -i
}
service http
{
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/local/apache/bin/httpd
}
#service finger
#{
# socket_type = stream
# protocol = tcp
# wait = no
# user = root
# no_access = 0.0.0.0
# only_from = 127.0.0.1
# banner_fail = /etc/finger_fail
# server = /usr/sbin/in.fingerd
# server_args = -l
#}
# End of /etc/xinetd.conf

defaults .( # )

( log)

imapd )superservers IP
: (popd

default {
instances = 20
log_type = SYSLOG
authpriv log_on_success = HOST
log_on_failure = HOST
only_from = 192.168.0.0/16
per_source = 3
enabled = imaps
}

:
service imapd {
socket_type = stream
wait = no
user = root
server = /usr/sbin/imapd
only_from = 0.0.0.0/0 #allows every client
no_access = 192.168.0.1
instances = 30
log_on_success += DURATION USERID
log_on_failure += USERID
nice = 2
redirect = 192.168.1.1 993 #Makes it possible to redirect the traffic of port 993
to node 192.168.1.1
bind = 192.168.10.4
#Makes it possible to indicate the interface to which the service is associated to
avoid service spoofing problems.
}

) /etc/init.d/xinetd

.( 5 4 3
:
chmod 700 /etc/init.d/xinetd; chown 0.0 /etc/init.d/xconfig; \

chmod 400 /etc/xinetd.conf; chattr +i /etc/xinetd.conf

:Linuxconf /
] [ .
./http://www.solucorp.qc.ca/linuxconf

:Webmin ) webmin-core, webmin-dhcp, webmin-inetd, webmin-sshd packages(



)

( . .

.http://www.webmin.com https://localhost:10000

SSL ) ( .

:system-config-* system-config-
.
. system-

-config system-config-control

. "" " "


10

) Fedora-Extras
11

10 3 .
)( .

11 Pirut . yumex Gnome PackageKit KpackageKit


.yum

( . *system--

config system-config-control "" .

:NetworkManager
) ( . apt-get install :

network-manager-xx xx .

) ( /etc/network/interfaces --
:
auto lo
iface lo inet loopback

/ .
netdev .

) sudo ( adduser current_user

netdev ) /etc/init.d/networking restart

.(netdev
) : ( ) Nmap (
) Nessus ( ] Wireshark [

) http://www.wireshark.org/download.html ) (Ethereal : ( snort

) (intrusion detection system IDS ) Netcat

) TCPDump ( ) Hping2
ICMP/TCP/UDP (.


( :
- .
- ) 4 (.
(.
- )
- ) + (.
- .
.

( "" "" "".

:
.

) ( .
. : ) runlevel 1 (

) ( ) ( ) (.
.
5 3

/sbin/runlevel cat /etc/inittab | grep :initdefault


) id:5:initdefault /etc/inittab (.
/sbin/chkconfig --list system-

config-services ntsysv . chkconfig


crond 3 ./sbin/chkconfig --level 35 crond on :5

/sbin/service --status-all sbin/service


/crond status . ) (start, stop, status, reload, restart

service crond stop service crond restart .

) (acpid, haldaemon, messagebus, :


.klogd, network, syslogd )
( :
:NetworkManager, NetworkManagerDispatcher )
Wifi ( . .
:avahi-daemon, avahi-dnsconfd zeroconf

) DNS .(mDNS
:bluetooth, hcid, hidd, sdpd, dund, pand ) Wifi
.(80211 .
:capi, isdn .ISDN
:iptables . )
[(.
DSL ] T1
:ip6tables .IPv6
:netplugd netplugd .
:netfs ) NFS, Samba( .
:nfs, nfslock //
.BSD
:ntpd .
:portmap ) NFS ( / ) NIS(.
:rpcgssd, rpcidmapd, rpcsvcgssd ) NFS v4 .(NFS
:sendmail ) (MTA IMAP .POP3
:smb .

:sshd sshd .
:yum-updatesd .
:xinetd inetd

) (.

. )/ (
.

: . ) (
. .

) ( .
.

.
.

:
.

) ( .

DNS NISYP LDAPK


. ) (SSH, Telnet FTP

) (MTA, IMAP, POP

) (wiki .NFS /
.

1 DNS
) DNS ( )

( IP.

pirulo.remix.com ) 192.168.0.1
(mapping IP ) reverse
.(mapping
DNS .

DNS .

named / )
(/usr/sbin/named ) bind ( 9
1

.Internet Software Consortium ISC DNS


.

. bind .bind-doc bind


bind-utils caching-nameserver yum .

1.1

DNS )
(

) /etc/bind/named.conf ( ) //
(:

1 .

options {
directory "/var/cache/bind";
// query-source address * port 53;
// forwarders {
//

0.0.0.0;

// };
auth-nxdomain no; # conform to RFC1035
};
// prime the server with knowledge of the root servers}
zone "." {
type hint;
file "/etc/bind/db.root"; };
// be authoritative for the localhost forward and reverse zones, and for
// broadcast zones as per RFC 1912
}
zone "localhost" {
type master;
file "/etc/bind/db.local";
};
zone "127.in-addr.arpa" {
type master;
file "/etc/bind/db.127";
};
zone "0.in-addr.arpa" {
type master;
file "/etc/bind/db.0";
};
zone "255.in-addr.arpa" {
type master;
file "/etc/bind/db.255";
};
// add entries for other zones below here
}

.(/var/cache/bind/ ) directory

) /etc/bind/db.root

; " (. :
...
; formerly NS.INTERNIC.NET
;
. 3600000 IN NS A.ROOT-SERVERS.NET.
A.ROOT-SERVERS.NET. 3600000 A 198.41.0.4
;
; formerly NS1.ISI.EDU
;
. 3600000 NS B.ROOT-SERVERS.NET.
B.ROOT-SERVERS.NET. 3600000 A 128.9.0.107
;
; formerly C.PSI.NET
;
. 3600000 NS C.ROOT-SERVERS.NET.
C.ROOT-SERVERS.NET. 3600000 A 192.33.4.12
;
...

) (root name servers .


. localhost in-addr.arpa.127
.
/etc/bind/db.local/ /etc/bind/db.127/

) (RFC1912 . db.local

) "; (:

; BIND reverse data file for local loopback interface


$TTL 604800
( root.remix.bogus.

ns.remix.bogus.

SOA

; Serial

; Refresh

604800

; Retry

86400

; Expire

2419200

; Negative Cache TTL

)604800

ns.remix.bogus.

NS

IN

localhost.

PTR

IN

@
IN

1.0.0

. :/etc/resolv.conf
search subdomain.your-domain.domain your-domain.domain
# for example search remix.bogus bogus
nameserver 127.0.0.1

subdomain.your-domain.domain .
) search domain

( ) (.

: pirulo pirulo.subdomain.your-
domain.domain pirulo.your-domain.domain .pirulo

pirulo subdomain.your-domain.domain .
named .

/etc/init.d/bind9 start ) named (/etc/init.d/bind9 reload


./usr/sbin/named /var/log/daemon.log :
\\ Sep 1 20:42:28 remolix named[165]: starting BIND 9.2.1
\\ Sep 1 20:42:28 remolix named[165]: using 1 CPU
Sep 1 20:42:28 remolix named[167]: loading configuration from
''/etc/bind/named.conf

(
( ) nslookup
host ) dig( . dig -x 127.0.0.1 :

# dig -x 127.0.0.1
;; <<>> DiG 9.2.1 <<>> -x 127.0.0.1
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 31245
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION: ;1.0.0.127.in-addr.arpa. IN PTR
;;ANSWER SECTION: 1.0.0.127.in-addr.arpa. 604800 IN PTR localhost.
;; AUTHORITY SECTION: 127.in-addr.arpa. 604800 IN NS ns.remix.bogus.
;; Query time: 1 msec
);; SERVER: 127.0.0.1 #53(127.0.0.1
;; WHEN: Mon Sep 1 22:23:35 2003
;; MSG SIZE rcvd: 91

1 .

. BIND9 ) lwresd lightweight resolver

(daemon .BIND9 lightweight resolver

) caching ( BIND9 lightweight resolver


protocol .DNS ) 127.0.0.1

( UDP .921 .DNS


lwresd lightweight .

./etc/nsswitch.conf
IP :
hosts: files dns

) (

/etc/hosts DNS ./etc/resolv.conf

1.2

Forwarders

.Forwarders
ISP .
) (// forwarders etc/bind/named.conf

0.0.0.0 .

1.3

DNS ") . .(/etc/bind/db.root . TLDs

) (top level domains org, com, edu, net .


. )

(pirulo.remix.com DNS ) (1

) in-addr.arpa (reverse mapping

.IP

. pirulo.remix.com 192.168.0.1 1.0.168.192


.pirulo.remix.com remix.bogus :/etc/bind/db.127

; BIND reverse data file for local loopback interface


$TTL 604800
( root.remix.bogus.

SOA

ns.remix.bogus.

; Serial

; Refresh

604800

; Retry

86400

; Expire

2419200

; Negative Cache TTL

)604800

ns.remix.bogus.

NS

IN

localhost.

PTR

IN

@
IN

1.0.0

" ". .

in-addr.arpa .127. ) (db.127 3 .SOA, NS, PTR : ) SOA

(start of authority TTL @

NS name server PTR ) (domain name pointer

1 127.0.0.1 .local host 1 ) root@remix.bogus

(SOA . named dig -x


127.0.0.1 ) (.
:named.conf
{ zone remix.bogus
;type master
;notify no
;file /etc/bind/remix.bogus
;}

named . remix.bogus
:

; Zone file for remix.bogus


$TTL 604800
( root.remix.bogus.

ns.remix.bogus.

SOA

IN

; serial, todays date + todays serial

199802151

; Refresh

604800

; Retry

86400

; Expire

2419200

; Negative Cache TTL

) 604800

; Inet Address of name server

ns

NS

mail.remix.bogus.

10

MX

127.0.0.1

localhost

192.168.1.2

ns

192.168.1.4

mail

; Primary Mail Exchanger

"TXT "Mail Server


192.168.1.5

10 mail

MX

ftp

CNAME

ftp
www

MX Mail eXchanger .
someone@remix.bogus ) mail.remix.bogus

.(MX ) SOA

mail.remix.bogus mail.remix.bogus.remix.bogue
( . ) CNAME (canonical name .
) /etc/init.d/bind9 reload .dig.remix.bogus

inverse

:
IP

{ "zone "192.168.1.in-addr.arpa
;type master
;notify no
;"file "/etc/bind/192.168.1
;}

/etc/bind/192.168.1 :

$TTL 604800
( root.remix.bogus.

ns.remix.bogus.

SOA

IN

; serial, todays date + todays serial

199802151

; Refresh

604800

; Retry

86400

; Expire

2419200

; Negative Cache TTL

) 604800

ns.remix.bogus.

NS

ns.remix.bogus

PTR

mail.remix.bogus

PTR

ftp.remix.bogus

PTR

.dig -x 192.168.1.4

DNS ) DNS DNS ( .


.
DNS-HOWTO .http://tldp.org/HOWTO/DNS-HOWTO-7.html

master server slave


) slave ""( master .
:

{ zone "remix.bogus
;type slave
;notify no
;]masters [19216812
;}

NIS (YP) 2

/ ) Sun Solaris ( Network

Information Services ) NIS Sun Yellow Pages .(YP /

NIS NIS+ .NIS


NIS : ) ( ) (/etc/passwd )

( ) (/etc/group
)

NFS .(automount

NIS

" " ) (

.

) multiple server architecture +(.

2.1

NIS

NIS:
) netbase TCP/IP( ) portmap

RPC DARPA RPC NFS (NIS ) nis(

. kpackage ) apt-get

. NIS ) .(NIS
(apt-cache pkgnames
) NIS ( . NISPirulo

.Nispirulo nisdomainname
./proc/sys/kernel/domainname

portmap:
/etc/init.d/portmap start

.rpcinfo -p
NIS .ypbind ypbind

) broadcast (

) /etc/yp.conf( . /etc/yp.conf :

hostname .nisdomain
:domain nisdomain server hostname


:domain nisdomain broadcast

NIS .

:ypserver hostname hostname . )

(ypserver IP .NIS
DNS /etc/hosts .
:

2 hostname ) ( nisdomain .nis

/etc/init.d/nis stop

:
/etc/init.d/nis start

. ) NIS rpcinfo localhost ypbind


( ) ypcat mapname

ypcat passwd NIS ( mapnames

NIS ./var/yp/nicknames

2.2

NIS

) libc

( .
:
( /etc/nsswitch.conf passwd, group, shadow, netgroup
:

passwd: compat
group: compat
shadow: compat
netgroup: nis

man nsswitch.conf .
( NIS ) /etc/passwd
:(NIS

) 6 (

+::::::

( " + "? /etc/passwd


. ) shadows

(
:/etc/shadow
) (

+::::::::

( :/etc/group
) (

+:::

( ) (hosts lookup ) DNS (NIS

hosts: files dns : /etc/nsswitch.conf .Libc6

NIS .hosts: files nis libc5 host.conf


order hosts, DNS hosts, NIS .

) (NIS

/etc/passwd ) .(ypserver
ssh -l localhost .ypserver

NIS

2.3

nis ) portmap portmap( NIS )

(:

/etc/hosts ) FQDN

(Fully Qualified Domain Name IP

) pirulo.remix.com pirulo .(19216801

NIS .DNS
/etc/defaultdomain .

DNS /etc/ypserv.securenets

network/netmask

/etc/ypserv.conf

maps .passwd.byname o shadow.byname :


NISSERVER = master ./etc/default/nis

./etc/ypserv.securenets
/etc/init.d/nis stop ./etc/init.d/nis start ypserv
yppasswdd .ypwhich -d domain

2.4


/usr/lib/yp/ypinit -m
.
/etc/networks

.touch /etc/networks


ypbind NIS
/etc/passwd NIS ) +:::::: (

NIS .

passwd, chfn,

adduser . .yppasswd, ypchsh, ypchfn


NIS make

/var/yp .
NISSERVER = slave ./etc/default/nis

NOPUSH = false
./var/yp/Makefile
:
/usr/lib/yp/ypinit -m

. .
:
/etc/init.d/nis stop
/etc/init.d/nis start

:
/usr/lib/yp/ypinit -s name_master_server.

.
nis /etc/cron.d ) chmod 755
(/etc/cron.d/nis
NIS.

: adduser make -C /var/yp ) NIS
passwd

.(NIS NIS ypmatch userid passwd


userid adduser .make NIS

http://tldp.org/HOWTO/NIS-HOWTO/verification.html

.NIS

3 telnet : ssh

3.1

telnet telnetd

telnet )( .telnetd telnet

> telnet .open host


telnet host telnet

) ( open logout ) mode ( close, encrypt, quit, set,


unset "! . /etc/telnetrc .telnetrc

) (.
telnetd telnet . telnetd inetd

) tcpd wrapper hosts.allow (hosts.deny


telnetd ) /etc/inetd ( :
telnet stream tcp nowait telnetd.telenetd /usr/sbin/tcpd /usr/bin/in.telnetd

. inetd
xinetd /etc/xinetd.conf ) ( .

inetd ./etc/init.d/inetd.real start

/etc/uissue.net telnet . /etc/security/access.conf


3 telnet
) SSH ( SSH POSIX .

telnet-telnetd

) (


) (

.

) ( apt-get install telnetd


/etc/inetd.conf ) /etc/xinetd.conf /etc/xinetd.d/

( . xinetd.conf xinetd.d/telnetd )
xinetd.conf :(service xinetd restart
service telnet
{
disable = no
flags = REUSE
socket_type = stream
wait = nouser = root
server = /usr/sbin/in.telnetd
log_on_failure += USERID
}

telnetd SSL telnetd telnetd


SSL ) SSH ( . SSLTelnet telnet

SSL telnet



. telnet

tcpdump . SSLTelnet

) (https://servidor.web.org : .telnet server.web.org 443

3.2

Secure Shell SSH

SSH telnet rlogin .rsh )

(SSLTelnet :
) telnet-telnetd

(
. ) ( ,telnet, rsh .

telnet )
) ssh (OpenSSH

( . ssh sshd.
3.2.1

ssh

:
ssh user@hostname

ssh -l login name host

SSH X11 TCP/IP . -l


. SSH

) (man ssh RSA .

.ssh-keygen -t rsa|dsa .ssh


id_rsa id_rsa.pub ) .(RSA

) (id_rsa.pub .ssh

.authorized_keys

. ) .rhosts ( .

- .


) (

. man
.ssh ][:
ssh -l login name host_remote_command

:
ssh -l user localhost ls -a

3.2.2

sshd

sshd )( ) ssh (apt-get install ssh


( . rlogin telnet rsh
.
) /etc/init.d (/etc/rc . sshd

.ssh RSA

RSA .

256 .

. ) ( .

.

.man ssh

3.2.3

ssh

sshd

) POP3 X11 (

. tunnel )
ssh (putty .sshd

. POP3 110
) sshd ( :
ssh -C -L 1100:localhost:110 user-id@host

user-id@host .
1100 110 ) POP3

-C (.

.
) ( .

gateway proxy Squid


.3128:
ssh -C -L 8080:proxy:3128 user@gateway

8080 gateway
proxy .3128 . http://localhost:8080
4

4 ) (
.

4 FTP :
FTP / ) (TCP
. ftp . ftpd
5

4.1

) ftp (

FTP FTP FTP . FTP


:
ftp server-name

ftp :
open server-name

) anonymous

anonymous ( ) (
. ASCII .binary

ASCII . ascii .binary

FTP ) ls ( ) get file_name ( mget ) put file_name

( mput .

"! . !cd /tmp

./tmp/ hash
.tick ) (man ftp .
6

5 ftp vsftpd .lftpd

6 help .ftp

ncftp, lukemftp, lftp, cftp, yafc : :

. gFTP, WXftp, LLNL XFTP, guiftp


7

4.2

ftp

21 ) inetd xinetd

( . inetd.conf tcpd wrapper host.allow host.deny



ftpd inetd ) ( .

. FTP ) (anonymous

. pub bin etc lib FTP

.ls FTP :
:/etc/ftpusers .
:/etc/ftpchroot chroot .
.

:/etc/ftpwelcome .
:/etc/motd .
:/etc/nologin .
7 filezilla FTP
) ( ) ( .

.
:/var/log/ftpd
FTP ./etc/nologin ftp

. .message ftpd .
5 :
( .
( ./etc/ftpusers
( .

( /etc/ftpchroot ) Anonymous .(FTP


( anonymous FTP /etc/passwd FTP
) (.
FTP

/etc/passwd telnet ssh .


:
useradd -d nteum -s /bin/false nteum

:
passwd nteum

nteum )

/etc/passwd .(/bin/false /bin/false

FTP
./etc/shells ] [Mou01 FTP

. ) WUFTPD (http://www.wuftpd.org ) ProFTPD


(http://www.proftpd.org FTP .

ProFTPD .apt-get install proftpd : debconf


(
) ( . )
inetd
/etc/init.d/proftpd stop ./etc/proftpd.conf

http://www.debian-administration.org/articles/228 ) (TSL
.
) PureFtpd (pure-ftpd

SSL/TSL . /
.http://www.debian-administration.org/articles/383

5
5.1

MTA

Mail Transport Agent MTA /


/ .Simple Mail Transfer Protocol SMTP exim

MTA smail ) sendmail ( .


exim
8

. inetd /etc/inetd.conf
) .(xinetd

exim /etc/exim/exim.conf

eximconfig exim .

. /usr/doc/exim

exim-bV
.

exim -v -bt local_user

local_user .

8 mail bombing
.

:
) exim (mailx ) (
exim postmaster@OurDomain
From: user@domain
To: postmaster@OurDomain
Subject: Test Exim
Test message
^D

mainlog paniclog /var/log/exim/

. ) postmaster
( .

-dNro Nro ) .(9-1 exim -bs


inetd .xinetd /etc/init.d/exim start
. ) (exim-doc-html

. eximon exim

) (.

exim ) exim4 apt-get install exim-daemon-heavy


exim4-config (exim4 exim-
. /usr/share/doc/exim/README.Debian.gz
daemon-heavy

.http://www.exim.org/docs.html

) exim.conf exim ( ) exim4-config (


/etc/exim4/conf.d/

) (/var/lib/exim4/config.autogenerated update-exim4.conf

5.2

)( IMAP

thunderbird

) seamonkey (mozilla.org ) imapd


(IMAP4rev1 . imapd (imap2) 143 ) 993

SSL( ) .(imaps inetd /etc/inetd.conf


:
imap2 stream tcp nowait root /usr/sbin/tcpd /usr/sbin/imapd
imap3 stream tcp nowait root /usr/sbin/tcpd /usr/sbin/imapd

tcpd wrapper hosts.allow hosts.deny .

) uw-imapd " " University of Washington (

uw-imapd-ssl cyrus-imap .courier-imap imap

seamonkey-mail

imap .

imap MD5

) imap

MD5 ( .

imap SSL .993 ssh



imap )

thunderbird .(seamonkey -mail imaps uw-imapd-ssl


imap .ssl
./etc/ssl/certs/imapd.pem

.OpenSSL imaps
/etc/inetd.conf imap2 imap3 imap SSL.

IMAP
Post Office Protocol POP 2 .3 .IMAP POP

courier-pop cyrus-pop3d ) ipopd ( qpopper .solid-pop3d


5.2.1

exim IMAP .

) courier-imap (wu-imapd Maildir


exim maildir ) /etc/exim/exim.conf

(exim4 mail_dir format ) true


.(Maildir exim /etc/init.d/exim restart

) maildir mutt -mailx


.(http://www.mutt.org
fetchmail ) apt-get install

.(fetchmail .fetchmailrc )

(fetchmailconf :

"set postmaster "pirulo


set bouncemail
set no spambounce
set flush
poll pop.domain.com proto pop3
user 'user1' there with password 'secret' is pirulo here
poll mail.domain2.com
user 'user5' there with password 'secret2' is 'pirulo' here
user 'user7' there with password 'secret3' is 'pirulo' here

Fetchmail ) (.

: POP3

.
.pirulo MUA .

. fetchmail ) cron

/var/spool/cron/crontabs/pirulo * * * * /usr/bin/fetchmail -s (1

) set daemon 60 ) .fetchmailrc Autostart


/ .bashrc 60(.

) SpamAssassin (apt-get install spamassassin

Kmail ) Evolution ( . Procmail


) ( . ) apt-get install
(procmail .procmailrc :Spamassassin
" "yes :
VERBOSE = no

~/.Maildir

PATH=/usr/bin:/bin:/usr/local/bin:
MAILDIR=$HOME/Maildir
DEFAULT=$MAILDIR/
# Directory for storing the files
PMDIR=$HOME/.procmail
# Comment if we do not want a log of Procmail
LOGFILE=$PMDIR/log
# Spam filter
INCLUDERC=$PMDIR/spam.r

~/.procmail/spam.rc
# If the spamassassin is not on the PATH
# add the directory to the PATH variable:
# 0fw: spamassassin.lock|
| spamassassin - a
# The three following lines will move
# Spam mail to a directory called
# "spam-folder". If we want to save it in the Inbox, so that
# it can be filtered later with the client, comment the three lines.
:0:
* ^X-Spam-Status: Yes
spam-folder

:( ) spamassassin ~ /.spamassassin/user_prefs

#User preferences file. Ver man


#Mail::SpamAssassin::Conf
#Threshold for recognising a Spam: #Default 5, but with 4 it works a bit better
required_hits 4
# Sites we will never consider Spam to
#come from
whitelist_from root @debian.org
whitelist_from *@uoc.edu
#Sites SPAM always comes from
#(separated by commas)
blacklist_from viagra@domain.com
#Addresses on Whitelist and blacklist are
#global patterns such
#as:"friend@place.com", "*@isp.net", or
#"*.domain.com".
#Insert the word "[SPAM]" in the subject
#(to make filtering easier).
#If we do not wish to comment the line.
subject_tag [SPAM]

.Spam X-Spam-Status: yes


. procmail .

.http://www.debian-administration.org/articles/242

X-Spam-Status: yes

.( junk )

) webmail
(hotmail gmail

http://www.debian- .( apt-get install squirrelmail )Squirrelmail

.administration.org/articles/200

http://www.debian-administration.org/articles/364

)Clamav/Amavisd Exim postfix Procmail

MailDrop

Amavisd postfix spamassassin .(clamav

5.3

Network News Transfer Protocol


.NNTP

. INN CNEWS
. Leafnode USENET TNP

dpkg-reconfigure leafnode

. inetd ) imap .(xinetd leafnode


) regular expressions (^Newsgroups:. * [,] alt.flame$ /etc/news/leafnode/filters
9

)
./etc/passwd /var/spool/news

./etc/news/leafnode/config )
( . ) server ( ) expire

( .

9 Regular expressions RE Regex

... . " "


.

. ) man leafnode
.(/usr/doc/leafnode/README.Debian
:
telnet localhost nntp

] help

) Ctrl + C Quit([.

5.4

httpd

Apache hyper text

.transfer protocol http .

metafiles . ) (
PHP, Perl, Java Servlets, SSL ) .(http://www.apache.org

.

.
. inetd
) (

. /etc/apache ) httpd.conf ( srm.conf


) access.conf ( ) mime.conf (MIME ) magic ( .

/var/log/apache ) error.log ( ) access.log


( ) apache.pid (.

/etc/init.d/apache /etc/rcX.d

.apachectl apacheconfig . :
: /var/www/ .HTML
: /usr/bin/cgibin/ cgi .
: http://server.domain/user .user
:/home/~user/public.html .

.index.html apache apache-common

. ) ( http://localhost

./var/www/index.html
5.4.1

) ( httpd.conf

)
(.

ServerType standalone

ServerRoot /etc/apache


) (
) (.


hosts DNS


CGI

Port 80
User www-data
Group www-data
ServerAdmin webmaster@pirulo.remix.com
ServerName pirulo.remix.com
DocumentRoot /var/www
Alias /icons/ /usr/share/apache/icons/
ScriptAlias /cgibin/ /usr/lib/cgibin

SSL + PHP + MySQL + 2 2

5.4.2

SSL ) PHP ( MySQL + PHPMyAdmin

) ( .

. apt .
.

- ) /root/ :(cd /root


. : http://httpd.apache.org/download.cgi httpd-2.2.4.tar.bz2
:PHP . http://www.php.net/downloads.php PHP 5.2.1 tar.bz2
:MySQL . http://mysql.org/get/Downloads/MySQL-4.1/mysql-standard-4.1.21-pc-
.linux-gnu-i686.tar.gz/from/pick
:PHPMyAdmin . http://prdownloads.sourceforge.net/phpmyadmin/phpMyAdmin-2.9.1-
.all-languages.tar.bz2?download

- .bzip2 libssl-dev openssl gcc g++ cpp make : :


apt-get install bzip2 libssl-dev openssl gcc g++ cpp make

-:

cd /root
tar jvxf httpd-224tar.bz2
cd httpd-224

/usr/local/apache2 prefix
./configure --prefix=/usr/local/apache2 with ssl=/usr/include/openssl --enable-ssl
make
make install

:www-data /usr/local/apache2/conf/httpd.conf
User www-data
Groupe www-data

:
chown -R www-data:www-data /usr/local/apache2/htdocs

:/etc/passwd www-data
www-data:x:33:33:www-data:/usr/local/apache2/htdocs:/bin/sh

:(stop start ) .
/usr/local/apache2/bin/apachectl start

:

ln -s /usr/local/apache2/bin/apachectl /etc/rcS.d/S99apache
chmod 755 /etc/rcS.d/S99apache

:SSL -
: /usr/local/apache2/conf/httpd.conf
Include conf/extra/httpd-ssl.conf

) ( )/root/
:(1024 ssl

openssl genrsa -rand ../httpd-2.2.4.tar.bz2:../php-5.2.1.tar.bz2:../phpMyAdmin-2.9.1-alllanguages.tar.bz2 -out server.key 1024


openssl rsa -in server.key -out server.pem
openssl req -new -key server.key -out server.csr
openssl x509 -req -days 720 -in server.csr -signkey server.key -out server.crt


cp server.crt /usr/local/apache2/conf/
cp server.key /usr/local/apache2/conf/


/usr/local/apache2/bin/apachectl restart

http://www.debian- SSL
.administration.org/articles/349

:( ) MySQL -
. MySQL
groupadd mysql
useradd -g mysql mysql

:( /usr/local/ )MySQL
cd /usr/local/
gunzip < /root/mysql-standard-4.1.21-pc-linux-gnu-i686.tar.gz | tar xvf - ln -s
mysql-standard-4.1.21-pc-linux-gnu-i686 mysql
cd mysql


scripts/mysql_install_db --user=mysql
chown -R root .
chown -R mysql data
chgrp -R mysql .

MySQL

ln -s /usr/local/mysql/support-files/mysql.server /etc/rcS.d/S99mysql.server
chmod 755 /etc/rcS.d/S99mysql.server


/etc/rcS.d/S99mysql.server start

)
( http://dev.mysql.com/doc/refman/5.0/en/index.html
/usr/local/mysql/bin/mysql

:
USE mysql

pirulo
UPDATE user SET Password=PASSWORD('pirulo') WHERE User='root';
FLUSH privileges;

MySQL
/usr/local/mysql/bin/mysql -u root -p pirulo

( ) PHP -
:
apt-get install libxml2-dev curl libcurl3-dev libjpeg-mmx-dev zlib1g-dev libpng12dev


cd /root
tar jvxf php-520.tar.bz2
cd php-520

:( ) prefix

./configure --prefix=/usr/local/php5 --enable-mbstring --withapxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --withcurl=/usr/include/curl --with-jpeg-dir=/usr/include --with-zlib-dir=/usr/include --withgd --with-xml --enable-ftp enable-bcmath
make
make install
cp php.ini-dist /usr/local/php5/lib/php.ini

:( usr/local/apache2/conf/httpd.conf/)
<IfModule mime_module>
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps

:
DirectoryIndex index.php index.html

.
PHPAdmin -
cd /usr/local/apache2/

.( ) apache2 phpmyadmin
tar jxvf /root/phpMyAdmin-2.9.1-all-languages.tar.bz2
mv phpMyAdmin-2.9.1-all-languages phpmyadmin
cd phpmyadmin
cp config.sample.inc.php config.inc.php

:(config.inc.php)
$cfg['blowfish_secret']='pirulo';

: )'(
$cfg['Servers'][$i]['controluser'] = '';
$cfg['Servers'][$i]['controlpass'] = '';

<IfModule alias_module> ( /usr/local/apache2/conf/httpd.conf)


<IfModule alias_module>
Alias /phpmyadmin "/usr/local/apache2/phpmyadmin/"
<Directory "/usr/local/apache2/phpmyadmin/">
Order allow, deny
Allow from all
</Directory>

http://localhost/phpmyadmin
.LWP

6 Squid :
Proxy Server PS
.
) ICP

( ) SSL ( FTP Gopher


HTTP ) HTTPS( . RAM
. ) (
. :

( httpd .
( proxy-caching .

.
. )
squid (squid-cgi, squidguard, squidtaild /etc/squid.conf :

)( ) /etc/init.d/squid ( ) /etc/logrotate.d/squid (.

1.1


) 81 port 80 port 81 .(httpd.conf )(/etc/squid.conf

:
http_port 80
icp_port 0
hierarchy_stoplist cgi-bin \?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
cache_mem 100 MB
redirect_rewrites_host_header off
cache_replacement_policy lru
memory_replacement_policy lru
cache_dir ufs /var/spool/squid 100 16 256
Database
emulate_httpd_log on
acl all src 0.0.0.0/0.0.0.0
http_access allow all
cache_mgr root
cache_effective_user proxy
cache_effective_group proxy
httpd_accel_host192.168.1.1
httpd_accel_port 81
logfile_rotate 0
log_icp_queries off
buffered_logs on

http
icp




UID
GID

. httpd_accel_host
.http://www.squid-cache.org

proxy-caching

6.1

.
:/etc/squid.conf

acl localnet src 192.168.1.0/255.255.255.0


acl localhost src 127.0.0.1/255.255.255.255
acl Safe_ports port 80 443 210 70 21 102565535
acl CONNECT method CONNECT
acl all src 0.0.0.0/0.0.0.0
http_access allow localnet
http_access allow localhost
http_access deny
http_access deny CONNECT
http_access deny all
cache_emulate_httpd_log on

C acl
19216810
connect ftp 21 gopher 70 whois 210 https 443 http 80

http://tldp.org/HOWTO/TransparentProxy- transparent http://www.squid-cache.org


.1.html

OpenLDAP ldap 7
LDAP lightweight directory access protocol

.X500 TCP/IP
.


.
ldap

) LDIF .(LDAP data interchange format LDIF

. LDIF :

dn: o = UOC, c = SP
or: UOC
objectclass: organization
dn: cn = Pirulo Nteum, o = UOC, c = SP
cn: Pirulo Nteum
sn: Nteum
mail: nteum@uoc.edu
objectclass: person

.distinguished name dn dn

objectclass
. LDAP : )

( ) ( .

""

inetOrgPerson groupOfNames .organisation ) (schema

) /etc/ldap/schema openldap.schema, cobra.schema,


nis.schema, inetorgperson.schema(.

] = [ "" ) (attribute
commonName cn Pirulo
Nteum cn: Pirulo Nteum person

givenname: Pirulo surname: Nteum .mail: pirulo@uoc.edu

) bin (binary ) ces


case exact string ( ) cis case ignore string

() tel telephone number string " (- dn


) distinguished name ( . :LDIF

dn: dc = UOC, dc = com


objectclass: top
objectclass: organizationalUnit
dn: ou = groups, dc = UOC, dc = com
objectclass: top
objectclass: organizationalUnit
ou: groups
dn: ou = people, dc = UOC, dc = com
objectclass: top
objectclass: organizationalUnit
ou: people
dn: cn = Pirulo Nteum, ou = people, dc = UOC, dc = com
cn: Pirulo Nteum
sn: Nteum
objectclass: top
objectclass: person
objectclass: posixAccount
objectclass: shadowAccount
uid:pirulo
userpassword:{crypt}p1pss2ii(0pgbs*do&@ = )eksd
uidnumber:104
gidnumber:100
gecos:Pirulo Nteum
loginShell:/bin/bash
homeDirectory: /home/pirulo

shadowLastChange:10877
shadowMin: 0
shadowMax: 999999
shadowWarning: 7
shadowInactive: -1
shadowExpire: -1
shadowFlag: 0
dn: cn = unixgroup, ou = groups, dc = UOC, dc = com
objectclass: top
objectclass: posixGroup
cn: unixgroup
gidnumber: 200
memberuid: pirulo other-user
memberuid:

)) (tab .(LDIF

DN dc=OUC, dc=com people : .groups


people .group
.LDAP .LDIF

slapd .OpenLDAP :
Method of installing the directory: auto;extensions to the directory [domain-host,site,institution]:


.host, domain, password of the Adm; replicate local changes to other servers: no
/etc/ldap/slapd.conf ./var/lib/ldap ) /etc/ldap/ldap.conf

(~/.ldaprc .ldap

ldap .
) /etc/ldap/slapd.conf (man slap.conf

: global backend specific database

specific . ) (

schemas .

) ( bdb, dnssrv, ldbm


. :
/etc/init.d/slapd start

) stop(

7.1

.LDAP

) ldapadd LDAP Browser

(/http://www.iit.edu/~gawojar/ldap .

slapadd .slapd
slapd.conf ) suffix : "

(o=UOC, c=SP ) /var/lib/ldap/ .(slapd

:
index cn,sn,uid
index objectClass pres,eq

slapd.conf :
]slapadd -l entry-f configuration [-d level] [-n whole| -b suffix

:
-l .LDFI
-f .

-d .
-n .
-b .
slapd slapindex slapcat

.LDIF

8 NFS
NFS .

nfsd ) (mountd ) (

apt-get install nfs-common portmap :


apt-get install nfs-kernel-server nfs-common portmap

) ( nfscommon nfs-kernel-server ) /etc/init.d/


.(/etc/rcX.d
) (/etc/exports .

) (sudo

mount IPserver:remote-directory local_directory

remote-directory ) local_directory

.(mount )
:
(/etc/fstab

pirulo.remix.com:/usr/local /pub nfs rsize=8192,wzise=8192,timeo=14

/usr/local/ pirulo.remix.com ./pub/


rsize wsize timeo ) RPC timeout

(.

/etc/exports access control list ACL


. .

) man exports (.

:
# Example of /etc/exports
)/ /master(rw) trusty(rw,no_root_squash
)/projects proj*.local.domain(rw
)/usr *.local.domain(ro) @trusted(rw
)/pub (ro,insecure,all_squash
)/home 195.12.32.2(rw,no_root_squash) www.first.com(ro
)/user 195.12.32.2/24(ro,insecure

) (/ master trusty / .
) uid squashing
( . "*

) netgroups @( . /pub/

NFS ) NFS (insecure nobody


) .(all squash ) (/24

)( . . 3
NFS ) v2 v3 .(v4 .v3 v3 v2
.

9 Wiki
) wiki wiki " " (
.

) (
.

) ( .

http://wiki.debian.org http://fedoraproject.org/wiki/ Moin Moin

) .(http://moinmoin.wikiwikiweb.de MoinMoin WikiClone


.

http://moinmoin.wikiwikiweb.de/MoinMoinPackages/DebianLinux
MoinMoin (1 : 2 (2

Moin Moin (3 MoinMoin (4 MoinMoin (5 .


:
apt-get install python-moinmoin
mkdir /var/www/mywiki
\ cp -r /usr/share/moin/data /usr/share/moin/underlay
/usr/share/moin/server/moin.cgi /var/www/mywiki
chown -R www-data:www-data /var/www/mywiki
chmod -R g+w /var/www/mywiki

2 ) /etc/apache2/conf.d/wiki (:

Alias /wiki/ "/usr/share/moin/htdocs/"


<Location /mywiki>
SetHandler python-program
PythonPath "['/var/www/mywiki','/etc/moin/']+sys.path"
PythonHandler MoinMoin.request::RequestModPy.run
PythonDebug On
</Location>

:2
/etc/init.d/apache2 reload

( ) /etc/moin/farmconfig.py :MoinMoin
wikis =</emphasis>
[
("mywiki", r"^yoursite.com/mywiki/.*$"),
]

:( )
wikis = [
(mywiki,r.*),
]

( ) data_underlay_dir data_dir /etc/moin/farmconfig.py


.
cp /etc/moin/moinmaster.py /etc/moin/mywiki.py

: /etc/moin/mywiki.py
sitename = u'MyWiki'
data_dir = '/var/www/mywiki/data'
data_underlay_dir = '/var/www/mywiki/underlay'

.http://yoursite.com/mywiki/


( DNS .
( / NIS .NFS
( SSH .
( SSL + PHP + MySQL + PHPMyAdmin +
.

( Exim, Fetchmail, Spam-Assassin IMAP


).(Thunderbird
( Moin Moin .


:
[Debc, LPD03b, Ibi]
http://tldp.org/HOWTO/DNS-HOWTO-7.html
http://tldp.org/HOWTO/NIS-HOWTO/verification.html
Squid proxy server
Proxy Cache: http://www.squid-cache.org/
Transparent Proxy: http://tldp.org/HOWTO/TransparentProxy-1.html
Proftpd: http://www.debian-administration.org/articles/228
PureFtpd: http://www.debian-administration.org/articles/383
Exim: http://www.exim.org/docs.html
Mutt: http://www.mutt.org
ProcMail: http://www.debian-administration.org/articles/242
LWP:
http://www.lawebdelprogramador.com/temas/tema_stablephpapachemysql.php
Moin Moin: http://moinmoin.wikiwikiweb.de/
Moin Moin + Debian:
http://moinmoin.wikiwikiweb.de/MoinMoinPackages/DebianLinux
Apache2 + SSL: http://www.debian-administration.org/articles/349

.databases DB

.

.
1

) ( ) SQL

.(structured query language .

.SQL

PHP ) Perl (.
PHP Perl

2

PostgreSQL MySQL .

) ( .
)(

1 "" )( .

2 PHP Perl /

PHP Perl . server-side

programming .client-side programming

)cvs, subversion, SourceSafe, ClearCase,


3

Darcs, Plastic SCM, RCS.(.

Subversion
.

cvs Subversion cvs


Subversion cvs . Subversion svn

. Subversion CVS

3 svn git .cvs

PostgreSQL 1
PostgreSQL . PostgreSQL
:

. PostgreSQL .postmaster

) (
.
:
.TCP/IP

.
.

1.1

PostgreSQL .

createdb . CREATE DATABASE


.

. ) (14

. ) (

.postgres createdb ) postgres


(postgres

.createdb :nteumdb
createdb nteumdb

. ) (/usr/local/pgsql/bin/createdb nteumdb

. could not connect to server

) " "( CREATE DATABASE: permission denied


. .dropdb nteumdb

1.2

:
psql .SQL
PgAccess ODBC .
) PHP, Perl, Java PostgreSQL 73
.(Programmer's Guide

psql
:psql nteumdb >= .nteumdb
SQL:

;SELECT current date

;)(SELECT version

psql SQL "\ ) \h ( \q

4 command not found .


: nteumdb
)

psql nteumdb
>= nteumdb

1.3

SQL
SQL .

PostgreSQL ) InstallationDirectory/src/tutorial InstallationDirectory


(PostgreSQL ) PostgreSQL cd

(InstallationDirectory/src/tutorial psql -s nteumdb .\i basics.sql \i

) .(basics.sql
PostgreSQL ) RDBMS Relational Database Management

(System .

. )

.(database cluster
:
psql

( CREATE TABLE weather


varchar(80),

city

int,

min_temp

int,

max_temp

rain,

real

date

day
;)

. psql::
;) CREATE TABLE NameTB (var1 type, var2 type,

; . )varchar(80

80 ) ( . .PostgreSQL
:
DROP TABLE table_name


.
;)'INSERT INTO weather VALUES ('Barcelona', 16, 37, 025, '2007-03-19
)INSERT INTO weather (city, min_temp, max_temp, rain, day

;'COPY weather FROM '/home/user/weather.txt


) (

:

;SELECT * FROM weather

. :psql
;) INSERT INTO TBName (valueVar1, valueVar2,

. :psql

. :psql

;'COPY TBName FROM 'FileName


;Select * FROM TBName

) : (psql

city :

;SELECT city, (max_temp+min_temp)/2 AS average_temp, date FROM weather

:
'SELECT * FROM weather WHERE city = 'Barcelona
;AND rain \verb+>+ 00

;SELECT * FROM weather, city WHERE city = name

functions : ) max(:
;SELECT max(min_temp) FROM weather

SELECT city FROM weather WHERE min_temp = (SELECT max(min_temp) FROM


;)weather

:

UPDATE weather SET max_temp = max_temp 2, min_temp = min_temp 2
;'WHERE day > '19990128

:
:
;'DELETE FROM weather WHERE city = 'Sabadell

1.4

PostgreSQL
.

: )(

. kpackage apt-get .

) ( .

apt-cache apt-get
.

:
http://www.postgresql.org/download )
x.x.x 823 (:

gnuzip postgresql-x.x.x.tar.gz
tar -xf postgresql-73.tar

postgresql ./configure
gmake gmake check ) gmake install

.(/usr/local/pgsql

1.4.1


:bash, sh, ksh
;LD_LIBRARY_PATH = /usr/local/pgsql/lib
;PATH = /usr/local/pgsql/bin:$PATH
;export LD_LIBRARY_PATH PATH

:csh
;setenv LD_LIBRARY_PATH /usr/local/pgsql/lib
)set path = (/usr/local/pgsql/bin $path

/etc/profile .bashrc

.bash MANPATH :
;MANPATH = /usr/local/pgsql/man:$MANPATH
export MANPATH

postgres
.
useradd
) (

./usr/local/pgsql/data initdb -D /usr/local/pgsql/data

mkdir /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
su postgres
initdb -D /usr/local/pgsql/data

) (postmaster :
postmaster -D /usr/local/pgsql/data

) ( ) ( :
& postmaster -D /usr/local/pgsql/data < logfile 2 >&1

) (pg_ctl
.

postmaster :

\ /usr/local/pgsql/bin/pg_ctl start -l logfile


-D /usr/local/pgsql/data

pg_ctl :
'kill -INT 'head -l /usr/local/pgsql/data/postmaster.pid

1.4.2

.
5

. SQL:

5
.

CREATE USER name

:
DROP USER name

createuser dropuser .

) postgres ( ) psql -U postgres


.(postgres

:
:superuser . :
CREATE USER name CREATEUSER

: . :
CREATE USER name CREATEDB

: .
:

'CREATE USER name PASSWORD 'password

.ALTER USER
:

CREATE GROUP GroupName

:
ALTER GROUP GroupName ADD USER Name1


ALTER GROUP GroupName DROP USER Name1

psql

;CREATE GROUP GroupName


; ALTER GROUP GroupName ADD USER Name1
; ALTER GROUP GroupName Drop USER Name1

) .(superuser

. SELECT,
INSERT, UPDATE, DELETE, RULE, REFERENCES, TRIGGER, CREATE, TEMPORARY,

) EXECUTE, USAGE, ALL PRIVILEGES ( .

;GRANT UPDATE ON object TO user

( .
user PostgreSQL object )

"
superuser . PUBLIC

" ALL " " .


:

;REVOKE ALL ON object FROM PUBLIC

1.5

:
( : VACCUM
PostgreSQL .
( : PostgreSQL
REINDEX .

contrib/reindexdb )

(.
( : .
:

pg_ctl start | logrotate

logrotate ./etc/logrotate.conf
( : SQL Dump .
:

pg_dump DBFile > BackupFile

psql DBFile < BackupFile :


:
pg_dumpall > TotalBackupFile

:

tar -cf backup.tar /usr/local/pgsql/data

. ) (

pg_dump

:PostgreSQL
./configure
gmake
su
gmake install
adduser postgres
mkdir /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
su postgres
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data > logfile 2>&1 &
/usr/local/pgsql/bin/createdb test
/usr/local/pgsql/bin/psql test

pgaccess

1.6

(http://www.pgaccess.org) ( ) pgaccess
.

( postgresql ) xhost +
.
su postgres
pgaccess [DBName] &

.pgaccess 1 ." "

PgAccess :1

/ = Port

5432 ) DataBase = nteum (

"" .
) (
New/Add Open Design

. Users New )(

timeout ) ( . DataBase
.
.~/.pgaccessrc /

/ PostgreSQL

) psql (.
webmin ) webmin-core

(webmin-postgresql )
.(http://www.webmin.com webmin

https://localhost:10000 ) ( SSL SSL


.PostgreSQL Data Base Server

MySQL 2
MySQL SQL )

( MySQL . .DBMS DBMS


. PostgreSQL MySQL

.

MySQL

.GPL MySQL
.

2.1

http://www.mysql.com .
.

) ( *mysql-

) common server .(client


mysql /etc/init.d/mysql .

/etc/init.d/mysql start|stop

mysql .
) deb rpm apt-get (rpm gz mysql
:

groupadd mysql
useradd -g mysql mysql
cd /usr/local gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf ln -s full-path-to-mysql-VERSION-OS mysql
cd mysql
scripts/mysql_install_db --user=mysql
chown -R root .
chown -R mysql data
chgrp -R mysql .
bin/mysqld_safe --user=mysql &

./usr/local/mysql /
:
groupadd mysql
useradd -g mysql mysql
gunzip < mysql-VERSION.tar.gz | tar -xvf cd mysql-VERSION
./configure --prefix=/usr/local/mysql
make
make install
cp support-files/my-medium.cnf /etc/my.cnf
cd /usr/local/mysql
bin/mysql_install_db --user=mysql
chown -R root .
chown -R mysql var
chgrp -R mysql .
bin/mysqld_safe --user=mysql &

prefix = /usr/local/mysql


( )

2.2

: .

/etc/init.d/mysql/start

mysqladmin version

mysqladmin variables

mysqladmin -u root shutdown

mysqlshow

mysqlshow sql

mysql

) (:

./scripts/mysql_install_db
cd InstallationDirectoryMysql
& ./bin/mysqld_safe --user = mysql

) ( ,RPM, Pkg :
cd InstallationDirectoryMysql
./scripts/mysql_install_db
& ./bin/mysqld_safe user = mysql

mysql_install_db mysql mysqld_safe .mysqld

cd sql-bench .run-all-tests sql-


bench/results .

2.3

) MySQL(
MySQL

(
. )

. .mysql help ) (
mysql :

mysql -h localhost -u mysql -p DBName

.
.
mysql )> (mysql ) (SQL help

) ; (:
;mysql> SELECT VERSION(), CURRENT_DATE

.
mysql> SELECT SIN(PI()/4), (4+1)*5; Calculator.
;)(mysql> SELECT VERSION(); SELECT NOW

.
mysql> SELECT
)(-> USER
-> ,
;-> CURRENT_DATE

.
;mysql> SHOW DATABASES

.
;mysql> USE test

mysql> CREATE DATABASE nteum; USE nteum;

.nteum

mysql> CREATE TABLE pet (name VARCHAR(20), owner VARCHAR(20),
-> species VARCHAR(20), sex CHAR(1), birth DATE, death DATE);

.nteum

mysql> SHOW TABLES;


mysql> DESCRIBE pet;

.
mysql> LOAD DATA LOCAL INFILE "pet.txt" INTO TABLE pet;

pet .pet pet.txt

.( YYYY-MM-DD )
6

mysql> INSERT INTO pet;


-> VALUES ('Marciano','Estela','gato','f','1999-03-30',NULL);

.
mysql> SELECT * FROM pet;Shows table data.
mysql> UPDATE pet SET birth = "1989-08-31" WHERE name = "Browser";


mysql> SELECT * FROM pet WHERE name = "Browser";


mysql> SELECT name, birth FROM pet ORDER BY birth;

. 6

;mysql> SELECT name, birth FROM pet WHERE MONTH(birth) = 5


mysql> GRANT ALL PRIVILEGES ON *.* TO
'martian@localhost -> IDENTIFIED BY 'passwd
;WITH GRANT OPTION

marciano . .

>mysql> INSERT INTO user (Host,User,Password) -


;)'VALUES('localhost','marciano','passwd

2.4

MySQL ) /etc/mysql/my.cnf (

:
. :
( ) (MySQL
MySQL .

( .mysql -u root .
:

mysql -u root mysql


)'mysql> UPDATE user SET Password = PASSWORD('new_password
;'-> WHERE user = 'root
;mysql> FLUSH PRIVILEGES

:
mysql -u root -p mysql

( / .
( :
\ mysqldump --tab = /DestinationDirectory
--opt DBName

mysqlhotcopy DBName /DestinationDirectory

*.frm *.MYD *.MYI . :


REPAIR TABLE o myisamchk -r

%99 . .
/ ) 44
(.

2.5


MySQL ) MySQL Administrator

(http://www.mysql.com/products/tools/administrator ) MySQL-Navigator

(http://sourceforge.net/projects/mysqlnavigator Webmin ) MySQL

webmin-core (webmin-mysql . PostgreSQL

Webmin ) MySQL ( . webmin

root . Webmin
http://localhost:10000 ) (

SSL MySQL Data Base


.Server

MySQL Administrator .MySQL

. :
" " .

) MySQL Administrator
.(http://dev.mysql.com/doc/administrator/en/index.html

MySQL Administrator :2

) (

. RCS, CVS, SVN, HQ, Git : svn

) CVS (RCS

. CVS "
CVS " http://www.infomag.news.sy/index.php? :

inc=issues/showarticle&issuenb=28&id=578 " CVS and Subversion: Combined Tutorial

CVS ) SVN ( :

http://www.developingprogrammers.com/index.php/2005/11/24/cvs-and-subversion-combined.tutorial

) Subversion (http://subversion.tigris.org

CVS . Apache/BSD
svn . CVS

. :
.
) (.

7 CVS .
.http://ftacademy.org/materials/fsm/2#1

.
) CVS (.
.WebDAV/DeltaV

) CVS (.
) Subversion http://svnbook.red-

(bean.com/index.html .

Git

GNU GPL v2


. Git

.http://www.ojuba.org/wiki/docs/git_tutorial :

Subversion 4
Subversion )( .

.
10

. CVS Subversion

. )
(http://svnbook.red-beans.com/nightly/en/index.html :

.http://subversion.tigris.org/servlets/ProjectDocumentList
apt-get install subversion 2

apt-get install apache2-common .apt-get install libapache2-subversion

: ) (svuser ) (svgroup
:
mkdir -p /usr/local/svn
addgroup svgroup
chown -R root.svgroup /usr/local/svn
chmod 2775 /usr/local/svn

svuser svgroup .addgroup svuser svgroup


svuser svgroup .groups
Svnadmin create /usr/local/svn/tests

.

/usr/local/svn mkdir -p $HOME/svndir : svnadmin create

.$HOME/svndir/tests
mkdir -p $HOME/svntmp/tests cd $HOME/svntmp/tests
.echo First File Svn 'date' > file1.txt :

: svn import file:///home/svnuser/svndir/tests -m view


.initial /usr/local/svn/tests .file:// import

-m . m

) ( . $HOME/svntmp/tests

). (rm -rf $HOME/svntmp/tests


9


:
mkdir $HOME/svm-work
cd $HOME/svn-work
svn checkout file:///home/svuser/svndir/tests

.tests .
:
cd /home/kikov/svn-work/tests
echo Second File Svn 'date' > file2.txt
svn add file2.txt
"svn commit -m"New file

) (svn-work . svn

.svn commit
8 .

9 r f rm !

.
file1.txt echo 'date' >> file1.txt

.svn commit -m New Line :

file1.txt 'echo 'date

file1.txt .svn diff :

. svn commit -m new line2

) ( svn diff .

svn update .
) (commit


) (

) (commit . svn update


) (conflict C .

svn log file1.txt .


subversion ) apache2 (SSL
) (http://svnbook.red-bean.com . Debian

Administration Apache2 SSL .

) WebDAV http://www.debian-administration.org/articles/285
.http://www.debian-administration.org/articles/208

:
mkdir /subversion chmod www-data:www-data


svnadmin create /subversion


ls -s /subversion
-rw-r--r--

www-data

www-data

376

May 11 20:27 README.txt

drwxr-xr-x

www-data

www-data

4096 May 11 20:27 conf

drwxr-xr-x

www-data

www-data

4096 May 11 20:27 dav

drwxr-xr-x

www-data

www-data

4096 May 11 20:28 db

-rw-r--r--

www-data

www-data

drwxr-xr-x

www-data

www-data

4096 May 11 20:27 hooks

drwxr-xr-x

www-data

www-data

4096 May 11 20:27 locks

May 11 20:27 format

: ) htpasswd
htpasswd2 -c -m /subversion/.dav_svn.passwd user

. -c .www-data
.( )
: httpd.conf
<location /svn>
DAV svn
SVNPath /subversion
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /subversion/.dav_svn.passwd
Require valid-user
</location>

"svn import file1.txt http://url-server.org/svn \ -m "Import Initial

) ( file1.txt .


( PostgreSQL 3 5 ) 3
(.

/ . ) ( .
) ( ) (
)) (.(2/

( .MySQL
( Subversion 3 4 .makefile
.


(
.svn

( .


:
[Debc, Ibi, Mou01]
PgAccess: http://www.pgaccess.org/
WebMin: http://www.webmin.com/
Mysql Administrator: http://www.mysql.com/products/tools/administrator/
Apache2 and SSL: http://www.debian-administration.org/articles/349
Apache2 and WebDav: http://www.debian-administration.org/articles/285
Subversion: http://subversion.tigris.org
http://svnbook.red-bean.com/index.es.html : Subversion
Apache & SSL + Subversion
"Apache2 SSL and Subversion" .http://www.debian-administration.org

.
:

:" git "


http://www.ojuba.org/wiki/docs/git_tutorial

: .

"" .

)(
. )

( ) ( )
(.
.%100
.

.
.


.
.

.
.

1

(
. )

.
)

1

(
.


) (

.
. Hacker

1 ) hacker : (

"" "" "" crackers


:
.

hacktivism . .
cyber-terrorism.

/ ""


) (.

) ( .crackers
) (
.

hacking cracking
.

) ( .
vulnerabilities ) holes (exploits

. )(
. /

TCP/IP .

: .

.

"" .

:Confidentiality :

:Integrity :

:Availability :

( :
)
:
.
) ( : .
) Falsification ( :
.

: .
:
.
)

( .


:
2

:
" "



.
: .

: .

:
. .

) ( :

. .

2 .

1.1


) ( .

.
. :

: "" exploits

( .
)
.

) (bugs .

.

/ .

: .
3

""


3 "" " " .Malware

: rootkit

.macro .
/ :

.
. ) Outlook Visual Basic Script

) ] Visual Basic for Applications

[VBA .(Microsoft Office

/ .



. .

spam

)

(.

: .

.
.
) Trojan horse :(Trojan

ActiveX )

ActiveX ( ) ( .

) back doors :(trap doors

. .
:logic bombs )
( .

:Keyloggers "" .
.
)

)
( .
( .

) :(port scanning

.
TCP UDP .

TCP 80
.
) :(sniffers . :

.

telnet, rsh, rcp, ftp


)(
) .(ssh, scp, sftp :

(.
)( )
:Hijacking

. .

:Buffer Overflow .

. C

.
(
) C
) :(Denial of Service DoS

. )
(Distributed Denial of Service DDoS

. DoS DDoS
DNS

.
BIND

DDoS Backdoor .Trojan Horse


SYN flood TCP

.
.

) (

:spoofing ) (
) / ( . :

IP

ARP ) (DDoS

. .

ARP

.
.





. ) (Phishing

. ) ( :
. ) (Verisign

:SQL Injection
.

) (
.

API
)
( SQL
PHP

) ( .

SQL SQL

. )
(

)
(.

:Cross-site Scripting XSS


HTML

.
) HTML HTML

HTML ( .
.


.
HTML .

.
cookies

. .

) (

)
(.

:
:
.
.
) (

.
) (

. .

( . ""
)

) 6 8( .

) (.

) GPG .(gpg
) md5sum (md5sum

( .
md5 )
.

) ( )

( .
.
.

1.2

.
) (:

: brute force

) )( ( .
.

) ( .

( . 6 8

)( .

. ) (

telnet,

.FTP, rsh, rlogin

: ) ( .
. .

] [.

:
) ( .


) (.
:
.

) :(Trojan sum .
. .

) rootkit ( .
sum gpg

Tripwire .AIDE
:

)(

sum ) md5 .(gpg

.
.

: .
crontab ) type nohup type (

.
.

) (keyloggers :rootkits
.

) lsof

(man

) script .(man script ) rootkit (

) ( .


. rootkits
.
. .chrootkit

:
) ( .
: .

Wireshark Snort )( .Nmap

) (
) broadcast .(multicast
) ( :Hijacking
. .
.
/ :Buffer Overflow .

) SELinux (.

) (DoS SYN flood :


) ( . buffer

:( .IP( .ARP(

)
IP (

) IP ( . DNS

ARP .

:
. :
.

: .

.

2
.

.
.
) (


) (.

. .

3.1

. . ) ( CD
/ ) (

. BIOS

( . BIOS
)
.

) ( .

) .(grub
.

grub-legacy /sbin/grub-md5-crypt md5sum .


./boot/grub/grub.conf timeout:
password --md5 sum-md5-calculated

Lilo :
>password = <selected password

image = /boot/vmlinuz-version
>password = <selected password
restricted

restricted .
/etc/lilo.conf )chmod

.(600

) CTRL+ALT+DELETE ( .
/etc/inittab :

ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now

/etc/shutdown.allow .

3.2

Secure Shell SSH

) /(

) DES crypt
(.
/etc/passwd :
user:sndb565sadsd:


bruteforce .
shadow .

. "* .

/ shadow .

) md5 (sha .

md5 NIS

md5 . /etc/shadow ") $1$

(.

)
change( .
(
)


. John the Ripper .crack

ASCII ) ( .
slurpie .

) (

) (
.

3.3

Suid & sticky bits

.
sticky bits )

. bit ./tmp/


. bit ) (chmod +t
.-t ls ) drwxrwxrwxt t (.

) suid (set uid ) ( .

. suid

: setuid
.

. setuid

. chmod +s ) (suid )
(sgid .-s ls
) -rwSrw-rw (S suid sgid w.
chmod

) rwxrwxrwx 4 r 2 w 1 (x
) () 4 : (suid ) 2 (sgid ) 1 .(sticky

3.4

. :

.rhosts : )(
) r rsh ( rcp .

)
( .rhosts .

.r

:/etc/hosts.equiv .rhosts
" r .

.
+
ssh .r

lpd .
:/etc/hosts.lpd

. CUPS LPRng
. LPD
. .hosts.lpd

3.5

PAM

PAM .

.PAM PAM

. )

(PAM .

) PAM( ) /lib/security/ (.
PAM /etc/pam.d/ PAM .PAM
ssh X Window System xdm, gdm,
,kdm, xscreensaver ) ( . ""

) (/etc/pam.conf "" /etc/pam.d/


.
) (/etc/pam.d/ ) /etc/pam.conf

(:

module-type control-flag module-path arguments

:
(1 :module type ) (auth )(account
.
)(session

(2 :control flags required requisite


sufficient .optional .

(3 .
(4 ) ( .

:
@include service

) PAM ( )
(:
pam_securetty.so

requisite

auth

pam_nologin.so

requisite

auth

pam_env.so

required

auth

pam_unix.so nullok

required

auth

pam_unix.so

required

account

pam_unix.so

required

session

pam_lastlog.so

optional

session

pam_motd.so

optional

session

pam_mail.so standard noenv

optional

session

pam_unix.so nullok obscure min = 4 max = 8 md5

required

password

pam_unix.so ) .( ,passwd, shadow


)
(lastlog ) (

) ( 4 8
md5.

: auth passwords :

nullok . ) ( .

. )

: ( .nullok

.
max = 16

3.6

" . PATH
.

) gpg (md5 Tripwire .AIDE


chrootkit rootkit.

SELinux
4
Discretionary Access Control

DAC ) ( . )
(

. ) (
.

. .
Mandatory Access Control MAC

.
MAC
MAC .

) 2.6 ( MAC SELinux

.
) (

SELinux MAC
. log

) ( .
) (
4 "" KING SABRI SELinux object .

.
SELinux NSA

SELinux 2000
Linux .BSD
GNU/Linux.

)
SELinux ""


... ( .

) (
.

.
SELinux SELinux policy database SELinux

SELinux : .

system_u user_u . .

( . user_r user_u
user_r ) sysadm_t

. :
sysadm_t
root:sysadm_r:sysadm_t

.
SELinux ) ( Z- ps
:

# ps -ax -Z
LABEL

PID

TTY

STAT TIME COMMAND

system_u:system_r:init_t

1 ?

Ss

0:00

init

system_u:system_r:kernel_t

2 ?

0:00

[migration/0]

system_u:system_r:kernel_t

3 ?

0:00

[ksoftirqd/0]

system_u:system_r:kernel_t

4 ?

0:00

[watchdog/0]

system_u:system_r:kernel_t

5 ?

0:00

[migration/1]

system_u:system_r:kernel_t

6 ?

SN

0:00

[migration/1]

system_u:system_r:kernel_t

7 ?

0:00

[watchdog/1]

system_u:system_r:syslogd_t

2564

Ss

0:00

syslogd -m 0

system_u:system_r:klogd_t

2567

Ss

0:00

klogd -x

system_u:system_r:irqbalance_t 2579

Ss

0:00

irqbalance

system_u:system_r:portmap_t

2608

Ss

0:00

portmap

system_u:system_r:rpcd_t

2629

Ss

0:00

rpc.statd

user_u:system_r:unconfined_t

4812

Ss

0:00

/usr/libexec/gconfd-2 5

user_u:system_r:unconfined_t

4858

Sl

0:00

gnome-terminal

user_u:system_r:unconfined_t

4861

0:00

gnome-pty-helper

user_u:system_r:unconfined_t

4862

pts/0

Ss

0:00

bash

user_u:system_r:unconfined_t

4920

pts/0

0:00

gedit

system_u:system_r:rpcd_t

4984

Ss

0:00

rpc.idmapd

system_u:system_r:gpm_t
exps2

5029

Ss

0:00

gpm -m /dev/input/mice -t

user_u:system_r:unconfined_t

5184

pts/0

R+

0:00

ps ax -Z

user_u:system_r:unconfined_t

5185

pts/0

D+

0:00

Bash

: ls Z-
# ls -Z
drwxr-xr-x

josep josep user_u:object_r:user_home_t

Desktop

drwxrwxr-x

josep josep user_u:object_r:user_home_t

proves

-rw-r--r--

josep josep user_u:object_r:user_home_t

yum.conf

:
$ id -Z
user_u:system_r:unconfined_t

.enforcing
permissive SELinux

.unconfined_u:unconfined_r:unconfined_t 5


var/log/messages var/log/audit/audit.log ( .
. SELinux

/etc/selinux/config .SELINUX=disabled


SELinux
.
SELinux .

. SELinux

) (SELinux
) (.

targeted .strict
SELinux :

) (

.

.
) (MLS

.
. ) (MLS

. .
/etc/selinux/config

.SELINUXTYPE /

/etc/selinux/SELINUXTYPE

) .(SELinux

4.1

SELinux :
.
Selinux.
) (.
.
:

SELinux
. 2.6

SELinux
libselinux1.so .SELinux

.SELinux )
(
SELinux

) /etc/security/selinux (.

) .(make )(

/etc/security/selinux/src/policy ./etc/selinux

makefile .

: .SELinux .
.
:
:

chcon
checkpolicy

.makefile
) SELinux permissive (enforcing deactivated
.


.
.
) (start, stop
) .(init
.enfocing
selinux 0 permissive 1
.
SELinux
.SELinux

getenforce
getsebool
newrole
runn_init
setenforce
setfiles
setstatus

SELinux:
:cron .cron
:Login .
:Logrotate .
:Pam SELinux
.

:Ssh .
/etc/passwd ./etc/shadow
SELinux
. SELinux

system-config-security SELinux
:

:1 SELinux
.

getsebool setsebool togglesebool


.

)( cron, FTP, http (apache), DNS, :

grub, lilo, nfs, nis, cups, pam, ppd, samba .

SELinux .
.

4.2

SELinux .

SELinux

. SELinux

UNIX SELinux
SELinux .

. strict
.

SELinux )

( .

SELinux

5.1

( . ) FTP
Telnet ( . SSH .SSL
.

) SSH SSL

( .

5.1

inetd : xinetd

:
/etc/inetd.conf :/etc/xinetd.d/
superservers . xinetd

) inetd (.

. .

/etc/rc2.d/ /
/etc/init.d start stop restart .

:RPC NIS .NFS


.rpcinfo -p

) ( /etc/services :
TCP UDP

/etc/protocols /etc/rpc RPC .

.
6

/etc/inetd.conf

# .

xinetd /etc/xinetd.conf
./etc/initd.d
inted.conf

disable=yes . xinetd inetd

) DoS .(DDoS

. ksysv KDE system-


6 http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers :


config-services ntsysv ) sysv-rc-conf rcconf .(bum

) /etc/rcX.d/
: S20ssh STOP_S20ssh
S K

) service chkconfig

update-rc.d .(invoke-rc.d

.
FTP telnet ) login (copy ) r

.( rsh, rcp, rexec finger rwhod

. . :


(1 telnet ftp
(.
) sniffers
(2 rsh rcp rexec

) (.rhosts

.
.

) OpenSSH SSL ( .
OpenSSH ssh scp sftp )

.(sshd ssh telnet rlogin rsh scp

rcp sftp .ftp


ssh .ssh

OpenSSH

) .(/etc/ssh/ssh_config

6
.
.
Intrusion Detection Systems IDS

(.

) Logcheck : ( ) TripWire
md5 ( ) AIDE (TripWire ) Snort
(.

7
.

7 ) (wrappers
) TCP (TCP wrappers
. wrappers .
inetd xinetd .

) tcpd


.(/ust/sbin/tcpd/

.
.
:inetd
finger stream tcp nowait nobody /usr/etc/in.fingerd in.fingerd

:
finger stream tcp nowait nobody /usr/etc/in.fingerd

tcpd )

.(man tcpd

TCP wrapper .wrapper


inetd

/etc/hosts.deny
/etc/hosts.allow

( .
)

tcpdchk ) hosts_access (hosts_options

. tcpdmatch
) / ( .

7.1

.
.
)

( .

)
( ) (

.
:


.

.
.

( TCP/UDP
.

) (.

Network Address Translation


"" .NAT
. .masquerading NAT

masquerading IP .

ADSL

.IP ADSL

NAT masquerading . .

(.

4.3

Netfilter: IPtables

) (2.4 Netfilter

.NAT .Iptables )
(2.2 ipchains ) ( . ) 2.0 (
.ipfwadm ) ( Netfilter/IPtables )

(.

iptables :

NAT .
/etc/init.d/iptables start : .
iptables -L .

Iptables . .

Filter : NAT .Mangled

NAT .
.Filter

) (

NAT IP masquerading NAT


) .(Filter
.
NAT

) (

NAT masquerade .

:NAT .
. )

( .

) .(man iptables
)

(.


) ( . :
iptables -A chain -j target

chain input output forward target


. -A . .


. -j accept

reject .drop reject .drop


) .(ICMP drop

"" . target log


. log accept

reject drop .
) -I (insert :
iptables -I INPUT 3 -s 10.0.0.0/8 -j ACCEPT

) INPUT( ) (-j

) source (-s 10.0.0.0 255.0.0.0 . D


iptables -D INPUT 1
iptables -D INPUT -s 10.0.0.0/8 -j ACCEPT

) (P .


( :
)
iptables -P INPUT DENY
iptables -P OUTPUT REJECT
iptables -P FORWARD REJECT

. .

:
1) iptables -A INPUT -s 10.0.0.0/8 -d 192.168.1.2 -j DROP
2) iptables -A INPUT -p tcp --dport 113 -j REJECT --reject-with-tcp-reset
3) iptables -I INPUT -p tcp --dport 113 -s 10.0.0.0/8 -j ACCEPT

:
(1 x.x.x10. .192.168.1.2
(2 TCP 113 .tcp-reset
(3 2 x.x.x 10. .
iptables /etc/services

/etc/protocols ) ( )

(.


iptables iptables .

iptables
:
/etc/init.d/iptables save

:
/etc/sysconfig/iptables

:
/etc/init.d/iptables save name-rules

/var/log/iptables
name-rules .
) (/etc/init.d/iptables load ) (

) (
) ( .

iptables

./etc/init.d/

4.4


) iptables ( . :
)
:lokkit /

( .

. .iptables
etc/sysconfig/iptables iptables

/etc/init.d/iptables start .stop


etc/default/lokkit-1 ./etc/init.d/lokkit-1
.gnome-lokkit

:Bastille
) ( . .
:Fwbuilder .
)/ OpenBSD (MacOS
) .(iptables

:Firestarter )( . iptables
.

4.5

:
8

8 .hole punching

IPP CUPS WebDAV


) (.


) tunneling ( .

HTTP ) 80 ( ) (

HTTP

) ActiveX Java (JavaScript


.

.
) (

8
.

:
:TripWire . .
.IDS snapshot
.

.
rootkit

.
TripWire . .AIDE

nmap . . .

.

. TCP UDP .
.xnmap

xnmap :2

) WireShark . :(Ethereal )

.(sniffer

.

.TCP

:Snort .
) ( .
.
.
.

) (log ) (alert ) .(drop


:Nessus . ) (

. ) ( .

( . 2005
Nessus ) HTML
.
Nessus 2 . Nessus 2

/ GPL Nessus 2 .
/
.

:3 Nessus
. http://sectools.org

Nmap ) (.

9
) (logs
) ( .
. ./var/log/

)
( . syslog .syslogd
./etc/syslog.conf : .

debug, info, err, notice, crit, alert, emerge

. /var/log/messages
.
) ( syslog

/ . )(

. . logrotated

/etc/logrotate.conf


./etc/logrotate.d/

) (:
:/var/log/messages (1 syslogd
.

) ( .
.

:/var/log/utmp (2 .
. who .

:/var/log/wtmp (3
.

. )(
. lastb

) /var/log/btmp

( .auth.log lastlog

/var/loglastlog .

:/var/log/secure (4 ) tcp wrapper ( .


inetd xinetd .

/var/log
) ( . .

10

.
:( ) nmap .
nmap -sTU -O localhost

:
root@machine:# nmap -sUT -O localhost
starting nmap 3.27 (www.insecure.org/nmap/) at 2003-09-17 11:31 CEST
Interesting ports on localhost (127.0.0.1):

(
3079 )
Port

State

Service

9/tcp

open

discard

9/udp

open

discard

13/tcp

Open

daytime

22/tcp

Open

smtp

25/tcp

open

time

37/tcp

open

time

37/udp

open

http

80/tcp

open

sunrpc

111/tcp open

sunrpc

111/udp open

auth

113/tcp open

ipp

631/tcp open

unknown

728/udp open
731/udp open

netviewdm3

734/tcp open

unknown

Remote operating system guess: Linux kernel 2.4.0-2.5.20


Uptime 2.011 days (since Mon Sep 15 11:14:57 2003)
Nmap run completed 1 IP address (1 host up) scanned in 9.404 seconds

daytime discard .UDP TCP ( telnet, ftp, finger :

time SMTP .


POP3 IMAP .

.netstat -lut

nmap DNS IP )
localhost (

) ( .
/etc/init.d.conf . :
discard stream tcp nowait root internal
smtp stream tcp nowait mail /usr/sbin/exim exim bs

# ) )
man ( . ftp telnet finger

ssh.

inetd ./etc/init.d/inetd restart :


:nmap

ssh

open

22/tcp

http

open

80/tcp

sunrpc

open

111/tcp

sunrpc

111/udp open

auth

113/tcp open

ipp

631/tcp open

unknown

728/udp open

unknown

734/tcp open

ssh :
/etc/init.d/apache stop

ipp .CUPS CUPS


.631 :/etc/services
root@machine:# grep 631 /etc/services
# Internet Printing Protocol
# Internet Printing Protocol

ipp 631/tcp
ipp 631/udp

CUPS
) listen 127.0.0.1:631 ( .
728 734

nmap . . netstat


. :

root@machine:# netstat -anp | grep 728


udp 0 0 0.0.0.0:728 0.0.0.0:* 552/rpc.statd

734 rpc.statd rpc.statd


) NFS .(NFS 11 sunrpc

.RPC RPC
portmap

Portmap .

RPC NFS NIS .NIS+


RPC :rpcinfo

root@machine:# rpcinfo -p
service

vers proto Port

program

portmapper

111

tcp

100000

portmapper

111

udp

100000

status

731

udp

100024

status

734

tcp

100024

sgi_fam

39797

tcp

391002

sgi_fam

39797

tcp

391002

RPC .

lsof -i | grep :
lsof )

.(731

portmap
) NFS .( NIS portmap

. portmap

wrappers/ . NFS NIS

portmap . ) (:
/etc/init.d/nfs-common
/etc/init.d/nfs-kernel-server
/etc/init.d/portmap

stop ) RPC .(NFS


.

ssh .1.2.3.4 portmap NIS NFS

) ( . ) TCP
( .hosts.deny -j allow :/etc/hosts.deny

\ ALL : ALL : spawn (/usr/sbin/safe_finger -l @%h


& )| /usr/bin/mail -s "%c FAILED ACCESS TO %d!!" root

) (inetd

:/etc/hosts.allow

sshd 1.2.3.4

1.2.3.4 ) sshd .(ssh

portmap portmap .la_ip :


tcpdchk

) .(man hosts.allow
tcpdmatch :

root@machine:# tcpdmatch sshd 1.2.3.4


warning: sshd: no such process name in /etc/inetd.conf client: hostname
machine.domain.es
client: address 1.2.3.4
server: process sshd
matched: /etc/hosts.allow line 13
access: grantedv

. sshd inetd.conf

: inetd .

( .
) tcpd

ssh, portmap, in.talk, rpc.statd, rpc.mountd : .


.
. netstat -utp

tcp udp

. ) ( lsof

.
lsof -i

) ( .

) : (iptables -L

root@aopcjj:~# iptables -L
)Chain INPUT (policy ACCEPT
destination

target prot opt source

)Chain FORWARD (policy ACCEPT


destination

target prot opt source


)Chain OUTPUT (policy ACCEPT

destination

target prot opt source

.
.

) (iptables
.

.

.


.
(

IP .

( suid SUID SGID


/etc/passwd SUID
( .rhosts .

( /etc/init.d/service :
. )

(.

( .
( ) nmap nessus(.
( Iptables SSH
(


:
] [Deb] [Hatc .
] [Pe ] [Hatb
/.

] [Mou01 ) (.
] [Hat01 / .
] [Line ) ( .
] [Sei .
] [Net Netfilter IPtables
] [Ian TCP/IP
] [Proa] [Sno] [Insb] [Nes
] [NSAb .NSA .SELinux
] [CERa][Aus][Insa][Incb] [NSAa .
] [CERb][Ins][San .
] [NSAa][FBI][USA "" .

:
SELinux Arabic Guide <http://king-sabri.net/files/SELinux-ar.pdf> .
http://www.linuxac.org/forum/forums/4


. /

) ( . ""
) (

. ) "

.
"( .

1

.
:
(1 :
1

.
(2 Amdahl " ) (

" %10

2 )( %5

(3 :

. .

(4 : .
/ .

. 1.5
1.5 2
RAID .

(5 :

(6 : (1 :
.%20
(2
(7 : .
.

(8 :
%50 100 , 0 , 0 , 100 . .
(9 : "" .
)

/ ( .
(10 :

( cache

buffers ) ( .

1.1

System

/proc/

. ) (
. )
man (:

:/proc/1 ) PID (
:/proc/cpuinfo ) .(
:/proc/devices .
:/proc/dma DMA .
:/Proc/filesystems .
.
:/Xproc/interrupts
:/proc/ioports .
:/Xproc/kcore .
:/Xproc/kmsg .syslog
:/Xproc/ksyms .
:/Xproc/loadavg .
:/Xproc/memingo .

:/Xproc/modules .
:/Xproc/net .
:/Xproc/stat .
:/Xproc/uptime .
:/Xproc/version .
)( ""

. .

SV sar sadc )
sysstat iostat .(mpstat / ) atsar (atsadc

. atsar /proc/ .
:
atsar options t [n] n

n t ) n .(1
:
atsar -options -s time -e time -i sec -f file -n day

) -f /var/log/atsar/atsarxx xx

( ) atsadc

.(/usr/lib/atsar n -s -e

. atsadc /etc/cron.d/atsar :

'@reboot root test -x /usr/lib/atsadc && /usr/lib/atsar/atsadc /var/log/atsar/atsa'date +\%d


10,20,30,40,50 * * * * root test -x /usr/lib/atsar/atsa1 && /usr/lib/atsar/atsa1

.atsadc

. 10 atsa1

) atsar (sar :

d
) I (i

and

tty
paging swap

swap

r
) l (L

IP

TCP

UDP

ICMP

NFS

:atsar

atsar -u

atsar -r

atsar -d

atsar -p

atsar sar sar

) ( . ) sar atsar

( :
(1 :
sar -u 4 5
Linux 2.6.19-prep (localhost.localdomain) 24/03/07
%idle

%steal

%iowait

%system

%nice

%user

CPU

08:23:22

99.25

0.00

0.00

0.50

0.00

0.25

all

08:23:26

100.00

0.00

0.00

0.00

0.00

0.00

all

08:23:30

100.00

0.00

0.00

0.00

0.00

0.00

all

08:23:34

99.75

0.00

0.00

0.00

0.00

0.25

all

08:23:38

100.00

0.00

0.00

0.00

0.00

0.00

all

08:23:42

99.80

0.00

0.00

0.10

0.00

0.10

all

Media:

user system ) nice = 0 (


.

Nice ) nice > 0 (.


.
idle
Steal ) (.
idle=100
idle=10
.

(2

sar -I 4 5
24/03/07

)Linux 2.6.19-prep (localhost.localdomain


08:24:01 INTR intr/s
08:24:06 4 0.00
Media: 4 0.00

/proc/interruprs .
.
(3
sar -r 4 5
24/03/07

)Linux 2.6.19-prep (localhost.localdomain

08:24:20 kbmemfree kbmemused %memused kbbuffers kbcached kbswpfree


kbswpused %swpused kbswpcad
08:24:24 296516 729700 71.11 24260 459972 963860 0 0.00 0
08:24:28 296500 729716 71.11 24268 459968 963860 0 0.00 0
08:24:32 296516 729700 71.11 24268 459976 963860 0 0.00 0
08:24:36 296516 729700 71.11 24276 459976 963860 0 0.00 0
08:24:40 296500 729716 71.11 24276 459976 963860 0 0.00 0
Media: 296510 729706 71.11 24270 459974 963860 0 0.00 0

kbmemfree )(MP used buffers )


(MP buffers cache swpfree/used

/ . MP

. .
buffers / ).(I/O
free :
cached

buffers

shared

459980

24324

free

used

total

1026216 729716 296500


963860

Mem:

780804

-/+ buffers/cache: 245412

Swap:

963860

1 .

) vmstat (sar -r
. :vmstat 1 10
-----cpu------

--system--

-----io----

---swap--

procs -----------memory----------

st

wa

sy id

us

cs

bo in

swpd free buff cache si so bi

rb

2 81

724 11

0 0 295896 24384 459984 0 0 321 56 1249

0 99

383 1

28 1179

0 0 295896 24384 459984 0 0 0

0 100 0

498 0

0 1260

0 0 295896 24384 460012 0 0 0

0 100

342 0

0 1175

0 0 295896 24384 460012 0 0 0

0 100 0

526 0

0 1275

0 0 295896 24384 460012 0 0 0

0 99

356 0

72 1176

0 0 295896 24392 460004 0 0 0

0 100 0

420 0

0 1218

0 0 295896 24392 460012 0 0 0

0 100 0

436 0

0 1216

0 0 295896 24392 460012 0 0 0

0 100 0

361 0

0 1174

0 0 295896 24392 460012 0 0 0

0 100 0

492 0

0 1260

0 0 295896 24392 460012 0 0 0

(4
Linux 2.6.19-prep (localhost.localdomain) 24/03/07
%super-sz dquot-sz %dquot-sz rtsig-sz %rtsig-sz

08:24:48 dentunusd file-sz inode-sz super-sz

0.00

0.00 0

0.00

3904 15153

08:24:52 19177

0.00

0.00 0

0.00

3904 15153

08:24:56 19177

0.00

0.00 0

0.00

3904 15153

08:25:00 19177

0.00

0.00 0

0.00

3904 15153

08:25:04 19177

0.00

0.00 0

0.00

3904 15153

08:25:08 19177

0.00

0.00 0

0.00

3904 15153

Media:

19177

superb-sz superblocks
inode-sz incore-inode

file-sz dquota-sz )

man ) sar .((atsar ) ps -edaflm (

top . ) (:

CMD

WCHAN STIME TTY TIME

SZ

PRI NI ADDR

PPID C

F S UID PID

]init [5

00:00:00

08:01

508

root 1

4 -

][kondemand/0

00:00:00

08:02

root 1927 7

1 -

syslogd -m 0

00:00:00

08:02

424

2523 1

rpc

1 -

portmap

00:00:00

08:02

444

2566 1

5 S rpc

00:00:00

08:02

78

rpc.statd

00:00:00

08:02

472

00:00:00

08:02

81

rpc.idmapd

00:00:00

08:02

1232 -

00:00:00

08:02

75

/usr/sbin/sshd

00:00:00

08:02

1294 -

root 2804 1

00:00:00

08:02

84

/usr/sbin/atd

00:00:00

08:02

551

root 2910 1

00:00:00

08:02

84

/sbin/mingetty tty1

tty1 00:00:00

08:02

407

root 3066 1

nautilus --no-default-

00:00:01

08:03

21636 -

4
root 3305 1
window --sm-

client-id default3

00:00:01

08:03

21636 -

root 3305 1

4 -

bash

00:00:00

pts/1

08:17

1123 -

root 3643 3541 0

0 -

ps -edaflm

00:00:00

pts/1

08:27

1054 -

root 3701 3643 0

4 -

defaul

root -

5 -

root 2587 1

5 S rootroot 2620

1 -

1 S root5 -

5 S root5 -

5 S root4 -

:
) F 1 4 ( S ):D

/ :R :S :T :Z
) .(Zombie PRI NI nice STIME TTY

TIME CMD . )

( top ) (
ps 5.

top - 08:26:52 up 25 min, 2 users, load average: 0.21, 0.25, 0.33


Tasks: 124 total, 1 running, 123 sleeping, 0 stopped, 0 zombie
Cpu(s): 10.8%us, 2.1%sy, 0.0%ni, 82.0%id, 4.9%wa, 0.1%hi, 0.1%si, 0.0%st
Mem: 1026216k total, 731056k used, 295160k free, 24464k
buffers
Swap: 963860k total, 0k used, 963860k free, 460208k cached
PID

USER PR NI

VIRT

3541

root

15

3695

root

15

root

SHR S

%CPU

42148 14m

981

1.9

1.5 0:00.76 gnome-terminal

260

944

1650 R

1.9

0.1 0:00.02 top

RT 0

2032

680

580

0.0

0.1 0:00.85 init

root

34

0.0

0.0 0:00.00 migration/0

root

RT 19 0

0.0

0.0 0:00.04 ksoftirqd/0

root

10

0.0

0.0 0:00.00 watchdog/0

root

16

-5

0.0

0.0 0:00.00 events/0

root

10

-5

0.0

0.0 0:00.00 khelper

root

10

-5

0.0

0.0 0:00.00 kthread

53

root

11

-5

0.0

0.0 0:00.01 kblockd/0

54

root

15

-5

0.0

0.0 0:00.00 kacpid

177

root

18

-5

0.0

0.0 0:00.00 cqueue/0

178

root

18

-5

0.0

0.0 0:00.00 ksuspend_usbd

181

root

10

-5

0.0

0.0 0:00.00 khubd

183

root

10

-5

0.0

0.0 0:00.01 kseriod

203

root

23

0.0

0.0 0:00.00 pdflush

204

root

15

0.0

0.0 0:00.03 pdflush

RES

%MEM

TIME+ COMMAND

BSD sar
)iostat (/ ) vmstat .

.( ) uptime (

1.2

.
(1

.

. ) (SIZE R

dmesg )
:(free

Memory:
255048k/262080k available (1423k kernel core, 6644k reserved, 466k data, 240k
init, Ok highmem

atsar -r .(-p

: .

buffers ) ( )
(.

.
)( / )

( .

)
at(.
(2
) ( . ps top

"" : )
( ) ( ) ( .

/ /proc/
.
systune dump > /tmp/sysfile

) /tmp/sysfile .(sysctl
systune -c /tmp/sysfile ./proc/ systune

-c ./etc/systune.conf )

( ) /proc/sys/vm ( ) /proc/sys/kernel (.
) (

) renice( . /

) ( .

"" ) ( time slice

) kernel/sched.c (.

(3

)( fork )( exec . PATH

)( exec ) (./ .
) (.bashrc:
PATH .

.export PATH=$PATH

.
) (atsar -I .
.
(4 :
.

(
( in/out ) in/out/s > 30
) idle > 20%
:
atsar -u .atsar -d
.1
) /home/ /usr/ (

/ ) .(IDE
. ) atsar -d .(iostat

RAID .

.2
.

.3 4

/usr/, swap, /home/ ,/ : /


/
/home/user/
/usr/bin . /
/usr /home/ )(

.4 ) (cache buffer / ) .(/proc/ide/hdX :


.5 ext2 dumpe2fs -h /dev/hdX :
tune2fs /dev/hdX .
.6 ) (RPM
/ .

(5 :TCP/IP
) atsar netstat -i (netstat -s | more

) NFS, NIS,

:
FTP ( .

. .
. .
2
seek time
.

. ) (/proc/sys/net/ :
). (300

echo 600 > /proc/sys/net/core/netdev max backlog

(6 :


. vm.txt fs.txt kernel.txt sunrpc.txt
:Documentation/sysctl

:/proc/sys/vm . )(VM .
swap
) .

.gpowertweak

:/proc/sys/fs . Kernel-FS .file-max


. /proc/sys/kernel ./proc/sys/sunrpc
(7 .
.
./usr/src/linux

. : ) ( )

( .

) (.
(8 :

http://people.redhat.com/alikins/system_tuning.html

http://www.linuxjournal.com/article.php?sid=2396

1.3

:
( : ) (libr.a
) (libre.so.xx.x .

.
) ( disable-
-static


--shared . libc.a ) libc.so

( ) (libc6 .

( : .
) -march : -march i686 (-march k6 gcc -march i686

) O1,2,3 -O3 (gcc -O3 -march = i686


) -f (.

( : UltraDMA 100

. ) (hdparm

. IDE
3

.
) UltraDMA BIOS DMA(

) (man hdparm ) ( c3,- :

.-d1, -X34, -X66, -X12, -X86, -mXX, -a16, -u1, -W1, -k1, -K1

.
) hdparm -vtT /dev/hdx X ( hdparm
/etc/init.d .

1.4

. :

. :
BIOS

) BIOS
(.

. : . /
) /etc/init.d/networking stop start ( ) ifdown eth0 ifup(

3 IDE IDE
.

. /etc/security .
access.conf

users

Format: permission:

: origins +o - : users: from where

Disable access to all no-root over tty1.

-:ALL EXCEPT root: tty1

-:ALL EXCEPT user1 user2 user3:console


prevents access except for
users1,2,3 but the latter may only access from the console.
-:user1:ALL EXCEPT LOCAL .uoc.edu 'group.conf':

) (limits.conf
.
CPU I/O . DoS
. : 6
)(,_-.
.

min x /etc/pam.d/passwd
) x (.

. : sysadm .
ssh sysadm su .

. : TMOUT 360 ) (

) /etc/profile .( ~/.bashrc

) ( .

. NFS : /etc/exports

wildcards

.directory_exported host.domain.com (ro,root_squash)i /


. : single

. .

/etc/inittab S:wait:/sbin/sulogin : /bin/sulogin


) .(chmod 600

blocking ) chattr +i -i ( .

timeout :

restricted linux init = /bin/sh

lilo grub-legacy .grub

. .Ctrl+Alt+Delete
# :

ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now


telinit q

. : /etc/services
.chattr +i /etc/services
. : /etc/securetty TTY ) VC (Virtual Console
tty1 vc/1 sysadm

.su
. :

) ( operator, shutdown, ftp, uucp, games )root, bin, daemon,


(sync, nobody, sysadm ) .(/etc/group

) (chattr +i /etc/passwd /etc/shadow /etc/group/


/etc/gshadow )

(.

: /etc/fstab ) nosuid
.
( ) nodey ( ) noexec
( . :

/tmp /tmp ext2 defaults,nosuid,noexec 0 0

/boot/ .

. : ) /etc/init.d/ ( 700
/etc/issue /etc/issue.net )

( telnet ssh.
SUID . :SGID SUID SGID

s ) SUID (-rwsr-xr-x ) SGID .(-r-xr-sr-x )


(chmod a-s .
find / -type f -perm -4000 or -perm -2000 print

.
SUID SGID

. :
uid/gid " ) ( ") .. ( " ..^G

:
find / -name ".*" -print | cat -v

:
find / name ".." -print

uid/gid find / -nouser ) -nogroup

(.

)
. : .rhosts
ssh .(.rhosts
. :X Display manager /etc/X11/xdm/xaccess
.
XDM
5

1.5

munin
: monin .monit

) MySQL eth0(

monit Apache MySQL Postfix

.
.

5 XDM GDM KDM LightDM .


.

www.pirulo.org pirulo.org

apt-get install munin munin ./var/www/pirulo.org/web


.munin-node
:( /etc/munin/munin.conf )munin
dbdir /var/lib/munin
htmldir /var/www/www.pirulo.org/web/monitoring
logdir /var/log/munin
rundir /var/run/munin
tmpldir /etc/munin/templates
[pirulo.org]
address 127.0.0.1
use_node_name yes

.
mkdir -p /var/www/pirulo.org/web/monitoring
chown munin:munin /var/www/pirulo.org/web/monitoring
/etc/init.d/munin-node restart

http://www.pirulo.org/monitoring
. ) ( .

2

. .htaccess
:/var/www.pirulo.org/web/monitoring

AuthType Basic
"AuthName "Members Only
AuthUserFile /var/www/pirulo.org/.htpasswd
><limit GET PUT POST
require valid-user
></limit

/var/www/pirulo.org/.htpasswd ) (:
htpasswd -c /var/www/pirulo.org/.htpasswd admin

www.pirulo.org/monitoring ) (admin

monit apt-get install monit ./etc/monit/monitrc


.http://www.tildeslash.com/monit/doc/examples.php

proftpd, sshd, mysql, apache, postfix monitrc

monit :3333

set daemon 60
set logfile syslog facility log_daemon
set mailserver localhost
set mail-format { from: monit@pirulo.org }
set alert root@localhost
set httpd port 3333 and
allow admin:test
check process proftpd with pidfile /var/run/proftpd.pid
start program = "/etc/init.d/proftpd start"
stop program = "/etc/init.d/proftpd stop"
if failed port 21 protocol ftp then restart
if 5 restarts within 5 cycles then timeout
check process sshd with pidfile /var/run/sshd.pid
start program "/etc/init.d/ssh start"
stop program "/etc/init.d/ssh stop"
if failed port 22 protocol ssh then restart
if 5 restarts within 5 cycles then timeout
check process mysql with pidfile /var/run/mysqld/mysqld.pid
group database
start program = "/etc/init.d/mysql start"
stop program = "/etc/init.d/mysql stop"
if failed host 127.0.0.1 port 3306 then restart
if 5 restarts within 5 cycles then timeout
check process apache with pidfile /var/run/apache2.pid
group www
start program = "/etc/init.d/apache2 start"
stop program = "/etc/init.d/apache2 stop"
if failed host www.pirulo.org port 80 protocol http and request "/monit/token" then
restart
if cpu is greater than 60% for 2 cycles then alert
if cpu > 80% for 5 cycles then restart
if totalmem > 500 MB for 5 cycles then restart
if children > 250 then restart
if loadavg(5min) greater than 10 for 8 cycles then stop
if 3 restarts within 5 cycles then timeout

check process postfix with pidfile /var/spool/postfix/pid/master.pid


group mail
start program = "/etc/init.d/postfix start"
stop program = "/etc/init.d/postfix stop"
if failed port 25 protocol smtp then restart
if 5 restarts within 5 cycles then timeout

.http://www.tildeslash.com/monit/doc/manual.php

if failed host www.pirulo.org port 80 monit


.protocol http and request /monit/token then restart

mkdir /var/www/pirulo.org/web/monit; )

SSL monit .(echo "pirulo" > /var/www/pirulo.org/web/monit/token

.(http://www.howtoforge.com/server_monitoring_monit_munin_p2 )

startup=1 monit /etc/default/monit


(/etc/init.d/monit start )monit .( )CHECK_INTERVALS=60

: http://www.pirulo.org:3333

SNMP multi-route

. >
) traffic grapher (MRTG

http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch22_:_Monitoring_Ser

.<ver_Performance

) MRTG http://oss.oetiker.ch/mrtg
.

.atsar :/etc/mrtg.cfg

mrtg

WorkDir: /var/www/mrtg

Target[average]: '/usr/local/bin/cpu-load/average'
MaxBytes[average]: 1000

Options[average]: gauge, nopercent, growright, integer


YLegend[average]: Load average
kMG[average]: ,,

ShortLegend[average]:

Legend1[average]: Load average x 100


LegendI[average]: load:
LegendO[average]:

Title[average]: Load average x 100 for pirulo.org

PageTop[average]: <H1>Load average x 100 for pirulo.org</H1>


<TABLE>

<TR><TD>System:</TD> <TD>pirulo.org</TD></TR>

<TR><TD>Maintainer:</TD> <TD>webmaster@pirulo.org</TD></TR>
<TR><TD>Max used:</TD> <TD>1000</TD></TR>
</TABLE>

) /usr/local/bin/cpu-load/average (sar )atsar

:mrtg (

#!/bin/sh
''}load='/usr/bin/atsar -u 1 | tail -n 1 | awk -F" " '{print $10
'}echo "$load * 100" | bc | awk -F"." '{print $1

./var/www/mrtg mrtg cron

/etc/mrtg.cfg /var/www/mrtg/average.html
.http://www.pirulo.org/mrtg/averange.html

4
:
) Frysk :(http://sources.redhat.com/frysk frysk
.

) Cacti .(http://cacti.net Cacti .PRDTools Cacti

(
) ( / )
. )

(:

: atsar, ac, sac, sysstat, isag .

Arpwatch :mon Ethernet/FDDI MACIP


:Diffmon, fcheck

:Fam File Alteration Monitor .

:Genpower .

:Gkrellm )(

) :Ksensors :(lm-sensors ) (.

:Systune, .lcap /proc/sys/kernel .

:Log watcher .

Munin :monit .

Powertweak :gpowertweak VFS ) VM

swap.

.(/proc/

) :Gps, gtop, tkps, lavaps ( :

) (/proc/
6 isag .Interactive System Activity Grapher

:Swatch .

:Vtgrab ) .(VNC

:Whowatch .

:Wmnd, dmachinemon )( .

:Xosview, si .
ksensors gkrellm xosview .

) (
:

:5

screenlets .GTK
:Screenlets

:6 screenlets


(
sumdis.c
.

. :
sumdis 1 2000000

:
) (sumdis.c
(
time ./sumdis 1 1000000

( .


:
[Debc, Ibi]
http://people.redhat.com/alikins/system_tuning.html :
: Monit Munin
http://www.howtoforge.com/server_monitoring_monit_munin
: MRTG SNMP
http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch22_:_
Monitoring_Server_Performance
Munin: http://munin.projects.linpro.no/
Monit: http://www.tildeslash.com/monit/
MRTG: http://oss.oetiker.ch/mrtg/
Frysk: http://sources.redhat.com/frysk/
Cacti: http://cacti.net/
:
. " "


cluster .

LAN .
grid .WAN

" .
)

( .

High Performance Computing HPC .


.

HPC

: )
( .
: ) ( )
(.

.
) (

) ( .
.

) ( .

) 10/ 56/ 1973

1 ) (ATM 12/
( .
) ( .

) (
)

(.

1.1

Beowulf

/ ) .(APD
) ( .

) sockets (RPC

Parallel Virtual Machines

PVM Message Passing Interface MPI

/ . -- ) (master-workers

. ) 1024( -
.
/

Cluster of Workstations COW

) ( COW

COW .

) Mosix (.

/ .

/ .

([(
) (hub / ) ]

NFS rsh .ssh


.
1.1.1

) /etc/hosts ( localhost 127001

127001

localhost

) ( :
pirulo1

19216801

pirulo2

19216802

) (nteum :
groupadd beowulf
adduser nteum beowulf
echo unmask 007 >> /home/nteum/.bash_profile

beowulf nteum

.beowulf

) NFS ( . :

mkdir /mnt/nteum
chmod 770 /mnt/nteum
chown -R nteum:beowulf /mnt/nteum

.
cd /etc
cat >> exports
)/mnt/wolf 192.168.0.100/192.168.0.255 (rw
><control d

xxx 1921680
) (.
:
chkconfig -add sshd
chkconfig -add nfs
chkconfig -add rexec
chkconfig -add rlogin
chkconfig -level 3 rsh on
chkconfig -level 3 nfs on
chkconfig -level 3 rexec on
chkconfig -level 3 rlogin on

ssh rsh

nteum . ) (# :/etc/ssh/sshd_config
yes

RSAAuthentication

.ssh/authorized_keys

AuthorizedKeysFile

nteum . :
"" ssh-keygen -b 1024 -f ~/.ssh/id_rsa -t rsa -N

id_rsa id_rsa.pub /home/nteum/.ssh

id_rsa.pub authorized_keys . :

chmod 755 ~/.ssh

*chmod 644 ~/.ssh/aut

) ( )
(id_rsa.pub / /home/nteum/.ssh/authorized_keys .

NFS :/etc/fstab

pirulo1:/mnt/nteum /mnt/nteum nfs rw,hard,intr 0 0

Beowulf PVM ) MPI (.

) (system-config-cluster .
:

http://www.redhat.com/docs/manuals/enterprise/RHEL-5manual/Cluster_Administration/index.html

1.1.2

( +6+5+4 : sumdis.c
. )

>#include <stdio.h
{)int main (int argc, char** argv
;float initial, final, result, tmp
{ )if (argc < 2
;)]printf ("Use: %s N. initial N. final\n",argv[0
;)exit(1
}
{ else
;)]initial = atol (argv[1
;)]final = atol (argv[2
;result = 0.0
}
{)for (tmp = inicial; tmp <= final; tmp++
} ;result + = tmp
)printf("%f\n", result
;return 0
}

gcc -o sumdis sumdis.c :



) 1 (106

time ./sumdis 1 1000000

2418 AMD Athelon 1400 256


) ( real = 0013 user = 0010 13 10

) 1 (106*16

time ./sumdis 1 16000000

real = 182 14 160000000

) (160*10 .
6

: 4 ) (node1 node4
NFS rsh ) (

1 40000000 40000001 80000000 80000001

120000000000 120000001 .160000000 .

/home/ NFS ) (nteum .rhosts


. tcpd

/etc/inetd.conf rsh /etc/hosts.allow

mkfifo out
) fifo ( /home/nteum/
'}./distr.sh & time cat salida | awk '{total + = $1 } END printf "%lf", total
) distr.sh (

distr.sh :

& rsh node1 /home/nteum/sumdis 1 40000000 > /home/nteum/out < /dev/null
& rsh node2 /home/nteum/sumdis 40000001 80000000 > /home/nteum/out < /dev/null
& rsh node3 /home/nteum/sumdis 80000001 120000000 > /home/nteum/out < /dev/null
& rsh node4 /home/nteum/sumdis 120000001 160000000 > /home/nteum/out < /dev/null

) (4 .

) PVM .(MPI

1.2

. :
( ) (.
( ) (MPS
) ( MPS

)( . :
)send(destination,msg
)recv(origin,msg

PVM MPI

) ( / .
) (SHM threads

.
:

( ) ( ) NFS .(NIS YP
( ) (NOS .
( :
- ) .(sockets
- API ).(PVM, MPI
- ).( ,RMI, CORBA, AGENTS
1.2.1

PVM

PVM

.Virtual Machine VM ) (spawn )


(kill PVM . )

/ (

.
) (VM ) ( )

(blocking send, blocking/nonblocking receive, multicast )


( ) VM (.
PVM pvm3d UDP

) PVM (libpvm3.a routines/ /


. .
PVM .

" "" . PVM

) ( : pvm ) pvm-dev pvm

( .
libpvm3.
/ / PVM

)( . .
)

ScaLapack scalapack-pvm | mpich-test | dev, scalapack1-pvm | mpich

PVM .(MPI / )
(http://www.epm.ornl.gov/pvm .

.Amdahl
Amdahl speedup ) (f

)speedup = 1/(1-f

) (f=0 speedup = 1

f=1 speedup ) (infinite %90


10 f=099 .
:

(- : - /.
( ) :(SMPD .
( : .
pvm add .
~/pvm3/bin/LINUX . PVM_ROOT

lib/LINUX/libpvm3.a PVM_ARCH=LINUX ./cshrc

. ) NIS

( ) csh rsh (
~/.rhosts . PVM rsh-pvm

/usr/lib/pvm3/bin/ rsh PVM ) (


. ssh

.ssh/authorized_keys .


PVM -

( .
:PVM

master.c

:
gcc -O -I/usr/share/pvm3/include/ -L/usr/share/pvm3/lib/LINUX -o master master.c -lpvm3

-I -L pvm3.h * libpvm .
:
. pvmd

pvm

. add ) (.
. ) quit pvm (
. :master

#include <stdio.h>
#include "pvm3.h"
#define SLAVENAME "/home/nteum/pvm3/client"
main() {
int mytid, tids[20], n, nproc, numt, i, who, msgtype, loops; float data[10]; int
n_times;
if( pvm_parent() ==PvmNoParent ){
/*Return if this is the parent or child process */
loops = 1;
printf("\n How many children (120)? ");
scanf("%d", &nproc);
printf("\n How many child-child communication loops (1 - 5000)? ");
scanf("%d", &loops); }
/*Redirects the in/out of the children to the parent */
pvm_catchout(stdout);
/*Creates the children */
numt = pvm_spawn(SLAVENAME, (char**)0, 0, "", nproc, tids);
/*Starts up a new process, 1st: executable child, 2nd: argv, 3rd :options, 4th
:where, 5th :N. copies, 6th :matrix of id*/
printf("Result of Spawn: %d \n", numt);
/*Has it managed?*/
if( numt &lt; nproc ){
Printf("Error creating the children. Error code:\n");
for( i = numt ; i<nproc ; i++ ) {
printf("Tid %d %d\n",i,tids[i]); }
for( i = 0 ; i<numt ; i++ ){
pvm_kill( tids[i] ); } /*Kill the processes with id in tids*/
pvm_exit();
exit(); /*Finish*/
}
/*Start up parent program, initialising the data */
n = 10;
for( i = 0 ; i<n ; i++ ){
data[i] = 2.0;}
/*Broadcast with initial data to slaves*/
pvm_initsend(PvmDataDefault);.
/*Delete the buffer and specify message encoding*/

pvm_pkint(&loops, 1, 1);
/*Package data in the buffer, 2nd N., 3*:stride*/
pvm_pkint(&nproc, 1, 1);
pvm_pkint(tids, nproc, 1);
pvm_pkint(&n, 1, 1);
pvm_pkfloat(data, n, 1);
pvm_mcast(tids, nproc, 0);
/*Multicast in the buffer to the tids and wait for the result from the children*/
msgtype = 5;
for( i = 0 ; i < nproc ; i++ ){
pvm_recv( -1, msgtype );
/*Receive a message, -1 :of any, 2nd:tag of msg*/
pvm_upkint( &who, 1, 1 );
/*Unpackage*/
printf("Finished %d\n",who);
}
pvm_exit();
}

client.c

:PVM
:

gcc -O -I/usr/share/pvm3/include/ -L/usr/share/pvm3/lib/LINUX -or client client.c -lpvm3

/home/nteum/pvm3

#include <stdio.h>
#include "pvm3.h" main() {
int mytid;

/*Mi task id*/

int tids[20];

/*Task ids*/

int n, me, i, nproc, master, msgtype, loops; float data[10];


long result[4]; float work();
mytid = pvm_mytid(); msgtype = 0;
pvm_recv( -1, msgtype );
pvm_upkint(&loops, 1, 1);
pvm_upkint(&nproc, 1, 1);
pvm_upkint(tids, nproc, 1);
pvm_upkint(&n, 1, 1);
pvm_upkfloat(data, n, 1);
/*Determines which child it is (0 -- nproc-1) */
for( i = 0; i < nproc ; i++ )
if( mytid == tids[i] ){ me = i; break; }
/*Processes and passes the data between neighbours*/
work (me, data, tids, nproc, loops);
/*Send the data to the master */
pvm_initsend( PvmDataDefault );
pvm_pkint( &me, 1, 1 );
msgtype = 5;

master = pvm_parent(); /*Find out who created it */


pvm_send( master, msgtype);
pvm_exit();
}
float work(me, data, tids, nproc, loops)
int me, *tids, nproc; float *data; {
int i,j, dest; float psum = 0.0, sum = 0.1;
for (j = 1; j <= loops; j++){
pvm_initsend( PvmDataDefault );
pvm_pkfloat( &sum, 1, 1 );
dest = me + 1;
if( dest == nproc ) dest = 0;
pvm_send( tids[dest], 22 );
i = me - 1;
if (me == 0 ) i = nproc-1;
pvm_recv( tids[i], 22 );
pvm_upkfloat( &psum, 1, 1 );
}
}

( )

(xpvm ) xpvm PVM


. ( )

1.2.2

API MPI ) MPI MPIF

F (Forum 40 . MPI

) WRC : (IBM Intel NX/2, Express, nCUBE, Vertex, p4, Parmac

.ZipCode, Chimp, PVM, Chamaleon, PICL MPIF

C ) F77 ++C (F90

. ) ( ,PVM, NX, Express, p4

) .(thread-safety

MPP C F77
.portability : MPP WS

. ) MPI1 ( ) (spawn MPI2


) ( .

Scalable
Parallel Computers SPC )SGI, Sun, Cray, HPConvex, IBM,
.( Parsystec ) freeware mpich ( )

( --

F77 C .profiling

: SHM

/ ) API

.(MPI2 MPI1

) (MIMD
.MPI )( MPI threadsafe

MPI .

]([ MPI )
( . mpich ) mpich-bin mpich (

) mpich-mpd-bin ( .

mpich-bin MPI12 ) MPI2 .(parallel in/out

MPI ) LAM * lam .(/usr/doc/lam-runtime/release.html


MPI . ) Mpich

* (mpich ) /usr/share/doc/mpi .(/usr/doc/mpi mpi rsh


~/.rhosts host username :

username host ) .(PVM

rshserver tcpd /etc/inetd.conf rsh.d


./etc/hosts.allow NFS

/etc/mpich/machines.LINUX )
.(localhost .csh
update-cluster . Mpich ssh

rsh rsh ssh .


ssh .

. ssh

. ssh localhost .

Mpich LAM-MPI mpirun Mpich mpirun.mpich mpirun

mpirun .LAM-MPI mpirun LAM lamboot

lamboot )
.(MPI mpirun

lamboot . lamboot /etc/lam


) *(bhost ).(http://www.lam-mpi.org

MMPI ) mpicc (mpicc -o test test.c

gcc makefile ) /usr/doc/mpich/examples (.


mpireconfig makefile makefile.in makefile

. :

mpirun.mpich -np 8 programme mpirun -np 8 programme

np ) 8 ( .
mpich

./etc/mpich/machine.LINUX mpich swap

/ . ) /usr/doc/mpich-doc usr/share/doc/mpich-
(/doc ) API MPI(.
MPImpicc -O -o output output.c :
mpich) mpirun.mpich -np N output : N (.
) Mpich 12X .(/usr/doc/mpich/examples Srtest
-- cpi Pi ) (.

:
:

srtest.c

mpicc -O -o srtest srtest.c

mpich) mpirun.mpich -np N srtest : N


.(ssh
LAM) mpirun -np N srtest : (root

#include "mpi.h"
#include <stdio.h>
#define BUFLEN 512
int main(int argc, char *argv[]) {
int myid, numprocs, next, namelen;
char buffer[BUFLEN], processor_name[MPI_MAX_PROCESSOR_NAME];
MPI_Status status;
MPI_Init(&argc,&argv);
/* Must be placed before other MPI calls, always */
MPI_Comm_size(MPI_COMM_WORLD,&numprocs);
MPI_Comm_rank(MPI_COMM_WORLD,&amp;myid);
/*Integrates the process in a communications group*/
MPI_Get_processor_name(processor_name,&namelen);
/*Obtains the name of the processor*/
fprintf(stderr,"Process %d on %s\n", myid, processor_name);
strcpy(buffer,"Hello People");
if (myid ==numprocs1) next = 0;
else next = myid+1;
if (myid ==0) { /*If it is the initial, send string of buffer*/
printf("%d Send '%s' \n",myid,buffer);
MPI_Send(buffer, strlen(buffer)+1, MPI_CHAR, next, 99, MPI_COMM_WORLD);
/*Blocking Send, 1 or :buffer, 2 or :size, 3 or :type, 4or :destination, 5 or :tag, 6
or :context*/
/*MPI_Send(buffer, strlen(buffer)+1, MPI_CHAR,
MPI_PROC_NULL, 299,MPI_COMM_WORLD);*/
printf("%d receiving \n",myid);
/* Blocking Recv, 1 o :buffer, 2 or :size, 3 or :type, 4 or :source, 5 or :tag, 6 or :context, 7
or :status*/
MPI_Recv(buffer, BUFLEN, MPI_CHAR, MPI_ANY_SOURCE, 99,
MPI_COMM_WORLD,&status);
printf("%d received '%s' \n",myid,buffer) }

else {
printf("%d receiving \n",myid);
MPI_Recv(buffer, BUFLEN, MPI_CHAR, MPI_ANY_SOURCE, 99,
MPI_COMM_WORLD,status);
/*MPI_Recv(buffer, BUFLEN, MPI_CHAR, MPI_PROC_NULL,
299,MPI_COMM_WORLD,&status);*/
printf("%d received '%s' \n",myid,buffer);
MPI_Send(buffer, strlen(buffer)+1, MPI_CHAR, next, 99, MPI_COMM_WORLD);
printf("%d sent '%s' \n",myid,buffer);}
MPI_Barrier(MPI_COMM_WORLD); /*Synchronises all the processes*/
MPI_Finalize(); /*Frees up the resources and ends*/
return (0);
}

cpi.c
cpi cpi.c

: PI

mpicc O :

N-1 ) mpirun.mpich -np -N cpi : mpich


.(ssh
.( ) mpirun -np N cpi : LAM
e(); /*Frees up the resources and ends*/
#include "mpi.h"
#include <stdio.h>
#include <math.h>
double f( double );
double f( double a) { return (4.0 / (1.0 + a*a)); }
int main( int argc, char *argv[] ) {
int done = 0, n, myid, numprocs, i;
double PI25DT = 3.141592653589793238462643;
double mypi, pi, h, sum, x;
double startwtime = 0.0, endwtime;
int namelen;
char processor_name[MPI_MAX_PROCESSOR_NAME];
MPI_Init(&argc,&argv);
MPI_Comm_size(MPI_COMM_WORLD,&amp;numprocs);
/*Indicates the number of processes in the group*/

MPI_Comm_rank(MPI_COMM_WORLD,&myid);
/*Id of the process*/
MPI_Get_processor_name(processor_name,&namelen);
/*Name of the process*/
fprintf(stderr,"Process %d on %s\n", myid, processor_name);
n = 0;
while (!done) {
if (myid ==0) {/*If it is the first...*/
if (n ==0) n = 100; else n = 0;
startwtime = MPI_Wtime();} /* Time Clock */
MPI_Bcast(&amp;n, 1, MPI_INT, 0, MPI_COMM_WORLD);
/*Broadcast to the rest*/
/*Send from 4th arg. to all the processes of the group.
All others that are not 0 will copy the buffer from 4 or arg -process 0-*/
/*1.:buffer, 2nd :size, 3rd :type, 5th :group */
if (n == 0) done = 1; else {
h = 1.0 / (double) n;
sum = 0.0;
for (i = myid + 1; i &lt;= n; i + = numprocs) {
x = h * ((double)i - 0.5); sum + = f(x); }
mypi = h * sum;
MPI_Reduce(&mypi, &pi, 1, MPI_DOUBLE, MPI_SUM, 0,
MPI_Init(&argc,&argv);
MPI_Comm_size(MPI_COMM_WORLD,&amp;numprocs);
/*Indicates the number of processes in the group*/
MPI_COMM_WORLD);
/* Combines the elements of the Send Buffer of each process of
the group using the operation MPI_SUM and returns the result in
the Recv Buffer. It must be called by all the processes of the group
using the same arguments*/
/*1st :sendbuffer, 2nd :recvbuffer, 3rd :size, 4th :typo,
5th :oper, 6th :root, 7th :context*/
if (myid == 0){ /*Only the P0 prints the result*/
printf("Pi is approximately %.16f, the error is %.16f\n", pi, fabs(pi - PI25DT));
endwtime = MPI_Wtime();
printf("Execution time = %f\n", endwtime-startwtime); }
}
}

MPI_Finalize(); /*Free up resources and finish*/


;return 0
}

PVM XPVM MPI ) ( ) XMPI .(xmpi

libxmpi3 XMPI MPI .xmpi


.xmpi

XMPI :2

OpenMosix
OpenMosix / .

.
. OpenMosix ) (

/ . OpenMosix

) (oMFS .HPC OpenMosix

) openmosix-dev ( ) kernel-patch-openmosix (OpenMosix openmosix


) ( . ) mosix Mosix
.(OpenMosix OpenMosix )(
http://openmosix.sourceforge.net ) ( ) http://howto.x-
.(tend.be/openMosix-HOWTO

OpenMosix ) /etc
( openmosix.map . :
Nodo_ID ) IP ( .Range-size
:
1

node1

node2

node3

19216811

19216812

ID IP / .

OpenMosix . OpenMosix :

setpe -w -f /etc/openmosix.map

) OpenMosix userspace-tools (/etc/init.d

oMFS .

/mfs /home/ 3
./mfs/3/home/
UID GID )
OpenLDAP (.
oMFS /etc/fstab mfs_mnt /mfs mfs dfsa = 1 0 0 : :

.mfs_mnt /mfs mfs dfsa = 0 0 0

MFS ID .

) Howto

:(OpenMosix

'};)awk 'BEGIN {for(i = 0;i<10000;i++)for(j = 0;j<10000;j++

mosmom ) openmosixview( OpenMosix . )

(omdiscd ./etc/openmosix.map
multicast OpenMosix omdiscd

. .
) (omdiscd . OpenMosix

.OpenMosix
) (migrate, mon, mosctl, mosrun ./proc/hpc

2416 OpenMosix /proc/mosix 2417


./proc/hpc

/proc/hpc :
:migrate [PID] [OpenMosix ID] .
:mon .
:mosctl .OpenMosix )stay, lstay, block, quiet, mfs, expel, bring,
(get- tune, getyard, getdecay MFS

:mosrun [h | OpenMosix ID | list of OpenMosix IDs] command [argument]


.

Metacomputers, grid computing


. metacomputers .grid computers

. ) I-WAY 17 (

DataGrid CrossGrid IrisGrid . grid computers

SPD /
.

. ) (

. SPD metacomputing

metacomputing SPD .

3.1

. )(
) (

.reliability ) LAN

)
(Myrinet SAN / SPD /

15 3 /( .

. .HTC
(
) C

) ( .

Sun Grid Engine Sun Microsystems Condor


) Wisconsin( LSF ) Platform Computing(.

.
) (Condor, LSF, SGE


.
1986 2000 500 340000

2001 2010 60 4000 .


: Grid Computing GC
.metacomputing

Grid Computing
.

Ian Foster " Grid " ) (2002 Grid :

. .
. .
. .

/ .
.

1.3

Globus

Globus Project

metacomputing grid computing


.

middleware
.

) (Globus toolkit /

. :

. RPC
stream-based dataflow .multicast

Unified Resource Information Service


metasystem .

.
.

.

COBRA

/ High
.Performance Storage System HPSS

):(http://www.globus.org/toolkit/about.html

1.4

' 'The Globus Alliance .http://www.globus.org

.grid grid

.grid .
IrisGrid . :
.http://www.rediris.es/irisgrid

) (Globus Toolkit 5 .GT5

) / (
. .

.http://www.globus.org/toolkit/docs/5.0/admin/docbook/quickstart.html
:
. : )zlib, j2se, disable gcj, apache, C/C++, tar, make, sed, perl,
.(sudo, postgres, iodbc

.GT5
.
. )(.
. .GridFTP
. .Webservices Container
1 GT4 .GT5

. .Reliable File Transfer RFT


. ) WS GRAM (.
. .
. .
. .
. .Cross-CA Trust
GT5 Grid

) ( .GT5
GT5 :
http://www.globus.org/toolkit/docs/5.0/admin/docbook/


( PVM master.c client.c .xpvm
.cpi.c
( mpich
( LAM-MPI cpi.c .xmpi


:
[Debc, Ibi, Mou01]
LAM-MPI : http://www.lam-mpi.org/
system-config-cluster (Fedora):
http://www.redhat.com/docs/manuals/enterprise/RHEL-5manual/Cluster_Administration/index.html
OpenMosix: http://openmosix.sourceforge.net/
HowTo OpenMosix: http://howto.x-tend.be/openMosix-HOWTO/
Globus 5: http://www.globus.org/toolkit/5.0/
GT5 Quick Guide:
http://www.globus.org/toolkit/docs/5.0/admin/docbook/quickstart.html


[Aiv02] Tigran Aivazian (2002). "Linux Kernel 2.4 Internals". The Linux
Documentation Project(guas).
[Ano99] Anonymous. Maximum Linux Security: A Hacker's Guide to Protecting
[Apa] Apache2 + SSL. <http://www.debian-administration.org/articles/349>.
[Apab] Apache2 + WebDav <http://www.debian-administration.org/articles/285>.
[Apac] Apache2 + Subversion <http://www.debian-administration.org>.
[Ar01] Jonathan Corbet; Alessandro Rubini. Linux Device Drivers 2nd Editon.
O'Reilly, 2001.
[Arc] Roberto Arcomano. "Kernel Analysis-HOWTO". The Linux Documentation
Project.
[Aus] "Australian CERT". <http://www.auscert.org.au/>.
[Bac86] Maurice J. Bach (1986). The Design of the UNIX Operating System. Prentice
Hall.
[Bai03] Edward C. Bailey (2003). RedHat Maximum RPM.
<http://www.redhat.com/docs/books/max-rpm/index.html>.
[Ban] Tobby Banerjee. "Linux Installation Strategies HOWTO". The Linux
Documentation Project.
[Bar] Slashdot. slashdot site. <http://barrapunto.com>.
[Bas] Mike G. "BASH Programming - Introduction HOWTO". The Linux
Documentation Project.
[Beo] Beowulf.org. Beowulf Web Site. <http://www.beowulf.org>.
[Bor] Matthew Borowski (2000). "FTP". The Linux Documentation Project.
[Bro] Scott Bronson (2001). " VPN PPP-SSH". The Linux Documentation Project.
[Bul] "Bulma Linux User Group". <http://bulmalug.net>.
[Bur02] Hal Burgiss (2002). "Security QuickStart HOWTO for Linux". The Linux
Documentation Project.
[Cac] Monitoring with Cacti. <http://cacti.net/>.

[Cdg] (Environment for portability of GNU/Linux games)


<http://www.transgaming.com/>.
[Ced] "Version Management with CVS". <http://www.cvshome.org>.
[Cen] The Comunity ENTerprise Operatyng System <http://www.centos.org>.
[CERa] "CERT site". <http://www.cert.org>.
[CERb] (2003). "CERT vulnerabilities". <http://www.cert.org/nav/index red.htm>.
[Cerc] "Cervisia interface for CVS". <http://cervisia.sourceforge.net>.
[Cis00] (2000). "TCP/IP White Paper". <http://www.cisco.com>.
[Com01] Douglas Comer (2001). TCP/IP Basic principles, protocols and
architecture. Prentice Hall.
[Coo] Mendel Cooper (2006). "Advanced bashScripting Guide". The Linux
Documentation Project (guas).
[CVS] "CVS Home". <http://www.cvshome.org>
[CVSI] Graphic interfaces for CVS <http://www.twobarleycorns.net/tkcvs.html>.
[DBo] Marco Cesati; Daniel Bovet (2006). Understanding the Linux Kernel (3rd ed.).
O'Reilly.
[Deb] "Debian Security Site". <http://www.debian.org/security/>.
[Deb04] (2004). "APT-HOWTO". <http://www.debian.org/doc/manuals/apthowto/index.en.html>.
[Deba] "Free Software vs Open Software".
<http://www.debian.org/intro/free.es.html>.
[Debb] "Debian Distribution". <http://www.debian.org>.
[Dieb] Hank Dietz (2004). "Linux Parallel Processing". The Linux Documentation
Project.
[Dis] "Available Linux distributions". <http://www.distrowatch.com>.
[Dgn] The Dot Gnu Project. <http://www.gnu.org/software/dotgnu/>.
[DNS] Start up a DNS Server. <http://tldp.org/HOWTO/DNS-HOWTO-7.html>.
[Dra] Joshua Drake (1999). "Linux Networking". The Linux Documentation Project.

[DSL] Digital Line Subscriber (2002)The Linux Documentation Project.


[Buy] Kris Buytaert and others (2002). "The OpenMosix". The Linux
DocumentationProject.
[Ext] "Extreme Linux Web Site". <http://www.extremelinux.org>.
[Exim] Mail service (MTA). <http://www.exim.org/docs.html>.
[FBI] FBI. "FBI Brigade for cybercrime". <http://www.emergency.com/fbi-nccs.htm>.
[Fed] The Fedora Project. <http://fedoraproject.org>.
[Fen02] Kevin Fenzi. "Linux security HOWTO". The Linux Documentation Project.
[Fos] (2003). "Globus: A Metacomputing Infrastructure Toolkit".
<http://www.globus.org>.
[Fre] "Freshmeat site". <http://freshmeat.org>.
[Fri02] Aleen Frisch (2002)Essential System Administration. O'Reilly.
[Fry] Monitoring with Frysk. <http://sources.redhat.com/frysk/>.
[FSF] "Free Software Foundation and GNU Project". <http://www.gnu.org>.
[Gar98] Bdale Garbee (1998)TCP/IP Tutorial. N3EUA Inc.
[Gloa] Globus. GT4. "Admin Guide Installation" and "Admin Guide Configuration".
<http://www.globus.org>.
[Glob] "User's Guide Core Framework Globus Toolkit ", <http://www.globus.org>.
[Gt] Dirk Allaert Grant Taylor. "The Linux Printing HOWTO". The Linux
Documentation Project.
[GT4] Quick Guide.
<http://www.globus.org/toolkit/docs/4.0/admin/docbook/quickstart.html>.
[Gnu] Gnupg.org. GnuPG Web Site. <http://www.gnupg.org>.
[Gon] Guido Gonzato. "From DOS/Windows to Linux HOWTO". The Linux
Documentation Project.
[Gor] Paul Gortmaker (2003). "The Linux BootPrompt HOWTO". The Linux
Documentation Project.
[Gre] Mark Grennan. "Firewall and Proxy Server HOWTO". The Linux
Documentation Project.

[Hat01] Brian Hatch (2001)Hacking Linux Exposed. McGraw-Hill.


[Hat03] (2003). "Firewalls" en Red Hat 9 manual.
<http://www.redhat.com/docs/manuals/linux/RHL-9-Manual/securityguide/ch-fw.html#S1-FIREWALL-IPT>.
[Hatb] (2003). "Red Hat 9 Security Guide".
<http://www.redhat.com/docs/manuals/linux/RHL-9-Manual/security-guide/>.
[Hatc] (2003). "Red Hat Security Site". <http://www.redhat.com/security/>.
[Hatd] Red Hat (2003)Use of GPG signatures in Red Hat.
<http://www.redhat.com/docs/manuals/linux/RHL-7.3-Manual/customguide/ch-gnupg.html>.
[Hen03] Bryan Henderson. "Linux Loadable Kernel Module HOWTO". The Linux
Documentation Project.
[Him01] Pekka Himanen (2001). Hacker ethics and the spirit of the information age .
Destination.
[Hin00] Martin Hinner. "Filesystems HOWTO". The Linux Documentation Project.
[His] "Linux Hispanic Community". <http://www.hispalinux.es>.
[IET] "Request For Comment Repository developed by the Internet Engineering Task
Force (IETF) in the Network Information Center (NIC). ".
<http://www.cis.ohio-state.edu/rfc/>.
[Ian] "List of TCP/IP ports". <http://www.iana.org/assignments/port-numbers>.
[IP] Routing with the ip tool. ftp://ftp.inr.ac.ru/ip_routing/>.
[ipw] Firmware for wireless cards IPW2200.
<http://ipw2200.sourceforge.net/firmware.php>.
[Ibi] (2003). "Linux Documentation Center".
<http://www.ibiblio.org/pub/Linux/docs/HOWTO/>.
[Incb] "vulnerabilities Incidents". <http://isc.incidents.org>.
[Ins] (1998). "Vulnerabilities and exploits". <http://www.insecure.org/sploits.html>.
[Insa] "Insecure.org site". <http://www.insecure.org>.
[Insb] (2003). "Nmap". <http://www.insecure.org/nmap/index.html>.
[Log] LogCheck. <http://logcheck.org/>.

[LWP] LWP: Apache+MySQL+:PHP.


<http://www.lawebdelprogramador.com/temas/tema_stablephpapachemysql.p
hp>.
[Joh98] Michael K. Johnson (1998). "Linux Information Sheet". The Linux
Documentation Project.
[Jou] Linux Journal. Linux Journal [Linux Magazine] .
<http://www.linuxjournal.com>.
[Kan] Ivan Kanis. "Multiboot with GRUB Mini-HOWTO". The Linux Documentation
Project.
[Kat] Jonathan Katz. "Linux + Windows HOWTO". The Linux Documentation
Project.
[KD00] Olaf Kirch; Terry Dawson. Linux Network Administrator's Guide. O'Reilly
Associates. And howe-book(free) in Free Software Foundation, Inc. , 2000.
<http://www.tldp.org/guides.html>.
[Ker02] (2002). "Kernel Hacking Doc Project". <http://www.kernelhacking.org>.
[Kera] "Kernel Newbies". <http://www.kernelnewbies.org>.
[Kerb] "Linux Kernel Archives". <http://www.kernel.org>.
[Kie] Robert Kiesling (1997). "The RCS (Revision Control System). ". The Linux
Documentation Project.
[Knp] Knoppix Distribution. <http://knoppix.org>.
The Linux Documentation Project. [Koe] Kristian Koehntopp. "Linux Partition
HOWTO".
[Kuk] Thorsten Kukuk (2003). "The Linux NIS(YP)/NYS/NIS+". The Linux
Documentation Project.
[Lam] "LAM (Local Area Multicomputer). ". <http://www.lam-mpi.org>.
[Law07] David Lawyer (2007). "Linux Modem". The Linux Documentation Project.
[Lev02] Bozidar Levi (2002). UNIX administration. CRC Press.
[Lev] "UNIX History". <http://www.levenez.com/unix>.
FHS Standard,[Lin03b] 2003. <http://www.pathname.com/fhs>.
Linux Standards Base project. [Linc] <http://www.linux-foundation.org/en/LSB>.

[Line] Linuxsecurity.com. Linux Security Reference Card.


<http://www.linuxsecurity.com/docs/QuickRefCard.pdf>.
[lkm] lkml. Linux Kernel Mailing List. <http://www.tux.org/lkml>.
[Llo] Ignacio Mart n Llorente. State of Grid Technology and IrisGrid Initiative .
<http://www.rediris.es/irisgrid>.
[Lan] Nicolai Langfeldt; Jamie Norrish (2001). "DNS". The Linux Documentation
Project.
[Log] "Logckeck Web Site". <http://logcheck.org/>.
[LPD] LPD. The Linux Documentation Project. <http://www.tldp.org>.
[Mag] Linux Magazine. Linux Magazine. <http://www.linux-mag.com/>.
[Maj96] Amir Majidimehr (1996). Optimizing UNIX for Performance. Prentice Hall.
[Mal96] Fred Mallett (1996). TCP/IP Tutorial. FAME Computer Education.
[Mal07] Luiz Ernesto Pinheiro Malre (2007). "Ldap". The Linux
DocumentationProject.
[Miq] Miquel, S. "NIS Debian". On Debian Woody, /usr/doc/nis/ nis.debian.howto.
[Moin] Moin Moin <http://moinmoin.wikiwikiweb.de/>.
[Moi] Moin Moin + Debian.
<http://moinmoin.wikiwikiweb.de/MoinMoinPackages/DebianLinux>.
[Mon] Monit. <http://www.tildeslash.com/monit/>.
[Monb] Monitoring with Munin and monit.
<http://www.howtoforge.com/server_monitoring_monit_munin>.
[Monc] Monitoring with SNMP and MRTG.
<http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_C
h22_:_Monitoring_Server_Performance>.
[Mono] Mono project. <http://www.mono-project.com/Main_Page>.
[Mor03] Daniel Morill (2003). Configuration of Linux systems . Anaya Multimedia.
[Mou01] Gerhard Mourani (2001). Securing and Optimizing Linux: The Ultimate
Solution. Open Network Architecture, Inc.
[Mun] Munin. <http://munin.projects.linpro.no/>.

[MRTG] MRTG. <http://oss.oetiker.ch/mrtg/>.


[Mur] Gary Lawrence Murphy. Kernel Book Project.
<http://kernelbook.sourceforge.net>.
[Mutt] Mutt mail client. <http://www.mutt.org>.
[Mys] "Reference Manual". <http://www.mysql.com/>.
[MysqlA] <http://www.mysql.com/products/tools/administrator/>.
[Nes] "Nessus". <http://www.nessus.org>.
[Net] Netfilter.org.netfilter/IPtables Project. <www.netfilter.org>.
[Neu] Christopher Neufeld. "Setting Up Your New Domain Mini-HOWTO". The
Linux Documentation Project.
[New] "Newsforge site". <http://newsforge.org>.
[NIS] Setting up a NIS Server. <http://tldp.org/HOWTO/NISHOWTO/verification.html>.
[NSAa] "NIST site". <http://csrc.nist.gov/>.
[NSAb] (2003). "Security Enhanced Linux". <http://www.nsa.gov/selinux>.
[Nt3] NTFS-3g Project: NTFS-3G Read/Write Driver. <http://www.ntfs-3g.org/>.
[Oke] Greg O'Keefe. "From Power Up To bash Prompt HOWTO". The Linux
Documentation Project.
[Open] Virtual private network. <http://openvpn.net/howto.html>.
[OpenM] OpenMosix. <http://openmosix.sourceforge.net/>.
[OpenMb] HowTo Openmosix. <http://howto.x-tend.be/openMosix-HOWTO/>.
[OSDa] "Open Source Developement Laboratories". <http://www.osdl.org>.
[OSDb] OSDN. "Open Source Development Network". <http://osdn.com>.
[OSIa] "List of Open Source licenses".
<http://www.opensource.org/licenses/index.html>.
[OSIb] (2003). "Open Source Definition".
<http://www.opensource.org/docs/definition.php>.
[OSIc] (2003). "Open Source Iniciative". <http://www.opensource.org>.

[Pe 2007) [). "Securing Debian Manual".


<http://www.debian.org/doc/manuals/securing-debian-howto/>.
[Pga] Client for PostgreSQL. <http://www.pgaccess.org/>.
[Pla] "LSF". <http://www.platform.com>.
[Posa] "PostgreSQL Administrator's Guide". <http://www.postgresql.org/docs/>.
[Per] Performance Monitoring Tools for Linux.
<http://www.linuxjournal.com/article.php?sid=2396>.
[Pose] "PostgreSQL Web Site". <http://www.postgresql.org>.
[PPP] Linux PPP (2000). "Corwin Williams, Joshua Drake and Robert Hart". The
Linux Documentation Project.
[Pra03] (2003). "The Wonderful World of Linux 2. 6".
<http://www.kniggit.net/wwol26.html>.
[Pri] Steven Pritchard. "Linux Hardware HOWTO". The Linux Documentation
Project.
[Pro] "Grub Manual". <http://www.gnu.org/software/grub/manual/>.
[Proa] "Bastille". <http://bastille-linux.sourceforge.net/>.
[Prob] "MPI". <http://www.mcs.anl.gov:80/mpi/>.
[Proc] "Mpich MPI Freeware". <http://www-unix.mcs.anl.gov/mpi/>.
[Prod] "OpenMosix". <http://openMosix.sourceforge.net>.
[Proe] "PVM Web Site". <http://www.csm.ornl.gov/pvm/>.
[Proc] ProcMail. <http://www.debian-administration.org/articles/242>.
[ProX] Proxy Cache. <http://www.squid-cache.org/>.
[ProT] Transparent Proxy. <http://tldp.org/HOWTO/TransparentProxy-1.html>.
[Prof] ProFTP: FTP file server. <http://www.debian-administration.org/articles/228>.
[PS02] Ricardo Enr quez Pio Sierra (2002). Open Source. Anaya Multimedia.
[PurF] PureFTP: FTP file server. <http://www.debian-administration.org/articles/383>.
[Qui01] Ellie Quigley (2001). Linux shells by Example. Prentice Hall.

[Ran] David Ranch (2005). "Linux IP Masquerade" andJohn Tapsell. Masquerading


Made Simple. The Linux Documentation Project.
[Ray98] (1998). "The cathedral and the bazaar". <http://es.tldp.org/Otros/catedralbazar/cathedral-es-paper-00.html>.
[Ray02a] Eric Raymond (2002). "UNIX and Internet Fundamentals". The
LinuxDocumentation Project.
[Rayb] Eric Steven Raymond. "The Linux Installation HOWTO". The Linux
Documentation Project.
[Rad] Jacek Radajewski; Douglas Eadline (2002). "Beowulf: Installation and
Administration". In: Kurt Swendson. Beowulf HOWTO (tlpd).
<http://www.sci.usq.edu.au/staff/jacek/beowulf>.
[Red] Optimisation of Linux servers.
<http://people.redhat.com/alikins/system_tuning.html>.
[Redb] System-config-cluster (FC).
<http://www.redhat.com/docs/manuals/enterprise/RHEL-5manual/Cluster_Administration/index.htm>.
[Redh] Red Hat Inc. "Red Hat Distribution". <http://www.redhat.com>.
[Rid] Daniel Lopez Ridruejo (2000). "The Linux Networking Overview". The Linux
Documentation Project.
[Rus] Rusty Russell. "Linux IPCHAINS". The Linux Documentation Project.
[SM02] Michael Schwartz and other (2002). Multitool Linux - Practical Uses for
Open Source Software. Addison Wesley.
[Sal94] Peter H. Salus (1994). "25th anniversary of UNIX" (no. 1, November). Byte
Spain.
[Sam] Samba Project. <http://samba.org>.
[Sama] Samba HOWTO and Reference Guide (Chapter Domain Control).
<http://samba.org/samba/docs/man/Samba-HOWTO-Collection/sambapdc.html>.
[Samb] Samba Guide (Chapter Adding Domain member Servers and Clients).
<http://samba.org/samba/docs/man/Samba-Guide/unixclients.html>.
[San] "Top20 vulnerabilities". <http://www.sans.org/top20/>.
[Sci] Scientific Linux. <http://www.scientificlinux.org>.

[Sec] Andr s Seco (2000). "Diald". The Linux Documentation Project.


[Sei02] (2002). "Securing Linux, Step by Step".
<http://seifried.org/security/os/linux/20020324-securing-linux-step-bystep.html>.
[Skoa] Miroslav Skoric. "LILO mini-HOWTO". The Linux Documentation Project.
[Skob] Miroslav Skoric. "Linux+WindowsNT mini-HOWTO". The Linux
Documentation Project.
[Sla] "Slashdot site". <http://slashdot.org>.
[Smb] Wikipedia entry for "Server Message Block".
<http://en.wikipedia.org/wiki/Server_Message_Block>.
[Smi02] Rod Smith (2002). Advanced Linux Networking. Addison Wesley.
[Sno] Snort.org. Snort. <http://www.snort.org>.
[Sou] "Sourceforge site". <http://sourceforge.org>.
[Squ] Squid proxy server. <http://www.squid-cache.org/>.
[Sta02] (2002). "Discussion by Richard Stallman on relationship between GNU and
Linux". <http://www.gnu.org/gnu/linux-and-gnu.html>.
[Stu] Michael Stutz. "The Linux Cookbook: Tips and Techniques for Everyday Use".
The Linux Documentation Project(guas).
[Ste07] Steve French, Linux CIFS Client guide. <http://us1.samba.org/samba/ftp/cifscvs/linux-cifs-client-guide.pdf>.
[Stei] (2005). Your Linux Server and Network. Sams.
[Sub] Subversion. <http://subversion.tigris.org>.
[Subb] Control of versions with Subversion. Free Book. <http://svnbook.redbean.com/index.es.html>.
*[Sun02] Rahul Sundaram (2002). "The dosemu HOWTO". The Linux
Documentation Project.
[Sun] "Sun Grid Engine". <http://www.sun.com/software/gridware/>.
[Tan87] Andrew Tanenbaum (1987). Operating system: Design and Implementation.
Prentice Hall.
[Tan06] Andrew Tanenbaum; Albert S. Woodhull (2006). The Minix Book:

Operating Systems Design and Implementation (3rd ed. ). Prentice Hall.


[Tkc] (2003). "Tkcvs interface for CVS". <http://www.tkcvs.org>.
<http://www.twobarleycorns.net/tkcvs.html>.
[Tri] Tripwire.com. Tripwire Web Site. <http://www.tripwire.com/>.
[Tum02] Enkh Tumenbayar (2002). "Linux SMP HOWTO". The Linux
Documentation Project.
[Ubn] Ubuntu Distribution. <http://www.ubuntu.com>.
[Uni] Wisconsin University (2003). Condor Web Site.
<http://www.cs.wisc.edu/condor>.
[USA] "Division of the US Justice Department for cybercrime".
<http://www.usdoj.gov/criminal/cybercrime/>.
[Vah96] Uresh Vahalia (1996). UNIX Internals: The New Frontiers. Prentice Hall.
[Vas] Alavoor Vasudevan (2000). "Modem-Dialup-NT". The Linux Documentation
Project.
[Vasa] Alavoor Vasudevan (2003). "CVS-RCS (Source Code Control System). ". The
Linux Documentation Project.
[Vasb] Alavoor Vasudevan. "The Linux Kernel HOWTO". The Linux Documentation
Project.
[Wm02] Matt Welsh and others (2002). Running Linux 4th edition. O'Reilly.
[War] Ian Ward. "Debian and Windows Shared Printing mini-HOWTO". The Linux
Documentation Project.
[Web] Webmin. Tool for administrating Linux systems. <http://www.webmin.com/>.
[Wil02] Matthew D. Wilson (2002). "VPN". The Linux Documentation Project.
[Win] Wine Project. <http://www.winehq.com/>.
[Wir] WireShark. <http://www.wireshark.org/download.html>.
[Woo] David Wood. "SMB HOWTO". The Linux Documentation Project.
[Xin] Xinetd Web Site. <http://www.xinetd.org>.
[Zan] Renzo Zanelli. Win95 + WinNT + Linux multiboot using LILOmini-HOWTO.
The Linux Documentation Project.

GNU Free Documentation License


Version 1.2, November 2002
Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

0. PREAMBLE
The purpose of this License is to make a manual, textbook, or other functional and useful document
"free" in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it,
with or without modifying it, either commercially or noncommercially. Secondarily, this License
preserves for the author and publisher a way to get credit for their work, while not being considered
responsible for modifications made by others.
This License is a kind of "copyleft", which means that derivative works of the document must
themselves be free in the same sense. It complements the GNU General Public License, which is a
copyleft license designed for free software.
We have designed this License in order to use it for manuals for free software, because free
software needs free documentation: a free program should come with manuals providing the same
freedoms that the software does. But this License is not limited to software manuals; it can be used
for any textual work, regardless of subject matter or whether it is published as a printed book. We
recommend this License principally for works whose purpose is instruction or reference.
1. APPLICABILITY AND DEFINITIONS
This License applies to any manual or other work, in any medium, that contains a notice placed by
the copyright holder saying it can be distributed under the terms of this License. Such a notice
grants a world-wide, royalty-free license, unlimited in duration, to use that work under the
conditions stated herein. The "Document", below, refers to any such manual or work. Any member
of the public is a licensee, and is addressed as "you". You accept the license if you copy, modify or
distribute the work in a way requiring permission under copyright law.
A "Modified Version" of the Document means any work containing the Document or a portion of it,
either copied verbatim, or with modifications and/or translated into another language.
A "Secondary Section" is a named appendix or a front-matter section of the Document that deals
exclusively with the relationship of the publishers or authors of the Document to the Document's
overall subject (or to related matters) and contains nothing that could fall directly within that overall
subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not
explain any mathematics.) The relationship could be a matter of historical connection with the
subject or with related matters, or of legal, commercial, philosophical, ethical or political position
regarding them.
The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those
of Invariant Sections, in the notice that says that the Document is released under this License. If a
section does not fit the above definition of Secondary then it is not allowed to be designated as
Invariant. The Document may contain zero Invariant Sections. If the Document does not identify
any Invariant Sections then there are none.
The "Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts or BackCover Texts, in the notice that says that the Document is released under this License. A Front-Cover
Text may be at most 5 words, and a Back-Cover Text may be at most 25 words.
A "Transparent" copy of the Document means a machine-readable copy, represented in a format
whose specification is available to the general public, that is suitable for revising the document

straightforwardly with generic text editors or (for images composed of pixels) generic paint
programs or (for drawings) some widely available drawing editor, and that is suitable for input to
text formatters or for automatic translation to a variety of formats suitable for input to text
formatters. A copy made in an otherwise Transparent file format whose markup, or absence of
markup, has been arranged to thwart or discourage subsequent modification by readers is not
Transparent. An image format is not Transparent if used for any substantial amount of text. A copy
that is not "Transparent" is called "Opaque".
Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo
input format, LaTeX input format, SGML or XML using a publicly available DTD, and standardconforming simple HTML, PostScript or PDF designed for human modification. Examples of
transparent image formats include PNG, XCF and JPG. Opaque formats include proprietary formats
that can be read and edited only by proprietary word processors, SGML or XML for which the DTD
and/or processing tools are not generally available, and the machine-generated HTML, PostScript or
PDF produced by some word processors for output purposes only.
The "Title Page" means, for a printed book, the title page itself, plus such following pages as are
needed to hold, legibly, the material this License requires to appear in the title page. For works in
formats which do not have any title page as such, "Title Page" means the text near the most
prominent appearance of the work's title, preceding the beginning of the body of the text.
A section "Entitled XYZ" means a named subunit of the Document whose title either is precisely
XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here
XYZ stands for a specific section name mentioned below, such as "Acknowledgements",
"Dedications", "Endorsements", or "History".) To "Preserve the Title" of such a section when you
modify the Document means that it remains a section "Entitled XYZ" according to this definition.
The Document may include Warranty Disclaimers next to the notice which states that this License
applies to the Document. These Warranty Disclaimers are considered to be included by reference in
this License, but only as regards disclaiming warranties: any other implication that these Warranty
Disclaimers may have is void and has no effect on the meaning of this License.
2. VERBATIM COPYING
You may copy and distribute the Document in any medium, either commercially or
noncommercially, provided that this License, the copyright notices, and the license notice saying
this License applies to the Document are reproduced in all copies, and that you add no other
conditions whatsoever to those of this License. You may not use technical measures to obstruct or
control the reading or further copying of the copies you make or distribute. However, you may
accept compensation in exchange for copies. If you distribute a large enough number of copies you
must also follow the conditions in section 3.
You may also lend copies, under the same conditions stated above, and you may publicly display
copies.
3. COPYING IN QUANTITY
If you publish printed copies (or copies in media that commonly have printed covers) of the
Document, numbering more than 100, and the Document's license notice requires Cover Texts, you
must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover
Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly
and legibly identify you as the publisher of these copies. The front cover must present the full title
with all words of the title equally prominent and visible. You may add other material on the covers
in addition. Copying with changes limited to the covers, as long as they preserve the title of the
Document and satisfy these conditions, can be treated as verbatim copying in other respects.
If the required texts for either cover are too voluminous to fit legibly, you should put the first ones
listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages.

If you publish or distribute Opaque copies of the Document numbering more than 100, you must
either include a machine-readable Transparent copy along with each Opaque copy, or state in or
with each Opaque copy a computer-network location from which the general network-using public
has access to download using public-standard network protocols a complete Transparent copy of the
Document, free of added material. If you use the latter option, you must take reasonably prudent
steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent
copy will remain thus accessible at the stated location until at least one year after the last time you
distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public.
It is requested, but not required, that you contact the authors of the Document well before
redistributing any large number of copies, to give them a chance to provide you with an updated
version of the Document.
4. MODIFICATIONS
You may copy and distribute a Modified Version of the Document under the conditions of sections 2
and 3 above, provided that you release the Modified Version under precisely this License, with the
Modified Version filling the role of the Document, thus licensing distribution and modification of
the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the
Modified Version:
A. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document,
and from those of previous versions (which should, if there were any, be listed in the History
section of the Document). You may use the same title as a previous version if the original
publisher of that version gives permission.
B. List on the Title Page, as authors, one or more persons or entities responsible for
authorship of the modifications in the Modified Version, together with at least five of the
principal authors of the Document (all of its principal authors, if it has fewer than five),
unless they release you from this requirement.
C. State on the Title page the name of the publisher of the Modified Version, as the
publisher.
D. Preserve all the copyright notices of the Document.
E. Add an appropriate copyright notice for your modifications adjacent to the other
copyright notices.
F. Include, immediately after the copyright notices, a license notice giving the public
permission to use the Modified Version under the terms of this License, in the form shown in
the Addendum below.
G. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts
given in the Document's license notice.
H. Include an unaltered copy of this License.
I. Preserve the section Entitled "History", Preserve its Title, and add to it an item stating at
least the title, year, new authors, and publisher of the Modified Version as given on the Title
Page. If there is no section Entitled "History" in the Document, create one stating the title,
year, authors, and publisher of the Document as given on its Title Page, then add an item
describing the Modified Version as stated in the previous sentence.
J. Preserve the network location, if any, given in the Document for public access to a
Transparent copy of the Document, and likewise the network locations given in the
Document for previous versions it was based on. These may be placed in the "History"
section. You may omit a network location for a work that was published at least four years
before the Document itself, or if the original publisher of the version it refers to gives
permission.
K. For any section Entitled "Acknowledgements" or "Dedications", Preserve the Title of the
section, and preserve in the section all the substance and tone of each of the contributor
acknowledgements and/or dedications given therein.

L. Preserve all the Invariant Sections of the Document, unaltered in their text and in their
titles. Section numbers or the equivalent are not considered part of the section titles.
M. Delete any section Entitled "Endorsements". Such a section may not be included in the
Modified Version.
N. Do not retitle any existing section to be Entitled "Endorsements" or to conflict in title
with any Invariant Section.
O. Preserve any Warranty Disclaimers.
If the Modified Version includes new front-matter sections or appendices that qualify as Secondary
Sections and contain no material copied from the Document, you may at your option designate
some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections
in the Modified Version's license notice. These titles must be distinct from any other section titles.
You may add a section Entitled "Endorsements", provided it contains nothing but endorsements of
your Modified Version by various parties--for example, statements of peer review or that the text
has been approved by an organization as the authoritative definition of a standard.
You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words
as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one
passage of Front-Cover Text and one of Back-Cover Text may be added by (or through
arrangements made by) any one entity. If the Document already includes a cover text for the same
cover, previously added by you or by arrangement made by the same entity you are acting on behalf
of, you may not add another; but you may replace the old one, on explicit permission from the
previous publisher that added the old one.
The author(s) and publisher(s) of the Document do not by this License give permission to use their
names for publicity for or to assert or imply endorsement of any Modified Version.
5. COMBINING DOCUMENTS
You may combine the Document with other documents released under this License, under the terms
defined in section 4 above for modified versions, provided that you include in the combination all
of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant
Sections of your combined work in its license notice, and that you preserve all their Warranty
Disclaimers.
The combined work need only contain one copy of this License, and multiple identical Invariant
Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same
name but different contents, make the title of each such section unique by adding at the end of it, in
parentheses, the name of the original author or publisher of that section if known, or else a unique
number. Make the same adjustment to the section titles in the list of Invariant Sections in the license
notice of the combined work.
In the combination, you must combine any sections Entitled "History" in the various original
documents, forming one section Entitled "History"; likewise combine any sections Entitled
"Acknowledgements", and any sections Entitled "Dedications". You must delete all sections
Entitled "Endorsements."
6. COLLECTIONS OF DOCUMENTS
You may make a collection consisting of the Document and other documents released under this
License, and replace the individual copies of this License in the various documents with a single
copy that is included in the collection, provided that you follow the rules of this License for
verbatim copying of each of the documents in all other respects.
You may extract a single document from such a collection, and distribute it individually under this
License, provided you insert a copy of this License into the extracted document, and follow this
License in all other respects regarding verbatim copying of that document.

7. AGGREGATION WITH INDEPENDENT WORKS


A compilation of the Document or its derivatives with other separate and independent documents or
works, in or on a volume of a storage or distribution medium, is called an "aggregate" if the
copyright resulting from the compilation is not used to limit the legal rights of the compilation's
users beyond what the individual works permit. When the Document is included in an aggregate,
this License does not apply to the other works in the aggregate which are not themselves derivative
works of the Document.
If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the
Document is less than one half of the entire aggregate, the Document's Cover Texts may be placed
on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if
the Document is in electronic form. Otherwise they must appear on printed covers that bracket the
whole aggregate.
8. TRANSLATION
Translation is considered a kind of modification, so you may distribute translations of the Document
under the terms of section 4. Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include translations of some or all Invariant
Sections in addition to the original versions of these Invariant Sections. You may include a
translation of this License, and all the license notices in the Document, and any Warranty
Disclaimers, provided that you also include the original English version of this License and the
original versions of those notices and disclaimers. In case of a disagreement between the translation
and the original version of this License or a notice or disclaimer, the original version will prevail.
If a section in the Document is Entitled "Acknowledgements", "Dedications", or "History", the
requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual
title.
9. TERMINATION
You may not copy, modify, sublicense, or distribute the Document except as expressly provided for
under this License. Any other attempt to copy, modify, sublicense or distribute the Document is
void, and will automatically terminate your rights under this License. However, parties who have
received copies, or rights, from you under this License will not have their licenses terminated so
long as such parties remain in full compliance.
10. FUTURE REVISIONS OF THIS LICENSE
The Free Software Foundation may publish new, revised versions of the GNU Free Documentation
License from time to time. Such new versions will be similar in spirit to the present version, but
may differ in detail to address new problems or concerns. See http://www.gnu.org/copyleft/.
Each version of the License is given a distinguishing version number. If the Document specifies that
a particular numbered version of this License "or any later version" applies to it, you have the
option of following the terms and conditions either of that specified version or of any later version
that has been published (not as a draft) by the Free Software Foundation. If the Document does not
specify a version number of this License, you may choose any version ever published (not as a
draft) by the Free Software Foundation.

How to use this License for your documents


To use this License in a document you have written, include a copy of the License in the document
and put the following copyright and license notices just after the title page:
Copyright (c) YEAR YOUR NAME.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2

or any later version published by the Free Software Foundation;


with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
Texts. A copy of the license is included in the section entitled "GNU
Free Documentation License".

If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the "with...Texts."
line with this:
with the Invariant Sections being LIST THEIR TITLES, with the
Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.

If you have Invariant Sections without Cover Texts, or some other combination of the three, merge
those two alternatives to suit the situation.
If your document contains nontrivial examples of program code, we recommend releasing these
examples in parallel under your choice of free software license, such as the GNU General Public
License, to permit their use in free software.

You might also like