Вы находитесь на странице: 1из 918

,

, .

UNIX

{ h h y

- - -
-- -

2002

, , , .
UNIX:


.
.

32.973.2-016.2
6 8 1 . 3 1
., ., ., . .
50 UNIX: / .
. .: ; .: BHV, 2002. 928 .: .
ISBN 9 6 6 - 5 5 2 - 1 0 6 - 3
ISBN 5 - 3 1 8 - 0 0 7 6 4 - 6
. , , , UNIX.
, .
. , ,
UNIX.
, ,
, , , . ,
, .
, U N I X : S o l a r i i , H P - U X , R e d H a l Linux F r e e B S D .

Prentice Hall PTR 2001


BHV, . 2002
, 2002
Hall PTR
. * >

, , ! .
* ,
, .

ISBN 666-552-106-3
ISBN -316-00754-6
ISBN 0-13-020601-6 (.)
. 196105, -, . , 67.

057 07.09.01.
BHV

175 13.09.2000.
- OK005-93, 2: 953005 - .
18.09.02. 70xtO(VI6. . . 74,82. . . Si 1302.
. . .
, .
197110. -, ., 15.


UNIX Internet:
, .

(John Lions),
(),
UNIX 70- .
10000 ,
.
UNIX .
, ,

. , ,
. 1998 .

(John Postel) RFC-


( ),
Internet . ,
Internet

.
J 998 . (www.postel.org)
I*
(Rich Stevens)

UNIX. ,
,
.
Internet
TCP,
.

TCP/IP Illusirated TCP.
1999 . (www.kohala.com)

Linux "UNIX:
".
UNIX, .
,
, (!) .
.
, Linux FreeBSD,
.
,
,

.
?
,
,
( , ),
.
,
. "" .
,
. ,
, ,
,
? ,
.
, ,
UNIX- ,
. .
.
. !

2000 .

,
. . , *
.
-, .

,
hj4u.hi
, Unibu*
DZ1I ( ).
,
, ,
. ,
, . ,
.
-, .
, UNIX
(,
sendmail). , )

. ^
" U N I X " ,
: "..."
, , , .
, . .
UNIX- ,
. ,
, ,
, ,
. ,
UNIX-: " ! -,
, ( ,
, Disable Apply),
, , ,
, (
, , , ...), , , ,
, T C P / I P . !
. , !
UNIX - -> ,
.

, - ,
(, , ...)- ,
T C P / I P (), telnet! ,
!"
UNIX-, ,
. ,
, .
, "
",
.

, ,
. ,
, ,
, .
, .
- UNIX-, , , .
,
( ,
), , , .
,
.
, , .
.

!
1994 .



UNIX-
. , ,
UNIX.
-,
, .
,
, 70- , , .
-, UNIX-
.
,
, , . .
( ) UNIX- ,
,
, .
, , .

, .
. ,
,
,
.
, UNIX- .

,
. ,
,
Usenet ,
.
, UNIX-
- , .
,
. , ,
,
.
, . .
, ,
.
.

1988 .

80- . ,
,
UNIX- ,

.
"

,
,
.
.

, UNIX-
. UNIX, >
. ,

,
, .


. UNIX,
Internet.
, UNIX-
! .

UNIX

UNIX-, (. System V)
AT&T, ( )
( BSD). AT&T,
UNIX, "AT&T UNIX" 11 "Berkeley UNIX"
.

Solans 2.7;

HP-UX 11.00:

Red Hai Linux 6 2:

FreeBSD 3.4 ( 4 0).

, ,
,
UNIX-. AT&T UNIX, FreeBSD
Berkeley UNIX, a Red Hat Linux
.

. ,
, .
UNIX.
- ,
(, AIX SCO) ,
.

" ",
" ",
"".
UNIX,
.
,
UNIX-.
"UNIX " ,
UNIX-, ,
. ,
.
(DNS), (NFS), ,
sendmail .
"" .
,
UNIX ( , ).
,
UNIX- ..

(Adam
Boggs), (Rob Brown), (Ned McClain).
( (Lynda McCinley) (Todd Miller),
. ,
.
,
.
, , , , :
sa-book0admin.com

11

, , , : .
,
, :
www.admin.com
,
.




.
2000 /

, , . :
Red Hat Red Hal SHADOW MAN
Red Hat, Inc.
BSD ( 1988)
(Marshall Kirk McKusick).
http://www.rnckusick.com/beastie.
, "Solaris", : "ihe
Solaris Operating Environment". Sun.

12


, . ,
, , .
UNIX
, .
, ,
: .
:

(Eric Aliman)


(Steve Gaede)


(Jeff )


(Pete Barber)


(Andrew Gollan)


(Herb Morreale)


(Dave )


(Boh Gray)


(Laszlo Nemeth)


(Dave Clements)


(Andreas GustaTsson)


(Tobi Oetiker)


(David Conrad)


(Geoff Halprin)


(Ray Plzak)


(Drew Eckhardt)


(Daniel Karrenberg)


(Andy Rudoff)


(Randy Else)


(Cricket Liu)


(Greg Shapiro)


(Bill Fenner)


(Bill Manning)


(Daniel Sully)

1
(Peggy Fenncr)


(Lynda McGinley)


(Paul Vixie)


(Jeff Forys)


(Hal Miller)

(Barb Dijker)
, (Pat Parseghian),

.
(Mary Frantz), ,
, . ,
, , .

13

, (John Wait).
(Tyler Curtain),

.
JTy ( Lou Nohr) paooiy . .
(Danny Savard) Hewlett-Packard Sun
Microsystems ,
.
, ,
.


C A I D A
(Cooperative Association for Internet DHta Analysis)
- . U N I X
.
evi@cs.Colorado.edu
N e X T Sun
(Swarthmore), .

(Rochester), - .
garth@cs.colorado.edu
U N I X ,
, Interactive Systems Xinu.
Xinet,

, ,
scottnet.com
.
X O R Inc.,
. Lifetime Achievement Award
U S E N I X , .
Cisco.
trent@xor.com

15

,
,
. , ,
, .
.


;
, ;
,
,


-;

, , ,
.

.
.
,
. ,
,
.

19

1.1.


,
U N I X . , ,
.
.
, 1.9,
.

,
- .
vl. UNIX- ,
"" (
, emacs), .
,
. , Microsoft Word

.
UNIX ,

. . , Bourne shell (sh). , " ",

Perl.
, , ,
. ,
expect, 18.2,
.

1.2.

U N I X
UNIX 1969 . - Bell Labs AT&T. 1976
,
, , .
70- AT&T UNIX (UNIX
Support Group, USG),
UNIX ( U N I X System Laboratories, USL). ""
UNIX . Bell
Labs, USG, U S L System III
System V
.
Berkeley UNIX 1977 ..
(Computer Systems Research Group, CSRG),
,
AT&T ,
, BSD (Berkeley Software Distribution).
1977 . 1BSD PDP-11
1993 ., 4.4BSD.

20

I.

AT&T
.
, U N I X
. ,
AT&T BSD. ,
.
.

AT&T 4.4BSD-Lite.
BSD UNIX ( BSD/OS. FreeBSD, Net BSD OpenBSD)
.
BSD System V
UNIX, ^.
,
.
, .
, UNIX
.
U N I X Linux,
UNIX-. Linux
1991 .
(Linux Torvalds),
UNIX. ,
. ,
. Linux
( , Oracle).

1.3.

UNIX-

UNIX: Solaris 2.7, HP-UX 11.00, Red Hat Linux 6.2
FreeBSD 3.4. , UNIX,
.
Solaris Sun Microsystems
System V, . Sun UNIX (
80- .)
Berkeley UNIX, ( ) Sun AT&T
.
H P - U X Hewlett-Packard System V
Berkeley UNIX, "".
U N I X Intel,
. Linux".
, ,
, UNIX-. Linux ,
. ,
Linux, ,

Linux ,
Nintendo64.

1,

21

Linux . (
Red Hal, SuSE Corel) ,
.
FreeBSD U N I X , 4.4BSD-Lite.
Linux, Intel.
BSDI.

1.4.


, ,
, . , ,
. ,

, ,
.
,
. , :
% grep Bob /pub/phonelist /* */
Bob Knowles 555-2834
Bob Smith 555-2311
. ,
, U N I X :

, ('[' "]"), ;

, ("..."), ;

('{' '}') ,
, ().
,

(-]

ioniofff

:
bork on /etc/passwd
bork -x off /t/passwd /ets/termcap
bork off /usr/lib/troac

;
('*') ;
('?') ;
~') ,

.
, BSD

/etc/

/etc/rc-boot
/etc/rc.local
/etc/rc*.

22

I.


, ,
, . , , :
HP-UX II
FreeBSD 3.4
. ,
.

1.5.


UNIX ,
jty
, , .

UNIX, . ,
.
, Web- .
, UNIX, ,
, - ( ,
man) -
. ,
.
, .
, .
.
. -,
, - vi
, ,
, .
- ,
,
'. i
,
.
UNIX , ISC (Internet Software Consortium
Internet) ASF (Apache Software
Foundation
Apache).
.
, ,
.

. Hewlett-Packard, ,
-

1.

23

UNIX
RFC (Request for comments ),
Internet ( 13.1).

UNIX- - ,
.
- . 1.1.
1 1 - UNIX

Solaris HP-UX

FreeBSD

lm

-
. , -
.
- :
8 ,
.
, 6
"1" -.
( man-). ""
,
, .
-
/usr/man/manX, X 1 9 '',
trofT
/usr/man/catX man - " " ( ).
cat ,
,
. , , catman,
- , FreeBSD, -
/usr/share/man
( compress gzip) .

24

I.

Solaris - S G M L (Standard
Generalized M a r k u p Language ).
, trolT, ,
,
: man
man
more (
,
P A G E R ) , , ,
, .
,
, (1. 6 8).
.
man -
. , man tty
tty, man 4 tty

Solaris -s
man - s 4 tty.
man ,
M A N P A T H ,
. M A N P A T H
,
man. , .login
s e t e n v MANPATH /home /share/localman:/usr/man
man ,
- , / u s r / .
Bourne shell :
MANPATH=/home/si iare/1oralman:/usr/man
export MANPATH
M A N P A T H
, .
, - . .
man - - ,
.
% man -k t r a n s l a t e
gftype tlL) - translate a f o n t f r l e f o r humans to r e a d
pktype (1L) - translate a packed f o n t file
tr (1)
- translate characters

whatis '
- ( / u s r / m a n / u s r / s h a r e / m a n ) .
- . . , catman -w.

1.

25

1.6.


,
. ,
.
. ,



.

, ,
.
, ,
( ,
..).
,
. , , , .

8, 12 23.


, .
(,
), (,
)

[71

10.

, . , .
,
. , ,
no .


, UNIX
. , .

26

I.

,
, UNIX.
,

.


, :
,
;
; ( ,
).

UNIX , ,
.
. ,
,

, , 27.10.
,
, ,
.
,
, ,
,
,
.

21.

,


.
.

" "
,
""
.
, " ,
! ?" " !
, ?"

27

Internet

. ,
, 27.
Internet. , , , www.yahoo.com,www.altavista.com www.webopedia.com.
Web- . :

freshmcat.com
Linux;

www.ugu.com "ugu" " U N I X Guru


Universe U N I X " ;
;

www.stokeIy.com ,
;

www.tucows.com Windows
Macintosh;
slashdot.org , ;
www.cpan.org Perl:
securityfocus.com Web-, ;
.


, .
}':
" ". ,
, , , .
UNIX,
. , , ,

. ,
, , .
,
. ,
,
, , , ,
, ,
, .
,
,
. ,
, .
, ,
, . , ,
.
, ,
, , .

24 I.

, .
,
. ,
, , ,
27

, , , , , ,
.

.
.

,

,
72 .


, ,
,
.


,


.
,
. ,
- ,
"?
?!" , .

1.9.

Anderson, Gail, and Paul Anderson. The UNIX Shell Field Guide. Englewood
Cliffs, NJ Prentice Hall 1986
Hewlett-Packard Company. The Ultimate Guide to the VI and EX Text Editors.
Redwood City, CA: Benjamin/Cummings. 1990.
Abrahams. Paul W., and Bruce A. Larson UNIX for the Impatient, 2nd Edition.
Reading, MA: Addison-Wesley. 1995
Peek, Jerri', Tim O'Reilly, and Mike Loukides. UNIX Pov.tr Tools, 2nd Edition.
Sebastopol, CA: O'Reilly & Associates. 1997.
Montgomety, John, and Woody Leonard. The Underground Guide to Unix:
Slightly Askew Advice from a Unix Guru. Reading, MA Addison-Wesley 1995
Reichard, Kevin, and Eric Foster-Johnson. Unix in Plain English, 3rd Edition.
Foster City, CA: IDO Books Worldwide. 1999.
Rankin, Bob, The No BS Guide to Linux. No Starch Press. 1997.
Wall, Lany, Tom Christiansen, and Randal L. Schwartz. Programming Peri,
2nd Edition Sebastopol, CA: O'Reilly & Associates. 1997

29

UNIX , / .
, ,
.
,
,
, . , U N I X
, , Microsoft,
. ,
, ,
, , ,
.
,
,
. 5, 12 28 ,
.
,
.
,
.

2.1.



.
, "
". . ,
.

30

I.

.
, , .

, . , ,
UNIX.
,
, .
,
init, 1.
, .
, . shell,
init.
"rc-", "".
"run command" " " ,
UNIX CTSS.

.

UNIX- ,
. ,
- .
, :
(,
).
" ".
, .
:
(...), .
, , ,
, , .

, .
, ,
.

:
;
;
:
( );
;
.

2. 3

31

.
, ,

12.
UNIX ,
.
, /unix /vmunlx.
.
.
(
, ) ,
.
UNIX, -.
, ,
.
, ,
. ,

, ,
. ,
, .
, ,
.
.
,
.
,


,
UNIX- ,
" .

,
, ""
. fork
(. 4.2).

plug-and-play
.
, - ,
.

32

I.


. BSD- :

swapper ( 0);

Init ( 1);

pagedaemon ( 2).
Syscem V
:

sched ( 0);

Init ( 1);

.
Linux 0 ,
:

Init ( I);

(kflushd, kupdate, kpiod. kswapd).


init
;
,
.

. , ,
, (, ), .
( ) init.
( )
,
,
init.
root.
, root. , <Ctrl-D>,
. Red Hat .
|71

171

root
3.

. .
.
,
, /bin, /sbin /etc*.
, ,
(, mail), .
5.

. /tmp
, ,
/usr.

2. 3

33

(, vi), .
, / /. ,
. mouiiL /,
fstab vfstab.
Red Hat "" . , shell,
. , , -
- , .
fsck,
, .
, fsck
"" .
8.4.
,
, , .

,
, "" .
, UNIX.
, , ,
init .
,
(. 2.4).

7.8.

, : .
,
, getty. ".
init getty,

, init , xdm. gdm dtlohin.
, init
. BSD-
: .
" ", ,
. 2.4.

Solaris .

34

2.2.


. ( )
, .
.
UNIX- ,
.
, .
,
.
, 2.3.


, ,
.
, UNIX, ""
, ,
.
.
,
.

- BIOS (Basic Input/Output System),
UNlX-. BIOS
, SCSI-,
.
BIOS ,
, IDE ( ),
, . SCSI-
,
. BIOS
.
, .

BIOS- "",
,
. ,
, .
,
. , ,
IDE- CD-ROM IDE.
, , , , ,
BIOS-.

2. 3

35

,
.
, ,
512- .
(). ,
,
( ) .

8.

. Linux F r e e B S D
, ,
.
,
, ,
.
.
L I L O : Linux
L I L O .
,
, .
L I L O Linux,
Red Hat.
L I L O . -
. L I L O Linux,
. ...
L I L O
Linux. lilo,
/etc/Iilo.conf
,
lilo.
, .
.

LILO

lilo.conf
boot=-/dev/hda
root-/dev/hdal
install-/boot/boot.b
map^/boot/map
delay-20
image-/vmlinuz
label-lmux
read-only
image-/vmlinuz-backup
label-backup
read-only

36

#
#

2 - ,



*

.
, LILO ,
. , lilo.conf ,
.
( l i n u x ) /vmlinuz.
r e a a - o n l y .
" " . ;
,
" / " , . ,
( /vmllnuz-backup). .
,
, , .
.
lilo.conf ,
. .
, lilo .
, - t ,
, .
, . ,
, .
:
* lilo
Added l i n u x *
Added b a c k u p

:

L I L O

LILO:
2 ( d e l a y , 1.
1/10 ., lilo.conf 20)
/vmlinuz I D E -
. ,
<>:
LILO: <>
linux
backup
LILO:
, .

FreeBSD

F r e e B S D .
: ,
FreeBSD. .
boolOcfjg
,
# bootOcfg - /dev/wdo
I D E - .
(

2. 3

37

).
( BIOS) , , ,
.
:
F1
F2

FreeBSD
Windows

D e f a u l t : F]

,
bootOcfg.
FreeBSD
.
disklabel -. disklabel
:
. :
disklabel - /dev/vdOsl

IDE-.

:

/boot/loader.conf

/boot/loader.coBf.local

/boot/defaults/Ioader.conf

.
loader.conf loader.conf.local.
.
boot(8) loader(8).


, ,
. ,
,
.

, . , . ,
.
Linux,
LILO. , Windows NT/2000.
.

. ,
.

38

I.

Windows (95. 98 M e ) ,
, .
Windows ,
- .
,
.
Windows N T / 2 0 0 0 .
Windows . ,
. N T / 2 0 0 0
.
.
U N I X , UNLX
- . 512 U N I X
( ) .
dd. Linux:
# dd i f = / d e v / h d a 2 o f = l i n u x . b i n bs=512 c o u n t = l
N T / 2 0 0 0
NT ,
. . . C:\bool.ini
. Linux
:
:\linux.bin-"Linux"
boot.ini
Web- support.microsofi.com.
Linux Windows N T / 2 0 0 0 , L I L O
Linux,
lilo.conf
b o o t Linux. , Linux
I D E - , :
boot=/dev/hda2
,
N T . ,
, lilo.

LILO

L I L O ( ,
Linux Windows 98),
LILO, .
/etc/lilo.conf.
, Windows
I D E - :
other = /dev/hdal
l a b e l = windows
table ~ /dev/hda

2. 3

39

lilo.coef , Windows
, Linux , a F r e e B S D :
boot

/dev/hda

*
IDE-
# 2- ,

default linux
# L i n u x

image / b o o t / v m l m u z - 2 . 3. 41
r o o t / d e v / h d a 2
label - linux
read-only
image - / d e v / h d a l
* Windows
l a b e l = windows
table ~ /dev/hda
image - / a e v / h d a 3
t FreeBSD
label - freebsd
t a b l e - /dev/hda
delay - 20

lilo.conf
.
-t.

FreeBSD

FreeBSD . , - bootOcfg.
, . 0001 ( 0x1),
0010 ( 0x2) .. ,
# bootOcfg - - 0x7
. I.
2 3 (0x7=0111)
.

2.3.


.
Solaris
Sun.
<L1> <>.
Sun <L1> < S T O P > . .
boot -s, .
Solaris , .
, , 1 Is -1
/dev
% Is -1 /dev/rdsk/cOtOdOsO
lrwxrwxrwx
I root
root
55 J a n 15 1998 /aev/rdsk/cOtOdOsO
../../devices/sbusfilf,O/SUNW,fasGe.8800000/sdGO,0:a,raw

40

I.

, /kernel/backup,
:
boot /devices/abusSIf,0/SUNW, fesfle ,e800000/sdS0,0: a, raw/Vemel/bacfcup
. 2.1 ,
Sun.
2.1. Sun

boot /___

boot -*

boat -

boot -a /etc/item, bale


/etc/synlem.bak, /etc/eytem

probe-seel

SCSI-

HP-UX
HP-UX

HP 9000/735.
.
. b o o t l s l
. :
ISL> prompt:

:
ISL> prompt: hpux -IS /stand/vmunix
Linux
l i n u x
LILO LILO ,
( lilo.conf), -s single.
, , Red Hat,
"linux", , , :
LILO: l i n u x s i n g l e
LILO (. 2.2).
2.2. LILO

root"/dev/foo

,
/dev/foo

tall
Ethernet

single
init-/sbin/inic
e t h e r - 0, , e t h l

2. 3

41

Red Hat
. . Red Hat
fsck ,


, . ,

.
Red Hat,
- . .
.

.
FreeBSD
,
F r e e B S D :
F1
FreeBSD
D e f a u l t : F1
, ,
boot -s:
H i t [ E n t e r ] t o b o o t i m m e d i a t e l y , o r a n y o t h e r k e y f o r t h e command
prompt.
Booting [kernel] in 9 s e c o n d s . . .
<>
T y p e " ? ' f o r a l i s t o f commands, ' h e l p ' f o r m o r e d e t a i l e d h e l p .
d i s k l s l a : > boot -a
,
. < > ,
/bin/sh.
.
, , :
disklsla:>
d var
d stand
d etc

le

kernel.SYNACK
kernel.LMC
kernel
d i s k l s l a : > unload
d i s k l s l a : > load kernel.SYNACK
d i s k l s l a : > boot
,
, (/kernel),
(/kernel.SYNACK) .

42

I.

2.4.


(
, ,
root) init
. Bourne shell (sh),
.

, . BSD-
/etc "".
System V
/etc/inii-d, /etc/rcU.d, /etc/rc 1 .d .


, :

fsck (
);

/tinp;

-

.

.

, . ,
, ,
.
,
{ ). , ,
! Bourne shell,
.
System V
System V .
.
,
.
System V' init 7 " ".

0 . .

I S .

25 .

6 .

2. 3

43

0 6 ,
. ,
, .
2 3; 4 5 .
1 S .
1.

,
.
root, ,
.
S: ,
. Solaris S
, Linux
.
, , .
, 7 ,
UNLX- . Red Hat
10- , 79 .
/etc/lnlttab , ,
init .
, , ,
( ),
.
Init
0 , /etc/lnlttab.
, init
.
.
, /etc/lnlttab
,
UNIX-. ,
System V , .
, /etc/inittab
.
, ;
.
/etc/lnittab,
.
, Init
. , Init
- , ;
.
init.d. ,
, /etc, .

. s t a r t ,
, ,
. r e s t a r t ,
s t o p + s t a r t .
,
, Init.d
.

44

I.

, ,
sshd:
#! / b i n / s h
t e a t -f / u s r / l o c a l / s b i n / s s h d I I e x i t 0
case "SI" in
start)
echo - r " S t a r t i n g sshd: sshd"
/usr/local/sbin/sshd
echo " . "
stop)
echo -n "Stopping sshd: sshd"
k i l l "cat / v a r / r u n / s s h d . p i d
echo
restart)
echo -n "Stopping s s h d : sshd"
kill
cat /var/run/sshd.pid
echo " . "
echo -n " S t a r t i n g s s h d : sshd"
/usr/local/sbin/sshd
echo " . "
)

e c h o "Usage:
exit 1

/etc/init.d/sshd start I stop|restart"

esac
, init
,
. initd,
rcypoeeHb.d,
, (rcO.d. r c l , d ..).

init.d. S .
, (.
S34named). init ,
S ("start" )
, s t a r t .
,
("kill" ) ,
s t o p . , init
-d,
, .
, ,
.

2. . sshd
2
:
# In
/etc/init.d/eahd /etc/rc2.d/S99eeh2
# In -s / tc/init.d/eiihd /etc/rc0.d/K25eah2

2. 3

45

, /etc/iniud/sshd
2
s t a r t . ,
/etc/init.d/sshd ,
s t o p .
-,
/ e t c / r c 6 . d .
.

Solaris
Solaris. H P - U X Red Hal
System V, init.d. Solaris ,
.* / e t c .
Solaris
, ,
. Sun .
.
/etc/defaults
(. 2.3), .
- .
2.3. Solaris

/etc/.UNCONFIGURED

( )

/etc/hostname.

,
( )

/etc/.

,
DHCP

/etc/defaultrouter

HP-UX
H P - U X /sbin/init.d.
/sbin.
/etc/rc.config.d.
. ,
/sbin/init.d/SnmpMaster

/ t c / r c . c o n f.d/SnmpMa s t e r
init :
/sbin/rc2.d/35603nmpMaster
/ s b m / r c l .d/K440SnmpMaster
/etc/rc.log.
- ,

46

I.

,
.
, ,
.
,
. . 2.4 ,
.
2.4, HP-UX [ /etc/rc.conflg.d)
()

SnmpMaster

SNMP

Snmp*

, SNMP

acct

, . acct(IM)

auditing

; . audsjs(lM) audevent(lM)

cde

CDE (Common Desktop Environment


)

clean*

desktop

hpbaselOOconf

Fast Ethernet

hpeflierconf

Ethernet-; . Lanadmin( 1)

Iistjmode

P
mailservs

namesem

nddconf

,
add

netconf

(IP- ..)

netdaemons

netti

; .
nettl(lM), nettlconfdM) nettlgen.coaf{4)

nfsconf

NFS (Network File System


)

sendmafl

pd

HP-UX

vt

vtdaemon

xfs

X Windows

.
netconf, netdaemons . , nddconf.
Red Hat
, Linux
. , Debian Solaris,
Slackware "" FreeBSD Red
Hai ,

2. 3

47

System V F r e e B S D " " ,


, .
Red Hat ,

# ,

4 !
init Red H a t
System V.
/ e t c / r c . d / r c , .
, ,
.

chkconfig.
Red H a t rc.Iocai,
F r e e B S D . .
;
System V.
Red Hat:
[ ]
INIT; v e r s i o n 2.77 b o o t i n g
Welcome to Red Hat L i n u x
P r e s s "I" t o e n t e r i n t e r a c t i v e s t a r t u p .
Mounting p r o c f i l e s y s t e m
Setting clock
( u t c ) : F r i Mar 1 0 0 7 : 1 6 : 4 1 MST 2000
L o a d i n g d e f a u l t keymap
A c t i v a t i n g swap p a r t i t i o n s

I
t
I
[

OK
OK
OK
OK

]
]
]
]

" W e l c o m e to Red Hat Linux",


< I > , .
. Red Hat
, , .
3 init :
Welcome to Red Hat L i n u x
Press ' I ' to enter interactive startup.
Mounting p r o c f i l e e y s t e m
Setting clock
( u t c ) : F r i Mar 10 0 7 : 1 6 : 4 1 MST 2000
L o a d i n g d e f a u l t keymap
A c t i v a t i n g swap p a r t i t i o n s
S e t t i n g h o s t n a m e r e d h a t . s y n a c k . n e t [ OK ]
Checking r o o t f i l e s y s t e m
/ d e v / h d a l : c l e a n , 73355/191616 f i l e s , 214536/3B3032 b l o c k s
R e m o u n t i n g r o o t f i l e s y s t e m in r e a d - w r i t e mode
F i n d i n g module d e p e n d e n c i e s
Checking f i l e s y s t e m s
Mounting l o c a l f i l e s y s t e m s
T u r n i n g on u s e r and g r o u p q u o t a s f o r l o c a l f i l e s y s t e m s
E n a b l i n g swap s p a c e
INIT: E n t e r i n g r u n l e v e l 3

I
[
[
[

OK
OK
OK
OK

]
]
]
]

f OK
I OK
[ OK
[ OK
[ OK
[ OK
[ OK

)
]
]
]
]
]
]

44 I.

Entering i n t e r a c t i v e s t a r t u p
S t a r t s e r v i c e kudzu ()/(/()ontinue? []

.
,
.
LILO i n i t = / b i n / s h ,

, init".
,
fsck .
Red Hai
, /etc/sysconflg. , /etc/rc.config.d
HP-UX, , (. 2.5).
2.5. /etc/sysconfig Red Hot
/
aprad
clock
console
hwconf
ilfin
lull
keyboard
mouse
network
network-scripts
pcmcla
sendmai)

H~ j.Hji-. COje
(Advanced
Power Management )
( 1)
,
; Kudzu
( /, ..)
, ,

( "us"
101- )
: X Windows
gpm
( , , ..)
,

, PCMCIA,

undmall

:
hwconf Kudzu, ,
- ,
.

, ,
Red Hat ,
. Inll^/bln/sh
-

2.

49

,
. , , 30 .

network-scripts ,
. , .
ifcfg-. , networkscripts/ifcfg-ethO e t h O ,
IP-.
13.10.

sendmail : DAEMON QUEUE. DAEMON yes, seBdmail


. QUEUE seBdmail .

,
.

FreeBSD
F r e e B S D . B S D - .
init F r e e B S D ,
/ e t c / r c . , , ,
/ e t c , ..
, .
/ e t c / r c ,
:

/etc/defaults/rc.conf

/etc/rc.conf

/ e t c / r c . conf.local

,
( local.startup). , shell,
. /etc/rc
source (, ' . ' ) ,


.
/ e t c / d e f a u l t s / r c . c o n f . .
- , / e t c / r c . c o n f /etc/rc.conf.local. , / e t c / r e ,
, .
/ e t c ,
:
% la / e t c / r c *
rc
rc.disklessl
rc.atm
rc.diskless2
rc.conf
rc.firewall
rc.i3B6
rc.network

50

rc.isdn
rc.local
rc.serial
rc.shutdown

rc.pccard
rc.resume
rc.devfs
rc.suspend

I.

,
rc. diskless 1 - rc.sysctl,
rc.serial, rc.pccard rc. net work, / e t c / r e
. rc.local. - ,
( rc.sysetl ).
rc.serial ,
,
.
rc.conf
P C M C I A / C a r d B u s , rc.pccard ,
P C M C I A , pccardd, P C M C I A
.
rc.network .
, rc.conf, , D H C P ,
. ,
rc.conf.
; rc.atm, rc.isdn rc.firewall.
FreeBSD
: h o s t n a m e , d e f a u l t r o u t e r i f c o n f iq_unm (
). if c o n f __ , ifconfig
. ,
hostname="my. f u l l y q u a l i f i e d .name"
i f c o n f i g _ d e O = " i n e t 1 9 2 . 1 6 8 . 1 . 2 netmask O x f f f f f f O O "
defaultrouter-"192.168.1.1"
IP- 192.168.1.2
192.168.1.1.
D H C P , :
if c o n f ig_deC=-" DHCP"
D H C P IP-,
.

2.5.


UNIX-
.
-,
.
UNIX-
. , .
. ,
.

. U N I X
. ,
, , ,

2. 3

51

, . ,
UNIX ,
.
,
.
. ,
,
. , "" .
, , ,
.
, - ,
-:

;
shutdown,
halt reboot ( BSD- Linux);
Init TERM,
init telirit
( System V);
init.


UNLX- .

. , ,
.
(, Hewlett-Packard)
,
, .
, ,
.
, .
, ,
.
,
.
shutdown:
shutdown

. , , "
" . ,
,
- .
shutdown
. , .

52

I.

, ,
, .
, ,
,
.
shutdown ,
: ,
. ,
fsck.
,
,
.
,
.
. 2.6 shutdown
. .
2.6. shutdown

Solaris

/uir/ibln/ihutdown

-g

-16

-10

HP-UX

/etc/shutdown

Red Hat

/nbln/ohutdown

-h

FreeBSD

/sbln/sbutdowa

, , .

halt:
halt ,
. ,
shutdown -h halt. halt
, ,
sync (, ,
sync), ,
.
halt - sync .
fsck,
,
. halt -q
, .
-q .
reboot:
reboot halt.
, , .
shutdown -. , shutdown
- -q.

2. 3

53

init T E R M
init
. -
, . BSD- init
TERM,
, , getty . shutdown.
, ps
. init
. kill:
# ;
kill - 1
kill

4.

telinit: init
, init , telinit
. ,
# telinit S
Solaris HP-UX Red
Hat 1, S, shell
root, :
# telinit 1

# shutdown -xl
, ,
.
telinit ,
inittab. -q init
.
init
init ,
kill -KILL kill -9.
(
). ""
. shutdown reboot

54

I.

. ,
.
,
.

root, .
. , , .
"" .
,
, .
,
.

. .
, 21. 27
.

3.1.


UNIX .
,
: . ,
, , ,
".
5.

, , .

3.

. /etc/group.

6.1.

,
.
. . ,
Is -I _. :
% 1 -1 / e t a f f / c o t t / t o d o
-rw
1
scett staff

1258 Jun 4 1 6 : 1 5 / s t a f f / s c o t c / t o d o

, "scoti",
, , "staff".
U N I X ,
. ( U I D User
ID) /etc/passwd, ( G I D G r o u p ID) /etc/group".

. Is
,
.
, , : ( U I D ) .
( G I D )
.
. , .
(. 4.3),
.
,
, ,
,
, : S U I D
(Set User ID ) S G I D (Set G r o u p
ID ).
, ,
(
, ). ,
.
S U I D ,

. ,
. , passwd,
,
/etc/passwd, .
S U I D .
. ,
, , , passwd ,
.

( 18)

56

I.

3.2.

UID, 0. UNIX
,
. ,
, .
UNIX (.. , 0)
". ,
( )
. , :

chroot.
;
;

;

.

. login,

,
. , ,
,
.

3.3.


root *
; .
, )
.
21
,

,
, , , , .
,
,
.

"". (, ,
! .

3.


, ,
. ,
, .
,
" ".
(Grady Ward) FAQ-,
PG :
" "
( ),
.

.
, ,
, .
, - ,
. ,
.
: '' "
.
,
- . ,
, (
).

3.4.

:
;
, -, ,
;
, , ;
,
.


root ,
,
. , .
-, ,
. , - ,
3:00 - , ,
. ,
, . -,

. root
, ,
.
root
, .. , .
(. 21.6.

58

I.

,
).
su:
su. ,
,
root.
, (
exit <Control-D>). su
, ,
, .
.
su root
. su .
- ,
, su _.
root
su login ,
, su,
.

, /bin/su /esr/bin/su, su. -
su,
PATH , " " .
su
wheel.
sudo: su

, -
(, ),
. root
, ,
.

sudo, (
).
Web- www.courtesan.com.
sudo ,
root (
). /etc/sudoers,
, ,
, .
, sudo
.
( ) sudo .

3.

. , .
sudo , , ,
.
syslog
. ""
.
, randy,
//1 etc/sudoers,
:
Dec 7 1 0 : 5 7 : 1 9 t i g g e r s u d o : r a n d y : TTY-ttypO TTY-ttypO;
P W D = / t i g g e r / u s e r s / r a n d y ; USER=root; COMMAND-/bin/cat / e t c / s u d o e r s
/etc/sudoers
. :
#
H o s t _ A l i a s CS t i g g e r , anchor, p i p e r , moet, s i g i
HostAlias
PHYSICS - e p r i n c e , p p r i n c e , i c a r u s
#
Cmnd_Alias DUMP = / u s r / s b i n / d u m p , / u s r / s b i n / r e s t o r e
CmndAlias
PRINTING e / u s r / s b i n / l p c , / u s r / s b i n / l p r f l l
Cmnd_Alias
SHELLS - / b i n / a h , / b i n / t c s h , / b i n / c s h
#
mark, ed
PHYSICS = ALL
herb
CS - / u s r / l o c a l / b i n / t c p d u m p : PHYSICS - ( o p e r a t o r )
DUMP
iynda
ALL - (ALL) ALL, !SHELLS
%wheel
ALL, .'PHYSICS - NOPASSWD: PRINTING
^ ,
. ,
, sudoers
, .
.
:

, ;

, -
;

, ;

, .

mark ed.
PHYSICS (eprince,
pprince Icarus). ALL
.
, sudo root.
herb tcpdump
CS,

60

I.

PHYSICS. , ,
root, operator.
, herb,
:
% udo -u operator /uer/ebin/dump Ou /dov/rsdOa
lynda
, . .
, ? , :
I - //coh /tznp/cah
% audo /tmp/csh
, " , ..."
, . ,
sudoers ,
,
,
UNIX- wheel
1 Iprm
, PHYSICS. ,
.
, /etc/sudoers
,
.
. ,
sudoers ,
.
/etc/sudoers
visudo. , - ,
, . ,
sudoers sudo
.
sudo :

,
;

- ;
sudo , su
root;

,
root;
, ,
, ;

3.

.
.
root. . ,
sudo,
. .
sudo
,
sudo csli sudo su,
.

3.5.


root , UNIX
. , , , .
/etc/passwd ,
1 .
:
daemon
daemon, , ,
1. ,
, ,
, root,
. UNIX- daemon,
.
: bin
bin
, , .
(
),
root.
: sys
sys ,
/dev/kmem, /dev/mem /dev/drum /dcv/swap,
,
.
,
sys. sys Kmcm sys.
: n o b o d y
UNIX nobody
-1 -2. Solaris
60001 ( 60002 noaccess).

62

I.

NFS (Network File System)


nobody
.
, NFS
- . nobody.

17.1.

nobody

nobody ,
.
,
,
. nobody
, fingerd.
, , -1 32767.
,
adduser, .

, UNIX
. ,
,
-.
,
, ,
UNIX. UNIX
,
.

4.1.


,

",
.
, , ,
. UNIX ,

, .

. :

;
(, , ..);
;
, ;
( , );

, , 1 8 .

64

I.

.
UNIX- ,
.
"" ( ,
).
, .

, .
, , .
,
. '
. , , ..

.
UNIX.
(PID)
, ,
(Process ID, PID). ,
, ,
. . ,
, , .
(PPID)
UNIX ,
.
, . ,
,
.
UNIX ,
. ,
PPID (Parent Process ID),
, ".
(UID)
(EUID)
UID (User ID) ,
, , , EUID .
()
root.

, . - , Init { 1)
(. 4.2).

4. ,

65

6.1.
EUID (Effective User ID) ""
. , ,

. U I D EUID
(SUID).
? ,
. ,
SUID,
. EUID
,
.

( G I D )
( E G I D )
G I D (Group ID) ,
. (Effective Group ID.
EG ID) G I D , EUID UID
, ,
,
.
6.1.

. G I D EGID
.
- , ,
,
.
nice
,
.
, ,
.
,
( nice), ,
"'" . nice, "" .
4.6.

. ,
. -
shell, , ,

66

I.

. , 4.3.

4.2.



fork
, . ,
,
.
fork :
.. 0.
.
, , ,
.
fork

" exec
:
. exec

, .
,
. init.
1. init
, .
, , , init.

|7f

init 2.
init .
, _exit<).
.
_exit() ,
. ,
.
UNIX , , ,

wait
, , .
, .
,
,
.

,

wait , - , ,
wait , -

. , .

4.

67

Init. "" .
wait.
init
. , ,
.

4.3.

. UNIX
,
:


, , <Conirol-C> <Control-Z>";

kill;

,
, .
,
. ,
, ,
.
, .
. ,
.
, ;
.
.
, ,
.
, ,
.
.
,
. ,
.
. 4.1 , . .
S1C (, S I G H UP).

, ,
stty, .
, . 7.10.

68

I.

4.1. ,
No

1
2

HUP
INT

3
9

QUIT
KILL

BUS

SEGV

IS

TERM

?
?
?

CONT

i
WINCH

USRI


|
USR2


(. /usr/includc/sigtial.b
).
STOP
TSTP

man signal

, . 4.1,
, "
". , ,
.
, "" ,
.
BUS SEGV .
, : 99%
- .
. .
.
WINCH,
(,
). ,

4.

/5

( ),
.
KILL STOP , ,
. KILL , ,
STOP
CONT. C O N T ,
.
TSTP "" STOP.
.
<Ctri-Z>. , , ,
STOP. , TSTP
,
.
, KILL, INT. HUP, Q U I T TERM
,
-:

KILL
. ,
.

INT
<Ctr1-C>.
.
( )
. ,
, ,
.

TERM . , , ,
.
H U P . -,


, H U P . -,
"" (.. ) ,
. , ,
(
"hang-up" ). shell (csh.
tcsh .)
HUP, ,
. Bourne shell (sh, ksh, bash)
nohup.

QUIT TERM, ,
.
USRI USR2 .
. , named
.

70

I.

4.4.

: kill
kill
. ,
TERM ( ). kill
( ),
root ( ).
:
k i l l I-]
(.
. 4.1), -.
-1
, .
kill ,
, TERM ,
.
k i l l -9 pid
"" , 9, KILL,
. "" ,
,
( -,
, ).
.

4.5.




, . 4.2.
4.2.

( )

,

. ,
(, ),
.
.
,
. ,
.

4.

71

. STOP TSTP
CONT. ,
.

4.6.

:
nice renice
nice ( ) ,
,
.
nice, .
.
, - 2 0 +19, 0 39 (. . 4.3).
nice,
. , . nice,
.
. nice
,
.
nice
,
.
.
UNIX 7080- .. .
. ,
, UNIX,
, . ,
- ,
,
" " .

[yj

25.
.
nice. rcnice
nice .
, ( ) .
:
% nice +10 -/bin/longtask
% renice -5 aS29
,
, .
nice renice .
, .
, -.
.

72

I.

, nice,
shell ( sh).
, ,
. ,
( ).
. 4.3 .
nice,
nice .
,
(, 10). '+'
nice.
4.3. nice renice

/
^

nic

.*
nice

csh

+ -

Solaris

039

- -

HP-UX

039

- - + -


-
- ]

Red Hat

-20-20

- -

+ -

FreeBSD

-20 20

+ -

, 20.

xmpd .
, -12.
- , 65,
, ,
nice shell. ,
.

4 7.

: ps
ps ,
. , , ,
. :
System V (Solaris, H P - U X ) BSD (Red Hal,
FreeBSD). ,
,
.
ps , ,
. ,
, ,
(, , ..).
- ps < e x i t i n g >
<defunct>.

/3

ps. , (
), , .
ps .
.
,
. Red Hat ps
.
, .
: , !
ps. .
Red Hat FreeBSD ,
& , ps aux.
FreeBSD ( Red Hat ).
* aux
USER PID
root
0
root
1
root
2
root
46
root
bo
root
75
root
100
evi 1251
evi
1511
evi
1520

*CPU
0.0
0.0
0.0
fl.O

0.0

0.0
5.5
0.0
0.0
o.c

0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 D
0 0

VS2
0
208
0
160
22B

226
204
320
126
332

RSS
0
120
12
112
Lai
1 a
92
256
64
224

TT

STAT STARTED
8 35PM
35PH
e 3*>PM
Ss
e 37 PM
37 PM
1
lWs 8 3"PM

?? DLs
?? Ss
?? BL
"7
?3
?'
??
p8
pB
pB

37PM
l S + 1 50PM
3
s-
3 17PM
REIs

TTI-5E
0 00
0 DO
0 00
0 01
0 00
0 DD
0 00
06
0 00
0 00

06
20
03
45

COMMAND
(swapper)
init -s
ipagedaenwnj
eysloqd

/3

02
1

Lpd
lnetd

03
04

(ceh>
nan l o g g e r
ps aux

- c s h

. 4.4.
ps Red Hat FreeBSD
lax. ps lax
, .
, -
.
P P I D (
). N1 ( nice) W C H A N (, ).
ps lax
UID PID PPID
0
0
0
0
1
0
0
0
2
0 46
I
0 77
1
0 64

CPU
0
0
0
0
0
0

PR MI
-18
0
10
0
0
-16
2
0
2

2
0

vsz
0
208
G
160
"60
260

RS5
0
120
12
112
BB
204

WCHAN
a5ec
wait
a203c
select
select
select

STAT TT
DLs ?? 0 : 0 0 . .06
I s ?? 0 : 0 0 . 20
DL ?? 0 : 0 0 . 06
S s ?? 0 : 0 1 . ,47
IWs ?? 0 : 0 0 . .0
tMs ?? 0 : 0 0 . > 2 ?

COMMAND
fswanper)
init -s
pagpdaemon
syslocd
porVPiap
mojntd

70 I.

4.4 ps oux ( FreeBSD)

USER

PID

%CPO

( ),

%MEM

( ),

vsz

RSS

(
1 )

TT

STAT

:
R
D
I (< 20 )
S (> 20 )

Z
:
>
N
<

s FIFO
V vforV
exit
L
X
S (
)
w
+

STARTED

TIME

COMMAND

'

. ww.
.
Solaris H P - U X
ps -ef ( Red Hat):
%

-ef
DID
PIC
oot
0
oot
1
oot
2
171
oot
t ent
B4B2
t ent
e<44

PPID
0
0
0
1
444
422

C
STIME
BO
Dec 21
D e c 21
2
D e c 21

Dec 2 1
BO
35 1 4 : 3 4 : 1 0
203 14:32:50

TTV

pts/7
pts/

TIME
0:02
4:32
0:00
0:02
0:00
0:01

COMD
shed
/etc/init pageout
/usr/lib/seiwnao.1 -bd
ps - e f
-csh

. 4.5.

4.

/5

4.5. -ef
(Solaris, HP-UX Red Hot)

UID

PID

PPID

STIME

TTY

TIME

COMD

ps lax Red Hat FreeBSD, ps -elf


System V :
% - i f
F
.9
6

S UID
root
s root
S root

PID PPID
0
D
1
0
142
1

BO
65
41

P
0
1
1

N1
Si'
20
20

ADDR
f00c2fd8
ff2eaB00
ff2eB000

sz

WCHAN TIME
0
0:02
f f 2 6 3 2 c B 4:32
176
f00cb69 0:00

COMD
sched
init sysLoad

S T I M E TTY ,
; , ps -ef.
. 4.6.
4.6. -elf
(Solaris, HP-UX, IRIX Red Hof|

76

; (
)

:

S ( )
R

Z
D
( )

( )

( ,
nice)

N1

nice SY

ADDR

SZ

WCHAN

I.

4.8.

:
top
ps , ""
,
. t o p ,
,
.
(William LeFebvre).

[vj

top Web- vsww.groupsys.com.


:
l a s t p i d : 2 1 3 1 4 ; Lped a v e r a g e s : 2 . 9 7 , 2 . 9 5 , 2 . B 9 1 5 : 5 1 : 5 1
75 p r o c e s a e s : 71 s l e e p i n g , 3 r u n n i n g , 1 zombie
cpu s t a t e s : 4 4 . 5 1 u s e r , 0 % n i c e , 2 3 . 9 * s y s t e m , 3 1 . 6 4 i d l e
Memory: 113M a v a i l , 1CBM i n u s e , 4972K f r e e , 6232K l o c k e d
PID
1313
25
1310
901
192
778
529
151
0962
5843
167
1311

USER
root
root
root
root
root
uucp
randy
root
trent
beth
root
rand

PHI NICE
1 -19
0
1
27
0
29
0
0
1
27
D
15
0
15
0
0
15
15
0
15
0
D
5

SIZE
297K
1564K
812K
2152K
44K
244K
220K
12K
212K
20BK
100K
224K

RES
14BK
67 6K
4BBK
2324K
27 6K
508K
176K
BK
OK
OK
OK
40BK

STATE TIME
0:: 00
sleep
sleep
0:: 20
run
0:: 00
run
0::03
sleep
0::4B
run
0:: 04
sleep
0;: 00
s l e e p 54;: 4 D
0;: 00
sleep
sleep
0:: 00
0:: 00
sleep
sleep
0:: 00

13
9.3*
5.4*
7.61
0.01
0.0%
D. 01
0.04
0,0%
C-0%
D.0%
0.0%
0.01

CPU
0.71
0.71
0.3%
0.0*
0.0%
0.01
0.0%
0.0
0.0%
0.0%
o.ot
0.0%

COMMAND
ecpcd
se^dms
sendma
top
in.rlo
UUC1CO
csh
upds te
csh
csh
lpd
prev

.
. t o p r e n i c e ,
,
.
,
t o p .
* ,
, .
root top -q,
. ,
- .

4.9.

, -
,
.
: ,
(, ), , " "
.
, .

.

4.

/5

25.4.
, . , ps.
, -
, , .

, ,
.
, ,
,
.
. -.
,
,
. -, ,
-. ,
, .
,
STOP
, .
CONT. ,
,
. ,
, "" , .
,
,
r e n i c e
.
, .
. ,
.
, -
.
, , ,
.
,
: - . ,
p s , , .
, ,
; fuser Isof 5.2.
, .

.

:
while 1
mkdir a d i r
cd a d i r

74 I.

touch

afile

end
,
,
.
,
,
. , .

. ,
" " ,
-, ,
, , , .
/ t m p ,
, ,
/ t m p n e w f s .
8.

, , :
?


UNIX, " ". .
, .
(.. ),



( ,
), (
). ,
, UNIX.

:

API" ,
;

(Application Programming Interface, API)


,
.

80

I.

, ;

,
.
UNIX
,
. ,
. , (NFS) ,
.
, ,
"" . ,
.
, ,
. ,
.
,
UNIX .
4 3BSD, , ,
(, VXFS HP-UX), ,
(, ,
Solaris HP-UX), ,
( , DOS -
ISO-966D).
UNIX, .

5.1.


,
/ ,
. .
,
, .
(, /tmp/) (, /niesystem). ,
. ,
.
.
,
.
,
. , , .
,
, .
UNIX .
:
255 ,
1023 . ,
,

5.

81

cd ,
".
,
,
'/'. , , .
U N I X ,

.
,
, ,
. ,
Macintosh Windows,
, .
,

. ,
% "My e x c e l l e n t f i l e . t x t "
My
excellent file.txt.

5.2.


, ,
. " ", ,
. , ,
, U N I X
. , .
, ,
, ,
: , , ..

mount.
( )
,
.
, . ,
4 mount /dov/adlc /uaars
, / d e v / s d l c .
/users. Is / u s e r s
, .
, ,
/etc/fstab, /etc/vfstab /etc/checklist,

82

.
. ,
, 1023 .

I.

. (fsck -) (mount -)
,
mouBt / u s r .
fstab (. 8 3).
umount.
.
. ,
.
FreeBSD uniount -f, .
, , ,
.
umount -f .
Solaris 8 umount -.
.
lockfs -h ,

" ".
umount.
"" , ,
fuser, ,
. fuser - ,
.
, . :

fuser

/usr:
490tm

/usr

157tm
16938c

315ctom
16902ctm

474 torn
358ctom

5049tom
484tm

84tm

496ctom

( );

(
cfaroot).

, ,
ps
, fuser. ;
%

-fp

UID

root
root
1

"157

315

5049"

PID

PPID

STIME

5D49
157
315

4 90
1
1

0
0
0

Oct 11
J i m 21
J u n 27

TTY

TIME

CMD

?
?
?

0:! 00
5 : 26
0::00

/usr/bin/Xll/xdjn
/usr/sbln/nairied
/usr/lib/lpsched

,
ps .

5 .

shell

83

fuser
, .
:
fuser

fuaar

/usr

-f

-, fuser
KILL. ,
root (
sudo).
RedMat fuser. (Werner
Almesberger), - -
, - .
-v, )' fuser
ps:
-mv

/uer

USER
root
root
root
root

PID
1
125
274
321

ACCESS
....m
,...ra
m
....in

COMMAND
init
apmd
portmap
sysiogd

Bo FreeBSD fuser, fstal


.
fuser Isof ("list of
open files" ), . Isof
(Vic Abell) . .
FTP-
ftp://vie..purdue.edu/pub/tools/unix/lsof
.

5.3.


U N I X .
,
, .
, , .
. , / e t c
, , .
, /var,
, .
, . UNIX-

, .
, , .

. ,
/unix /vmunix.
/kernel /stand.

/dev , / e t c
, /sbin /
/ t m p .
,
/lib.
/usr/lib, /lib
.
/ u s r /var.
,
. ,
/ u s r , , , .
/var , ,
,
. .
/ u s r / v a r ,
.
/ v a r
/usr. , ,
, .

, ,
/usr.
,
.
. 5.1.
5.1.

/ /1

,
1

/dev

: , , ..

/etc

/lib

/trap

, (BSD)

( )

/stand

, .

/osr/

/uir/games

(
)

/usr/lnclude

/usr/5bln

, System V
BSD-

/usr/abin

/, /bin
/usr/bln.

5.

85

5.4.

/usr/llb

UNIX-

/usr/man

/usr/share

,
)

/var/adm

/var/log

( )

/var/spool

, UUCP,
.

/var/tinp

(
)

/usr/ucb

BSD

/usr/local

(,
)

/usr/local/adm

/usr/loeal/

/usr/local/etc

/usr/Iocal/llb

/usr/local/sbin

/usr/local/src

/usr/local/*

, ( Solaris)

;
;
- () ;
- () ;
;
( F I F O ) ;
.
,
.

. U N I X
. , ,
. ,
.

.
mkdir ( ) rmdir. ,
, rm -.

7

.
,
"
, .

,
. ,
.
, :
UNIX . UNIX , ,
, .
.
"",
("") , .
In. .
In ,
.
o l d f i i e newfile
oldfiie newfile. ,
lrt o l d f i i e n e w f i l e
newfile oldfiie.
,
.
. ,
, .
-
-
12.
UNIX-
.
, ,
*.
,
.
, .
- -
, .
.
. ,
.
-
-.
- ,
*

5.

87

- ()
.
,
, .
.
:
. ,
, ,
. ,
6 Linux .
(/dev/IpO) 6
0.
. ,
,
. " " (
)
, , ,
, .
mknod, . MAKEDEV
( /dev),
.
, , ,
.

,
, . UNIX
, . UNIX .
, .

, , ,
.
, X Window Syslog.
Syslog .
socket.
, rm
unlink.

,
, .
mknod, rm.

88

I.


, " " ,
.
,
.
, , ..
,
. , ,
.
In -s,
. ,
, , . .
, . ,
In -s

. . / . . / u f s /usr/include/bsd/sys/ufs

/usr/include/bsd/sys/ufs /usr/include/ufs
. /usr/include ,
, , .

, ,

"..*'

. ,

/usr/include/bsd/sys/ufs/../pararc.h

/usr/include/param.h

/usr/include/bad/sys/pararn. h

,
In -s - .
In, .

5.5.


,
. ,
, .
, ,
. 16-
,
.

.
clrniod ("change m o d e "
) Is.

5.

89

S U I D S G I D
,
4000 2000,
(SU1D) (SGID).
,
, .
3.1.
SGID ,
, ,
.
, .
UNIX (
). ,
SGID
.
SG1D ,
.
.
Sticky-
,
1000. sticky- ("sticky" ).
", UNIX ,
.
, PDP-11/70, UNIX ,
, .
sticky- ,
. 25- sticky- ,
.
sticky- ,
UNIX ,
,
root.
. ,
/tmp .
^
Solaris HP-UX
^^ siickv- ,
, ,
.

, ,
. UNIX
".
,
UNIX. Solaris HP-UX ,
. ,

90

I.

() , ,
, . : ,
(
).
,
. (
400, 200 100)
.
(40, 20 10) .
(4, 2 I) >
. ,
, .
, .
,
.
, ,
, .
,
. ,
( ).
,
.
: , , ,
shell - (, awk sed).
:
#! b i n / c s h -f
,
, sh (Bourne shell)*
(
) ,
. , . ,
.

,
. , .
, , , .
! * !.
,
. ,
Bourne shell.

5.

91

, ,
. Is -I.

, .. .
("ctime") , ,
.
(, .
), .
:
% 1 -1 /bin/eh
-rwxr-xr-x 1 root

bio

85924 Sep 27

1997 //sh

.
, , .
(. 5.2).
5.2. U
-

,..

, .

d
-

- b

mkdir
mknod

nndir, rm -

mknod

rm

aocket(2)

rm

mknod

1 -

rm

.
Is , w (
, ).
,
.
( S U I D ) ,
, ,
s.
( S G I D ) , s
( )
, siicky-. S U I D / S G I D
slicky- , ,
S ,
.
.
, . /bin/sh
, .

88
I.

: 7 .
.
.
root,
bin, ,
.
, .
,
/etc/pesswd / e t c / g r o u p . ,
(. 18).
, . 85924 , .. 84 ".
: 27 1997 .
: /bln/sh.
Is .
:
I 1 -1 / d e v / t t y
c r w - r w - r w - 1 r o o t daemon

12, 0 Dec 20 1998 / d e v / t t y a

,
. /dev/ttya ,
12 (
).
Is -i,
.
, ,
,
. , ,
.
,
. , climod, chown
chgrp.
F r e e B S D
FreeBSD , 4.4BSD,
, .
. ,
s a p p n d (
). s c h g
.
Is -1:
%

la

-lo

-r-xr-xr-x

/kernel

1 root

Wheel

s c h g 2498230 Nov 3C 2 3 : 5 1 / k e r n e l

" " "" , 1000.


: 1 210,
1024, . , 220,
1048576, .

93

chflags
# c h f l a g e noechg / k e r n e l
# Is - l o /kernel
- r - x r - x r - x 1 r o o t wheel

- 2498230 Nov 30 23:51 / k e r n e l

chflags(l).
chmod:
chmod.
root.
UNIX- .
. ,
.
,
.
chmod .
,
.
, ,
. S U I D / S G I D sticky-,
, .
.
. 5.3
, , w ,
.
5.3. chmod

001

010

-w-

011

-wx

100

101

110

rw-

111

rwx

, chmod 711 myprog ,


*.
. 5.4 .
myprog shell,
. , ,
.
, .

94

I.

5.4. chmod

u+w

ug^rw, ^

/,

ug^srx,-

/, SUID;

u ("user") , g ("group")
, ("others") , a ("all")
.
chown chgrp:
chown ,
chgrp , .

. chgrp,
,
root.
chown chgip -R,
,
. , :
| Chmod 755 - m a t t
# chown -R m a t t - m a t t
# chgrp -R s t a f f - m a t t

.
chown ,
;
4 chown R m a t t - m a t t / . *
" m a l t / . . , .

chown

. :
chown

-,

...

:
I chown R m a t t ; s t a f f - m a t t
U N I X , System V,

chown, BSD- chown
. ,
.

5.

95

. ,
root.
umask:
shell- umask
. umask ,
.
, ,
umask. . 5.5
umask.
5.5. umask

0

001

rwx
rv-

010

r-x

Oil

100

-wx

101

-v-

110

111

, umask 027 ,
. umask , , 022, ..
.
,
umask,
. , , umask
.cshrc .profile,
.
6.

96

I.

/^ fd%\

'


. , , , ,
,
.
\ .
, , .
, ,
.

6.1.

/etc/passwd
passwd ,

,
.
, :

( ;
. ):

;
;
GECOS ( , , );
;

I 6.

97

.
/etc/passwd:

r o o t : j s g 8 Y . lp6uWMo: 0 : 0 : The S y s t e m , , x 6 0 9 6 , : / : / b i n / c s h
j 1: Hwex 6bM8 cT 3 / E: 10 0 : 0 : J i m Lan e, ECT8 -- 3 , , : / st a f f / j 1: / b i n / sh
dotty:oP0vdZ/s93ZiY:101:20::/home/korbel/dotty:/bin/csh
/etc/passwd ,
N I S N I S + .
18.
/etc/passwd.

( )
. ,
*. N I S N I S + ,
8 .
- . ,
. ,
8 .
,
, . : ,
.
,
, ( sendmail) , .

,
.
,
, . ,
. .

, .
. , ,
.

,
.
/etc/mail/aliases , ,
.

19.4.

, :
. (Brent Browning),
, "bbrowning",

FreeBSD 16- , Red Hal 32-.

- "brenib",
a "bbrowning" aliases:
bbrowninq: b r e n t b
,
,
.
, .
, . -,
,
.
.
-,
.
,
. , scott@boiilder scotl@refuge
,
.
21.6.
,
. ,
,
.

/etc/passwd .
DES- (
),
passwd ( yppasswd.
NIS), , ,
".
/etc/passwd ,
(*).
. ,
,
.
, DES-, 8 .
, 8 .
13
.
"",
. , passwd.
DES.
,
.

I 6.

99

HP-UX " ",


.
DES, 8- .
Red Hat FreeBSD MD5, /
t .
, 31
"$ 1 $".


,
.
. 21.3.
Solaris . ,
,
/etc/passwd. shadow Solaris
6.4.


(UID) 32- 0 2147483647
>.

32767. Linux L'lD
65535, .
root 0.
bin { 1) daemon
( 2). ,
/etc/passwd, , ,
100.
0.
,
.
, sudo.
, ,
.
,
, , .
. , ,
.
, NFS,
,
.

100

NFS 17.

I.

, ..
, .
,
.
Uniquid"
. ,
.

(GID) 16- 32-
. 0
root wheel, 1
daemon.
wheel root TOPS-20.

/etc/group. UNIX
. ,
, GID /etc/passwd.
UNIX 16 ,
G I D /etc/passwd .
, . ,
.
HP-UX
/etc/logingroup, /etc/group.
/etc/logingroup
/etc/group, HP-UX ,
.
, ,
. BSD.
G1D .

, .
newgrp.
BSD,
grpld mount
SGID (2000). FreeBSD
, newgrp.
G E C O S "
GECOS .
Bell Labs ,
UNIX- ,
GECOS. .

ftp://ftp.colorado.edu/its/unix/src/uniquid.mr.gz.
Honeywell General Electric,
GECOS GCOS.
.

I 6.

101

, . '&'
GECOS ,
,
finger sendmail. .
finger
GECOS :

( );

.
chfn fpasswd -g Solaris) , GECOS.
, :
.
. ,
, .

.
,
"no home directory" (
).
, . ,


,
.

, ,
Bourne shell shell ( /bin/sh /bin/csh),
.
Bourne shell, , /etc/passwd .
ksh ( shell), bash (Bourne-again shell) tcsh
( shell).

tcsh

chsh. Solaris
( passwd -).
N1S NLS+. /etc/shells
,
chsh. root
. , /etc/shells
.

102

I.

6.2.

/etc/master.passwd FreeBSD
Bo FreeBSD /etc/master.passwd.
/etc/passwd , "" .
, /etc/master.passwd
vipw. passwd, chfB, chsh chpass,
/etc/passwd. pwd_mbdb.
mastcr.passwd
, root (
/etc/passwd ). :

;
;
.
( ) 8
/etc/login.conf.
(.
).
,
. ( ,
UNIX 1 1970 .),
. ,
.
(. 21.3).
( ,
),
,
. ,
.

6.3.

/etc/login.conf FreeBSD
/etc/login FreeBSD
. termcap
printcap. /
.
,
/etc/master.passwd , /etc/login.conf
. , d e f a u l t .
/etc/login.conf :

( ,
..);

(
);

( PATH, MANPATH .);

, ;

umask;

6.

1<

( , ).

:
sysadnun: N
:ignorenologin;\
:requirehomed:\
:maxproc-unlimited:\
: oper.f i l e S " " u n l i i n i t e d :
:tc-default:
, s y s a d m i n ,
, /var/run/nologin
, (
, ).
s y s a d m m
". d e f a u l t .

6.4,

/etc/shadow Solaris Red Hat


Solaris .
Red Hai shadow.
/etc/shadow
,
/etc/passwd. master.passwd FreeBSD.
shadow passwd,
.
.
/etc/passwd, /etc/shadow
. 9 ,
:

, ,
:
, !
;

.
(we ), 1- 1970 .

,
,

104

I.

UNIX-. ,
usermod.
:
raillert:ir.NO. VAsclWn.: 11031: : 180:14 :: 18627:
:

/etc/passwd.
passwd shadow.

,
/etc/passwd.
, .
//passwd.

, ,

,
.


.
(. 21.3). Linux
.

,
, login
.

Solaris Linux -.

Solaris :
, .
.
. , , ,
/var/adm/lastiog.
, ,
.
,
lastlog.

Linux -.
, ,
.
, , Solaris,
. ,
Linux .
, ,
.

, .
,
. ,
.

; .

I 6.

105

,
:

m l l e r t : inNO.VAsclWn. : 1 1 0 3 1 : : 180:14 : : 18627:


. miller*
14- 2000 .
180 .
31- 2001 .

6.5.

/etc/group
/etc/group U N I X -
. :
wheel:*:0:root,evi.garth,scott,trent

csstaff:*:10:lloyd,evt
student:*:200:dotty

:
:
(, ).
;
( ).
/etc/passwd, .
8 .
( , Bewgrp), .
("),
.
,
.
.

, N F S .
,
.
,
. , , staff.
,
, ,
100 ,
, .

6.6.


,

. (? 1 ?
27.1. ,
.)
,
.

106

I.

, .
.
.
,
,
.
:

passwd shadow
;

" .
:

.
:

/etc/group;

.

, ,
.
,
root sudo.
passwd shadow

In)

passwd, vipw,
.
vi, ,
EDITOR.
: vipw
passwd. ,
vipw passwd .
Solaris vipw ,
shadow passwd. "".
FreeBSD vipw niaster.passwd, /etc/passwd.
pwd_mkdb,
passwd niaster.passwd (
root,
).
, tyler
/etc/passwd :
cyler:103:100:Tyler
/bin/csh

Stevens,

3-27,

7919,:/home/staff/tyler:

.
shadow,
'* /etc/shadow :
tyler:*::::::18627:

I 6.

107

. tyler , 31- 2001



:
# paaawd

passwd .
, , passwd
- . FreeBSD
, ,
,
8 .
passwd, , , .
UNIX.
21.3.
.
passwd
, .
. npasswd.
:
hup://www.uiexas.edu/cc/unix/software/npasswd
passwd, Red Hal, ,
. , .
npasswd, .



root,
chown chgrp.
tyler
#
#
#
#

mkdir
chown
chgrp
chmod

/home/ataff/tyler
tyler /home/staff/tyler
ataff /home/ataff/tyler
700 /home/ataff/tyler


,
.
, Is ,
-.
. 6.1.
,
/usr/local/llb/skel .
,
/etc/skel (/usr/share/skel FreeBSD), .

104
I.

6.1.
I
b/tcsh


.login
.cshrc

.logout
h
vl

.
.
._

miflx

.mallrc

tin
xrdb

.newsrc
.XdefaulU

lUrtx

.xioitrc




biff mesg

PATH
onuuk
,



.login .csbrc Bourne shell
vi
emacj
emacs



XII: ,
..
XI1

, ,
. , ,
"" . ,
alias dir Is -1
a l i a s rm rm -i
alias cp cp -i
.
/ e t c ,
. ,
Boume shell /etc/profile,
"/.profile.

tyler :
#

#
#

cp / u a r / l o c a l / l i b / a k o l / . [ - z A - Z J
chmod 644 - / t y l e r / . [ a - z A - Z ] *
chown t y l e r - / t y l e r / . [ a - z A - Z l *
chgrp a t a f f - / t y l e r / . [ a - r A - Z ] *

-/tyler

,
# chown

tyler -/tyler/.*

tyler
,
(/home/staff).


-
.

I 6.

105

/etc/mail/aliases
sendmail. 19,

19.3.
/etc/group
tyler.
100,

/etc/passwd. , tyler 100
, /etc/group ,
passwd. ,
/etc/gronp.
, .
, tyler
wheel.
su. /etc/group:
wheel:w:0:root,evi,garth,scott,trent, tyler
csstaff::100:11 oyd,evi,tyler

,
edquota.
,
,
, :
#

edquota

edquota
adduser.
,
. ,
, .
, ,
,
.

, ,
, :
% pwd
% la - 1

/ */
/* / */

, /etc/passwd /etc/group.
. passwd group
, , login. 7.8.

110

I.

. ,
,
,
.
,
,
.
,
, , .
^

27.1.

, .

6.7.


,
.
,
addnser. , :

( ) ;



;
1-
,

/ v a r / t m p /tmp;

;
aliases, at;
;

passwd group;
;
.
,
,
. ' ,
, ,
.
,
. quot.
, ,
/home, :
quot /home
/dev/rdsk/c0t3d0s6:
156254
millert
34520
hilbert
5572 #1161
683 #1069

I 6.

107

,
, ,
/etc/passwd ,
:
find - /home -noueer -print
, quot.
quot .
, N F S .

6.8-


.
1
, )'
,
, .
. , ,
,
/etc/shells.
, (,
ftpd), , /etc/shells;
, (
).
, . sendmail
,
/etc/shells. , /etc/shells
/ S E N D M A I L / A N Y / S H E L L

6.9.


Solaris, H P - U X Red Hat ,
,
. FreeBSD
.
useradd passwd (
shadow, ).
adduser usermod
passwd
userdel
,
. groupadd, groupmod groupdel
/etc/group.
, ,
.
adduser rniuser. Perl.
hilbert
4 useradd hilbert
/etc/passwd :
r . i l b a r t : * : 105:20: : /home/hilbert: / b i n / a h

112

. I

, .
, * ,
.
useradd * .
, hilbert
faculty; , i p y n n y famous. ,
useradd ,
,
# useradd - "Devid Hilbert -d /home/math/hilbert -g faculty
-G famous -m -a /bin/tcah hilbert
/etc/passwd :
hilbert:*:105:30:David

Hilbert:/home/iMth/hilbert://tcsh

, hilbert faculty famous


/etc/group; /home/math/hllbert,
/etc/skel. Solaris ( Red Hat,
shadow) hilbert
/etc/shadow.
, useradd -D.
H P - U X Red Hat / e t c / d e fault/useradd.
usermod , useradd. ,
hilbert 4
2002 .":
* uursod - "July 4, 2002" hilbert
userdel ,
, useradd hilbert

userdel hilbert

hilbert
passwd, shadow ( ) group.
. (
,
.)
FreeBSD adduser rmuser, Perl.
,
. rmuser { userdel ).
useradd userdel, adduser rmuser
. adduser
/etc/adduser.conf. adduser
/usr/share/skel.

HP-UX , "
".

6 .

, ,
- UNIX-. ,

.

, ,
. ( ), ,
- .
,
. , ;
.

7.1.



RS-232. ,
25- , DB-25 (. ).
RS-232"
, ,
.
, DB-25
.
(. 7.2).

EIA-232-E.
, - .

114

I.

. . DB-25
RS-232
( 22). RS-232
12 ,
5 .
3 . RS-232,
.
RS-232 :
.
, .
,
.
(TD RD) ,
, .
. RS-232
.
TD RD, ,
-, , -,
. , .
DB-25 (
; DB-25P) , (""
; DB-25S).
1 25
. ,
. 1. 13, 14
25.
DB-25 . .

,
.
: , ,
. .
RS-232 DB-2S
. 7.1. 18
20, .

115

7.1. RS-232
DB-25
-

FG

TD
RD

RTS

3
4
5

CTS
DSR

SG

DCD

10

11

12

SDCD

DCD

13
14

5CTS

CTS
TD

15

SRD

RC

16
17

STD

RD

18

19
20

SRTS
DTR

RTS

21

SQ

22

R1

23

24

DRS
SCTE

25

BUSY


: D T E (Data Terminal Equipment )
D C E (Data Communications Equipment ).
,
. DTE, D C E , ( ). ,
DTE,
DCE-. D T E D C E ,
.
.
.
RS-232.
:

RS-232
, (

116

I.

) :
. DTE- D -.
RS-232 D T E DCE-. ( " " ,
TD DTE- TD DCE-
.. .)

DTE-.
, TD (transmitted data ) ", DTE- DCE-". , TD
DC -. , RD
DTE- DCE-.

DTE- (
), "", ,
DCE-.
TD
RD, -,
.

" " DTE-


. -, TD RD,
. -, RTS CTS. -,
D T R D C D D S R
.

, DTE-, -.
.
, .

, DTE- ,
DCE- .
, .
, ,
, .
. - . " " .
/








FG
TD
RD
RTS
CTS
DSR
SG
DCD
DTR

-
1
2
3
4
5
6
7

20

1
2
3
4
5
6
7
8
20

. . DB-25

7.

117

7.2.


: D I N - 8 , DB-9 RJ-45.
,
, DB-25- ,
, , .
-

DIN-8

D I N - 8 Macintosh,


RS-232 (. ).

. . DIN-8
D B - 2 5 / D I N - 8 . ,
D I N - 8 ,
. D I N - 8 . 7.2.
7.2. DIN-8/DB-25
/

D1N-8

DB-25

llcpe

RD

'

Krs

1 .

CTS

4, 8

SG

DCD

. ,.

20

DTR

>

DB-9
(
DB-25) .
RS-232 (. ).

. . DB-9

DB-9/DB-25. . 7.3.
7.3. DB-9/DB-25
DB-25
2
3
4
5
6
7
8
20

TD
RD
RTS
CTS
DSR
SG
DCD
DTR

RJ-45
RJ-45 , ,
. RJ-11.
, 4 ,
RJ-45 8 (. ). RJ-45
Ethernet, .

RJ-45
RJ-45

7.

119


. ,
(, ).
RJ-45, , ,
,
.
RJ-45 .
.
.
,
RJ-45 DB-25.
(Dave Yost),
RJ-45 ,
DCE-, DTE-.
RJ-45
1987 . (Dave@Yosl.com).
.
,
RS-232:

( RJ-45).

DTE- DCE- .

,
.

, DB25/RJ-45 DB-9/RJ-45. ""
.
RJ-45, , :
DB-25 DB-9, DTE- DCE-, .
RS-232, -
-,
.
, ,
, , ..
.

, .
( ) .
(..
), "",
" ", " " .
""
"" .
,
, .. ,

120

, , .
".
RJ-45 ,

.
"-", : ,
, .
D B - 2 5 / R J - 4 5 .
. , , ,
,
RS-232.
, . ,
.
(, 5), ,
RJ-45 (lOBaseT. ..).
, 3:4 5:6 .
.
, 1:2 7;8.
5 J5.2.
RJ-45.
.
(. , ).
RS-232,
.
7.4. RJ-45/DB-25 RJ-45/DB-9
DCE
RJJ5
1
( )
2
( )
3
( )
4
( )
5
( )
6
( )
7
( )
8
( )

J3B 25_
4
20

DM
7

'
RTS

DTE
-
Q6-?
3

CTS

DTR

DCD

TD

RD

GND

GND

GND

GND

RD

TD

DCD

20

DTR

CTS

RTS

ob , , ""
.
, .

7.

121

, , :
DB-25 DB-9 ( 7 5 ).
.
DTE- , DSR ,
. DSR
DCE-, "", 20
6 ( 4 6 DB-9). DTE-
DSR DTR.
DCE- 7 RJ-45 (
) DSR ( 6 DB-25
DB-9). , , mi
DSR. DCD.
.
(, ), .
, ,
.
[7!

7.3.

, -, , 1999 .


(DCD) (+5 ).
8- DB-25.
D C D
, , .
, "
", D C D .
( , )
.
: , .
D C D . , "",
. ,
"" D C D ,
.
UNIX -. ""
, ,
.

. ,
stty -CLOCAL,
. ,
* utty -CLOCAL < /dev/fcty03
tty03.
>. <;
stty.

122

I.

7.4.


CTS RTS
, - . ,
(,
, ,
),
"", .
. ,
{ - , , - ,
C T S RTS ),
ASCII- X O N XOFF.
,
*.
Sun
.
C T S RTS.
,
, , 4 5
, .
4, " ", 5
, " " .
D T R / D S R / D C D .

7.5.


RS-232 ,
9600 / 75 (22,86 ).
, RS-232 .

( 1000 ). , -
800 (243,84 ) 1000 (304,8 ),
.

7.6.


,
/dev.
. /dev/ttya
/dev/ttyb, .
.
, Solaris /dev/cua/a / d e v / t e r m / a ,
:
% la -1L / d a v / t a n a / a / d e v / c u a /
crw-rw-rw- 1 root sys
29, 0
Jan 15 1998 /dev/term/
crv
1 uucp uucp
29, 131072 Jan 15 199 /dev/cua/a

XON X O F F <Ctrl-Q> <Ciri-S>


emacs. _
<Qrl-S> . ,
- .

7.

123

,
, . Solaris
/dev/term/, D C D ,
(,
). /dev/cua/a
D C D . ,
.
, .
FreeBSD
/etc/rc.serial. ,
, .

, (. cio(4)).
, .
,
".
. 7.5
. ,
.
7.5.

7.7.

Solaris

/dev/tenn/[a,b]

/dev/cua/[a,b]

HP-UX 1

/dev/ttyOpfO.l]

/dev/cul0p[0.1J

/dev/cua0p(0,l]

/dev/ttyd0p|0,l)

/dev/cOp[O.IJJp

Red Hat

/dev/HyS[0,IJ

/dev/cua[0,1J

(
)

FreeBSD

/dev/ttyd|0,lj

/dev/cuaaJO.l]

/dev/cualafO.l]

/dev/cuaia(0.11

mksf(IM).




,
,

"

, . ,
.

124

I.

, ". ,

.
,
, ,
:

,
. . .

, , .
.
,
, /ctc/remote
tip . , 7.13.
, ,
13. , .


23.
,
.

,
, .
. iocti,
, , ,
terraio tty.

7.8.


X-
, -
. , ,
- , .
:
,
,
.

.
Init,


, -, .

7.

125

, getty ( Solaris), ,
/etc/ltys /ctc/inittab (
). getty (
, )
.
:

getty;

getty login,
;

login
/etc/passwd":

login " ",


/etc/motd;

login TERM
;

";


.
,
init, getty
.
/etc ,
. getty ,
, .
, -
. . 7.6 ,
.
7.6.

Solaris'

sactab

' /

sactab

zsmon/jpmiab

ttymon

/etc/ttytvpe

/ctc/gettydefs

geny

HP-UX

/elc/inittab

Red Hat

/etc/inittab

/etc/ttyiype

/elc/gettydels

getty

FreeBSD

/etc/ttys

/etc/ttys

/etc/gettytab

getty

Solaris /etc/saf
sacadm

/etc/ttys /etc/ttytab
4.3BSD ( )
, ttvtab
ttys (FreeBSD) :

(on f f f | [ s e c u r e ]

/etc/passwd
, NIS. 18.
.profile sh, ksh bash; .login .cshrc csh lesb.

126

I.

. , init, .
, getty, ,
,
.
termcap
lerminfo (. ). ,
T E R M .
on o f f
(.. ,
). s e c u r e ,
}- root.
,
, .
/ e t c / t t y s :
console
ttydO
ttydl
ttyd2

none
"/usr/libexec/getty std.9600"
" / u s r / l i b e x e c / g e t t y std.9606"
" / u s r ' l i b e x e c / g e t t y std.9600"

unknown
dialup
dialup
dialup

of secure
off secure
off secure
off secure

getty
: inittab, gettytab gettydeFs ( ).
init ttys ttytab .
,
. ( H U P ) . init
,
# k i l l -1 1
root. ,
!

/etc/tlytype


/ e t c / t t y s /etc/ttytype. :
_

, , ,
/etc/ttys. ttytype:
wyse
dialup
dialup
vt320
hi 9
aialout

console
ttyiO
ttyil
ttyi2
ttyi3
ttyi4
/etc/gettytab

gettytab (
s t d . 9 6 0 0 , )

7.

127

,
. :

# ,
# ; ,
# g e t t y .
default:\
:ap:lm-=\r\n%h l o g i n \ 7 2
# ,

:sp#9600:

2|8td.9600 I9600-baud:\
:sp#9600:
hIstd.38400 I 38400-baud:\
:sp#38400:
/etc/prlntcap / e t c / t e n u c a p .
, , ,
.
.
gettytab
. , , 23.3.
.
/etc/inittab
Solaris, H P - U X Red Hat init "
" , , .
: 0 6 s
.
init ,
/etc/inittab i n i t d e f a u l t (. ).
inittab ,
.
, >
,
, , .
, ,
,
.
inittab :

:_ .

:
: : s y s i n i t : / e t c / s e t c l k < / d e v / c o n s o l e > / a e v / c o n s o l e 2>bl
:234:reapawn:/etc/getty console console
1 1 : 2 3 4 : r e s p a w n : / e t c / g e t t y t t y l l 9600
1 2 : 2 3 4 : o f f : / e t c / g e t t y t t y l 2 9600
- ,
.
, .
.

128

I.

_ ,
. ( ),
. ,
,
. 7.7.
7.7. /etc/lnWob

initdefault

boot

Inittab

bootwait

inittab

once

waxt

respawn

powerfail

init

powerwait

init

sysinit

off

_
, ,
init sh ,
( ). "?" . 7.7
, init
.
, getty,
getty ttyt2.
telinit -q init inittab.
/etc/gettydefs
gettytab, gettydefs
, getty. , ,
. gcttyders
:
c o n s o l e 9600 HUPCL * 9600 SANE IXANY # l o g i n : # c o n s o l *
19200# B19200 HUPCL # B19200 SANE IXANY # l o g i n : #9600
9600* B9600 HUPCL # B9600 SANE IXANY HUPCL # l o g i n i #4800
S800# B4800 HUPCL # B4800 SANE IXANY HUPCL t l o g i n : #2400
2400# B2400 HUPCL # B2400 SANE IXANY UPCL # l o g i n : #1200
1200# B1200 HUPCL * B1200 SANE IXANY HUPCL # l o g i n : #300
300* B300 HUPCL # B300 SANE IXANY TAB3 HUPCL # l o g i n : #9600
:
*

7.

__

129

getty ,
.
,
ioctl,
login
,
login.
,
, .
; ,
gettydefs ( , -).
,
.
gettydefs.
.
,

. .
gettydefs
getty - gettydefs,
.
Solaris
U N I X getty.
, Solaris
Service Access Facility (
),
, ,
.

"", ( ttymon).
, . ,
ttyb 9600
VT100,
:
# sacadm - - myttymon - t t t y m o n - / u s r / l i b / s a f / t t y m o n - v 1
f r pmadm - a - p myttymon - a b - i r o o t - f u - v 1 - m " t t y a d m - d \
/ d e v / t e r m / b - 1 96o0 - T vtlOO - s / u s r / b i n / l o g i n "
/etc/ttydefs .
gettydefs. ..
.

, saf, pacadm. pmadm.
ttyadm ttymon, Solaris AnswerBook.
: termcap terminfo
U N I X ,
,

126 I.

. U N I X
,
.
Lermcap,
lemiiiifo. .
/ e t c /usr/share.
.

. , . , "xterm",
.
, ,
UNIX- T E R M .
termcap terminfo. ,
termcap T E R M C A P . ,
T E R M C A P T E R M .
[7|


7. .
, ,
.
: " D E C VT100,
"

7.9.


,
(,
<Ctri>).
tset stty.
. 7.8.
7.8

ERASE

H
-w

WERASE
KILL

EOF

INTR
QL'IT

STOP
START
DISCARD
Sl.'SPEND
LNEXT

7.
V

7.

131

ERASE
<Deleie>,
.

U N I X - , ,
< Backspace >.
< # > , <@> <DeIete>
ERASE, KILL INTR.
,
,
.

7.10.

stty:
stty . ,
, , (tty(4), tty(5), t t y ( l ) ,
,
).
stty. , ,
, ,
.
stty
. . ,
9600 /
:
% stty 9600 even -tabu
:
% tty intr " kill eras*] -tabs
-tabs (
INTR,
KILL ERASE <Ctr!-C>, < Q r l - U > < C u l - H > .
stty
. stty
:
% etty
s p e e d 9600 b a u d ; - p a r i t y n u p c l
rows - 24; c o l u m n s - 80
e r a s e - " h ; swtch - < u n d e f > ;
b r k i n t - i n p c k - i s t r i p l c r n l - i x a n y imaxbel o n l c r
echo e c h o e e c h o k e c h o c t l e c h o k e l e x t e n
stty
everything, stty - stty all, .
:
* etty -
s p e e d 9600 b a u d ;

126
I.

rows - 24; columns - 80; y p i x e l s - 364; x p i x e l s - 739;


eucw 1 : 0 : 0 : 0 , e c r w 1 : 0 : 0 : 0
i n t r - ; q u i t - | / e r a s * - " h ; k i l l - ; e o f - " d ; e o i ~ <undef>;
eol2 - <undef>; switch - <undef>; s t a r t s t o p - * s ; s u s p - " ;
d s u s p - ' y ; r p r n t - ' r ; Clush - A o; w e r a s e - ' w ; l n e x t - " v ;
-parenb -parodd cs8 - c s t o p b hupcl cread - c l o c a l - l o b l k - c r t s c t s
- p a r e x t - i g n b r k b r k i n t ignpar -parmrk -inpck - i s t r i p - i r . l c r
- i g n c r i c r n l - i u c l c lxon - i x a n y - l x o f f i m a x b e l i s i g l c a n o n - x c a s e
echo echoe echok - e c h o n l - n o f l s h - t o s t o p e c h o c t l - e c h o p r t echoke
- a e f e c h o - f l u s h o -pendin i e x t e n opoat - o l c u c o n l c r - o c r n l -onocr
- o n l r e t of111 - o f d e l
,
.
.
stty
( ),
, ( " > " " < " ) ,
, .
root.

7.11.

tset:
tset ,
. ;
, T E R M .
tset T E R M . ,
, ,
,
" " ( "dialup").

7.12.

'"
(, vi)
. ,
, ,
. ,
.
,
,
.
cat
more
,
"" .
reset stty
sane. reset
tset , , ,

7.

133

. , reset, stty sane,


termcap ( terminfo). .
,
,
.
<Return> <Enier>
(<Ctrl-M>). ,
, .
, <Retum> <CtrI-J> ( ).

7.13.


, .
.
13.8.
RJ-11 ,
RS-232 (
DB-25). , , ,
.
,
.
. ISA, PCI PCMCIA
RJ-1I, .
,
.
, , UNIX.
,
. . , UNIX.
, , ,
.
, .
,
, ,
.
,
,
.
.
,
,
, ,
.

134

I.

, , .
,
.
,
. ,

. .
,
"'* " / " .

V.90 '"56'\ 56 /
33,6 / 53 /
. , V 90
, ,

" 5 6 " 2 56Kflex
( U S Robotics, 3 C o m , Rockwell )
V.90 , . - ,

2 56Kflex V.90,
, .

,

.

.
,
) ( ,
) 4:1. 1.5:1. ,
.
: /etc/phones /etc/remote
tip
,
" . tip
,
(/eic/phoncs) ( / e t c / r e mote).
/ c i c / r e m o t e :
# / e t c / r e m o t e :
dial19200119200 Baud:dv-/dev 'culO:brHI9200sy
cu~/dev/cul0:at-hayes:du:
d i a l 3 B 4 0 0 1 d i a l e r I 38400 B a u d : d v = / d e v / e u l O ; b r < l 38400:

7.

135

cu-/dev/culO:at-hayes:du;
,

ucc-.-: tc-dial3B400
:-0:tc-dial384Q0
d c a : d v - / d i v ' t t y h l , / d e v / t t y h 2 : b r # 9 6 0 0 :pa-nor.e

. ; .
. =@.
, ( ) /etc/phohes.
I

/ e t c / p h o n e s :
,
,

monet

5552530
8,,510,555-4567,,,,-

phones , . -
.

. ,
, .

,
.
, getty

. , , '
", ,
. ,
.
Solaris, ,
'

ttyadm -;

ttyadm / d e v / c u a / a ia
/dev/term/a),

^
Vjy

/etc/uucp/Devices.
.
" H o w to Sei Up Bidirectional Modem Sen-ice"
Solaris AnswerBook.
B
H P - U X Red Hai
getty, uugetty.
uugetty , cu, tip uucico

126
I.

7.14.


.
. , :

init ;

DB-25;

(, - ,
);

.

. ,
,
.
, ,
.
( , 2, 3, 4, 5. 6, 8 20) ,
, Koi- .
,

. ,
, -,

2 3, 6 20.

7.15.

-
UNIX-.
, UNIX ,

, 8 , I.
,
.
, Zip-
, ,
, . UNIX, ,

USB (Universal Serial Bus )
,
. ,
. ,
, .

7.

137


, UNIX-.
UNIX , ,
UNIX,
,
Windows.

, , .
IEEF-1284.

EPP (Enhanced Parallel Port


) (Extended Capability
).
2 / . ,
DMA-. ,
JTO - .
DB-25,
36- Centronix. ,
DB-25,
Centronix. mini-Centronix,
IEEE-1284.
10 .
Windows,
, UNIX
. , Zip-
, .
, , Linux .
, UNIX
, ,
US
U S B
USB . Compaq. DEC, IBM. Intel, Microsoft, NEC
Northern Telecom. USB 1995 .
USB Windows,
USB-. , USB-.
USB . ,
UNIX .
:

127 :

USB- : ,
;

I.

;
,
;

12 /;

USB-
.
,
Hewlett-Packard USB:
USB- USB-.
Linux. ,
USB UNIX-.

.
, ,
, .
, .

.

, SCSI (Small Compuier Systems
Interface ; "").
IDE (Integrated Drive Electronics
)
. SCSI
IDE ,
,
.
, -
. .
, .
, .
,
.

1
I.

8.1.




. . , .
,
,
, ,
.

.

,
.
,
.
, ,
. ,
, .

SCSI
. , ;
.
IDE .
"", ,
. . . IDE-
, . ,
IDE
.

- ( Fibre Channel) ,
,
. - .
100 / . -
FC-AL (Fibre Channel Arbitrated
Loop - ) . -
,
(World Wide Name) - Ethernet.

USB
, .
,
CD-ROM.

8.

141

USB
.
SCSI IDF ,
.
S C S I
,
SCSI, SCSI
.
SCSI ,
.
SCSI- , ,
. SCSI
, .
SCSI ,
SCSI-3. , SCSI-1,
1986 . SASI
(Shugart Associates System Interface) ANSI.
SCSI-2 1990 . SCSI-1, . , ,
. -.
SCSI-2, "Fast" () ''Wide" (),
, ( 16 32, 8)". Wide SCSI
16- ,
8. ,
.
SCSI-3 .
,
,
Fibre Channel IFEE 1394 (FireWire)
SCSI- , . .
SCSI-3 ,
, Ultra SCSI
SCSI-3 SCSI-2,
:
. ,
.
SCSI- , . ("") SCSI-
.
32- SCSI . , .

- ,
.

126
I.

6 - SCSI-1 3 - SCSI-2.
Ultra SCSI 1,5 .

,
.

25- SCSI-2 12- Ultra SCSI.
, (
) .
,
, , .
,

. 8.1 SCSI
8.1. SCSI

()

()

(/)

SCSI 1

25

SCSI 2

25

Fast SCSI 2

10

10

25

Faa/widc SCSI-2

10

16

20

25
25

Ultra SCSI

20

20

1.5'

Wide Ultra SCSI 7

20

16

40

1,5'

25

Wide Ultra2 SCSI 2

40

16

80

25 ()4
12 ()

Wide Ultra! SCSI5

80

16

160

1
2

3
4

12 ()

, . .
Wide UUra SCSI Wide Ulira2 SCSI Fast-20 wide SCSI
Fasl-40 wide SCSI .
SCSI .
, .
SCSI ,
UUra2 SCSI.
Wide Ultra3 SCSI Ultra-160.

Ultra SCSI
Wide Ultra SCSI . 8-
1,5 ; 4
, 3- . Wide Ultra
SCSI 16- .
SCSI-
. , .

8.

143

SCSI- 50- ,
68-. 50- " " 68-
" - " , .
50- 68- . Apple 50 25,
, DB-25.
SCA (Single Connector Attachment
), ""
. 80- ,
, .
. .
Centronics
50-, SCSI-1/2,

so

1
Miir,.. m e t *i

==;
60

{.===)

()
50-. SCSI-1/2.

- (HD50)
50-. SCSI-2,
1

- (HD66)
68-, SCSI-2/3.
/

68

SCA-2
80-, SCSI-32,

. . SCSI
( ; , )
SCSI , SCSI-
. SCSI
, SCSI. ,
. -
, , SCSI- (
.
).
SCSI-
. ,
. ,
I SCSI I ".
.

I.

()
SCSI. ,
, .
, , , ,
. .
SCSI-1
("", ""),
( )
SCSI.
,
.
(
SCSI-, SCSI-).
SCSI-.
SCSI , ,
.

SCSI-.
.
SCSI-, " ",
, .
0 7 15, ,
, . SCSI- 7 (
, ).
.
, ,
.
SCSI- .
,
.
, ,
0.
,
.
,
DIP- . , ,
.
SCSI , " ".
.
SCSI-.
. " SCSI",
, ,
. SCSI- ,
0.
SCSI , . .

SCSI-.
,

8.

145

. ,
,
( , Hewlett-Packard) SCSI-.
, SCSI-
, SCSI-, . .
SCSI-, , .
? SCSI ,
SCSI- (
).
(
SCSI-) . ,
.
, .
, SCSI-, . ,
, SCSI-, ,
.
SCSI-2,
( ). ,
SCSI- .
, SCSI-
SCSI-!

IDE
IDE. ATA (AT Attachment - ).
.
. IDE- ,
. IDE
80- . -2,
- .
-2 (Programmed I/O -) DMA (Direct Memoty Access
), Plug and Play. ,
LBA (Logical Block Addressing
), ( BIOS-
)
1024 . - 540 . ,
- '
BIOS ,
1024
, BIOS-.
, BIOS

146

I.

.
,
LBA "--"'.

-3 , . -4
- Ultra
-3 -4 , Ultra DMA/33 Ultra DMA/66.
16 / 33 /
66 / . -4
-3 ATAPI (ATA Packet Interface
). ,
CD-ROM IDE.
IDE- .
-2 IS (45.72 ), -
.
, IDE
.
IDE
IDE- , ..
, ,
. ,
, ,
CD-ROM ,
. SCSI , , , IDE
IDE 40- ,
, . IDE-, Ultra DMA/66,
,
, ,

. I
1 ,
, ,
. .
IDE ,
, .
IDE- ,
. - ,
.
IDE-, .

IDE- , -
. ,
, .

SCSI , ,
, - . SCSI- UNIX

8.

143

,
.
, .
I OS- , ""
500 , . Internet,
BIOS.
.

,
. ,
.

: S C S I I D E ?
, ,
" ".
: SCSI . .
, SCSI IDE
, SCSI-
.
IDE- 85% SCSI-. IDE- SCSI-
.
SCSI-
.

,
SCSI. SCSI
IDE,
, IDE- SCSI-. ,
,

IDE.


SCSI-. SCSI
.
IDE- SCSI- .

, : SCSI.
SCSI- ,
IDE- .
,
SCSI. ,
"" , IDE-.

8.2.


,
, . .
, .

148

I.

, ,
.

.
(),

,
. ,
, .
, .

, , .
.
(12G ), -
280 10%
.
,
, .
,
, .
10 , , *
.
.
, -,

, .
, . .
.
.
3600 5400 /. 7200 /, 10000 15000 /
.
,
,
*

() , ( ,
..) 18 .

8.

149

.
.
.
''" . .
. 14 ,
5,25 , 3,5 .

. - ,
, . ,
512 .
, ,
, , ,
.
, .
, ,

UNIX
. , BSD
, ,
, , ,
. ,
.
"--", .

.

8.3.


:
;
,
;

UNIX ;

.
, , . 8.5
.


.
IDE-, ,
.

126
I.

"/"
SCSI-, , ,

.

12.
,
/dev . - (
), - (
). UNIX
SCSI-.
8.5.

,
.
( root)
operator.
dump .

-
. ,
, ,
.
, ""
! .
"**,
, .
20
2 . 1048576 , ,
5%.

. ,
"" , . (
SMD)
UNIX. SCSI-
,
, ".
, , ,
, ,
,
. /,
, ( SCSI-),
, , .
.

8.

151


. - ,
, .
IDE-, , . , ,
Windows, .
, ,
.
SCSI- ,
. .
BIOS-
SCSI Solaris format, HP-UX
mediainit.
,
, .
, , ,
. , ,
. ""
.



, .

, . ,
(,
)
(, ).
, .
,
,
, .
( )
, .
. ,
,
.
, ,

.
"" . ,
dd ,
,
.

. , 0, 1 2 , 3 4 .

126
I.

,
, .
.
,
.

. ,
. .

.
, .
.
25.3.

. , , ..
,
. .

,
, .

, .

,
.

,
. .

. 25.3.

, .
10.1.
, , , .

(/tmp). ,

.
,
. /var
,
.


" ",
.
,
, . ( ,
Veritas, HP-UX.)

, .

8.

153

.
. ,
.
.
RAID5,

. , ,

, . .
. , .
,
,
.
Veritas , Solans,
HP-UX. Sun
Solstice DiskSuiie. Vinum
, FreeBSD Veritas.
Linux RAID ,
, Linux LVM.

,
.

mkfs newfs. newfs. ,


mkfs. UNIX
, .
, }' (mkfs
newfs) .
.
.

(Berkeley Fast File System), (McKusick),
(Joy) (LefTler) 4.2BSD.
UNIX BSD
:

;
"";
;
;
.
, I
32 . , ,
. , .

126
I.

.
.
,
.
, UNIX , ,
. , ( )
. , UNIX
.

:
,
,
, 2048 .
, .
,
, ,
.

, ,
. :
.

feck
newfs -N.
32.
fsck 8.4.
UNIX
. sync
,
. ,
,
. sync, ,
.
sync 30 ,
.
.
.
,
.

UNIX-, . .
,
.
5.2. , ,

8.

155

, :
}' mount fsck ,
.

""
,
I mount / d a v / c d l a /mnt
/mnt , ,
/ d e v / s d l a ( ). ,
:
# 1 /mnt
lost+found
lost+found
. fsck ,
. lost+found , fsck " " ,

. mklost+fonnd,
, .
,
, df.
BSD-:
t df / u e r
Filesystem
l K - b l o c k s Used
Avail
C a p a c i t y Mounted o n
/dev/wdOslf
610495
509516
236140
68%
/mnt
, df, I
512 .
df - 1 .
H P - U X df -.
, bdf (" - d f ) .
.

. / e t c ,
, .
fstab ( "filesystem
table" ), H P - U X
checklist, Solaris vfstab.
fstab.
-.
fstab. ,
":

# Device
/dev/wdOslb
/dev/wdOsla
/dev/wdOslf
*

Mouncpoinc
none
/
/usr

FStype
swap
ufs
ufs

Options
sw
rw
rw

Dump P a s s #
0
0
11
2
2

FreeBSD. , Solaris,
.

I.

/dev/acdOc
/cclrora
proc
/
server:/export /server

cdS660
procfs
nfs

ro,noauto
rw
rw

0
0
0

0
0
0

, ,
.
, .
. fstab
.
N F S , . s e r v e r : / e x p o r t /export server.
NFS

17.


. ,
,
.
swa.p ,
( , Solaris
t m p f s ) .
,
.
-: Solaris FreeBSD u f s , H P - U X v x f s
h f s , Linux e x t 2 .
( rw
-, ).
"" .
, .
fsck.
. , , ,
-,
.
fsck

9.5.

fstab mount, urnount, swapon fsck,


.
mount urnount ,

. , fstab

mount /cdrom
:
# mount -t cd9660 - ro,noauto /d*v/cd0c /cdrom
mount - " " , fstab.
. -t (Red Hat FreeBSD) -F (Solaris
H P - U X )
. ,
# mount -at ue

8.

157

FreeBSD. mount
fstab . ,
,
. ,
/usr/local /usr, /usr
.
umount, ,
.
, -
.
(. 5.2).

UNIX
.
, , .
"" ,
,

*

( ).
,
.
,
.
25.J.
,
.
(,
, SCSI).
, ,
.
fstab
, .
" /dev/daCb

none

swap

sw

( , swapon swap),
, fstab.

8.5.

.
"*"- UNIX
25.3.
FreeBSD; .

126

I.

8.4.

fsck:

UNIX ,
. , ,
.
,
, ,
, . ,
,
. ,
, .
, !.
.
fsck
( "filesysiem consistency check" ).
, .
, ,
,
.
.
,
,
. .
, .
UFS
Solaris VXFS HP-UX.
HP-UX, ,
.
, fsck. :

, ;
;
, ;
, , ;
.
Fsck .
,
, .

fsck -. , fstab, .
,
, .
, fsck ,

.

8. 155

fsck - ,
:

fsck

/dav/radOg

fsck -, ,
fsck fstab, ,
, ,
.
.
, .
feck , ,
-.
.
, ,
. fsck -
. }
fsck -.
,
. , fsck :

, ;
, ;
;
;
, ;
.
, ,
.
.

( fsdb).
,
, .
,
.
,
, fsck.
, , , (
) !.
,
, . ;
, ,
.
,
feck , , .
. dump, ,
( ).

126
I.

dd,
.
fsck ,

ncheck. , fsck ,
clri (, , ).
fsck ,
, lost+found.
. , , ,
- , , lost+found,
, .

8.5.



, ,
UNIX- -.

: , ,
.
.
SCSI-
: (
/bkroot). ,
( /new).
Seagate ST446452W. Wide Ultra SCSI, 63 , 47 .
,
, .
, SCSI-
*. ,
,

Solaris
SPARC- Solaris
Intel ,
.
Veritas,
" H P - U X " , HP-UX
.

SCSI- probe-scsi 1 *

, .
,
, <N>. : "ok"

8.

161

, ,
rebooting...

, ,
. , , , ,
probe-scsi :
ok proi>-!
Target

Unit
Disk
ok boot -r

SEAGATE ST44 6452W

0001

- boot Solaris
,
. , dmesg ,
,
Solaris. ,
, .
s d 3 a t : t a r g e t 3 l u r
sd3 is /sbusfil,0/espdmafie, 8400000/espSe,0800000/sd@3, 0
WARNING: / s b u s @ l f , 0 / e s p d m a g e , 8 4 0 0 0 0 0 / e s p @ e , 8 6 0 0 0 0 0 / s d P 3 , 0 ( s d 3 ) :
c o r r u p t l a b e l - wrong magic number
Vendor 'SEAGATE', p r o d u c t 'ST44 6452W', 91923356
512 b y t e b l o c k s
- - /dev/dsk /dev/rdsk
:
/dev/[]dsk/cWtXdYsZ
, X SCSI-, Y
S C S I - ( 0). a Z .

/device, .
, /dev,
/device .
boot -
,
.
drvconfig disk (, ,
devrsadm). .
I drvconfig; disks
Solaris 2 .
.
S C S I - 3, , ,
/dev/rdsk/c0t3d0s2.

126

I.

format .
.
# format /dev/rdk/c0t3d0o2
/ d e v / r d s k / c 0 t 3 d 0 s 2 : c o n f i g u r e d w i t h c a p a c i t y o f 43.77GB
selecting /dev/rdsk/c0t3d0s2
[disk formatted]
FORMAT MENU:

, format ,
. ,
Solaris.
label format.
, :
f o r m a label
Ready t o l a b e l d i s k , c o n t i n u e ?
f o r m a t > partition
PARTITION

MENU:

p a r t i t i o n > print
Current p a r t i t i o n t a b l e ( d e f a u l t ) :
T o t a l c y l i n d e r s a v a i l a b l e : 9994+2 ( r e s e r v e d c y l i n d e r s )
Blocks
Part
Flag Cylinders
Size
Tag
wm
2b6336
0
root
0-28 130.05MB (29/0/0)
266336
1
swap
wu
29-57 130.05MB '29/0/0)
43.77GB 19994/0/0) 91784896
2
backup wu
0-9993
6

home

wm

58-9993

43.51GB

(9936/0/0) 91252224

,
,
home. root home
wm ( ), swap
wu ( ). ,
;
.
partition>
Part
Tag
Flag Cylinders
Size
Blocks
0
root
wm
0 - 2 8 130.05MB
(29/0/0)
266336
Enter
Enter
Enter
Enter

p a r t i t i o n i d t a g r o o t ] : root
p a r t i t i o n p e r m i s s i o n f l a g s [ w m ] : wm
new s t a r t i n g c y l [ 0 ] : 0
p a r t i t i o n s i z e [266336b, 2 9 c , 130.05mb r

0.13gb]:

2gb

,
, . ,
( , ,
),
. , label,
. :
partition> print
Current

partition

table

(unnamed):

Total c y l i n d e r s a v a i l a b l e :

9994+2

8.

(reserved cylinders)

163

Part

1
2
6

Tag
root
swap
backup
home

Flag
Hm
wu
wu
wm

partition> labal
Ready t o l a b e l d i s k ,

Cylinders
0456
457-2283
0 -9993
2284-9993

Size
2.00G8
8.00GB
4 3.HGB
33.16GB

Blocks
4197088
(451/0'0)
16179168
11827/0/0)
,9994/0/0)
91184896
10808640
(1110/0/0)

c o n t i n u e ? yes

format, quit :
,
:
partitlon> quit
forrr.at> q u i t

.
t newfs - 3600 /dov/ rdak/cC 13d0sG
newfs: c o n s t r u c t f i l e system / d e v / r d s k / c 0 t 3 d 0 s 0 : [y/n]?
/ d e v / r d s k / c 0 t 3 d 0 s 0 : 41970B8 s e c t o r s i n 457 c y l i n d e r s o f 2 8 t r a c k s ,
328 s e c t o r s
2049.4MB i n 4 2 c y l g r o u p s (11 c / g , 49.33MB/g, 8000 i / g )
s u p e r - b l o c k b a c k u p s ( f o r f s c k - F u f s - o b*=#> a t :
32, 101392, 202752, 304112, 405472, 506832, 608192. 709552,
810912, 912272, 1013632, 1114992, 1216352, 1317712, 14190^2.
1520432, 1621792.
fsck:
ft fsck /dev/rdak/c0t3d0s0
**
/dev/rdsk/c0t3d0s0
** P h a s e 1 - Check B l o c k s and S i z e s
** P h a s e 2 - Check Pathnames
** P h a s e 3 - Check C o n n e c t i v i t y
** P h a s e 4 - Check R e f e r e n c e C o u n t s
** P h a s e 5 - Check Cyl g r o u p s
2 f i l e s , 9 used, 2055846 f r e e (14 f r a g s , 256979 b l o c k s , 0.0% fragmentation)
newfs fsek 6.
.
, .
mount -
( /dev/dsk), - ( /dev/rdsk) .
Solaris
U F S ( ).
, ,
.
,
fsck .
, mount
- logging ( /etc/vfslab) fsck
,

. -
.

I.

, :
mkdir / b k r o o t
t m k d i r /new
f mount / d e v / d a k / t 3 d 0 0 / b k r o o t
t mount / d e v / d a k / c 0 t 3 d 0 6 /now
# df -k / b k r o o t
Filesystem
kbytes
used a v a i l
capacity
/ d e v / d s k / c C t 3 d C s O 2055855 9
1994171
1%

Mounted o n
/bkroot

df ,
.
swap -
1. swap -I
. :
t swap - / d v / d a k / c 0 t 3 d 0 a l
# swap -1
swapfile
dev

swapio

blocks

free

/dev/ask/cOt3d0sl

16

4194272

4194272

32,25

swap -I
. , ,
.
/etc/vfstab.
. Solaris
/ e l c / f s t a b .
-, - ( mount fsck ).
,
. y e s ,
.
, ,
. ,
.

#device
# t o mount.
/dev/dsk/cOt3dOsO
/aev/dsk/cOt3dOs6
/dev/dsk/c0t3d0sl

dev_ce
to fsck
/dev/rdsk/c0t3d0s0
Zdev/rdsk/c0t3d0s6
-

mount.
point
/bkroot
/new
-

FS
Type
ufs
ufs
swap

1
2
-

mount
at boot
yes
yes
no

/bkrooi 1
, .
tifsdump ufsrestore.
# cd / b k r o o t
# ufadump Ouf - / | u f s r e s t o r e - r f DUMP: Date of t h i s l e v e l 0 dump: Tue J u n

7 1 3 : 1 1 : 4 4 1994

bkroot
installboot,

, . ,

8.

165

. in.slallbool
,
I /usr/ebin/installboot /uer/lib/s/ufe/boctblk /dv/xdak/c0t3d0s0
,

. ,
/bkroot , .

HP-UX
H P - U X 10.20 Veritas
. H P - U X 11.00
VXFS. ,
, H P - U X pai-
. Veritas Solaris. Windows NT
.

, .
,
.
. .
U N I X
SCSI-. ,
.
. ,
dmesg ioscari. ioscan ,
, 3:
# ioecan - - disk
Class

H/W

Path

disk

8/16/5.3.0

disk

8/16/5.6.0

Driver

S/W S t a c e

Description

sdisk
CLAIMED
SEAGATE 5T446452W
/dev/dsk/c0t3d0 /dev/rdsk/c0t3d0
sdisk
CLAIMED
SEAGATE ST34573W
Zdev/dsk/c0t3d0 /dev/rask/c0t6d0

, , .
-, ,
. -,
, . , ,
. , ,
.
pvcreate .
,
/dev/dsk /dev/rdsk ( -
- ). insf
.
:
/dev/[]dsk/cItDdN{sP]

126

I.

I . D S C S I -
, N ( 0),
.
/dev/rdsk/c0t3d0 /dev/dsk/cOt3dO.

.
mediainit. ,
,
. .
pvcreate -
,
mkboot:
# /usr/sbin/pvcraato - /dav/rdsk/cOt3d0
Physical

volume

/dev/rdsk/cot3d0"

has

been

created.

# mkboot /dev/rdak/cOt3dO
,
vgcreale.
vgextend ,
.
,
( /dev/vgXX. XX ),
group

. OxNNOOOO,
NN 00
( m a x v g s ) .
14 (20 ).
12.

, .
,
.
v 4 . "File big" (
) " N o such device" ( ),
, -s vgcreale
8 .
47 16 .
I mkdir /dav/vgOl
# mknod /dev/vgOl/group 64 0x010000
# vgcreata -a 16 /dev/vgOl /dev/dak/c0t3d0
I n c r e a s e d t h e number o f p h y s i c a l e x t e n t s p e r p h y s i c a l volume
Volume g r o u p " / d e v / v g O l " h a s b e e n s u c c e s s f u l l y c r e a t e d .
Volume G r o u p c o n f i g u r a t i o n f o r / d e v / v g O l h a s b e e n s a v e d i n
/etc/lvmconf/vgOl.conf

to

2B05.

# vgdisplay /dav/vgOl
Volume g r o u p s
V G Name
VG W r i t e Access
VG S t a t u s

/dev/vgOl
read/write
available

167

,
, . Ivcreale
. -L ,
-I .
, ,
4 ,
vgcreate. , , ,
.

(] ) (1 ) ". vgdisplay.

/dev/vgXX/lvonN, , N
. ,
-. .
,
, , ,
. - -
Ivcrcate.
I lvcreate - - n -L 1024 /dev/vgol
L o g i c a l volume " / d e v / v g O l / l v o l l " h a s b e e n s u c c e s s f u l l y c r e a t e d
with c h a r a c t e r d e v i c e " / d e v / v g O l / r l v o l l " .
L o g i c a l volume " / d e v / v g O l / l v o l l " h a s been s u c c e s s f u l l y e x t e n d e d .
Volume Group c o n f i g u r a t i o n f o r / d e v / v g O l h a s been s a v e d i n
/etc/lvmconf/vgOl.conf
# lvcreate - -r n -L 1024 /dev/vgol
L o g i c a l volume , ' / d e v / v g 0 1 / l v o l 2 " h a s b e e n s u c c e s s f u l l y c r e a t e d
with c h a r a c t e r device " / d e v / v g 0 1 / r l v o ! 2 " .
# Ivcreate -1 2676 /dev/vgOl
L o g i c a l volume " / d e v / v g 0 l / l v o l 3 " h a s been s u c c e s s f u l l y c r e a t e d
with character device " / a e v / v g 0 1 / r l v o i 3 " .
Ivlnboot.
:
I Ivlnboot - /dev/vgOl/lvoll
Volume Group c o n f i g u r a t i o n f o r / a e v / v g O l h a s been s a v e d i n
/etc/lvmconf/vgCl.conf
# Ivlnboot -a /dev/vgOl/lvol2
Volume Group c o n f i g u r a t i o n f o r / d e v / v g O l h a s been s a v e d i n
/etc/lvmconf/vgOl.conf
.
Ivcreale. ,
Ivextend, .
,
HP-UX , ,
.
I , .
Ivlnboot.

168

I.

. Ivcreate ,
,
.
, ,
vgdisplay -v /dev/vgOl. ,
,
pvdisplay -v /dev/dsk/c0t3d0. pvdisplay
,
, .
newfs
.
/etc/default/fs. VXFS ( v x f s ) , ..
Veritas. ,
, , -F.
H F S ( h f s ) ,
F F S (
UNIX). H F S
; VXFS,
newfs - , :

t nowfu -V vxfe /dev/vgOl/lvoll


version 3 layout
1048576 s e c t o r s , 1048576 b l o c k s o f s i z e 1024, l o g s i z e
1024 b l o c k s
u n l i m i t e d m o d e s , 1048576 d a t a b l o c k s , 1047224 f r e e d a t a b l o c k s
3 2 a l l o c a t i o n u n i t s o f 32768 b l o c k s , 32768 d a t a b l o c k s
f i r s t allocation unit s t a r t s at block 0
overhead per a l l o c a t l o n u n i t is 0 blocks
# n*ws -ff vxfci / d e v / v g O l / l : l v o l 3
version 3 layout
43843584 s e c t o r s , 5480488 b l o c k s o f s i z e 8192,

l o g s i z e 256 b l o c k s

VXFS
( Solaris - logging),
fsck :
# fack /cUv/vg01/rlvoll
f i l e system is clean - lof replay is not required
. , mount
- .
,
bdr ( BSD- df, ).
ft rokdir /new
J mount / d a v / v g 0 l / l v o l 3 /new
# b d f /new
Filesystem
Kbytes
used
/dev/vgOl/lvol3
43843584 3616

avail
4349^480

%used
0%

Mounted on
/new

/etc/fstab,
/etc/checklist H P - U X 10 .
- , ,

8.

169

, ,
fsck. .
d e l a y l o g .

VXFS mount_vxfs.
:
/dev/vgOl/1vol1
Zdev/vg01/lvol3

/bkroot
/new

vxfs
vxfs

delaylog
delaylog

0
0

2
2

, ,
. swapon
- .
,
m a x s w a p c h u n k s .
swapon .
swapinfo,
.


# swapon / d e v / v g O l / l v o l 2
# swapinfo
Kb
Kb
Kb
TYPE
AVAIL
USED
FREE
dev
262144
0
262144
dev
1048576
0 1048576
reserve
- 50876
-50876

12.

START/
Kb
LIMIT RESERVE PRI
NAME
0
1 /dev/vg00/lvol2
0
1 /dev/vg01/lvol2

, .
/ e t c / f s t a b ,
.
/dev/vgOl/lvol2

swap

defaults

0 # swap device

,
/ e t c / f s t a b ,
.
Red Hat
, ,
, . I D E - , ,
BIOS,
" "
. ,
,
BIOS IDE-.
SCSI- BIOS,
.
S C S I - , ,
-
, , , ,
- , .

I.

BIOS- SCSI-

; . ,
.
SCSI- ,
, . SCSI-
, , .

12.8.

SCSI- BusLogtc :
s c s i O : Buslxjgic -948
BCSI : 1 h o s t .
V e n d o r : SEAGATE
M o d e l : ST446452W
Rev: 0001
Type:
Direct-Access
ANSI SCSI r e v i s i o n : 0 2
D e t e c t e d e c s x d i s k s d a a t BCSIO, c h a n n e l 0 , i d 3 , l u n 0
s c e i O : T a r g e t 3 : Queue Depth 2 , A s y n c h r o n o u s
SCSI d e v i c e s d a : hdwr s e c t o r - 5 1 2 b y t e s . S e c t o r s ~ 9 l 9 2 3 3 5 6 [44B84 MB]
s d a ; unknown p a r t i t i o n t a b l e

( 4 4 . 9 GB]

He ,
. ,
.
,
. Linux , SCSI-,
/dev/sdXN, X , fa" SCSI- , '
..*), N , 1.
. Linux - .
SCSI-. , / d e v / s d a l ,
: /dev/sda. ,
/dev/MAKEDEV# cd /dv
# ./MAKEDEV da
.
, Red Hat fdisk.
( ,
Microsoft), .
,
fdisk . .
I fdisk /dev/scLa
The number of cylinders for this disk LS set to 5721.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., LILO)
, SCSI-, . , .

8.

171

2) booting and partitioning software from other oSs


{e.g., DIS FDISK, OS/2 FDISK)
Linux,

8.2, ,
BIOS-
, .
fdisk , ,
. :

t ;

v/ .

, ,
. ,
d e l e t e fdisk.
, .

. , ..
. ,
:
Command (m f o r h e l p ) : new
Command a c t i o n
e
extended
p
primary partition (1-4): p
Partition number (1-4) : 1
First cylinder Cl-5721, default 1) : 1
Last cylinder or +eize or +sizeM or +sizeK (1-5721, default 5721): +2G
Command (m for help): print
Disk /dev/eda: 255 heads. 63 sectors, 5721 cylinders
Units - cylinders of 16065 * 512 bytes
Device Boot Start End
Blocks
Id
System
/dev/sdal
1 255
2048256
83
Linux
,
L i n u x , a Swap. ,

. Linux
2 , .
, - ,
, .
nikswap ,
.
Command ( for help): new
Command action
e
extended
p
primary partition (1-4): p
Partition number (1-4): 2

126
I.

First cylinder (256-5721, default 256): 256


Last cylinder or +size or +sizeM or +BizeK (256-1275, default 1275): 511
Command (m for
Partition type
Hex code (type
Changed system

help): type
(1-4): 2
L to list codes): 82
type of partition 2 tD 82 (Linux swap)

.
, :
Command (m f o r help): print
Do.sk /dev/sda: 255 heads, 63 sectors, 5721 cylinders
Onits - cylinders of 16065 * 512 bytes
Device
/dev/sdal
/dev/sda2
/dev/sda3

Boot

Start End
1 255
256 511
512 5721

Blocks
2048256
2056320
41849325

Id
03
82
83

System
Linux
Swap
Linux

,
.
, , ,

, :
Command (m for help): write
The partition table has been altered!
Calling ioctK) to re-read partition table.
SCSI device sda: hdwr sector-512 byres. Sectors-91923356 [44884 MB] [44.9 GB]
sda: sdal sda2 sda3
Syncing disks.

, ,
. , , Windows,
, .
.
Linux -
Extended 2 ( e x t 2 f s ) ,
( F F S Fast File System).
mke2fs. Linux ,
mkfs.
mkeZfs :
# 2 /dav/sdal 2048256
mke2fs 1.14, 9-Jan-1999 for EXT2 FS 0.5b, 95/08/09
Linux ext2 filesystern format
514000 inodes, 2048001 blocks
102412 blocks (5.00%) reserved for the super user
First data block=l
Block size-1024 (log-=0)
Fragment size-1024 (log=0)
250 block groups
8192 blocks per group, 8192 fragments per group
2056 inodes per group

173

Superblock backups stored or blocks:


8193, 16385, 24577. 32769, 40961, 49153, 57345, 65537,
Writing inode tables: 250/250 done
Writing superblocks and filesystem accounting information:
done
, .
, ,
rake2fs, , ,
. , ,
.
,

, fsck,
:
# feck -f /dev/sdal
Parallelizing fsck version 1.14 (9-Jan-1999)
e2fsck 1.14, 0-Jan-1999 for EXT2 FS 0.5b, 95/08/09
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sdel: 11/514000 files (0.0% non-contiguous), 67014/2048001 blocks
,
:
# mkdir /bkroot
# mount /dev/sdal /bkroot
> df -k /bkroot
Filesystem
Ik-blocks
Used
/dev/sdal
1981000
13

Available
1878575

Use%
0%

Mounted on
/bkroot


,
/etc/fstab. ,
, , , fsck.
/dev/sdal
/dev/sda3

/bkroot
/bkroot

ext2
ext2

defaults
defaults

0
0

2
2

,
LILO. lilo,
( .) /etc/lilo.conf
LILO 2.2.

.
rakswap,
.
fdisk (. ). , , .

126

I.

,
swapon. ,
.
# rakswap - /dev/sda2 2056320
Setting up swapspa.ce version 1, size = 2105667584 bytes
# swapon /dev/eda2
# swapon -s
Filename
Type
Size
Used
Priority
/dev/hda5
partition
133020
688
-1
/dev/sda2
partition
2056316
0
-2
, /etc/fstab.
.
:
/dev/sda2

swap

swap

defaults

,
/etc/fstab,
.
FreeBSD
47 FreeBSD
. disklabel
" space left on device" (
).
,
: Seagate ST32550W (SCSI-2, 2 ). , ,
, ,
, /stand/sysinstall
, . SCSI-
BIOS,
" "
. BIOS- SCSI
. ,
.
, , ,
:
daO at btO b u s 0 t a r g e t 3 l u n 0
daO: SEAGATE ST32550W SUN2.IG 0418> Fixed Direct Access SCSI-2 device
daO: 3.300MB/s transfers. Tagged Queueing Enabled
daO: 2048MB (4194995 512 bytes sectors: 255H 63S/T 261C)
FreeBSD .
,
BSD-. FreeBSD ,
,
, fdisk Red Hal Windows.
, ,

175

fdisk. ,
". , .
: /dev/daO /dev/rdaO. - - ;
. , '' *h' (.
/dev/daOa), BSD- FreeBSD.
/dev/[r]da0s[I-4J.

, , , ,
.
, (. )
fdisk.
. ,
.
, -
fdisk. -I:
# f d i a k -1 cUO
-i fdisk
FreeBSD 4. FreeBSD
, ,
( ). , , . ,
, fdisk
, .

fdisk.

f t f d i a k d*0
.**.*. working on device /dev/rdaO
parameters extracted from in-core disklabel are:
cylinders=261 heads=255 sectors/track=*63 (16065 blks/'cyl)
parameters to be used for BIOS calculations are:
cylinders-261 heads-255 sectors/track=63 (16065 blks/cyl)
Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
<UNUSED>
The data for partition 2 is:
<LTNUSED>
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
sysid 165,(FreeBSD/NetBSD/366BSD)
start 1, size 4192964 (2047 Meg), flag 80 (active)

, FreeBSD , , Solaris Intel-. Solaris ,


fdisk, , , Solaris,

176

beg: cyl 0/ sector 2/ head 0;


beg; cyl 260/ sector 63/ head 254
. BSD- (
) -
h. , b
, .
disklabel - -w. -
,
, ,
. -w :
( /etc/dlsktab).
auto, disklabel
, . :
# disklabel - -w daO auto
,
/etc/dlsktab.
, ,
disklabel -. ,
, vl. , , .

/etc/disktab, , , , .
. , , ,
( 4 . 2 B S D s w a p ) ,
, newfs.
1
. - /dev/rdaOc.
disklabel, FreeBSD.
:
# disklabel - - /dev/rdaOc
type: SCSI
disk: SEAGATE
sectors/track: 63
tracks/cylinder: 255
cylinders: 261
sectors/unit: 4194995
8 partitions:
#
size
offset
a: 2097153
0
b: 2097841 2097154
c: 4194995
0

fstype
4.2BSD
swap
4.2BSD

[fsize
1024

bsize
8192

1024

8192

bps/cpg]
16
16

newfs.
- ,
.
tf newfs /dev/rdaOa
/dev/rdaOa:
2097152 sectors in 512 cylinders of 1 cracks, 4096 sectors

8.

177

1024.0MB in 32 cyl groups (16 c/g, 32.0QMB/g, 7744 i/g)


super-block backups (for fsck -b #) at:
32, 65568, 131104, 196640, 262176, 327712, 393248,
458784, 524320, 589856, 655392, 720928, 786464, 852000,

fsck. - .
# fsck /d*v/rd*0e
"* /dev/rdaOa
** Last Mounted on /bkroot
w Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
1 files, 1 used, 1017070 free (14 frags, 127132 blocks, 0.0% fragmentation)
swapon
. s w a p . swapinfo,
pstat -s, ,
.
# ewapon /dev/daOb
# swapinfo
Device
lK-blocks
/dev/wdOslb
70784
/dev/da0b
1048920
Total
1119448

Used
Avail
0
70656
0 1048792
0 1119448

Capacity
0%
0%
0%

Type
Interleaved
Interleaved


,
/etc/fstab:
# Device
/dev/daOa
/dev/da0b

Mountpoint
/new
none

FStype

Options

Dump

Pass!

ufs
swap

fstab
mount -,
. , , .

126

I.

<L

. , addi^er
,
, .

! Perl.
, . , .
(, ), ,
"

:
UNIX

. .
,
\ .
sh, ,
, ".
cronlab ( "
table'" ). tab- .
,
crontab R
.
crontab-.
,
, .
: ,
,
.
.' .

9.

179

U I D , .
on tab ,
.
crniUah-. ,
,
.
( H U P )
tab-. ,
, crontab
.
"",
( , /var/cron/log
/var/adm/cron/log),
. ,
.
. ,
syslog.
; ,
- .
[71

syslog / / .
- (,
- , ),
, . ,
/ ,
.
. , " " .

9.2.

1-
- .
(#) . ,
, >
:

,
.
, , ,
. . 9 1 .
91 1-

0 59
0 23
1 31
1 12
0 6 (0 )

1
I.

, :

, ;

,
.

,
.
,
45 10 - * 1-5

"10 45 , ".
_ ,
. ,
. ,
,
. ,
,30 - 13 5
"
", " ".
,
sh. , . ,
. tab- , . /bin/su
^
-.
su 3.4.
crou (%)
:
.
-:
echo The time is now "aaze" > /dev/console
write garth * Hi Garth. * Remember to get a Job.
cd ,'ets; /bin/nail -s "Passwords file" evi < passwa
:
30

'

led /users/joe/project; make)

2:30 .
make /users/joe/project.
,
.
"" ".
20

find /tmp -atime -exec rm -f {V

To , . crontab root

9.

181

1:20.
/ t m p , 72
.
55

23

0-3,6

/staff/trent/bin/acct-script

acct -script 23:55 ,


.

9.3.

crontab-
crontab crontab
. crontab - cronteb- , (
E D I T O R ) ,
. crontab -I crontab-,
crontab - .
root
^, tab- . , crontab - jsmith
crontab-, jsmith. Red Hat FreeBSD,
, ,
- (,
crontab -u jsmith crontab.new).
He , crontab crontab .
, ,
< C t r l - D > , crontab- .
<CirI-C>.
crontab-.
,
: cron.allow .deny.
. /etc/cron.d, /usr/lib
usr/lib/cron /var/spool/cron. FreeBSD
/var/cron allow deny. . 9.2
, , .
cron.allow, ,
( ). ,
, crontab . cron.allow
, cron.deny. cron.allow.
, : ,
. ,
root tab-.
, crontab,
.
1-,
.

9.4.


, , , ,
crontsb- root .
crontab-,

126
I.

U N I X - tab- . ,
, .
: , .

U N I X - ,
. ,
, .
core,
(,
netscape.core core.7288)*.
,
.
,
N F S , .
N F S ,
,
.
.nfsxxx, xcv . .
, , .
NFS / 7
/ t m p / v a r / t m p
, .
, ,
, .
"" ,
, (, )
.
, ,
.
find.
find / -xdev -name core -atime +7 -exec rm -f (} ';'
.
. -xdev , find

, ,
NFS*".
,
(, /var ).
find / -xdev -atime +3 '(' -name "#*' - -name '.#*' - -name '*.CKP' - \
-name '
- -name '.nfs*' *)* -exec rm -f ' 1
"core" () "memory" ()
,
, .
-xdev find.
-.

9.

183

,
#. . * . r . f s
..
.
f i n d /var/preserve -mtime

- e x e c r:r. -f 1 .

/var/preserve
. vi
,
. ,
vi - _.
cd /trap; find . ! -name lost+found -type -mtiir.e +3 \
-exec // - t f i

/tmp. 72 .
/trap ,
.
lost+found.
. , /tmp .
lost+found 8 4
- ,
,



,
f/usr/lib/aiiases /etc/aliases)
rdist expect.
,
18.
. ,
, ne wa liases

, sendmail.
, NIS NIS+.

UNIX .

. .

-.

.
.
111.

134

9.5.



,
, . 9.2.
9 . 2 .

c r o n t a b -

0?0Tdtnyn0E

Solaris

/spool/cron/crontabs

/etc/cron.d

/var/cron/log

HP-UX

/var/spool/cron/crontabs

///

/var/adm/cron/log

Red Hat

/vsr/apool/cron

/etc

/var/log/cron

FreeBSD

/var/cron/tabs

/var/cron

syslog1

/var/croa/log.*.

Solaris,
/etc/default/croii. CF0NL0G=E5.
PATH,
.
Red H a t F r e e B S D ( P a u l Vixie)
Vixic-cron.
. ,
erontab- .
Vixic-cron crontab. , 0 , 3 , 6 , 9 / 1 2 , 1 5 , 1 8 , 2 1
: 0 - 2 1 / 3 .

9.

185

. , .
(, ,
) .
,
.
. , .
. .
.

( )
,
.
. ,
.

. ,
.
-
, ,
.
.
(
, ).
UNIX, ,

182 I.

.

UN IX- dump restore.

Amanda .

10.1.


,
.
( )
, ,
.

rdump .
,
. , , rdump (
rsh ssli) ,
.
( ), .
( , )
,

]

.
, . ,
(6 / ),
, rdump,
(
, )

dd,
rdump

.
.
. (, ).

, /usr
, .

, dump
, .

10.

187


. ,
, , trofT.

,
. , ,
.

.

,
,
.
. ,
,
.

, ,
, . -
(,
/etc/passwd), ,
.
Usenet
, ;
.
.
/tmp ,
. /tmp ,
. ,
,


.
, Dl AIT,
.
, ,
.
, , , .
10.
, .
40 240$,
.
,
.

184 I.

,
, :

,
;

.

.
, - .

. ( ,
: , ,
.)
,

dump
. , , ,
", ,

, .

,
.
" '' ,
. , ,
.
, . :
, **

(Dan Geer), , : "
?
" , !
. ,
, ,
. ,
, , .
, ,
" " .
( ) .
"".

10.

189

.
, .
,
.



,
dump. , ,
,
dump.
, , , .
.
.
( , F700
Network Appliance)
,
.
.
17.5.

,
.

.
1 ,


.
.
restore t,
,
. ,
, h o s t : u s r . J a n . 13.
,
.
grep
.
restore v. 10.4.
restore t
,
. ,
''.

restore t , . ,

126
I.


, , .
( ),
.

. , ,

, .
,
.
,
,
, ,
. - , -
. ?
? , ,

, 40 .

. ,
, . , ,
. , , ml fsf ( ),
.

,
. ,
, .
,
. :

?
?
,
?


?
,

. ,
.

10.

191



: . ,

( )
, .

10.2.

,


,
. ,
, , ,
.
, , .
,
Internet.

.
.
, .

,
. ,
, .
.
.
,
. , .
.
. .
.

, ,
.
. ,
,
, .

, .

, ,
.
, ,

126

188 I.

2:1 .
,
.

.
1 /, , .
2:1, 2 /.
, ""
.
,
.
,
.


. (
2.8 ). ,
.
; . ,
.

Zip- Iomega (www.iomega.com)

.
100 250 . . , , SCSI USB.
Imaiion SuperDisk,
,
120 .
,

,
.
- CD-R C D - R W

, . -
650 .
, : SCSI,
IDE. USB .
-
. , ,
- , . ( CD-R) ,
-.
, ,
.

10.

193

DVD- ,
. DVD- 10 .


. Casilewood Industries (wv.-w.casilewood.com)
Orb 2,2 .
EIDE, USB Ulira SCSI ( ).
Jaz Iomega,
2
8,7 /. ,
10 , Orb
: 5 .

. ,
.
,
.
8-
, 8- () . Exabyte,
, .
2 ,
7 .
.
(8 )
,
612
. .
8
.

,
. ,
.
4-
DAT (Digital Audio )
, 4-
. DAT-
DDS (Digital Data Storage
), .
2 , DDS
(DDS-4)
20 .
DAT-
(2,5 / DDS-4). \

94

I.

.

. 4
, . , DAT-
T r a v a n
QIC- (Quarter-Inch Cartridge ) Travan.
Travan
2,5 10 . ,

(3$/). ,
2 /.
UNIX
Travan
Hewlett-Packard, Tandberg Tecmar.
OnStream A D R
ADR (Advanced Digital Recording
) OnStream .
15 25 .
,
.
, 25
2 /.
OnStream ,
, .
, ADR-
, , .
DLT
DLT (Digital Linear
) ,
. -50
-70.
VAX DEC. DLT-
-70. Dec
Quantum,

DLT- 40 .
6 /. ,
20 30 . ,
? - - ,
?
DLT , 65$. - - , ,
, .

10.

195

AIT
AIT (Advanced Intelligent Tape
) 8- Sony. 1996 . Sony
Exabyte AIT-1,
,
.
; AIT-I ( ) AIT-2.
Sony AIT-3.
AlT- (Advanced Metal Evaporated ^ ), .
(-
), . . 1-2
6 /, 50
DLT-.
M a m m o t h
Mammoth Exabyte 8- . Exabyte
,
Sony. Sony . Sony
, ,
Exabyte .
Mammoth ,
Exabyte
. , , 1 %
Mammoth ,
. Mammoih-2
: 12 /. ,
.


,
,
20 .
, .
,
. , .
, .
.
,
.
, DAT, DLT AIT, -.

, ,
. , , Storage
Technologies Sony.

196

I.

,
.
,
"",
-. ,
, . ,
,
,
. Storage Technology.


,
.
,
, .
, N F S ,
.

. 10.1
.


SuperDisk
Zip 250
CD-R
CD-RW
Jaz
Ort>
Exabyte (8)
Travan
DDS-4 (4 )
ADR
DLT (0,5 )
A1T-2 (8 )
Mammoth-2

2,8
120
250
650
650
2
2,2
7
10
20
25
40
50
60

2
6
6
12

/
/
/
/

15$
200$
200$
200$
200$
350$
200$
1200$
200$
1000$
700$
4000$
3500$
3500$

0.25$
8$
15$
0.75$
2$
100$
40$
8$
34$
30$
40$
60$
95$
80$

91.43$
68.27$
61.44$
1.18$
3,15$
50,00$
18,18$
1.14$
3,14$
1.50$
1.60$
1.50$
1.90$
1.33$

< 100 /
1,1 / 1
900 /
2,4 /
2,4 /
7 4 /
12.2 / 2
1 /
1 /
2,5 /

.
S

v
I

<

10.1. ,

Hei

.
;
.

10.

197

(W. Curtis Presion) Internet


.
www.backupcentral.com/hardware-drives.html.

,
-
. , !
.
DAT Exabyte
,
,
. ,
.
ADR,
, ,
- .
DLT, AIT Mammoth-2 . - ,

.
: ,
.

"" ,
. , ,

10.3.



dump restore.
UNIX ,
.
dump restore
.

dump ,
,
, dump
,
:

198

;

( );
, ;

I.

""*;
(
].
dump ,
, ,
.
dump
"
.
.
, . : ,
NFS . ,

; rdump.
NFS 17.
dump . , ,
, .
,
.
(
0 9). N ,
,
, N.
. ,
,
"*.
mi dump ,
.
,
.
dump ,
. ,
, , .
-
, , .

"" , . , ,
, 1 ,
,
. , dbra ndbra.
" dump . ,
, , ,
.
"* dump , .

.

10.

199

dump ,
UNIX
, . ,
- 5 - - dump 1 a b c 5 10.
dump
. ,
, dump /etc/dumpdates.
dump
/etc/dumpdates ,
. ,
0,
.
, /etc/dumpdates .
dump . , .
, .
dump, .
, ,
(.. ,

)
, man-
(. 10.2)".
10.2. SCSI

Solaris

/dev/rmt/

/dev/rmt/oo

HP-UX

/dev/rmt/0m

/dev/rmt/

Red Hal

/dev/stO

/dev/nstO

FreeBSD

/dev/

/dev/nrsaO

,
. dump .
,
.

rdump. .
:
i rdump Ouf anchor:/dav/net0 /
.rliosts.
SSH ( 21.8").
dump ,
.
.
(, ..).

200

I.


dump, ,
.

,
(EOT End Of ), , ,
dump
, EOT ,
U N I X - . \ dump
-. ,
EOT,
. , 2300
( 70 ) 1600 bpi ( ),
9- 15- ,
. EOT.
.
dump, . ,
.
dump d s,
.
.
. .
, ,
/work DDS-1 (DAT),
1 ,
1.5 . DAT- EOT.
dump , . 4 .
60000 6250 bpi.
# dump 5ucdf 60000 6250 / d c v / r j t O / w o r k
DUMP: Date of this level 5 dump: . Kay 8 16:59:45 2000
DUMP: Date of last level 0 dump: the epoch
DUMP: Dumping /aev/hda2 (/work) to /dev/rstC
DUMP: mapping (Pass I) [regular files]
DUMP: mapping ( II) [directories]
DUMP: estirratea 942223 tape blocits or. 0.23 tape(s).
5usdr s (: 60000), d
(: 6250) f ( : /dev/rstO).
, (/work)
dump ,
. }
.
,
dump , . ,
. ,
.
Solaris dump : .
Sun ,
, " "

10.

201

dump, . "" dump /usr/sbin/ulsdump.


, ufsdump ,
dump. ,
ufsdump Ouf /dav/rmt/2 /dev/rdk/c0t3d0e5
5 SCSI- 3,
2.
, Linux dump restore,
. rpm (Red Hat Package
Manager Red Hat), .
Linux ,
/lib. FreeBSD, OpenBSD Net BSD
restore
, .

( ), ,
.
:

,
, , ,
, .
,
.
,

.

.

:

,
;

(
);

,
.

.


, .

202

I.

. , N
( N )

(365/N1 * ( )
.
. , ,
,

. ,
, ( ).


, ( )
. ,
% ,
.
,
. .
.
3, 5 9 .
I. 2 3,
,
.
,
.
, .

10.4.


,
. restore.
( ),
, .

, , . ,
.
, . , ,
HI- ,
, .
, ,
.
,
. ,
, ,
, .
, ,
, /var/restore.

10.

203

, cd_
restore , '
,
/tmp:
.
restore I,
, ,
.
,
.
restore i ,
, ,
Is, cd pwd. , , add.
,
extract
,
restore
mt. !
ml

10.7.

, /users/janet/iamlost FreeBSD

. , ,
tapehost:/dev/nstO. ,
janet, .
mkdir / v a r / r d C t o r u
# cd / v a r / r e s t o r e
# r s h c a p e h o s t mt -f / d e v / n s t O f s f 3
# r r a a t o r a if tepehont:/dev/netO
restore> la
janet/
garth/
lost+found/
lynda/
restore> cd janat
restOre> la
afile bfile fixe
lamiost
r e s c o r e > add l a m i o s t
restore I s "
afile bfile cfile
iamiost*
restore? extract
You h a v e n o t r e a d any volumes y e t .
U n l e s s you know which volume your f i l e s a r e on you s h o u l d
s t a r t w i t h t h e l a s t volume a n d work t o w a r d s t h e f i r s t .
S p e c i f y n e x t volume #: 1
s e c owner/mode f o r ' . ' ? [ y n ] : n
I. 0. ,
, I.
restore ,
7, , ,

"

ssh .
lamiost , .

204

I.

) . ,

restore ,
janet:
# cd / v a r / r e s t o r e
# la u s e r s / j a n e t
jLatrlost
I la - j a n e t
afile oflie cfile
# cp -p u s e r s / j a n e t / i a m l o s t - j a n e t / i a m l o s t . r e s t o r e d
# chown j a n e t - j a n e t / l a m l o s t . r e s t o r e d
# chgrp s t u d e n t ~ j a n e t / l a m l o s t . r e s t o r e d
I rm - r f / v a r / r e s t o r e
# mall j a n e t
Your f i l e i a m l o s t h a s b e e n r e s t o r e d a s r e q u e s t e d and h a s
been p l a c e d i n / u s e r s / j a n e t / i a j r l o s t . r e s t o r e d .
Your Name, Hurctole System Admj.niscr.ator

, .
, .
, " "
rdump
restore ,
rreslorc.
,
.
restore 1
:
,
( 8-
) JTO , ,
restore .
( )
.
:

i
#
#
I

mkdir / v a r / r e s t o r e
cd / v a r / r e s t o r e
r s h t a p e h o s t rot -f / d e v / n s t O ffsf 3
r r e a t o r e xf t a p e h o s t : / d e v / n s t O / u s e r s / j a n e t / i a m l o s t


,
, , .
, , ,
, .
,
.
>
. , 8.

10.

205

cd
,
restore .
restore ,

,
. , ,
, .
:
#

1: .

2: , ;
, .
3: , ,
2.

. , :
0 0 0 0 0 0
0 5 5 5 5
0 3 2 5 4 5
0 9 9 5 9 9 3 9 9 5 9 9
0 3 5 9 3 5 9
. ,
3,
(. " " ),
/home,
/dev/dsk/c201d6s0, ( ncwfs ):
#
I
#
/*
#
/*
/*

/tc/newfs /d*v/dsk/c201d6a0 QDANTOM_PD1050S


/etc/mount /dev/dek/c201d6s0 /home
cd /home

rectora
,
restore
*/
3

teetore

/home

*/

*/

,
restore ml
. mt
10.7
, ,
, : " "
. ,
. , restore
*

, dump restore .
, Solaris Linux.

206

I.

10.5.


,

, .
,
.
,
.
, ,
, .
- ,
/ /usr. /etc/passwd, /etc/shadow, /usr/local
.. ,
, UNIX,
, , ,


. ,
.
,
. , ,
, ,
.

10.6.


, dump ,
tar. dd
t a r
tar
, .
, . , ,
,
tar ,

tar. ,
,

root ( tar
). ,
tar cf - _ I ( cd ; tar xfp - )
.
, '*.." ,

10.

207

,
. - .
tar
, .
,
.
tar , .
, , ,
tar . tar
, .
, .
, tar,
, 100 .

.
,
( GNU- tar), ,
tar ".
b tar (-),
.
512- ,

. DAT- , ;
.
-
.
.
. , - 20.
tar .
cpio:
System V
cpio
tar.
. .

f i n d _ - d e p t h - p r i n t

cpio -pdm _

.
tar, cpio
. , root.
,
.

GN U- .
tar ,
.

208

I.

dd:
dd .
- .
, UNIX, dd
.
dd
. :
newfs ,
dump restore. dd,
,

.

. newfs 8.
' dd
. ( , /dev/rmt8
/dev/rmt9)
%

dd

if~/dv/rmtfi

of-/dv/rmt9

-1

(/dev/rmt8), :
% dd i l / d e v / r m t 8 o f - t f i l a -1
/* "/
%

dd

i f s t f i l a

t f i l e

of-t/cUv/rmtfi

16

, ,
.
dd
QIC-,
. , Sun Ur-, SGI,

dd

lf/dav/rst8

convawab

tar

xf


volcopy:
volcopy
, .
Solaris, HP-UX Linux.

.

10.7.


.
,
UNIX-
. dump -

1 0 .

2 0 9

,
, (end of
file, EOF). .

E O F .

mt.
(, ). ,
U N I X .
:
rat l~f

_)

rew
offl

status
tsf []

bsf []

.
.
.
,
.

( ..).
. ,
. ,
.

, .
.
, .
( ).
, rew
.

,
.

10.8.

[]

_ (
, -
).
H P - U X - -t.
.
, ,
.

mt.

Amanda
A m a n d a (Advanced Maryland Automatic Network Disk Archiver
) ,
, .

. A m a n d a U N I X -
.
Amanda (James da Silva)
1991 .

210

I.

.

www.amanda.com.
Amanda , ,
.
dump restore,
gnu tar smbiar Samba,
NT-.
Amanda ,
.

compress gap,
.
. Amanda ,
. ,
, , ,
(
, , Amanda).
Amanda
. 1500 .
Amanda
.

Amanda .
. Amanda
,
, .
Amanda , vpoBHB 0.
.
.
Amanda , ,
,
( , ,
) .
.
Amanda
Amanda ,
. , , , .
,
,
. , ,
,
.
( 75 ) .

10.

211


Ha
Amanda 2.4.1 pi.
.
Internet Amanda, ,
.
, .
, README, docs/SYS . N O T E S docs/INSTALL. - . INSTALL
.
configure, configure
help, .
,
Amanda. ,
,
dump , chgrp

, Amanda .
configure make make install, .
Amanda .
N F S
, ,
(, , Amanda
).
, - /usr/local.
, ,
. .
amandad
selfcheck

seudbackup
sendsize

;

, Amanda,
: ,
jprip, /etc/dumpdates
..


. /etc/inetd.eonf /etc/services
Amanda.
, ,
, Amanda.
, /etc/dumpcheck.
, amcheck.
.
, metd.conf (,
Amanda
"amanda"):
amanda d g r a n

212

udp w a i t

araanda / u s r / l o c a l / s b i n / a m a n d a d amandad

I.

, .
,
inetd.conf tcpd, (Wietse
Venema); 21.7.
, /etc/services:
amanda

10080/udp

Amanda. , . Amanda
.
amdump
amfluuh
nmcleanup
amrestore
arolabel
amadmln
amcheck
sintape
amplot

;


,

Amanda
Amanda ;
,


, ,


Amanda (,
)


amanda.eonf disklist.
,
, .
.

amanda.eonf

amanda.eonf ,
: , , .
. Amanda,
.
,
.
, ,
Amanda, ,
, ,

##############*###############*################*####*##########
*

##*#*!###### #*####
org

"Podunk Univ."

10.

213

m a i l t o "araanda"
dumpuser "araanda"

f
# ,
#

runtapes 1

#
#
t
$
t
#

tpchanger "cbg-manual"
tapedev "/dev/rmt/Obn"

,
amdump

( Amanda)

( )

l a b e l s t r " " P o d u n k - [ 0 - 9 ] [ 0 - 9 ] *S"

t ,
# ;
#

i n f o f i l e "/usr/adm/amanda/podunk/curinfo"
l o g d i r "/usr/adm/amanda/podunk"
i n d e x d i r **/usr/adm/amanda/podunk/index"

#
#
#

A m a n d a ,
,
l a b e l s t r . ,
amlabel ,
. .
.
,
,
.
Podunk-01, Podunk-02 ..
,
, .
.
( , 0
, ..)
amanda.conf:
#
f#####t#t#############l###*#t#lt###############*#t ##*###### ##H##t
dumpcycle 4 weeks
bumpdays 2
b u r a p s i z e 20 Mb
bumpmult 2
r u n s p e r c y c l e 20
tapecycle 25 tapes

#
#
t
#
#
f
#
#

#
#
#
#
#

214



()
1 2
= b u n t p s i z e * bumprault' 4 ( l e v e l - 1 )
amdump ;
2 0 - 4 * 5
( )

2 5 - 4 * 5
( )
,
a m f l u s h ,

I.

Amanda .
,
. Amanda
,
. Amanda

. .
,
.
, ,
, . Amanda
, .
Amanda , .
, r u n s p e r c y c l e .
,
, - .
, , ,
'"",
Amanda). ,
.
.
t a p e c y c l e , . ,
, ,
.
,
.
,
, Amanda
. ,
bunipsize aniadniin.
,
(,
podunk):
| amadmin podunk buinpeize
C u r r e n t bump p a r a m e t e r s :
b u m p s i z e 204BO KB
- minimum s a v i n g s ( t h r e s h o l d ) bump l e v e l 1 -> 2
bumpdays 2
- minimum d a y s at e a c h l e v e l
bumpmult 2
- threshold = bumpsize * (level-1)""bumpmult

Bump
1
2
3
4
5
6
7
8

2
3
4
5
-> 6
-> 7
- >8
-> 9
->
->
->
->
- >

Threshold
20480 KB
40960 KB
81920 KB
163840 KB
327680 KB
65360 KB
1310720 KB
2621440 KB

0 Amanda 1.
1- 20 ,

10.

215

2. 40 .
Amanda 3 ..
,
.
,
.
amanda.conf , ,
, ,
, .
Iff
N # t t # ##### ################# #########*
#
it*#####t#**#mttt#t#t t4t#t#H*t#*i***tt*t#Ht***#ttt*ttH
t a p e t y p e -500
inparallel 4
n e t u s a g e 60C
e t i m e o u t 300

#
t
#
#
It

(. )
,

Amanda
, ,

holdingdisk hdl {
comment "main h o l d i n g d i s k "
d i r e c t o r y "/dumps/amanda"
u s e 8196 Mb

#
#
#

d e f i n e t a p e t y p e -8500 (
comment " E x a b y t e -8500 d r i v e o n d e c e n t m a c h i n e "
l e n g t h 4200 m b y t e s
f i l e m a r k 48 kbytes
s p e e d 474 k b y t e s

]
Amanda Exabyte 8500.
.
amanda.conf.
Amanda, docs/TAPETYPES

hit P://WVAV.cs.columbia.edu/~sdossick/arnanda
, Amanda. , tapetype. .
,
32 . :
(I 2 )!
, ,
(, , , )
.
.

216

I.

. :
########**##*#######!#############*##*##########################
#

**t#*####m*#*tt

#**#*##*########*#*##**

d e f i n e dumptype comp-uaer {
comment " p a r t i t i o n s o n r e a s o n a b l y
compress c l i e n t f a s t
p r i o r i t y medium

fast

machines"

)
d e f i n e dumptype c o m p - r o o t (
comment " r o o t p a r t i t i o n s
compress c l i e n t f a s t
p r i o r i t y low

on

reasonably

fast

machines"

1
d e f i n e dumptype nocomp-user (
comment " p a r t i t i o n s o n s l o w
compress none
p r i o r i t y medium

machines"

}
d e f i n e dumptype c l o n e - u s e r {
comment " p a r t i t i o n s which
compress c l i e n t f a s t
skip-incr
p r i o r i t y medium

should

only

get

incrementals"

that

are

always

1
d e f i n e dumptype comp-high-samba f
comment " u s e d f o r NT s y s t e m s "
p r o g r a m "GNUTAR"
compress server f a s t

1
d e f i n e dumptype d o s - u s e r
comment " u s e d f o r d o s
p r o g r a m "GNUTAR"
compress c l i e n t f a s t

(
partitions

mounted"

I
Amanda.
,
. c o m m e n t
, .
c o m p r e s s ,
: , .
(, coniprcss gzip) Amanda.
: .one, c l i e n t b e s t ,
c l i e n t f a s t , s e r v e r b e s t s e r v e r f a s t .
c l i e n t f a s t .
b e s t f a s t ,
. gzip: best fast.

10.

217

f a s t .
b e s t , .
h o l d i n g d i s k : y e s . ,
.
, .
y e s .
max d u m p s ,
. I.
, ,
.
p n . o r i . t y , .
l o w , m e d i u m h i g h .
. ,
.
Amanda
. ,
.
.
. (,
/usr/local), ,
.
p r o g r a m ,
: dump gnutar. ,
.
s k i p - f u l l Amanda 0. ,
Amanda
s k i p - i A m a n d a
.
, .

disklist

amanda.conf . ,
, .
disklist.
, amanda.conf.
#*#### ##*##*# #H*##*#H*#t4t*m###mff##*imr*tr#
#


If
#!#### ################ # # ##*###** *##### t H ######### #####*####
f t
ocean
sdOa
ocean
sdOg
ocean
sdOd
ocean
sdOh

comp-root
comp-user
comp-user
comp-high

t
I
t
#

/
/usr
/var
/amanda

# NT- l o r i e n ,
# Samba o c e a n
ocean
//lorien/c$
comp-high-samba
# c:\
#
squish

218

ycOtOdOsO

comp-high

I.

squish
squish
squish

ycCtOdCsfi
yc0t0d0s3
yc0t0d0s7

comp-high
comp-high
comp-high

#
#
*

t
zambonl
zamboni
zamboni
zamboni

cOtOdOsO
C0t0d0s6
c0c0d0s3
C0t0d0s7

clone-user
clone-user
comp-root
comp-user

t /
t /us X
I /var
# /local

#
fuzz
sdla
fuzz
sdlf
fuzz
sdle
uzz
sdld
/dos
fuzz

nocorap-high
nocomp-high
nocomp-high
nocomp-high
dos-user

/usr
/var
/local

/
t
t
I

/local
/usr
/var
* /dos

,
.
. , .
, (ocean)
disklist. ,
, Amanda.
, ,
holdirgdisk.
s k i p - m c r ( c l o n e - u s e r )
-.
-,
.
, ,
.
, (,
/etc), 0. / zamboai
, .
smbtar Samba,
Windows NT
lorien.
, disklist ocean, lorien.
Samba,
Amanda NT-, a UNIX-, smbtar. ( /dos fuzz ,

Samba.) Amanda Samba
( /usr /dos) :
Samba .
Samba 26.

Amanda .
amdBinp.n,

10.

19

A m a n d a .
, , Amanda. log .,
, an , .

Amanda
.
,
.
( ,
disklist, ):
: amanda@ocean
Subject: Podunk, Univ. AMANDA MAIL REPORT FOR September 1, 1999
These dumps were to tape Podunk-481
Tonight's dumps should go onto 1 tape: Podunk-482.
FAILURE AND STRANGE DUMP SUMMARY:
fuzz
sdla
lev 0
FAILED
[no estimate or historical data]
taper: FATAL syncpipe_get: w: unexpected EOF
STATISTICS:

Total

Full

Daily

Dump Time (hrs:min)


Output Size (meg)
Original Size (meg)
Avg Compressed Size (%>
Tape Used (%)
Filesystems Dumped
Avg Dump Rate (k/s)
Avg Tp Write Rate (k/s)

3:02
2954.6
7428.1
39.
70.5
16
105.3
1254.2

0:36
2666.8
6292.5
42.4
63.5
8
124.5
1251.

(0:34 start. 1:49 idle)


0:04
287.
1135.5
25.3
(level:disks ...)
7.0
(1:8 2:2)
10
43.4
1276.9

NOTES

planner: Adding new disk zamboni:c0t0d0s7.


driver: WARNING: /dumps/amanda: 8550400 KB requested, but only
1035113 KB available,
planner: Forcing full dump of squishy:cOtOdOsO as directed,
planner: Request to fuzz timed out.
planner: Incremental of ocean:sd0h bumped to level 2.
driver: going into degraded mode because of tape error.
,
Amanda . ,

(
fuzz). Amanda
. ,
amflush.

220

I.


, .
amanda.conf
/tnip/amanda, Amanda
--with-debugging ( ).
. amdump.:
SETTING

UP

FOR E S T I M A T E S . . .

dumper: Did 1B199 executable dumper version 2.4.lpl, using port 791
driver: started dumpersetup_estitrates: ocean:sdOd: command 0, options:
last_level 1 next_levelO 6 level_days 16
getting estimates 0 (20023) 1 (2735) -1 (-1)
zamboni:cOtOdOsO lev 1 skipped due to skip-incr flag
planner: SKIPPED zamboni cOtOdOsO 1 [skip-incr]
GETTING ESTIMATES...
got results for host ocean disk sdCa: 0 -> 53797K, 1 -> 1797K, -1 -> -IK
got results foe host ocean disk sdOd; 0 -> 19695K, 1 -> 2696K, -1 -> -IK
ANALYZING ESTIMATES...
pondering ocean:sdOd... next_levelO 6 last_level 1 (not due for a
full dump, picking an incr level)
log. 19990901.0.
START planner date 19990901
START driver date 19990901
INFO planner Adding new disk depot:dsk/dl.
SUCCESS planner zamboni cOtOdOsO 1 [skipped: skip-mcr]
WARNING driver WARNING: /dumps/amanda: 8550400 KB requested, but only
1035113 KB available.
START taper datestamp 19990901 label Podunk-481 tape 0
FAIL planner fuzz sdla 0 [no estimate or historical data]
STATS driver startup time 2019.4 56
SUCCESS dumper ocean sdOa 0 [sec 418.311 kb 25088 kps 59.97 orig-kb 58087]
SUCCESS dumper ocean sdOd 1 [sec 15.867 kb B00 kps 50.42 orig-kb 2719]
SUCCESS taper ocean sdOa 0 [sec 53.366 kb 25088 kps 474.612 (wr: writes 2
rdwalt 0.000 wrwait 0.032 filemark 38.332)]
SUCCESS taper ocean sdOd 1 [sec 6.345 kb 800 kps 133.3 {wr: writes 1
rdwalt 1.470 wrwait 0.356 filemark 2.637}]
STRANGE dumper ocean sdOh 1 [sec 82.435 kb 33.4 0.4 orig-kb 155.0]
eendbackup: start [ocean:sd0h level 1 datestamp 19990901]
I DUMP: Date of this level 1 dump: Wed Sep 01 23:47:54 1999
I DUMP: Date of last level 0 dump: Mon Aug 30 23:43:23 1999
I DUMP: Dumping /dev/rsdOh (/amanda) to standard output
| DUMP: mapping (Pass I) [regular files]
I DUMP: mapping (Pass II) [directories]
? DUMP: {This should not happen) bread from /dev/rsdOh [block 64] :
count-8192, g o t 1
I DUMP: estimated 38 blocks (19KB) on 0.00 tape (si.
I DUMP: dumping (Pass III) [directories]

10.

221

I DUMP: dumping (Pass IV) [regular files]


I DUMP: level I dump on Wed Sep 01 23:47:54 1999
I DUMP: 310 blocks (155KB) on 1 volume
I DUMP: DUMP IS DONE
sendbackup: size 15B720
sendbackup: end
SUCCESS d u m p e r ,
, SUCCESS t a p e r
. STRANGE d u m p e r , Amanda
dump. Amanda
( , , ),
.
, Amanda,



Amanda. /tmp/amanda
Amanda
.
Amanda ,
sendsize.
dump , .
, Amanda [ e s t i m a t e ] .
sendsize.debug:
sendsize: getting size via dump for c0t0d0s3 level 1
sendsize: running "/usr/ccs/bin/dump lsf 100000 - /dev/dsx/c0t0d0s3"
DUMP: Date of this level 1 dump: Wed Sep 01 21:59:36 1999
DUMP: Date of last level 0 dump: Mon aug 30 05:08:33 1999
DUMP: Dumping /dev/dsk/c0t0d0s3 (/var) to standard output
DUMP: mapping (Pass I) [regular files]
DUMP: mapping (Pass II} [directories]
DUMP: mapping (Pass II) [directories]
DUMP: mapping (Pass IIJ [directories]
DUMP: estimated 7150 blocks on 0.00 tape(s).
DUMP: mapping (Pass III) [directories]
calculating for amname 'cOtOdOsO', dirname '/local'
sendsize: getting size via dump for c0t0d0s7 level 0
sendsize: running "/usr/ccs/bin/dump Oaf 100000 - /dev/dsk/c0t0d0s7"
DUMP: Cannot open/stat /dev/rdsk/c0t0d0s7f Permission denied
(no size line match in above dump output)
,
/dev/rdsk/c0t0d0s7.

Amanda,
Amanda :
http://www.egroups.com/list/amanda-users
http://www.egroups.com/list/amanda-hackers

222

I.


Amanda amadmin amrestore .
, ,
.
. :

, ;

, .

, ,
. ,
/local zamboni;
5- 12- . amadmin
, :
% amidmin podunk f i n d
date
heat
2000- 01 -26
zamboni
2000- 01 - 2 5
zamboni
20C0- 01 - 2 3
zamboni
zamboni
2000- 01 -22

zajaboni cC 0dOs7
V
tape
disk
c0t0d0s7
Podunk- 795
C0t0d0s7
Podunk 794
c0t0d0s7
Podunk- 792
cCtGd0s7
Podunk- 791

file
33
41
9
32

status
OK
OK
OK
OK

1999- 10 - 1 3
1999 10 -12
1999- 10 - 1 1
1999- 10 -10
1999- 10 - 0 9
1999- 10 -08
1999- 10 -07
1999- 10 - 0 6
1999- 10 - 0 5
1999- 10 -04
1999- 10 - 0 3
1999- 10 -02
1999- 10 -01
1999- 09 -JO
1999- 09 -24
1999- 09 - 2 6

C0t0d0s7
c0t0d0s7
c0t0d0s7
c0t0d03?
c0tCd0s7
C0t0d0s7
C0t0d0a7
c0t0d0s7
c0t0d0s7
C0t0d0s7
cOtOdCs7
c0t0d0s7
c0t0d0s7
c0t0d0s7
C0t0d0s7
c0t0dCs7

38
37
39
72
44
88
35
33
33
51
16
19
36
15
78
99

OK
OK
OK
OK
OK
OK
OK
OK
OK
OK
OK
OK
OK
OK
OK
OK

zamboni
zamboni
zamboni
zamboni
zamboni
zamboni
zamboni
zamboni
zamboni
zamboni
zamboni
zamboni
zamboni
zamboni
zamboni
zamboni

Podunk- 685
Podunk- 684
Podunk- 663
Podunk- 682
podunk- 681
Podunk- 680
Podunk- 518
Podunk- 517
Podunk- 516
Podunk- 515
Podunk- 514
Podunk- 513
Podunk- 512
Podunk- 511
Podunk- 510
Podunk- 509

find amadmin , amanda.conf,


, . , Podunk-509
Podunk-683 1,
. I ,
,
5- 12- .
,
!
amrestore,
. Podunk-509.

10.

223

.

% anraator* - /dev/rmt/Obn zamboni c0t0d07 | restore if . amrestore ,
,
, restore.
, 10.4.
0, I
amrestore ,
A m a n d a
32 , ,
. ,
.
,
, .
amadmin , ,
amrestore
. mt fsf,
, amrestore.
restore , . Amanda

.
Amanda , , .
amrestore? :
, dd. ,
. ,
, , 0:
mt - /dev/nut/ taf 99
dd if-/dev/nnt/Obn bs32k count-1
AMANDA : FILE 19990928 zamboni cOtOdOsl l e v 0 comp . g z
T o r e s t o r e , p o s i t i o n t a p e a t s t a r t o f f i l e and r u n :
dd l f - < t a p e > bs32k s k i p - 1 I g z c a t I r e s t o r e . . . f 1+0 r e c o r d s i n
1+0 r e c o r d s o u t
:

Internet
. :

224

B U R T ,
Tcl/Tk 8.0.

CD Backup Linux ,
- C D - R .

hostdump.sh .

I.

10.9.

Backup ,
.
star tar
, , .
.


, UNIX
, . , .
,
.
Windows
Macintosh , UNIX.

, .
,
. ,
coniniand.com ?
Amanda ,
.

, .
.
ADSKVTSM
IBM
Tivoli. Tivoli Storage Manager (TSM
Tivoli)
, . Web- www.iivoIi.com.
:

IBM;

-, ;

Windows;

( ).
:

1 ;

.
Veritas
Veritas
. Web- www.veritas.com.

10.

225

;
;
Network Appliance;
UNIX;
gnutar;
,
.
:
,
DHCP- (,
);
;
NT-.

Legato
Legato
Legato, , Compaq. Web- www.legalo.com.
:

.
;

, 100;

(
);

.

,
, O'Reilly,
Web-, (
, , ..).
, .
www.backupcentral.com
.

10.10.

226

Presion. Curtis W. Unix Backup and Recovery. O'Reilly. 1999.

I.


Syslog

, ,
, . .
. " " . \ , , . ,
.

11.1.


.
;

.

;

(
);


.
,
. ,
,
.

.
9.

.
. ,

11. Syslog

227


. ,
, .
,

,
. ,
.

, ,
. , , , , ,
-
,
"" , .

,
,
. ,
. ,
,
grep.

(/var/!og) .
,
gzip.

.
: ,
.. ,
. , ,
logfile,
logfile.l, logfilc.2 ..
, logfile.7. Iogfile.8
logfile.7 ,
logfile.6.
, ,
.
:
H/bin/sh
cd / v a r / l o g
mv l o g f i l e . 2 l o g f i l e . 3
mv l o g f i l e . l l o g f i l e . 2
.w logfile logfile.l
cat /cev/null > logfile
chmod 600 l o g f i l e

228


. ,

1 ^

,
root, chown.

, , logfile.tues logfHe.aug26_
, ,

. :
mv l o g f i l e l o g f i l e . ' d a t e +%Y.%m.%d"
Is
.
.
-
:
logfile,
. ( - )
,

. (
) ,
. ,
, .
,
:
tI//sh
cd / v a r / l o g
mv l o g f i l e . 2 . g z l o g f i l e . 3 . g z
mv l o g f i l e . 1 . g z l o g f i l e . 2 . g z
mv l o g f i l e l o g f i l e . 1
cat /dev/null > l o g f i l e
kill
- pid
gzip l o g f i l e . 1
gzip logfile. 1,
gz.
, ; pid
. ,
:
(, /etc/syslog.pid: . ),
ps
( skill, (Albert Cahalan).
killall, (Werner Almesberger);
Red Hat), ps-grcp-kill*
-
, ,
, (
).
,
. ^ .

: Solaris HP-UX killalj,


. ,
pkill.

11. Syslog

229


11.4.
. 1- roU, (Matt Segur) (Michael Bernstein). Web- www.admin.com.



, ,

,
.
.

. ,

, .
tar
[]

10.

11.2.


UNIX .
, , , ,
maillog.
ftp.log - IpNet, Ipd-errs consolejog.
, ,
.
,
''" , - . , ,
.
,
(/etc/rc*, /etc/rc.d/* /elc/init.d/*) ,
.
Syslog.
11.5. /etc/syslog.conf Syslog, ,
.
syslog.conf U.S.
. 11.1
. , , :

, -
;

, ;

. ;

, ;

tpynna, ;

230

I.

11.1.

fc

TT


messages

JTO

syslog

shutdownlog

shutdown

shutdown

sulog

su

su

authlog

SIT

mqucuc/svslog sendmail

fip.lQg

ftpd

FTP-

galedlog

gated

cs1


acct

BSD ( )

pacci

System V ( )

wimp4

login

( )

Ipacct

Ipd

BSD

Ipd-cns

Ipd

BSD

aculog

tip. uucp

fd21og

runacct

System V

news/news

innd

ncws/*Iog

ruirpd

majordomo.
log

Majordomo

sudc.lpg

sudo

sudo

tcp.log

tepd

XOmsgs

xll

1-1

X Windows

xdm-cnore

xdm

httpd/* log

httpd

Wcb-

"" ( ): S = Syslog, = , F =
, = .
"" ( ): D = , W = .
- .
"" ( ). R - root/system. U = uucp/daeinoii, N =
news/news, D = daemon/daemon.
passwd, login shutdown .
2.1 ;
Syslog.
wtmpx.

11. Syslog

231

; 11.4. .
/var/adm /var/log.
( ""
, ,
).
"" , : S
Syslog, ; F
, .
,
Syslog. .
"" .
644.
640 600.
. sulog, autlilog sudo.log 600.
mqueue/syslog paccl.

11.3.

,

" ". ,
: /var/adm/lusllog /etc/utmp lastlog
' .
, .
, ,
root,
0. nobody, -2 (65534).
lastlog, .

[7|


10.3.
utmp ,
. , -
,
. utmp
.

11 .



,
. Syslog
.
, .
Solaris . ,
/var/log. .
:

/var/log/*

24 I

/var/cron/log
/var/lp/logs/*
/var/saf/_log
/var/saf/zsmon/log
/var/adm/{messages, aculog. sulog, vold.log. wtmpx}
/var/adm/log/asppp.log
.
. , Solaris 2.4
,
.

11.5.

13.8.

/usr/lib/newsyslog, ,
/var/adm/messages /var/log/syslog.
HP-UX /var/adm.
, ,
. nettl.LOGOO
;
man nettl. ,
Syslog, /var/adm/syslog
Red Hat

/var/log. , iogrotatc
.
/etc/logrotale.d ,
. Red Hat
!
FreeBSD .
/var/log.
/var/cron. !
/var/account. newsyslog
.
/etc/newsyslog.conf.
, FreeBSD ,
periodic, ,
/etc/periodic. ,
newsyslog -
.

: Syslog
Syslog ,
(Eric All man).
,
Syslog "
.
Syslog , ,
.

11. Syslog

233

. (" "
Syslog)
: ,
.
.
Syslog :

syslogd , ( /elc/syslog.conf);

openlogO, syslogO, closelogO ,


syslogd;

logger , .
syslogd
. , Syslog,
(
syslogO) /dev/log ( /var/run/Iog), ,
, ,
. syslogd ,

. , ,
/dev/klog.
"" (HUP. 1) syslogd
,
. syslog.conf, }'
syslogd HUP, . TERM
.
syslogd (PID)
/var/run/syslog.pid ( /ctc/sys!og.pid).
. ,
:
% kill -HOP '/bin/cat /var/run/syslog.pid"
,
syslogd
. (
/usr/lib/newsysiog),
*. , row.
Web- www.admin.com.
syslogd
syslogd /eic/syslog.conf.
. !,
(#), .
**:
<Tab>

( ) newsvslog
FreeBSD.
syslog ,
.

234

I.

,
mail.info

/var/log/maillog

, ,
/var/log/maillog.
;
,
.
.
(""
Syslog), ,
. :
.

; .
, ,
. "user"
(.. ).
MOOT # , "" "".
, .
.
;
, ,
, .
,
.
:
.
1,2.
! . ! ; ?.. 2
.
*.:_.

. 11.2 .
Syslog 18 ( 21).
.
syslogd ,
, syslog.conf
"mark". ,
: " ", " 3:00 3:20 ".
, . ,
,
, ,
.
,
. ,
.

. 11.3.

11. Syslog

235

11.2. SysloQ

kern

user

( , )

mail

sendmall

daemon

auth

Ipr

BSD

news

Usenei

uucp

UUCP,

cron

mark

localO-7

syslog1

syslogd

authpriv'

( )

ftpl

FTP- ftpd

, "mark*1

8.1 .

11.3. Syslog

eraeiB

alert

crii

err

warning

notice

info

debug

. syslog.eonf
,
, . ,
"warning"
m a i l . w a r n i n g , m a i l . n o t i c e , m a i l , i n f o , m a i l . d e b u g , * . w a r n i n g , * . n o t i c e , * . i n f o * . d e b u g . syslog.eonf
, m a i l . i n f o ,
m a i l . w a r n i n g .
, .
. 11.4.

236

I.

11 .. Syslog

syslogd

&]_

IP-

},
2,

, ,
. ;
syslogd . IP-, ,
,
D N S NIS.
[|


18.3.

I-

Syslog 4

, , . , 4 ,
.
, 4
auth.notice

lfdef('LOGHOST',

'/var/log/authlog',

"@loghost*}

,
. /var/log/authlog,
LOGHOST.
l o g h o s t . i f a e f 4
.
syslog.eonf, .

, .
(,
),
Syslog Red Hat
Red Hat syslogd.

syslog.eonf.
syslog.conf
'=' ' ! ' , " " "
" (. 11.5).

11. Syslog

237

11.5. syslog.conf
Red Hot

mail, info

"info"

mail.=info

"info"

mail-info;mail.!err


"notice" "warning"

m a i l . d e b u g ; m a i l . ! =warning

,
"warning"

"info",

Red syslogd .
-, .
: ,
, . -h
. ( , ,
/etc/rc.d/init.d/syslog.)
Red Hat , klogd,
Syslog.
.

Syslog F r e e B S D
Red Hat, FreeBSD
syslog.conf (. 11.6).
. 6 . syslog.conf
FreeBSD

mail.info

"info"

mail.>=ino

mail.info

"info"

mail.<=info

"info"

mail-<info

"info"

mail.>info

"info"

, FreeBSD
,
, - . , syslogd ,
,
. ,
named: s t a r t i n g , named 4 . 9 . 1 S a t Sep

2 0 9 : 3 9 : 1 2 GMT 1998 PHNE_146l8

named syslog.conf
, ,

238

I.

,
, :
!named
*.*

/var/log/named.log

syslogd named
/var/log/named.log.

.
, .
syslogd FreeBSD - .

IP- (, - 1 2 8 . 1 3 8 . 1 9 2 . 0 . 2 0 )
(, - * . c s . c o l o r a d o . e d u ) .
, -ss
syslogd .
syslogd
/ete/.,
. ;
syslogd_lags=,'-a

128.138.192.G/20 - * .cs .colorado.edu"

syslog.conf,
, , -

netloghost"

:
t s y s l o g . c o n f
#
*.emerg
fi
*.warning; daemon,auth.i nfo,user.none
It
lpr.debug


*
/var/adm/messages
/var/adm/lpd-errs

.
, shutdown
.

/var/adm/messages. "info" "warning"
d a e m o n , a u t h . i n f o

, netloghost . .
/etc/hosts CNAME
DNS. 16.11.

11. Syslog

2 3 9

passwd, su .
/var/adm/lpd-errs.

- .
s y s l o g . e o n f
#
#
*. ecnerg; u s e r . n o n e
*
#

.warning;lpr,locall.none
Snecloghosc
daemon,auth.info
@netioghost
#
localO,112,117.debug
Gnetloghost
# c a r d d l o c a l l
# b o u l d e r
local1.debug
@boulder.Colorado.edu
#
lpr.debug
/var/adm/lpd-errs
# s u d o
# " l o c a l 2 "
ioca!2.info
/var/adm/sudolog
#
kern, i n f o
/var/adx/kern.log
.
, netloghost ,
.
.
, ,
"user" "emerg".
u s e r .
.

;
.
-

boulder.

sudo.
sudo 3.4.

240


netloghost
, 400500 .
# s y s l o g . c o n f
#
# ,
t
*.emerg
/aev/console
" . e r r ; k e r n , : k . d e b u g r a u t h . n o t i c e
/dev/console
# . e r r ; k e r n , mark., d e b u g ; u s e r . none
/var/adm/console . log
auth. no nice
/var/adn: ' c o n s o l e , log
It , ,
#
# .err,-user .none; kern.debug
/var/adm/reessages
daemon,auth.notice;mail.crit
/var/adm/messages
lpr.debug
/var/adm/lpd-errs
mail.debug
/var/adm/mail.log
#
# , '-' s u d o npasswd
ioca!2.deDug
/var/adm/sudo.log
112.alern
/var/adm/sudo-errs.log
auth.info
/var/adm/auth.log
f
locaiO.info
local4.notice
local.debug
local7.debug

/var/adm/netbiazer.log
/var/adm/da.log
/var/adm/annex-isn.log
/var/adm/tcp.log

#
user.info

/var/adm/user.log

,
syslogd , .

.

.
. , , ,
.
Syslog
,

.
.
Dec 18 15:12:42 a v l . c s . c o l o r a d o . e d u sbatchri[495]: sbacchct/maxn: l s _ i n f o { )
f a i l e d : LIM i s down; c r y l a t e r ; c r y i n g . . .
Dec 18 15:14:28 p r o x y - l . c s . c o l o r a d o . e d u pop-proxy[27283]: Connection from

11. Syslog

241

128.138.198.84
Dec 18 15:14:30 mroe.cs.colorado.edu pingem[271]: raalteseoffice.cs.colorado.edu has not answered 42 times
Dec 18 15:15:05 schwarz.cs.colorado.edu vmunix: Multiple softerrors: Seen 10Q
Corrected Softerrors from SIMM J0201
Dec 18 15:15:05 schwarz.cs.colorado.edu vmunix: AFSR - 0x4c21, AFARO
0x8"? ffdd30, AFAR1 = oxbBfBaO
Dec 18 15:15:48 proxy-l.cs.colorado.edu pop-proxyf27285]: Connection from
12.2.209.183
Dec 18 15:15:50 avl8.cs.colorado.edu last message repeated 100 times
,
(avl8. proxy-1. mroe schwarz} , sbaichd,
pop-proxy, pin gem vmunix (). ,
, 100 .
, Syslog
.
, ,
,
.
avl8.
.
. , ,
.
, swatch,
(. 11.6).


, .
Syslog. syslog.eonf
.
.

,
- .
, ;
, .
, , , Syslog
, - . , Syslog U D P ,
, .

syslogd.
- , ,
.
,
. ,

242

I.

syslog.eonf. ,
.

pacnpedcjieiiuu

18-


,
Syslog -
. - -, ,
, .
, Syslog
. 11.7 ,
Syslog, , ,
.
11.7. , Syslog

amd

daemon

-info

NFS

date

auih

notice

ftpd

daemon

crr-debug

FTP

gated

daemon

alert-info

halt/reboot

auth

crit

inetd

daemon

err, warning

Internet

login/riogind

aulh

crit-info

lpd

lpr

-info

BSD

named

daemon

-info

(DNS)

nnrpd

news

crii-noiice

INN

otpd

daemon,
user

cril-info

passwd

auth

err

popper

localO

notice, debug


Macintosh

sendmall

mail

alert-debug

su

auth

crit, notice

sudo

loca!2

alert, notice

su

syslogd

syslog, mark

-info

,
.

tepd

loca|7

en-debug

- inetd

cron,
daemon

info

vmunix

kern

Ha , syslog.eonf 4,

11. Syslog

2 4 3

, , .
, , .
. ,
.
,

Syslog
logger .
shell-. ,
syslogd. ,

locals.warning

/tmp/evi.log

, ,
% logger - 115.warning "test message"
, "lest message" ( ),
/tmp/evi.log. , ,
, syslogd
.
syslogd NLOGS-
,
. 20.
, syslogd
, ,
M A X U N A M E S I
20). ,
.
syslogd -d ("debug", .. )
, , syslog.conf.
,
. :

0 0 0 0 0 0 0 0 0 0 0 0 X WALL:
4 6 6 4 FILE:
/adm/msgs
FILE: /adm/lperr
D 0 0 0 0 0 tl 0 0 UNUSED:
0 0 (1 0 (1 0 0 0 0 0 0 UNUSED:

, .
; .
UNUSED ,
N L O G S .
, , .
syslog.conf
logger. UNUSED ,
.
, /dev/console.
VT100 - <C.lrl-S>,

244

I.

. Syslog ,
.

logger. , -,
<Ctrl-Q>
,
""
, .
Syslog
openlogO. svslogO closelogO Syslog.
Perl. Perl-. ,
:
use Sys::Syslog;
openlog() ,
:
openlog(,

);


, .
openlogQ ,
, ,
"user".
. 11.8.
11.8. openlogQ

pid

delay

syslogd ( ,
)

cons

, syslogd

nowait

wait() ,
fork()

, openlogO :
openlog("adminscripc",

"pid,cons",

"daemon");

syslogO
:
syslog(,

syslogd.

...) ;

, ,
, openlogO.

11. Syslog

245

,
printf(). :
s y s l o q ( " i n f o " , " D e l i v e r y t o '%s'
$user, $nAttempts);

failed after

attempts.",

%m, ,
(
U N I X ) .
"^"
. openiogO
, syslogO ,
UNIX, :
adminscript:

User "nobody" n o t found i n / e t c / p a s s w d f i l e .

,
. (
) openiogO . , ,
( openiogO),
.
closelogO .
closelog ();
,
. closelogO ""
.
:
use

Sys::Syslog;

openlog("adminscript",
"pid,cons",
"user");
s y s l o g ( " i n f o " , " T h o s e whom t h e g o d s w o u l d d e s t r o y ,
teach
Basic")
closelog();

chey

first

:
Dec 28 2 2 : 5 6 : 2 4 m o e t . c o l o r a d o . e d u a d m i n s c r i p t [ 1 9 1 ] : Those whom t h e gods
would d e s t r o y , t h e y f i r s t t e a c h B a s i c .

11 6.


Syslog
,
. ,
- .
.
,
:
,
.
.

.

246

I.


swatch " (Todd Atkins) logcheck
(Craig Rowland).
fip://ftp.stanford.edu/general/securily-ioo!s/sv/alcl"i/
Web-
hnp://www.psionic.com/abaciis/logcheck
swatch Perl-, , . JTOTO
, Perl
. swatch
, ,
. ,
, , .
,
.
logcheck sit.
,
logcheck .

.
, .
logcheck
UNIX. ,
,
.
.
Syslog
, -
, ,
. , ,
.
,
, , ,
.

, , . . su sudo,
, . -
( ),

.


. ,
,
.

11. Syslog

247

UNIX- :
;
;
.

.
,
.
,
UNIX:

( ,
);

(, ,
);

(, , );

( ).
,
;
.
.
64 /ete/passwd.
, " 3348
3" ,
.

24

,
.
U N I X (
).
, , 400
15 .

12.1.


UNIX- \'
, .
.
Solaris
.
, , Sun
( ). ,
, .
.
Solaris, H P - U X
. ,
.
FreeBSD BSD-
, .
, .
,
:
" Fihemet-?"
Linux Solaris BSD-.
I- BSD, Linux ,
.
Linux ,
,
. , Solaris,
. Linux
, Solaris,
.
. 12.1 ,
,
.
12.1.

Solaris

/kcrnel/unix

HP-UX

/stand

/stand/vmunix

Linux

/usr/erc/linux

/vmlinuz /boot/vmlinuz

FreeBSD

/usr/sre/sys

/kernel

12.

249

12.2.


,
.
.
, :
, ,
. [ ,
,
, .

, , .
, .
,
, (.. ).
; .

, .. .
,
.

[\/|

12-8.
,
,
,
.
. ,
- .

12.3.

Solaris
Solaris

.
, (
).
Solans
.
Solaris \ 100%
. , (
Solaris)
.
, ,
Solaris , -

,
Solaris . ,

250

I.

,
:

/kernel ,
;

/ I a I fo m / _ am / kc el ,
, Ultra Enteiprise;

/platform/__/\\ , ,
"sun4u";
/usr/kernel /kernel.


uname -i unamc - .
% uname

SIJKW, U l t . r a - E n t e r p r i s e
" uname -m
sun4u
Solaris , :
' p l a t f o r m / / k e r n e l : / k e r n e l : / u s r / k e r n e l
. nnix,
genunix. -
.

{. 12.2). . K E R N E L ,

12.2. /KERNEL Soloris

arv

trisc

CpL

UltraSPARC

sirrjoa

STREAMS

64-

is

exec

sched

sys

qenunix

LiIllX

1-

,
.
conf KERNEL/drv.

12.

251

.
, .
/etc/system
/etc/system Solans
. , ,
. 12.3.
s e t .
12.3. , /etc/system

root fs

rootdev

forceload

(""),

exclude

moddir

set

(, maxusers)

maxusers

pt_cnt

max n p r o c

maxuprc

D , V .
/etc/system ,
,
. boot -
, ( ,
, /dev/null).
/etc/system
/etc/system :
roctfs:ufs
rootdev:/sbus@l,f8000000/e5p@G,800000/sde3, 0:a
,
U F S ( U N I X File System UNIX)
sd3a. , ,
, , Sun. ,
/dev.
tnodair: / p l a c f o r m / S U N W , U l t r a - E n i : e r p r i s e / k e r n e l : / p l a t C o r r c / s u n 4 u / k e r n e l :
/kernel:/usr/kernel
( ,
) .

252

I.

kernel, ,
.
exclude:
sys/shmsys
forceload:
drv/superplotter


, (
, ).
"".
set

maxusers=64


64- .

Solaris ,
. ,
,
.
priconf ,
, . ,
. ,
(, ), ,
.
sysdef prtconf.
,
. ,
sysdef
.
\
modinfo. Solaris
, STREAMS.
, modinfo
. 12.11.

12.4.

HP-UX
HP-UX :
.
. , SAM .
.
: ,
. ,
"Process new kernel"
.
, ,
,
SAM.

12.

253

, ' ,
. ,
X-
, .
H P - U X
/stand/system.
; system.example. system
SAM,
. ,
. SAM.
.
, .
system.example ,
, . , .
.
GSCtoPCI
asioG
730
sdisk
sctl
cdfs
rfs_core
STRMSGSZ 65535
dump lvol
nstcpty 60
,
SAM. ,
. . 12.4
.
12.4. system HP-UX

254

maxfi.les_li.itt

1024

maxusers

60

maxup

75

nproc

276

nfile

910

nflocks

200

ninode

476

npty

60

nstrtel

60

telnet

nkthread

499

I.

system.example
mk kernel.
/stand/system /stand/vmunix.test.
-s ,
-
:
* mk_kernel - / s t a n d / s y s t e m , e x a m p l e - / s t a n d / v m u n i x - example
. ,
, /stand/vmunix
- .

12.5.

Linux
Linux
,
.
/usr/src/linux/.config. ,
, .
Linux make-,
X Windows,
make xconlig. ,
, (
).
make
menuconllg, curses". ,
make conllg.

. .
,
. , ,
.
.config,
:
* A u t o m a t i c a l l y g e n e r a t e d make c o n f i g : don't e d i t
*
# Code m a t u r i t y l e v e l o p t i o n s
#
CONFIG_EXPERIMENTAL=y

S Processor type ana f e a t u r e s

# CONFIG_M3 S J.S no seL


# CONFIG_M486 i s n o t s e t
# CONrIG_M586 is n o t s e c
If ON F IG_M 5 8 oTSC is n o t s e t
CONFIG_M686=y
CON FIG_X8 6_WP_WORKS_OK-y

curses ,
.

I 12.

CONFIG_X86_INVLPG=y
COMF1G_X8 6_BSWAP=y
CONFIG_X8 6_POPAD_GK
CONFIG_X8 6_TSC=y
CONFIG__X86_GOOD_APIC=y
, ;
, CONFIG. ,
CONFIG .
.
; m ,
.
. config
, ""
. - CONFIG.
Config.in,
. ,
make xconfig make menuconfig.
,
,
,
Ethernet-.
LILO Linux.
/etc/lilo.conf, a p p e n d ;
2.2.
lilo.conf (-
),
LILO. , LILO
:
LILO: linux root/dev/hdal ether=0,0,th0 ethr=0,0,ethl
LILO , "linux",
/dev/hdal
Ethernet-.
Linux
.config
Linux, ,
. :

256

cd /usr/src/Hnux;

make xconfig make menuconfig;

make dep;

make clean;

make bzlmage;

make modules;

make modules_install;


/boot/vmlinuz;

/usr/src/linux/arch/i386/boot/bzImage

I.

/etc/Iilo.eonf
;

/sbin/, .
make clean , . ,
,
.

, .config

/. .
U N I X , " " \ .

. ,
, . ,
(
), ,
, .
, ,
, :
k e c h o 3276 / p r o c / r f y e / f s / f i l e - m & x

,
. : . . echo . . 12.5
.
12.5. /,

^

file-max

4096

inode-

16384

ip_forward

IP. 1

lcmp_echo_ixnorejRll

1-

ping, 1

icmp_echo_lgnore broadcasts


ping, 1

F /proc/sys/fs, N - /proc/sys/net/ipv-4.

12.

257

12.6.

FreeBSD
,
FreeBSD, Net BSD,
Open BSD B S D / O S .
BSD- ,
. ,
, .
,
.
FreeBSD, .
config ,
. ,
.
, BSD-,
/ n s r / s r c / s y s ,
/sys.
SYS, ,
. ,
.
Is -F SYS:
# lfl -F
Makefile
alpha/
boot/
cam/
coda/
compile/
conf/
contrib/

ddb/
dev/
gnu/
1386/
14b/
isa/
isofs/
kern/

libkern/
mescfs/
modules/
msdosfs/
net/
netatalk/
netatra/
netgraph/

netxnet/
netipx/
netkey/
netnatm/
netrns/
nfs/
ntfs/
pc98/

pccard/
pci/
posix4/
sys/
ufs/
vm/

1386 , :
* l a - 1386
Maxefile
boot/
apm/
conf/

eisa/
i386/

ibcs2/
include/

isa/
linux/

S Y S
S M S / / c o n ,
. ,
Intel i386. FreeBSD
Alpha. config

S\'S//

SYS/compile///A07 _.
, ,
G E N E R I C .
S Y S / i 3 8 6 / c o n f / G E N E R I C .
SYS/compile/GENERJC.
SYS ,
.
BSD- .

258

I.

:
;

SYS/i386/conf;
config conf:
make depend ;
make;
;
:
.


, , .
, , :

, CD-ROM, ;




.
"[heniei-" . ,
. ,
, .
,
. ,
.
dmesg.
SYS/i386/conf/LlNT.
SYS/i386/conf
, ,
, config.
SYS/i386/conf .
, ,
, SYS, ,
.
.
GENERIC , .
- , ,
config. man, .
,
, - de :
SYNOPSIS

device de

12.

259

, ,
. (,
, . man-,
.
man -.)

, ,
12.7.
config
config
SYS/1386/conf,
, .
- .
.
, SYS/1386/conf/EXAtVlPLE.
:
# cd SYS/1386/conf
config EXAMPLE
config ,
, . ,
, ,
.
m a k e d e p e n d
config ]
(cd ../../compIIe/EXAMPLE) Is.
. :
config , .
make depend make.


, make.

make, ,
, .
tee,
make ,
:
# make |& tee ERRS.LOG
& .
, .
Bourne shell
:
fr make 2>l I tee ERRS.LOG

260

I.

,
.
, , , -
.
,
.

, , - .
,
. /vmunix.
.
FreeBSD /kernel.
,
/kernel /kernel.works.
.
2.

/kernel ,
,
. /kernel ,
.

, , , .
.
Is
. ,
ping,
, .

,
> 5YS/i386/conf/ ,
-. ,
.
, SYS/cotnpile/
.
, :
config.

12.7

BSD-
tad S^ S/i386/conf BSD-;
.
5,
. ,
, .

12. ]

261

( # ) , ,
. .
.

, .
, . ,
, .
, ,
. . ,
,
. ,

.
.
, . 12.6.
12.6. , BSD-

machine

ident

maxusers

options

config

controller

disk

tape

device

pseudo-device

maxusers
m a x u s e r s
. ,
, (
U N I X ).

,
. N F S , m a x u s e r s
-. ,
,
.
m a x u s e r s
, ,

262

I.

-. >| . , :
= 20 +

I6*maxusers

, 18 .
options
o p t i o n s ,
,
.
, , (
# i f d e f f l i f n d e f ) . o p t i o n s ,
. .
, , N F S :
o p t i o n s NFS
, FreeBSD , ,
. , ISO-9660,
-, :
options "CDS660"
,

, ,

:
options

-""

, MAXDSIZ (
,
) :
options MAX0SIZ="(64*1024*1024) "
MAXDSIZ 64 .
.
- .
.
INET

.
,
. loop (
). INET
. .

FFS

.
, ,
"" .

NFS

NFS. ,
NFS.

12.

263

GATEWAY

,

Internet.
:
,
, ,
.

config
c o n f i g
.
. I
. .
, /ctc/felab.

.
fstab 8.3.
,
,
, ( ) . , ,
,
(/etc/rc*) swap on.
c o n f i g :
config

root

on

, . FreeBSD kernel,
,
(, da kernel]
.
. I D E - wdO. SCSI daO.
c o n f i g :
c o n f i g k e r n e l r o o t on wdO

.
, ,
.
,
, ,
. .

- ,

, ,
.

264

I.

, , , ,
. 4
BSD-. - ,
, ,
.
.
, , ,

, , ,

:

at
1 _ I i r q

port

.
munjyanpoucmea, , .
, c o n t r o l l e r d i s k . d e v i c e .
u\tx_ycmpoucmea (,
) . ,
ID - wricO. , 4 ,
* . ,
,
.
,
. , ,
.
. ,
ISA. IDE-
I D E - , :
controller
rsaO
controller
disk

wricO
wdcO

a t i s a ? p o r t "ZOJWDl" b i o i r q 1 4
at wdcO d r i v e 0

,
, , .
, IDE- wdcO
i s a O i s a l , i s a ? .
, p o r t , , . ,
, .
,
.
ISA EISA. PCI-
, .

12.

265

(IRQ),
. ,
ISA EISA, a PCI- .
.
.
man- .
ISA- NE200. :
d e v i c e edO aL i s a ? p o r t i r q 10
, edO
ISA 0x360. 10
.
Ethernet-, PCI:
d e v i c e deO
PC! .

. - ,
.
, I D E
IDE-
C D - R O M . .
pseudo-device
,
,
. "",
, ,
, .
p s e u d o - d e v i c e :
pseudo-device

_-1

,
_ , ,
.
.
,
.
.
, . , ,
, .

266

I.

pty

:
PTY .
,
- UNIX-.
, ssh, xterm. telnet
rlogin. ,
(, script),
.

loop

loop ,
(
).
, ,
. , INET.

14.

-
, EXAMPLE:
machine
cpu

"1386"
"T386_CPU"

cpu

"I4B6JCPU"

cpu
cpu
ident
maxusers

"I5B6CPU"
"I686_CPU"
EXAMPLE
32

,
Intel PC
. EXAMPLE.
32 532
.
options
options
options
options

INET
"CD9660"
FFS
NFS

*
tf

I n t e r n e t : TCP/IP
I S O 9 6 6 0 (CD-ROM)
# (FFS)
# (NFS)


. Internet,
, ISG-9660 (
-) NFS.
config

kernel

root

on

wdO


IDE.
contr
contr
contr
contr

o
o
o
o

ller
ller
ller
ller

IsaO
pnpO
eisaO
pciO

12.

267

,
: ISA, EISA PCI-
Plug and Play ISA- (pnpO).
controller
atkbdcO at
device
atkbdO
at
device
psmO
at
device
vgaC
at
#
pseudo-device splash
# syscons
device
scO
at

isa?
isa?
isa?
isa?

pore IO_KBD tty


tty trq 1
tty irq 12
port ? conflicts

, SCO
isa? tty

,
: , , .
#
controller
fdcO
disk
fdO
disk
fdl

at isa? port "IOJF'Dl" bio irq 6 drq 2


at fdcO drive 0
at fdcO drive 1

*
controller
wdcO
disk
wdC
disk
wdl
controller
wdcl
disk
wd2
disk
wd3

IDE
at isa? port 1 "IO WDl" bio irq 14
at wdcO drive 0
at wdcO drive 1
at isa? port 1 "IO _WD2 " bio irq 15
at wdcO drive 0 "
at wdcO drive 1

:
, ( .
) I D E
.
options
options
device

ATAPI
I ATAPI IDE
ATI_STATI #
acdO
# IDE- CD-ROM

Bo FreeBSD
IDE-. IDE
, IDE- ,
.
.
pseudo-device loop
pseudo-device ether
pseudo-device bpfilter 4

#
# Ethernet
I

( l o o p ) ,

G E N E R I C . e t h e r Eihernei. b p f i l t e r
tepdutnp D H C P - . , .
.

268

I.

K E R N E L ,
, Web-.
FreeBSD.
FreeBSD
sysctl,
.
( ) .
sysctf - . ,
. 12.7, . , ;
.
, sysctl,
. , sysctl ;
,
.
, ,
.
. 12.7 ,
sysctl
12.7. FreeBSD.
sysctl

kern.maxflies

1064

kern.maxproc

532

kern.maxfilesperproc

1064

kern.maxprocperuid

531

kern.ipc.nmbclusters

1024

kern.lpc.inaxsockecs

1064

,
, .
, ,
,
.
i n a x p r o c p e r u i d .

G E N E R I C . Web-cepeepe,

.
m a x u s e r s 26
m a x u s e r s ,

12.

269

,
, .
o p t i o n s NMBCLUSTERS=4096
.
256, .
o p t i o n s CHILD_MAX=1024

. ,
. , , ,
.
options

0PEN_MAX-1C)24


. CHILD_MAX,
.

12.8.


, .
" "
A P I - . U N I X .
, . , ,
. /dev
. ,
, .
, ,
. ,
SCSI
, C D - R O M ,
,
Ethernet, .
.
.
, "" . ;

266

Linux 30 SCSI
,
;

200 ;
;

, ,
; ,
U N I X .

I.

,
,
.
.

U N I X U N I X - . ,
,
. ,
- Web-.
, ,
. ,
.

/ d e v
;
.
.
.
,
( , ).
,
.
.
Is -I:
%

-X

brw-rw

/dev/ad*

1 root

disk

8,

0 Mar

1999 / d e v / s d a


. ,
/dev ,
,
. ,
.
-.
: - -. - ^ !
( ,
512) . -
.
-,
- . , "
'', .
.
,
:
attach
psize
strategy

close
read
timeout

12.

dump
receive
transmit

ioctl
reset
write

open
select

probe
stop

271

,
,
. -"" . , , , (PTY),
.
, ,
- ,
.
,
,
.
,
(, ),
ioctl,


, -
. 12.8
.
12.8.

Solaris

/keme!/drv/*conf

^/kerael/drv/*

HP-UX

/stand/system

/usr/conf/*

Linux

/usr/src/liniix/. config

/usr/src/linux/driverc/*

FreeBSD

///*/\/(/

/sys/i386/conf/files*

,
Solaris, Linux FreeBSD.
HP-UX,
( Hewlett-Packard
).
Solaris
Solaris. Solaris
.
pkgadd. -
, ,
.
Solaris ,
, FreeBSD Linux.
"snarf'.
: snarf.o ( ) snarf.conf (
). /platform/sun4u/kernel/drv

, .
, ""
.

272

.
add_drv (
12.11). add_drv snarf.
! .
Linux
Linux :

"" ;

, "".

"".

I cd /uar/arc/linux ; patch -pi < driver.diff


,
"snarf'. ,
.
Linax
/usr/src/linux. drivers , .
:
% la -F ///linux/dxivere
Makefile
cdrom/
12/
acorn/
char/
isdn/
aplOOO/
die/
macintosh/
atm/
fc4/
misc/
block/
12c/
net/

nubus/
parport/
pel/
pcmcia/
pnp/

sbus/
scsi/
sgi/
sound/
tc/

telephony/
uab/
video/
zorro/

block, char, net. usb, sound


scsi. - (, I D E - ) , - (, ), , USB-,
SCSI- . ,
(pci, nubus zorro); , .
- (Macintosh, acorn, I).
(atm, Isdn, telephony).
,
drivers/net. :

drivers/net/Makefile, ;

drivers/net/Config.in, ;

drivers/net/Space.c, .

. .h drivers/net
drivers/net/Makefile.
( ):
i feq

(S(CONFIG SNARFJ,)
L_OBJS + s n a r f .

else

12

273

ifeq

(S(CONFIG_SNARF),m)

MOBJS

snarf.

endif

endif

.
Makefile, ,
.
drivers/net/Config-in.
,
,
( , Makefile):
t r i s t a t e

"Snarf

device

support'

CONFIG_SNARF

t r i s t a t e ,
. , b o o l .
,
. ,
.
.
, , i f e q Makefile
, drivers/net/Space.c. ,
.
. -, ,
.
Space.c .
:
extern

int

snarf_probe(struct

device

"J;

, ,
.
(PCI. EISA. SBUS, M C A . ISA.
..). " s n a r f ' PC 1-,
p c i _ p r o b e s .
s t r u c t devprobe pci_probesLI
initdata {
. , , . PCI-, . ,
"snarf 1 ,
:
s t r u c t
t i f d e f

devprobe

pci_probesH

i n i t d a t a

CONFIGSNARF

snarfjprobe, 0),
#endif

Linux.
"Network devices" ( ).

274

I .

FreeBSD
FreeBSD

.
!
FreeBSD. ,
BSD- ( N e t B S D OpenBSD)
, ,
. " s c a r f ' (
).

:
~bbraun/enarf . /aya/pci/anarf.
PCI-,
SYS/pci PCI-.
,
SYS/i386/eonf/files.i386
,
.

. EXAMPLE:
d e v i c e snfG

# S n a r f , -

config
. ,
, . - -
,

, ,
.
SYS/i386/conf/majors.i386. , ,
.
:

config :

.
.
( )
.

12.9.



/dev". , , . . Solaris

Solaris /devices,
/dev.

12.

275

H P - U X :
/dev : disk, cdrom, terminal w ..
mknod,
:
mknod

_ , (.
- , -),
. , ,
,
man- ( FreeBSD 4, Solaris H P - U X 7,
Linux man- )
, .
she 11- /dev/MAKEDEV,
mknod
,
. , FreeBSD
:
# cd / d e v
# ./MAKKDBV p t y

12.10=
.
,
PDP-11 DEC.
, , ,
- '' ("raw"
), : /dev/daO /dev/rdaO.
,
(: /dev/dsk/dks0d3s0 /dev/rdsk/dks0d3s0).
() .
tty
, ,
. ;
.
7
BSD-
, .
. . daOa -
, SCSI-,
a rdaOa -
\
, ,
/
.
. 12.9
( C D - R O M )
.

276

12.9. 1

SCSI-

SCSI- C D - R O M

IDE-

Solaria

/dev/lrjdjk/cAtBdNiP

/dev/[r]dik/cAtBdNP

/dev/lr]djk/cAtBdNiP

HP-UX

/d*T/(r]djk/cAtBdN

/dev/[r]d>k/cAtBdN

Linux

/dev/sdLP

/dev/wdLP

/dev/hdLP

BSDI

/dev/daNsP

/dev/dtNeP{loih}

/dev/wdNaP

A , SCSI-, N ,
.

12.11.
Solaris, Linux FreeBSD,
. Solaris
, Linux , FreeBSD
.

.
, '
. , ,
.

" ",
. ,
. , .
, ! .
.
1 .
,

Solaris. Linux
FreeBSD.
Solaris
Solaris .
, ,
modinfo.

* modinfo
Id Loadacdr
1 fSOTeOOO
2 ff086000
3 ff082000
4 ffCB4000
5 ff095000
6 f f 0 b 8 00C
7 ff084a0C

Size
3ba0
1340
ld56
4 9c
15248
20e0

I n Fev
1
1
1
I
1
1
2
1
1
1

n o

57

12.

Module Name
speefs (filesystem for speefs)
suapgeneric (root/swap config)
TS (time s h a r i n g sched c l a s s )
T3 DPTBL ( T i m e s h a r i n g d i s p a t c h )
ufs (filesystem for ufs)
r o o t n e x (Sun4c r o o t n e x u s )
options loptions driver)

277

ffOBdcOO

2f4

62

ffOScOOO

968

59

dma ( D i r e c t Memory A c c e s s )
sbus

(SBus n e x u s d r i v e r )

Solaris 80 .
, U N I X " " (,
U F S ), Solaris
.
,
.
a d d d r v .
(
).
, .
rem_drv.
drvconfig.
/devices ,
.
,
, modload mod unload
Linux
Linux - , - , Solaris,
,
. Linux
. ,
.
/lib/modules/eepcw*, Linux,
uname -.
Is mod.
# lamod
M o d i Le

slhc
ds
182J65
pcmcia

core

Size
21452
4236
6344
26644
57024

Used by
0
0 [ppp]
1
1
0

[ds

,
P C M C I A , , -.
Linux
insmod. ,
"snarf":
# inamod /path/to/f.

, :

insmod /path/to/snarf. io=0xXXX irq=X


,
. rnimod

274
I.

snarf. rmniod ,
, (
U s e d bv Ismod) 0.
Linux
modprobe, , , .
/elc/conf.modules, , .
/etc/conf.modules,
, modprobe -. , :
t T h i s f i l e was g e n e r a t e d b y : modprobe - c
path[pcmcia]=/lib/modules/preferred
path Ipcrr.ciaI=/lib/modules/default
pathIpcmcia]-/lib/modules/2.3.39
path[misc)=/lib/modules/2 .3.39

(2.1.121)

I Aliases
alias biock-major-1 rd
alias block-major-2 floppy
a l i a s char-ma]or-4 s e r i a l
a l i a s char-ir.ajor-5 s e r i a l
alias char-major-6 lp
a n a s dos msdos
a l i a s plipQ p l i p
a l i a s pppO ppp
o p t i o n s n e io=x0340 i r q = 9
p a t h , .

.
a l i a s - - , ,
.
, k e r n e l d (. ).
o p t i o n s .
, . ,
"snarf* -
:
opt-ions

snarf

io-oxXXX

irq=X

modprobe p r e - i n s t a l l , p o s t - i n s t a l l , o r e - r e m o v e , p o s t - r e m o v e , i n s t a l l r e m o v e .
, . :
p r e - i n s t a i l
i n s t a l l . . .
p o s t - i n s t a l l
p r e - r e m o v e . .
remove . . .
p o s - r e m o v e .

12.

279

, ( ), ,
, ( ) .
!
kerneld. ,
.
/etc/conf.modules,
modprobe. a l i a s ,
.
, - ,
, /etc/conf.modules
, - ,
4. kerneld ,
modprobe, .
FreeBSD
FreeBSD Solaris
Linux. FreeBSD
.
/dev/kmem . ,
GENERIC.
, FreeBSD modload, modstat
modunload, ,
. ioctl
/dev/fkm.
FreeBSD /modules.
.

12.12.

280

McKusick, Marshall Kirk, ei al. The Design and Implementation of the 4.4BSD
Operating System. Reading. MA: Addison-Wesley. 1996.
Beck, Michael, et al. Linux Kernel Internals, Second Edition. Reading, MA.
Addison-Wesley. 1998.

I.

TCP/IP

HuSi

JlUMAbaft
Hoi'

^^

7&

1.

&,

11'

TeSunt

ms

.

WWW . 2000 .
Internet 300 ,
- . , Internet-,
Web- .
T C P / I P ,
UNIX, MacOS, Windows, Windows NT
. Internet.
IP (Internet Protocol
) T C P (Transmission Control Protocol
).
TCP/1
, , .
Internet IP, . T C P U D P (User Datagram Protocol
) , IP .
T C P . . -
: , ,
, .
, . T C P
, .
U D P
. . , .
T C P "" , ,

13. TCP/IP

283

. UDP
. , ,
.
Internet
TCP-,
, . U DP- 5%
19971998 . 1% 19992000 .

TCP/IP.
,
, "" .
14. 16 20.

13.1.

TCP/IP Internet
TCP/IP Internet
. Internet
TCP/IP. ,
TCP/IP Internet }

, .

. Internet
Microsoft, 1995 . Internet ARPANET,
1969 .
(Defense Advanced Research
Project Agency. DARPA). ARPANET
NFSNET (National Science Foundation Network
), .
80- . - ,

. :
NFSNET 1944 .
, Internet.
80- . Internet ARPANET ,
DEC VAX
Berkeley UNIX. Ethernet
( 10 /) Internet
56 /. ,
, . (Van
Jacobson),
Bell Labs ,

,
, .

^bft

II

(, 18 )
. 80- ., TCP,
1000 (
Ethernet 6%.
Ethernet 90%),
12000 , 50000 .
, ,

, ,
Internet ,
TCP/IP. 25
. (Bob Kahn).
(Vint Cerfj. (John Postel),
, .
Internet

. , Internet
, .
;,
. , Internet.
:

ICANN (Internet Corporation for Assigned Names and Numbers Internet)


, (www.icann.org);
IETF (Internet Engineering Task Force Internet)
Internet, ,
(www.ietf.org);

ISOC (Interne! Society Internet) ,


Internet (www.isoc.org).

ICANN, Internet,
.

- Internet , RFC (Requests For
Comments ). ,
,
RFC.
,
.
RFC .
3000. (, Algorithms for
Synchronizing Network Clocks ),
RFC
, RFC .

13. TCP/IP

285


.
, . , ,
.
RFC. ,
Internet Official Protocol Standards (
Internet). , . ,
100 : 2600.
2700 .. Internet
RFC2026. RFC2555. 30 Years of RFCs (30
RFC). RFC.
RFC.
,
. .
R F C ,
, .
RFC ( 1-
), :

RFC11I8 The Hitchhiker's Guide to the Internet (


no Internet );

RFC 1149 A Standard for the Transmission af IP Datagrams on Avian Carriers


( );

RFC2324 - Hyper Text Coffee Pot Control Protocol (HTCPCP/LO]) ( ) ;

RFC2795 The Infinite Monkey Protocol Suite i IMPS) (


).
RFC
FYI (For Your Information ). (Best
Current Practice ) STD (Standard
). RFC,
.
FYI ,
. ,
. STD
Internet,
1ETF

Imemet-cepBepoB; ,
RFC.
RFC, FYI, STD
, . , RFC1635, How to Use Anonymous FTP (
FTP) FYI0024.

^bft

II

R F C . R F C - Web- www.rfceditor.org, R F C .

13.2.

TCP/IP
, ,
T C P / I P . T C P / I P , .
:

IP (Intemei Protocol ) ( R F C 7 9 I ) ;

I C M P (Internet Control Message Protocol


Internet)
IP, , (RFC792);
ARP (Address Resolution Protocol )
IP- - (RFC823) ;

U D P (User Datagram Protocol ) T C P (Transmission Control Protocol


)
. U D P
, T C P


(RFC768 RFC793).

T C P / I P
(. 13.1).
13.1. TCP/IP

T C P / I P
. (International
Organization for Standardization, ISO)
, OSI (Open System Interconnection ^ )

, , ARP
TCP/IP.
. T C P / I P .

13. TCP/IP

:/

- .
, OSI :
.
. , T C P / I P
.

5 *

erp

rloflln, talk, tip

NFS, DNS, ntp

tncerouta

{JJdJ 1

IP

'

-4

. TCP/IP


U N I X ,
Ethernet ( ), F D D I , Token Ring, ATM
.
T C P / I P ,
,

,
, .
().
, .
, , , ,
, ,
. , .
.
, IP ,
T C P . "".
, ,
.
, . .

.
, , Ethernet,
"". Ethernet ""
,
,
( C R C ) . Ethernet- IP-.

288

II

IP- U D P - , , , UDP- .
. .
UDP- (10 )
IP- (128 )
' !, ! ^|?" |
Ethernet !
IP
UDP i
100
[
.
] 20 | |
Ethernet-Kaqp (146 )
. .
"' 1 8- .
,
R F C "".


.
Ethernet

.
,
,
.
.
Ethernet
: DIX Ethernet I E E E 802.2 LLC SNAP".
U N I X Cisco , IPX
Novell .
, ,
.

. ,
Windows, , U N I X .
U N I X .
Windows , , , .
)
,
.
: MAC (Media Access
Control ) LLC (Logical Link Control ). MAC .
LLC .

13. TCP/IP

289

Ethernet
Ethernet ,
, .
<.
5, 4 VG.
3)
(FX. - .
Hewlett-Packard VG
.
.
.
Ethernet
15. Web- wwwliost.ots.nlcxas.edu/ethemet, (Charles Spurgcon).

IEEE 802.11
. , ,

, .
,
.
Windows , UNIX ,
.
, ,

.
, 802.11.
PCMCIA , . , , .
,
,
.
Apple AirPori Lucent.
: ,



, . ,
Et he met- 1500 .
(Maximum Transfer Unit, MTU).
MTU . 13.2.
ATM MTU , ATM
- .
ATM 53 48- ,
AAL/5 216 .
, MTU 9ISO ,
LANE (Local Area Network Emulation )
1500 .

^bft
II

132.

Ethernet

1500 (1492 802.2)

FDD!

4500 (4352 IP/FDD1)

, 512 576

53

(TI, )

, 1500 4500

T C P / I P IP ,
.
, M T U
, .
,
. T C P
M T U
. U D P
"" IP.
IPv6
:
.
.
,
1500 , ,
1540 ,
.
-
ifconfig, , M T U .

,
.
T C P / I P :

MAC ;

IP- .

- ,
, IP-,
Internet, ,
.

. , Etliemet-
. Token Ring
.
i. : 13.8)
:
.

13. TCP/IP

291

Ethernet : ipn
, !
, .
http://ww*. iana.org/assignments/ethemet-numbers

RFC, .
Assigned Numbers ( ) RFC1700 (1994 .
,
Internet, Web- www.iana.org/ntimbers.him.
Ethernet !:
,
.

. Solaris Red Hat
, .
, Internet-
( IP-).
IP-.
.
13.4.
IP-
TCP/IP ,
(.. ,
), ARP
.
ARP 13.6.
IP- ,
, , . UNIX-
IP-, telnet 128.138.242.1
telnet anchor.
" L
(/etc/hosts), NIS NIS+ . .
DNS . , IP-;
.

IP- , ,
;
. TCP UDP IP-,
. ,
IP-
UNIX, . FTP.
, "" ,
/elc/services.

, NA'1. 6\JCI
, .

2Y1

II. *

, UNIX- 1024 root.



IP
:

,
( );

, ;

,
, ,
, ,
. IGMP (Internet Group
Management Protocol Internet)
, .

, ,
IP- .

( , ) I. ..
.

. Internet 01:00.5.
,
, .
IP ,
224239.
.

13.4.

IP-
IP- ) :
. ,
, .
IP- Rime
( ), . . IP-
boulder 128.138.240.1.

127.
,
. 127.0.0.1
; localhosi
IP-
ifconfig. 13.10.
IP-
IP- ,
. .
.

13. TCP/IP

293

.
. , euie
, .
, IP-; D
.
. 13.3 .
, .
13.3. 1-
] 1(]

1-126

128191

...

, ;

192-223

...

;
,

224-:39

240-254

,
-

0 255 IP- . 127


.

.
(
16777214 65534 )
. , 126
!
, ,
, .
"" .
,
. . . . ,
, : ....
256 ,
, 254 .
ifconfig.
.
, IP-, I,
0. ,
255.255.255.0 OxFFFFFFOO . , , ,
, ,
.
ifconfig

>91

13.1

II.


, .
. ... , .
.
, , . /XX, XX
( ). , 128.138.243.0/26
128.138.243.

64, 128 192. , ,
255.255.255.192. OxFFFFFFCO. 26 ,
(. ).

IP-

'


Ittl

255

'

255

255

t 1

192
1

<1

. .
/26 6
(32 26 = 6). , 64
6
(2 = 64). 62 ,
, , ( ).
,
, .
256:
= 256
, 256 64 = 192 . ,
( )
0, 64,
128 192 64.
00.
01, 10 II. , 128.138.243.0/24
/26:

128.138.243.0/26
(0 - 00000000);

128.138.243.64/26
(64 - 01000000).

128.138.243.128/26
(128 - 10000000);

128.138.243.192/26
(192 - 11000000).

.
IP- (, 128.138.243.100),
, , . . 13.4 /16

13. TCP/IP

295

( ), / 2 4 / 2 6 (
, : . ).
13.4. 1-
1


-

128 138 243.100/16

255 253 0.0

128.138 0.0

128.13d 255.255

128.138.243 100/24

25f 255.255.0

128.138 243.0

128.138.2*3.255

128 138.243.100/26

255 255.255 192

128.138 24? 64

128.138.243.127

(Keith Owens) Perl- ipcalc.pl.


.
ftp.ocs.com.au Perl 5.
, . , Palm Pilot
(www.ajw.com/ipcalc.htm).
(
):
% ipcalc.pl 128.138.243.100/26
IP address
128
13B . 243
. 100 / 26
Mask D i e s 11111111 11111111 11111111 11000000
Mask b y t e s
255 . 255
. 255 . 192
Address
10000000 10001010 11110011 0]100100
Network
128
138
243
64
127
Broad-as :
128
138
243
F i r s t Host
128
138
243
6b
L a s t Host
12B
13B
243
126
Total Hosts
62
FTR
100.243.138.128.in-aadr.arpa
IP Address {hex}
808AF364

128..138 .243. . 1 0 0 / 2 6
255..255. .255. .192
128..138 .243. .64
128..138. .243. .127
.
128.,13B . 24 J .65
128..138. .243. .126

Red Hat , ipcalc


,
.
RFC. IP- (RFC950).
(
).
, 0 192.
, Novell Cisco. (,
IOS Cisco 12 0
0 .)
,
. 0 ,
- .
, , \
, .
.
( ) ( ) 2,
4 : , ,

II

( ).
, ,
.. /30, 255.255.255.252,
OxFFFFFFFC
,

. ( 128.138.243.100)
,
. ,
, ,
.
IP-
1992 . Internet -
,
. -,

1995 . -,
, Internet-,
,
. -, IP- "
"
. ,
, . ,
,
!
:
, .
CIDR (Classless Inter-Domain Routing
)

.
IPv6.
IP.
16- , 25
IP.
, ,
.
.
,
. 16- l , 2 i , 665570793348S66943S98599
. 16
, : , 8- .
2000 . IPv6 .
CIDR ;
Internet- .
IP- NAT, ( ).

13. TCP/IP

297

IPv6, CIDR
NAT. Internet ,
, IPv6.
, ,
, -
, IPv6.
WAP-
, IPv6.
IP-
IPv6.
C I D R :
CIDR, RFC1519,
,
IP-. ,
,
. ,
, .
11
CIDR .
CIDR
.
. , ,
32-v ,
192.144.0.0 192.144.31.0 ( C1DR 192.144.0.0/21).
:

1 21 2046 ", 255.255.224.0;


32 24 254 ,
255.255.255.0;

64 25 126 ,
255.255.255.128,

128 26 62 ,
255.255.255.192;

.
,
. , Internet,
193.143.0.0/21,
/30 -, /24
/27

24, 25.
CIDR .
256, 128 32
.
,
Ethernet RG-11 1024 . ,
( ). "" - ,
.

3'

11.

.
199.144.0.0/21.
CIDR
. ,
UNIX- be.
ibase ohasc. . 13.5
.
13.5.

/2


()
()
/20
12
4094
255.255.240.0
OxFFFFFOOO
/21
II
2046
255.255.248.0
0xFFFFF800
/22
10
1022
255.255.252.0
OxFFFFFCOO
/23
9
510
255.255.254.0
OxFFFFFEOO
/24
8
254
255.255.255.0
OxFFFFFFOO
/26
7
126
255.255.255.128
DxFFFFFF80
/26
6
62
255.255.255.192
OxFFFFFFCO
/27
5
30
255.255.255.224
OxFFFFFFEO
/28
4
14
255.255.255.240
OxFFFFFFFO
/29
3
6
255.255.255.248
0xFFFFFFF8
/30
2
2
255.255.255.252
OxFFFFFFFC
1
32.
2
2"( )-2. ,
, .
CIDR 1993 ..
20000 .
Internet,
80000 2000 .
*.
, "" 192 ( ""
199 205). .
, .
CLLK ,
Internet ,
. ,
192, Internet
(American Registry for Internet Numbers. ARIN)
. , (
, IPv4)
.
1999 ., 60000.
80000 25- !
,
25%. www.antc.uoregon.edu/route-views/dynamics.

13. TCP/IP

299

C I D R ,
, Internet.
, . , C I D R ,
, IP. ,
IPv6
, ,
IPv6, ,
- , IPv6, Microsoft
IPv4 " ".

Internet
Internet (Internet Network Information Center,
InterNIC) .
A R I N . Internet,
. A R I N .
.
.

IP-.
I C A N N ,
Internet
(. 13.6). , ,
.
.
13.6. , 11

Web-

ARIN

www.aan.net

APNIC

www.apnic.net

RIPE

www.ilpe.net

I C A N N A R I N , RIPE A P N I C ,
Internet
.
, ,
. ,
.

.
, .
,
.
.
http://vAvw.caida.org/anaIysis/topology/as_core_network

,
, (.. ) ,
,

N A T

IP- (RFC 19IS)
CIDR IP- Internet.
,
. ,
.


.
.
.
RFC19I8 , , 16
256
. , ,
, .
. 13.7
(
C1DR).

13.7. IP-,

CIDR

10.0.0.0

10.255.255.255

10.0.0.0/8

172.16.0.0

172.31.255.255

172.16.0.0/12

192.168.0.0

192.168.255.255

192.168.0.0/16

, ,
Internet,
N A T (Network Address Translation ).

IP- .
/,
.
IP-.
,
IP- - "" .
, NAT. - ,

. ,

13. TCP/IP

301


4
^

NAT.
.
NAT -, Cisco. UNIX-
NAT, .
Red Hat FreeBSD*.
13.14 13.15.
NAT Linux "I-".
NAT ,
Internet.
, .
CAJDA (Cooperative Association for Internet Data Analysis
Internet),
, . 0.1-0,2% ,
, , . , , ,
-West ( ,
Internet) 10 20000 .
Internet
Web-
www.caida.org.
NAT ( , )
, Internet
.
(, Cisco PIX)
, .
, IP- . (
,
RealVideo SHOUTcast, FTP- PORT PASV,
ICQ )
NAT.
NAT .
,
, NAT
.
,
Internet.
IPv6
IPv6 128 .
, IPv4.
.
IP- ,
; .

. Red Hat PAT (Port Address Translation


), NAT IP- , ,
"" ,
.

3'

11.

, IPvo
. IP- , ,
Internet.
IPv6 64

48 (. 13.8).
13.8 IPv6
IPv6 (128 )


45

16 |

64

I- 3

FP

Format Prefix - : ,

4 - 16

I LA ID

lop-Level Aggregation ID -
,

|7 - 2 4

RES

Reserved -

25 48

NLA ID

Ncxl-Le*cl Aggregation ID - |
,
Internet

49-- 6 4

SLA ID

Side-Level Aggregation ID -
,

65-128

INTERF
ACE ID

(- -)

SLA I N T E R F A C E
"" , .
. SLA , 64- , ,
48- -, -
(OxFFFE). - ( ),
"", , : (RFC2373).
, ,
.
IPv6 - I. ,

-. .
.
IPv6 . -
.
.

13. TCP/IP

303

, IPv6 , IPv4,
.
( , ).
: ,
. 001
( ). TLA NLA
Internet.
IPv6. . 13.9
IPv6
. ( IPv6,
IP-.)
13.9. IPv6

1
2

IPv6

Solaris

Solaris 8

HP-UX


HP-UX 11.00

Red Hat

IPv6 Linux
2.2

FreeBSD

FreeBSD 4.0 1

Windows 2K

( )

Cisco

Jumper

Bay

1997 .

FreeBSD 3.4 IPv6,


, INRIA .
,
.

IPv6

http://playground.sun.com/piJb/ipng/html/ipng-iniplementation.html

IPv6. ARIN ,
12 IPv6.
.
, IPv6:

www.6bone.net IPv6;

www.6ren.net - IPv6;

www.ipv6.org FAQ- ;

3'

www.ipv6forum.com IPv6.

11.

IPv6 .
. IPv4
,
,
. IPv6
,
. : . NAT,
.

13.5.

,
. T C P / I P
, ,
, ,
. , , ,
. ,
, , .

, - , .
T C P / I P ( ), : " ,
" . ; ,
, ,
.
.
,
( ,
, ).
(.. , ).
( ) , I C M P - "network unreachable" ( ).
" " :


;
.

,
. ,
, , 14.

netstat -, , route get BSD-.


20.4,
, , .
: 132.236.227.93 ( e t h O )
132.236.227.0/24 132.236.212.1 ( e t h l ) 132.236.212.0/26.
% n e t s t a t - -
Kernel IP routing cable
Destination
Mask
Gateway
F1 MSS
If

13. TCP/IP

305

132.236..227.0

default

132.236..212.0
132.236 .220.64
127.0.0.. 1

255..255,. 2 5 5 . 0
0.0,.0.0
255..255.. 2 5 5 . 1 9 2
2 5 5 .255.. 2 5 5 . 1 9 2
2 5 5 .255.. 2 5 5 . 2 5 5

1 3 2 . . 2 3 6 . 2 2 7 . .93
132.. 2 3 6 . . 2 2 7 . . 1
1 3 2 . . 2 3 6 . . 2 1 2 . .1
1 3 2 .. 2 3 6 .. 2 1 2 ..6
1 2 7 . . 0 . 0 .. 1

I:G

UG
0

1500
1500
1500

1500
3584

ethO
ethO
ethl
ethl
luO

d e s t i n a t i o n . g a t e w a y
, ,
132.236.220.64/26
132.236.212.6 e t h l .
; , (
), 132.236.227.1.
,
.
,
. ,
route.
.

. , Red Hai
# route add -net 132.236.220.64 netmaak 255.255.255.192
132.236.212.6
I route add default 132.236.227.1
,
netstat - - (
ifconlig e t h O e t h l ) .
route 13.10 .
, .
, ,
.
.
.
, ,

. ,
:
.
. -,
. , ""
,
, .
. 14 UNIX-
routed gated, ,
.

306

II. FO6OTO

1
, IP
,
ICMP-. , ,
, - .
,
, , , ,
. .
.

ICMP-. ,
, : " *.
". ICMP
, .
, , .
,
, ,
, ,
,
ICMP- .

lCMP-
,
. ?

.
Linux FreeBSD. Cisco ,
.

13.6.

ARP:
IP-
IP-.
". ,
IP-, *RP
(Address Resolution Proiocol ) Fro
,
, Ethernet.
.
Ethernet-, ARP
. .
ARP
, , ARP
,
*",
, .

**

"-", .
. . !

13. TCP/IP

307

,
ARP. ARP-.
, ,
, ARP
.
ARP "
: " -
128.138.116.4?" , ,
: " . Eihemet-aapec 8:0:20:0:fb 6a".
IP- [1-
, ,
ARP-. ,
. , ''" ,
, .
,
ARP.
. -
; , .
- Solans Red Hat:
so!arls% / u r / s b i n / a r p -a
Net to Media Table
Device IP Address Mask
hmeO
hmeO
hmeO

titanla
arth
pluto

255.255.255.255
255.255.255.255
255.255.255.255

Flags

Phys Addr
00:5C:da:6:5:90
00:50:da:12:4e:e5
00:50:da:l2:4e:19

redhat% / s b l n / - a
xor.com { 1 9 2 . 1 0 8 . 2 1 . 1 ) at 08:00:20:77:5E:AO [ e t h e r ! on echO
e a r t h . x o r . c o t n ( 1 9 2 . 1 0 8 . 2 1 . 1 8 0 ) at 00:50;DA:12:4E:E5 [ e t h e r ] on ethO
l o l l i p o p . x o r . c o m (192.108.21.48) at 0 8 : 0 0 : 2 0 : 7 9 : 4 F : 4 9 [ e t h e r ] on ethO
, ,
.
ARP (,
),
- ARP.
.
IP-,
ARP- , .
-.
IP-.
( ,
, ) .
IP- ,
,
. RARP (Reverse
ARP ARP),
ARP.
AR.P , IP.

308

II

ARP. RARP ,
RARP ; Ethernet-
I -. , RARP.
rarpd.
/etc/others /etc/hosts.
RARP .
, DHCP.

13.7.

DHCP:

UNIX- .
Iniel ,
UNIX? DHCP (Dynamic Host
Configuration Protocol )
.

" " , .
, ,
, Internet, , .
"" :

IP- ;

( );

DNS-;

, Syslog;
WINS, NTP -;

TFTP ( )
(. RFC2132).
. DHCP- , IP-, ,
DNS.
DH-.
. ,
. DHCP-
. ,
( ).
DHCP . DHCP ,
.
D H C P
. 13.10 DHCP,
.

13. TCP/IP

309

13.10. DHCP

DHCP-

DHCP-

Solaris

/sbj.ro/dhcpagent

/usr/iib/met/in .dhcpd1

HP-UX

, auto_paranis

bootpd

Red Hal

/usr/sbin/dheped /sbin/pump

//sbin/dlicpd DT ISC

FreeBSD

/gbin/dhcllent

/usr/ports/net/ise-dbepZ

sheM- dhcpconfig, DHCP-cep Solaris.


lriernei (Inierne?
Software Consortium, ISC) DHCP, ftp.isc.oiS-
ISC ( DHCP,
).
ISC,
,
DHCP.
ISC ,

U N I X 3.0,
,
, .
DHCP- DHCP-
{ ),
. ",
(HP-UX Linux)
.
. ISC
. ,
DHCP.

.
DHCP- ISC
DNS. IP-
, D N S
IP-
16.12.
DHCP, ,
ISC, . DHCP- ,
.
D H C P
D H C P ,
, UNIX . IP-, ,
, , TFT
(Trivial File Transfer Protocol )

310

D H C P ,
"".
DHCP- DHCP-.
DHCPDISCOVER", : " ,
". , IP-,
255.255.255.255,
0.0.0.0. DISCOVER
, .
.
DISCOVER DHCP-.
-, .
OFFER,
. (, ) ,
REQUEST
; .
REQUEST NAK.
. .
,
ARP. - ,
DECLINE, .
,
, REQUEST.
, RELEASE.
, ,
. ,
, .
.
D H C P -.
( Control Protocol -
DHCP- ISC
DHCP- ISC fip.isc.oig www.isc.org.
2.0. 3.0.
, ,
.
tar.gz .
, ,
. ./configure, make make install,
.
DHCP-. dhcpd.
dhepd.conF scr>er /etc/dhcpd. "

DHCP- "DHCP". ,
.
! dbcpd.conf "" :
- , .

13 TCP/IP

311


, /var/db/dhcp.leases. , dhcpd
. dhcpd.conf
:

, dhcpd IP-,
;

,
( IP-,
-);

, DHCP-: , , DNS,
..
-, dhcpd,
.
-, dhcpd.conf.
server .
dhcpd
. ,
/etc/dhcpd.conf
dhcpd.conf.
Linux- :
, Internet.
NAT ,
10 IP-.
() h o s t ,
.
dhcpd.conf

#
o p t i o n domain-name " s y n a c k . n e t " ;
option domain-name-servers gw.synack.net;
option subnet-mask 255.255.255.0;
d e f a u l t - l e a s e - t i i n e 600;
m a x - l e a s e - t i m e 7200;
s u b n e t 1 9 2 . 1 6 8 . 1 . 0 netmask 2 5 5 . 2 5 5 . 2 5 5 . 0
range 192.168.1.51 192.16B.1.60;
option broadcast-address 192.168.1.255;
option routers gw.synack.net;
}
s u b n e t 2 C 9 . 1 8 0 . 2 5 1 . 0 netmask 2 5 5 . 2 5 5 , 2 5 5 . 0
)
host gandalf I
hardware e t h e r n e t 0 8 : 0 0 : 0 7 : 1 2 : 3 4 : 5 6 ;
fixed-address gandalf.synack.net;
, DHCP-, DNS.
(, dhcpl.synack.nei)

312

I!

, "" IP-. BIND,


,
dhcpd, DNS .
,
.
DNS 16.
dhcpd dhcp.leases.
, dhcpd.leases" dhep.leases
, .
, dhcpd.leases".
dhcpd , . dhcp.leases,
, .

13.8.

:
(Point-to-Point Protocol )
, IP-
( ) .
,
. ,
, .
-.
"" ,
DSL ,
. ,
Recb Ethernet,
Et lie met- .
SLIP (Serial Line Internet
Protocol ) CSLIP
(Compressed SLIP SLIP), (Rick Adams) .
.
.
RFC 1331.
:

LCP (Link Control Protocol ),


,
:

NCP (Network Control Protocol ),


.
,
, RFC-, .

13. TCP/IP

313

. . 13.11

.
13.11.

1
/usr/sbin/tepppd
/usr/sbin/aspppls


/elc/asppp.cf
/etc/uucp/Sysicme
/etc/uucp/Deviccs
/clc/uucp/ Diale is
/etc/uucp/Aulh

HP-UX

/uar/bin/pppd
/elc/ppp/Aulosurt

/etc/ppp/Systems
/eic//Filler
/etc/ppp/Dcvices
/etc/ppp/Dialere
/etc/ppp/Auth
/etc/ppp/Keys

Red Hai

/usr/sbin/pppd
/usr/sbin/chal

/elc/ppp/options
/etc// ppp.conf
/ctc/ppp/aliow

FreeBSD

/usr/sbin/pppd
/usr/sbin/chat

/etc/ppp/options
/elc/ppp/options.ttyserver
/etc/ppp/cha t.ttyservcr

Solaris

\ .
.

Ethernet,
.
10 100 /. .. 10000100000 /.
2856 /."
,
1 - 5 .
, Web-
, MTU (
) .
512 ; 128.

NFS - -
, NFS
T C P , UDP. (, Solaris) TCP
NFS .
NFS 17.
X Windows TCP. -
-. xterm .

19200 .
,
.

314

II.


.

,
.

IP- .

, ,
-.

,
.

- ,
-. UNIX
, .
,
, ifconfig.
ifconfig 13.10.
-
,
-. ,
. ,
.
,
,
. ,
.
,
.

"" ,
. - ,
, , ,
. , , ,

.
, ,



,

13. TCP/IP

315

.
Internet, .
.

- IP-,
Ethernet,
- (
). .
IP- 13.10.
- , .. ,
( "" ).
, Ethernet,
,

. ,
. ,
, "" .
IP- DHCP.
Internet
DHCP, .

,
IP-, I-
, (, ,
Ethernet).
.
.
- , -. ,
.
wee 14.
-

.
. , ,
,
: ,
,
..
21 .

311 II


- ,
,
. ,
, .
Luceru Ponmasier 3. Cisco
Access Server AS5x0O. . ,
-.

, ,
-.
UUCP.
, .
, "
'Login",
".
, ,
. ,
, , ,
.
,
.

13.9.


(21), ,
IP-, .
,
, .
1-
UNIX- IP-,
.
,

. ,
.
.
ICMP-
ICMP-
.

. , ,
,

13. TCP/IP

317

,
. ( ),
1 MP- .

IP
,
.
, ,
.

IP .
,
, .
, ,
Internet, .
.
ping-

, ping, ( )
. " 1',
"smnrf' ( ,
)
ping-, ..
.
, Internet,
.
, , .
ping- "" ,
.
. , Cisco IOS
11_ , 12.0 .
TCP/IP . ,
, , ,
,
.
U N I X
Red Hat FreeBSD
( ).
(13.14 13.15),
. UNIX- (
, ) if
, Windows NT .

318

II

.
, Firewall-1 Checkpoint (
Solaris),
1 Cisco, !
21.9.

, ,
,
. , .
Internet "" ,
, "" . .
IPSEC,
IETF, , ,
. ,
3660 Cisco Firebox Watch Guard; .
Firebox
,

.
IPSEC: IP
IPS (IP Secure IP)
IETF .
,
( ) . )'
.
,
, IPS .
RFC2409 ( ) IKE (Internet Key Exchange
Internet), .
IPSEC , .
,
. IETF
.
. 13.12 ,
IPSEC .
, IPSEC
,
IPSEC , : SAD (Security Association
Database ) SPD (Security

13. TCP/IP

319

Policy Database ).
selkey,
add spdadd. Web-
www.kame.net.
13.12. IPSEC *

Solaris
HP-UX

HP-UX 11.00 Presidium


IPSec/9000

Red Hat

FrecS/WAN1

FreeBSD

4.0 !
IPS

SuSe Linux 1999 .

13.10.

. ,
, , ,
.
, .\
. ,
-
:

IP- ;

;
. , ;
DNS-,
Internet.

,

,
,
,
,
.
, ,
.
- , .
; ,
, !
,
.

15.

' >320

II.

, , , , -
,

Ethernet;
.
I P -
,
IP- : hosts, NIS NIS+, D N S
- . ,
.
,
,
.
/etc/hosts
IP-.
IP- ,
. /etc/hosts
lollipop:

127.0.0.1
192.108.21.48
192.108.21.254
192.108.21.1
192.225.33.5

localhost
lollipop.xor.com l o l l i p o p loghost
chimchim-gw.xor.com ehimchim-gw
n s . x o r . c o m ne
licensea.xor.com license-server

localhost. ,
( FreeBSD,
).
/etc/hosts ,
,
.
DNS. /etc/hosts
,
DNS.
/etc/hosts , DNS
.
. ,
.
, ,
.
/etc/hosts ,
, .

(
); 18.
DNS. 16 DNS
BIND DNS UNIX.
hostname .
-

13. TCP/IP

321

,
. , -
(. 13 II). (.. ,
DNS. anchor.cs.colora.do.edu).
IP-
.
, .
addhost ,
. DHCP LDAP
(Lightweight Directory Access Protocol
). addhost "",
. ,
flp.xor.com.
ifconfig:
ifconfig
, IP- ,
.
( ),
.
,
.
ifconfig :
i f c o n f i g . . . up
:
# i f c o n f i g on0 128.138.240.1 netmaek 255.255.255.0 up
,
. , - ,
. : ieO, 1, l e i ,
InO, enO, weO, qeO, hmeO, echO lanO; loO
. , ;
, (Intel Ethernet. Lance Eihernet
..).
ifconfig
. - " ",
ifconfig - ,
. ,
netstat -i.
Solaris ifconfig
plumb:
netstat -i.
IP- . ,
Imernei ,
. ;
ifconfig (
hostname) .

' >2

II.

,
. .
. DNS-
, ,
.
up , down
.
ifconfig .
. , , ,
.
. , .
,
. ifconfig
, . ,
inet
netmask - .
, (.
). , .
broadcast IP-
.
, 1.
.
IP-.
UNIX
IP-, , .

, ,
ping. .
-,
,
. -, ,
,
,
, ( TTL. ).
- "" ,

, IP-. , , X AI. Y 2. X
1. Y (
), ,
{ Y
2), . , Y. ,
, .
"" .

,
. ,
.

13. TCP/IP

323

128.138.240.255, 24.
(255.255.255.0).
ifconfig enO :
enO: flaqs=63<CP,BROADCAST,NOTRAILERS,RUNNING inet 128.138.240.1
netmask f f f f f f O C b r o a d c a s t 1 2 8 . 1 3 8 . 2 4 0 . 2 5 5
.
# Ifconfig 10 127.0.0.1 up

, ,
, .
. 255.0.0.0
.
4

ifconfig 128.138.240.151 netmaek 255.255.255.192


broadcast 128.138.243.191 up

Ethernet. IP-
128.138.243.151 128.138.243.191 . ( ),
/26. 192
11000000 , .. 255 .
191 10111111 ,
.. 1,
(10) .
, ,
, ,
ifconfig , ,
. .
, .
route:
route
,
, *.
.
, route: ,
.
:
.
route,
14.
. ,
, IP-
. ( ) -
IP- ,
.
routed .

II.

. -,
, , -.

, .
ifconfig .
-, ,
. ,
, ICMP- "network unreachable"
( ). "
", - .
Internet .
route .
:
route

[-]

[]

: add (
) delete ( ).
, get. change, flush monitor
,
default.
0.0.0.0.
,
, , ,
.
. ( )
.

. ,
, ,
. ,
;
I.
FreeBSD .
, . ,
1 !
: .
, net host. ,
route
.
/etc/networks, "
route ,
, . ,
128.138.243.0 ,
, route
128.138 240.0.
route , net.
, .
/etc/networks
, /etc/hosts IP-.
, , ,
/etc/networks ( DNS).

13. TCP/IP

325


Ljjj

route delete
. route -f
. add, ,
.
BSD- route -f
route flush, net host -net -host.
Red Hat -net -host, route flush
. , Red Hat
.

netstat -nr. 20.4.

,
,
.
:
route add default IP-
IP- ,
. {. 13.13).
13.13.

Solaris
HP-UX

Red Hat

FreeBSD


/etc/defaultrouter
/etc/rc.config.d/netconf
/etc/sysconflg/network
/etc/rc.conf


ROUTE GATEWAY [ 0 ]
GATEWAY, GATEWAY DEV

defauitrouter

,
IP- .
. /etc/hosts.
D N S
DNS-,
: /etc/resolv.eonf (
" " ( ).
/etc/resolv.conf DNS-, .\
(, "anchor" anchor.cs.colorado.edu). IP- , .
;
16.8.
search cs.colorado.edu colorado.edu
nameserver
128.130.242.1
nameserver
126.138.243.151
nameserver
192.108.21.1

321

II.

,
.
nameserver. . -
, , ,
.
search domain.
, resolv.eonf,
. domain search
, .
D N S ,
resolv.eonf.
" ", ,
IP-.
18.3,
,
.
'' " ,
DNS, N1S ( NIS+)
/etc/hosts.
. DNS.
,
IP- /etc/hosts.
. 13.14 ,
.
13.14. " "

Solaris
HP-UX

/elc/nsswitch.coof
/etc/nsswitch.conf


-S [NOTFOUND=returnJ f i l e s
dns [NOTFOUPJD^return] is
[NoTFOUNDreturn] f ^ I e s
Red Hal
/etc/nsswitch.conf1
do f i l e s n i s p l u s dns
/elc/host.conf
hosts, bind
FreeBSD
/etc/host.conr
hoses, bind
1,
BIND nsswitdbconf. 1>5, host.conf.

Solans , .
hosts Solaris 7: Solaris 8
i p n o d e s .
IP-.
Solaris HP-UX [NOTFOUND=return],
, , .
.
,
. SUCCESS,

13. TCP/IP

327

UNAVAIL TRYAGAIN,
c o n t i n u e .

return

Solaris - UX /etc
; Hsswitch.*. HP-UX
nsswitch.hp_defaulis.

13.11.
/etc/re ( /etc/rc.local) ifconfig route. ,
,
.

.
, , , -
, , ifconfig route
,
.

, . , ,
"", UNIX '" ,
,
.
2
.
, .
;
.
.
UNIX- " ".
, (
), , ,
. . 13.15 ,
IP-
.
. , ,
, .
: /etc/hosts
/etc/resolv.conf. .
" " (. . 13.14).

.
:

DHCP-;

,
NAT;

323
II.

;
.

13.15.

Solaris

1--

/etc/reeolv.conf

DNS-

/ e t c / h o s t n a m e .

//.

D H C P

/etc/nodename

/etc/deraultrouter

/etc/"nel/netmasks

/etc/inet/boets

/elc/loet/ipnodes1

HP-UX

/etc/rc.config.d/netconf

Red

/etc/syscoafig/netwark

, ,

networic-scnpts/ifcfg 1

IP-, ,

/etc/rc.conf

Hat

FreeBSD
1

/etc/bosU

/etc/hosts

/etc/hosts

Solaris 8

Solaris 8 / e t c / f n e t / l p n o d e s / e t c / h o s t s .
IPv4, IPv6. / e t c / h o s t s
.
/ctc/sysconfig.

13.12. Solaris
Solaris .
,
. 1- :
,
IP- ,
Solaris, , SunOS.
Solaris 6 .
.

Solaris /etc.
/etc/inct
,
/etc/inet. /etc.
/etc/nodename.
.

13. TCP/IP

329

,
. nodename
, MOOT NIS+.
NIS+ J 8.4.

Pt

/etc/defaultdomain ,
DNS.
NIS N I S + . DNS- /etc/resolv.conf.
Solans etc nss witch, conf ,
/etc/hosts, NIS. NIS+ DNS
. hosts,
DNS, ,
. nsswitch.coiif
:
hosts:

files

dns

Solaris IP-
/etc/hostname./. ( 1 0 .
smcO. hmeO ..).
( Solaris), hosts, IP- (
!. , ,
ifconfig, IP-,
.
ifconfig. .
hostname,
D H C P R.ARP*
Solaris
netmask+ broadcast+ ifconlig. + ,
/etc/iietmasks . /etc/netmasks"
,
,
<. ). netmasks.
#
#

4
128.138 . .
#
128.138.192.64

255.255.255.192

255.255.255.192

# drag

128_138.192.192

255.255.255.192

128.138.193.0
128.138.193.32
128.138.198.0

255.255.255.224
255.255.255.224
255.255.255.192

csops

berg
4 oaLabase
slip

Solaris
ifconfig plumb ,
.
Solaris 7 -, netmasks, ;
.

325

II

/26 128.138.0.0
. .
, , .
, , netmasks
.
.

, .
Solaris ifconfig
(, ).

:

/etc/init.d/rootusr;

/ete/init.d/inelinit;

/etc/init.d/sysid.net:

/etc/init.d/fnetsvc
/etc/dcfaultrouter, ,
( IP-) ,
. ,
IP-; .
/etc/hosts DNS .
, Solaris routed
.
, /etc/gateways,
routed
.
/etc/notrouter, routed
"" . , "", routed
"" "


Solaris ;

i f c o n f i g hmaO p l u m b

ifconfig hmeO 192.108.21.48 netmask 255.255.255.0 up


f route add default 192.10B.21.254
,
. ,
sudo, . route
Solaris FreeBSD, :
get
.
% ifconfig -
10: flags=B4 9<UP,LOOPBACK,RUNNING,MULTICAST mtu 22
routed
, routed -q, ,
. -q .
, - routed .

13. TCP/IP

331

m e t 1 2 7 , 0 . 0 . 1 n e t m a s k ffOOOOOO
hmeO:flagfl-B63<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST? m t u 1 5 0 0
m a t 192.108.21.48 netmask f f f f f f O D broadcast 192.108.21-255
%

sudo ifconfig hmaO


hmeO;flags-863<UF,BROADCAST,NOTRAILERS,RUNNING,MULTICAST mtu 1500
i n e t 192.108.21.48 netmask ffffffOO broadcast 192.108.21.255
ether
8:0:20;T9:4f:49

: ifconfig , ,
, .
% netstat -nr
Destination

Gateway

Flags

Ref

Use

Interface

192.108.21.0
224.0.0.0
default
12">. 0 . 0 . 1

1 9 2 . 1 0 8 . , 2 1 .. 4 8
1 9 2 . 1 0 8 . . 2 1 .. 4 8
1 9 2 . L O B .. 2 1 .. 2 5 4
1 2 7 . 0 . 0 .. 0

UG
UH

3
3
0
0

244
0
459
29

hmeO
hmeO

u d o route g a t a n c h o r . c s . c o l o r a d o . e d u
route to:
anchor.cs.Colorado.EDU
destination:
default
mask:
default
gateway:
xor-gw2
i n t e r f a c e : hmeO
flags:
<UP,GATEWAY,DONE,STATIC
recvpipe
sendpipe
ssthr
rtt.msec
rttvar

C
O

loD

hopct

mtu
1500

expire
0

D H C P
Solaris DHCP-.

:
Ifconfig

dhcp

, !
dhcpagent DHCP
. Ifconfig ,
, -,
.
DHCP-, :
Ifconfig

drop

, , ,
DHCP .
.
/etc/dhcp. , ifconfig.
/etc/hostnanie.uwfleptfjebc - ,
. ,
DHCP. hostname.

' >332

II.

,
, DHCP.
dhcpinfo ,
DHCP. /1//.\}.
.
dhcpagem DHCP.

, .
, DHCP-,
, .
dhcpagent , DHCP-
( , , ..),
.
/etc/dhcp.
/etc/rc.*.
route, resolv.conf ..

dhcpagent Syslog (
"daemon", "err"),-
/dev/console. (
, ..) , - IN.
N 1, ;
.
dhcpagent USR1 (
kill),

/etc/dhcp.
.dhc , dhcpagent
: .

ndd Solaris
. , "''
.
,
.
ndd. , ,
Ethernet-: 10 / 100 /.
Solaris . HP-UX,
. ,
-, :
ndd [ - s e t ] ? I []
? ( : \ ? )
ndd ,
. ,
, \ -set ,
.

13. TCP/IP

333

,
; .
(, ip hmc> , (tcp
udp) . odd
:
" c o u l d n ' t push module

"ip",

No

such

device

or address"

. 13.16 ,
ndd.
13.16. , ndd Salons

/dev/tcp

TCP


tcp

/dev/udp

UDP

Udp-

/dev/fp

IP

/dev/icmp

ICMP

ip_*
icmp_*

/dev/rawip

, /dev/icmp

lcmp *

/dev/

ARP

arp_*

/dev/hme

Ethernet

Ethernet-
10 /, 100 /.
,
. ,
(Todd Williams)
Ei he met- ndd
#: / b m / s h
['ndd /dev/hme l i n k s t a t u s ' - e a 1]
STATUS-UP | | STATUS-DOWN
['ndd /dev/hme l i n k s p e e d 1 - e q 11
S P E E D = 1 0 0 | | SPEED=10
[ ' n d d / d e v / h m e l i n k _ m c d e ' - e q LI bS MODE-FULL 11 MODE=HALF
e c h o " e t h e r n e t i s S{STATUS}, c u n n i n g S ' S F E E D } M b p s S'MODEl d u p l e x "

:
ethernet

- s UP,

running

10

Mbps

HALP d u p l e x

, :

l i n k _ s t a t u s = 1. , 0 ;

l i n k s p e e d = I, 100. 0 10;

li.nk_iTOde = 1. .
,
.
,
10 /,
100 /:
#!/bin/sh
ndd - s e t /dev/hme i n s t a n c e
ndd - s e t /dev/hme adv a u t o n e g cap
nod - s e t /dev/hme a d v _ l 0 0 f d x _ c a p

334

0
0
0

II

ndd - /dev/hme adv_lOOhdx_cap


ndd -set /dev/hme advlOfdxcap
ndd -set /dev/hme adv_10hdx_cap

0
0
1

ndd
ndd
ndd
ndd
ndd
naa

1
D
0

-set
-set
-set
-set
-sec
-set

/dev/hmfe
/dev/hme
/dev/hme
/dev/hme
/dev/hme
/dev/hme

instance
adv_autoneg_cap
adv_100fdx_cap
adv_100hdx_cap
adv_10fdx_cap
advlOhcLxcap

,
,
.
HP-UX, ndd
-I ( ), ,
,
. , Solaris.
, , N A T
. 13.17 , Solaris ,
13.9. ndd.
13.17. , ,
Solaris

IP

ICMP-

piiig-

,

^^
ip forwaraing: 0 . 1

,
TTL
ip_forward_src_rauted:
ip_respond_to_echo_broadcast:
ipforward directed broadcasts:

, UNIX- (
NT-) NAT;
, Cisco PIX.
Solaris ,
1-.
Solaris 1 pfmod,
STREAMS- . Sun
Solaris,

IP-
N A T Solaris. IPFUter.
,
SPARC Intel. :
htt :// heops.anu.edu.au/~avalon/ip-n her. html

13. TCP/IP

335

ipf ipnat, ,
13.15.
Firewall-1 Checkpoint Solan's
, IPFilter.
, , , Web-, Web-.

Solaris "" ,

(, ).
Solaris,
.
:
#

pkginfo

grop

, :
system SUNWapppr PPP/IP Async daemon c o n f i g f i l e s
system SUNWapppu PPP/IP Async PPP daemon, l o g i n s e r v i c e
system SUNWpppk. PPP/IP and I P d i a l u p Device D r i v e r s
, . man-,
pkgadd. . 13.18 , Solaris.
13.18. , Solaris

/etc/knit.d/asppp

/usr/sbin/aspppd

, -

/etc/asppp.cf

/var/adm/log/asppp.log

/tmp/.asppp.fifo

aspppd -

/usr/sbin/aspppls

-, aspppd, ,
/etc/log/asppp.log. .
grep strings
, ,
/var/adm. /etc.
, U U C P , (!)
- Solaris UUCP
- .
. - ,

336

II

Systems, Dialers Devices


/etc/uucp
, .
, 30,
.

UUCP-, /etc/asppp-.
IP- Systems.
/etc/asppp.cf,
ppphub (192.225.32.1), mybost (192.225.32.2):
#
ifconfig

IP-
ipaptpO plumb 1 9 2 . 2 2 5 . 3 2 . 2 1 9 2 . 2 2 5 . 3 2 . 1

up

ff
i n t e r f a c e ipaptpO
p e e r _ s y s t e m _ n a m e ppphub # , S y s t e m s
i n a c t i v i n y _ t i m e o u t 600
-,

10

- :
# / a t c / i n i t d/aappp s t a r t
, .
init. (
/var/adm/log/asppp.log).
ssh ftp.

Solaris ifconfig: /sbin.
/usr/sbin.
I -:
/etc/hosts, DNS.

/etc/nsswitch.conf: "" .
/sbin/ifconfig , ,
/etc/hosts
DNS- .
Ifconfig -
, : root .
. IP-
-.
Solaris -
ifconfig. , .

13.13. HP-UX
HP-UX
.
/etc/rc.config.d/neteonf. (
re.config.d)
; /sbin/rc

13. TCP/IP

337

netconf , ,
.


, netconf,
:
HOSTNAME
INTERFACE_NAME[0]
I P ADDRESS[0|
SUBNET MASK[0]

:
HoSTNAME="cf i s a s t e r
INTERFACE_NAME [G] = l a r i O
IF_ADDRSS[0]=192.108.21.99
SUBNETMASK[0]=255.255.255.0

1.
NET CARDS. 2.
netconf , .
, .
R0UTE_DESTINAT10N[C]=default
ROUTE^MASK [ 0 ] *="*'
ROUTE_GATEWAY 0 ] = 1 9 2 . 1 0 8 . 2 1 . 2 5 4
ROUTE_COUNT[Oj=l

ROUTE_MASK ,
, .
ROUT_COUNT 0,
, 1,
. RUTE_* [] >. 2\ ..
route. , ROUTE_DESTINATION
default, , net , host .
HP-UX gated, routed.
GATED I, GATED_ARG3
, .
14.
-, (man routing).
netconf .
IP-. ,
/etc/hosts.
/etc/hosts .

, .
Ian scan,
. ifconfig - ,
ifconfig .

6
I).

"lan" "snap". "lan"


Ethernet, "snap" IEEE 802.3.
1, l a n l ..
HP-UX. Solaris,
, ileonfig
IP-.
SAM ,
,
.


, :
ifconfig

If
#

route

lan0

add

192.106.21.99

netmaok

default 192.10B.21.254

OxffffffOO

1*

lanscan ,
, . lanscan -v
. . MAC
ETHER , 1 0 ,
snapO. ifconlig , .
%

lanscan

Hardware
Path

Station
Address

Crd
In#

B/0/20/0

0x001...

ifconfig

lanO:

UP

Net-Int
NaraePPA

NM
ID

lanO snapO

MAC
Type

ETHER

flags=843<UP,BROADCAST,RUNNING,MULTICAST>

ifconfig

ifconfig:

HP-DLPI
Support
Yes

DLPI
Mjrt
130

lanO

netmask
%

Haw
State

ffffffOO

broadcast

inet 192.108.21.99

192.108.23.255

snapO
no

such

interface

netsiai -i ,
netstat -nr :
%

net*tat

-i

Name

Mtu

lanO

1500

192.108.21. 0

Add_ess
d i s a s t e r .x o r . c o m

loO

4136

12").0.0.0

l o c a l h o s t - x o r -com

Network

Ipkts
6047

opkts
3646

231

231

% netstat -nr
Routing

rubles

Dest/Netmask
127.0
0.1

Gateway

192.108
21.99
192.108.21.0
127 0 0 . 0

21.99
192.108.21 .99

UH
U

127.0.0.1
192.108.21 .254

UG

default

127.0.0
192.108

Flags
UH

Refs

Use

Int

Pmtu

231

loO
iar

4136

lanO

1500

loO
lanO

4136

4136

1500

HP-UX II ; 0, Fie
. .

13. TCP/IP

339

lanadmin
. . ,
.
l a n 0:
% lan&dmln
LOCAL AREA NETWORK ONLINE ADMINISTRATION, V e r s i o n
C o p y r i g h t 1994 H e w l e t t P a c k a r d Company.
All rights are reserved.
Test Selection
lan
=
menu
quit
terse
verbose
=

1.0

mode.
LAN I n t e r f a c e A d m i n i s t r a t i o n
D i s p l a y t h i s menu
Terminate the Administration
D o n o t d i s p l a y command menu
D i s p l a y command m e n u

E n t e r command; l a n
LAN I n t e r f a c e t e s t m o d e . LAN i n t e r f a c e PPA N u m b e r
clear
- Clear s t a t i s t i c s registers
display
* = D i s p l a y LAN I n t e r f a c e s t a t u s / s t a t i s t i c s
end
- E n d LAN I n t e r f a c e A d m i n . , g o u p I l e v e l
menu
- D i s p l a y t h i s menu
ppa
= PPA N u m b e r o f t h e LAN I n t e r f a c e
quit.
- T e r m i n a t e t h e Admin, r e t u r n t o s h e l l
reset
= R e s e t LAN I n t e r f a c e , e x e c u t e s e l f t e s t
specific
= G o t o D r i v e r s p e c i f i c menu
Enter

command:

display
LAN INTERFACE STATUS DISPLAY
T h u , Mar 2 , 2 0 0 0
00:41:24

PPA N u m b e r
Description
Rev 0.
Type ( v a l u e )
MTU S i z e
Speed
Station Address
Administration Status
(value)
Operation Status
(value)
Inbound
Inbound

Unicast Packets
Non-Unicast Packets

I n b o u n d Unknown P r o t o c o l s
Outbound O c t e t s
Outbound Unicast Packets

=
l a n O HP 1 0 / 1 0 0 TX H a l f - D u p l e x Hw
ethernet-csmacd(6)
1500
10

up (1)

up(l)
4204
5594
= 501
= 4 5 4 9 0 3
= 36D3

Deferred Transmissions
Late Collisions
Excessive Collisions

, ,
3 ( , ). . lan

340

II.

display, ,
clear ( ) reset ( ),
, .
D H C P
,
DHCP
/etc/rc.conflg.d/netconf.
DHCP_ENABLE; [0] , [1]
.. ,
DHCP_ENABLE[0]-1

DHCP.
-, DHCP-, . 0,
DHCP ;
netconf. DHCP ENABLE , ,
1.
/sbin/auto_parms
DHCP- dhcpdb2conf DHCP, autojparms, netconf.
.
HP-UX DHCP-
bootpd, dlicptools
DHCP , ,
. ,
dlicptools .
/tmp,
"dhcp".
DHCP
SAM. , HP-UX
DHCP- . , HP-UX
DHCP-.

Solaris, ndd
( 100). ,
ndd " ". , /etc/rc.config.d/nddconf,
.
-h ( ) .
ndd -h .
, ,
, ,
. :
% ndd -h | grop aourcs
ip_forward_src_routed
%

ndd

Controls

forwarding

of

source

routec

packets

-h i p _ _ r o r * a r d _ r c _ r o u t e d

13. TCP/IP

341

ip_f orward_src_couted:
Set to 1 to forward source-routed packets; set to 0 to
d i s a b l e f o r w a r d i n g . I f d i s a b l e d , a n I CMP D e s t i n a t i o n
Unreachable message is sent to the sender of sourcer o u t e d p a c k e t s needing to be forwarded. 10,1] D e f a u l t : 1

ndd. HP-UX (.00)


. (, ,
, ndd
.)
i p _ f o r w a r d _ s r c _ r o u t e d , -get -set:
% ndd - g e t / d a v / i p i p f o r w a r d s r c r o u t e d
1
% sudo ndd - s e t / d e v / i p i p _ f o r w a r d _ r c _ r o u t e d 0
% ndd - g e t / d e v / i p i p _ f o r w a x d _ a r c _ r o u t e d
0

nddconf:

t
TRANSPORT N A M E [ 0 ] = i p
NDD_NAME[0]-ip_forwardsrcr
NDD_VALUE[0]=0

outed


nddconf , ,
1. 0. , 10
.
, , N A T
. 13.19 , HP-UX ,

13.9.
ndd
13.19. , , HP-UX

,, ndd

IP-

ip f o r w a r d i n g : 0 . 1 -

ICMP-

ip

forward_src

ping-

ip

forward

, 2

routed: 0

directed

broadcasts: 0

, 1.
HP-UX IP-,
- (. ). NAT
. , (Darren Reed) IPFilter HP-UX.

342

II *

inetd HP-UX
TCP.
/var/adm/ine Id .see 21.7.
, Cisco PIX. . UNIX-
. , HP-UX
,
http://peopIe.hp.se/stevesk/bastionl 1 .html
, ,
, HP-UX 11.00. "" . "",
HP-UX,
Internet. , Web-,
?

HP-UX - Morning Star, tun
IP-. HP-UX . Solaris.
HoneyDanBer UUCP, Solaris ,
HP-UX !
.
. 13.20 ,
, Solaris.
13.20. , HP-UX

/elc//Auth

/etc/ppp/Dcvices

()

/etc/ppp/Dialers

/etc/ppp/Filter

/etc/ppp/Keys

/etc/ppp/Systems

/etc/ppp/Autostart

pppd

/iLsr/bin/pppd

man-cTpamiuhi, , ,
:
"", . , man Systems
, man ppp.Systems
Systems, .
/tc/ppp
. Systems, v:

13. TCP/IP

343

, - ppp.Systems:
# Examples of e n t r i e s t h a t we use at Morning S t a r Technologies
#
t r o u g h Any ACU 1 9 2 0 0 - P E P 5 5 5 1 2 1 2 o g l n : o g i n : P r e m o r a s s w o r a : \ q k j L J H I u D
# m a n a t e e Any ACU 3 6 4 0 0 5 5 5 2 4 6 6 o g i n : o g i n : P r e m o r a s s w o r d : \qd7DW3KiZ

/etc/ppp/examples ,
.
HP-UX, UUCP-
, ,
,
. /elc/ppp/Autostart,
pppd .
Autostart.ex, .
/sbln/rc2.d
Autostart .

HP-UX ,
8 . , UUCP /etc/rc.conlig.d/NODENAME, 8 .

13.14. Red Hat


Red Hat
/etc/sysconfig /etc/sysconfig/network-scripts.
DHCP , IP-.
, TCP
.

/etc/syscon fig/network.
DNS- . ,
network , Ethernet-
IP- :
NETWORKING-yes
FORWARD_IPV 4 = f a l s e
HOSTNAME=redhat.xor.com
DQMAINNAME-xor.com
GATEWAY-192.108.21.254
GATEWAYDEV=ethO

/etc/hostname.
, ,
.
, ,
/etc/sysconfig/network-scripts/ifcfg-wiwiep^euc,

344

II.

. IP-, ,
.
, ,
, .
Ethernet- (ethO)
(1).
ifcfg-ethO ifcfg-loO redhat.xor.com,
network:
DEVICE~ethO
IPADDR-l92.1OB.21.73
NETMASK=-255.255-255.0
NETW0RK=192.108.21.0
BROADCAST^l92.108-21.255
ONBOOT-yes

DEVICE-lO
IPADDR-127.0.0-1
NETMASK=255.0.0.0
NETW0RK=127.0.0.0
BROADCAST=127.255.255.255
ONBOOT-yes

Red Hat ,
. /sbin/ifup /sbin/ifdown

. /etc/syseonfig
/sbin/ifdown
/sbin/lfup . ,
.
, /etc/rc.d/init.d/network, start, slop,
restart status.
start.
.
, /etc/sysconfig/static-routes,
.
route add.
echO
ethl

ret
ret

130.225.204.48 netmask 255.255.255.248 gw 130.225.204.49


192.38.8.0 netmask 255.255.255.224 gw 192.38.8.129

, route:
( n e t h o s t ) , , , ,
. gw . Linux m e t r i c route,
,
.
Red Hat 5.1 linuxconf.
,
, .

13. TCP/IP

345



. , up
ifconfig , gw
route :
# ifconfig ethO 192.10. 21.73 netmaak 255.255.255.0
I route add default gw 192.108.21.254 ethO
ifconfig is Red Hal ,
, :
3 /sbin/ifconfig
ethO

Link encap:Ethernet
HWaddr O 0 : C 0 : F 0 : l F : 5 7 : 6 1
m e t addr; 192.108.21.73 Beasc: 192.108 .21.255
Mask:2b5:255:255:0
UP BROADCAST RUNNING MULTICAST
MTU:1500 M e t r i c : 1
RX pkts:248725 e r r o r s : 0 dropped:0 overruns:0 frame:0
TX pkts:5219 errors:24 dropped:0 overruns:0 c a r r i e r : 2 0
collisions:1280
txqueueien:100
I n t e r r u p t : 1 Base addr 0x6500
lo
Link e c n a p : L o c a l Loopback
inet addr:127.0.0.1
Mask:255.0.0.0
UP BROADCAST RUNNING MULTICAST
MTU:3924 M e t c i c : l
RX pkts:44 e r r o r s : 0 dropped:0 overruns:0 frame:0
TX pkts:44 e r r o r s : droppea:0 overruns:0 c a r r i e r : 0
collisions:0
txqueueien:100

Ethemei- 1280,
24,5% . ,
.
\ .
, netstat -nr
, netstat -i
:
% netstat -nr
Kernel IP routing t a o l e
Destination
Gateway
192.108.21.73 0.0.0.0
192.108.21.0
0.0.0.0
127.0.0.0
0.0.0.0
.0.0.0
19B.I08.21.254

Genraask
F l a g s MSS Window
2 6 5 . 2 5 5 . 2 5 5 . 2 5 5 UH
0
0
2 5 5 . 2 5 5 .. 2 5 5 . 0
U
0
0
2 5 5 . 0 . 0 .0
U
0
0
0.0.0.0
UG
0
0

i r t t Iface
0
ethO
0
ethO
0
lo
0
ethO

% netstat -i
Kernel

Interface

I f a c e MTU
MeL
ethO
1500
0
lo
3924
0

table
OK
251684
44

Receive
ERR DRP
0
0
0
0

OVR
0
0

OK
5710
44

-TransmitERR
DRP
24
0
0
0

OVR
0
0

fig
BRU
LRL'

netstat -i
, , ,
.

II.

DHCP

Red Hal DHCP- dhcpd DHCP-:


pnmp dhcpcd ( -. bootpd). ,
ISC (www.isc.org). ,
. DHCP- Red Hat ,
,
. lSC- 13.15.
pump DHCP- Red Hat.
/etc/sysconfig/neiworkscripts/ifcf%-UHtnep<fieuc. , e t h O D H C P ,
/etc/sysconfig/network-scripts/ifefg-ethQ, IP-,

BOOTPRoTO=dhcp
pump
e t h O ,

# -1 ithO
pump :
I pump - -1 othO
dhcpcd, pump,
. , Red Hat
, .
/etc/dhcpc.

Linux ,
.
, Linux ""
/.
/proc/sys/net/ipv4.
;
%

cd

/proc/eya/net/ipv4;

la

-F

conf/
icmp_destunreach_rate
icmp_echo_ignore_broadcasts
icmp_ignore_bogus_error_respons
i cmp_timeexceed_rate
ip_always_de f rag
ip_de f a u 1 t _ t 1 1
ip_forward
i p j m a s k debu g
ipfrag_high thresh
ipfrag_time
route/
tcpkeepaliveprobes

13. TCP/IP

es

icmp_echo_ignore_al1
i cmp_e chorep1y_r a t e
lcmp_paramprob_rate
icrap_max_memberships
ipautoconfig
ip_dynaddr
ip_local_port_range
i p n o _ p m tu _d i sc
ipfrag_low_thresh
neigh/
t c p f i n_tinieou t
tcp keepalivetime

347

tcp_max_ka_p r o b e s
tcp_retrans_collapse
tcp_retnes2
tcpsack
tcp_syn__re t r i e s
tcp_timestamps

tcp_max_syn_backlog
tcp retriesi
tcp_rfcl337
tcp_stdurg
tcp_syncookies
tcp_window_scaling

, "rate"
"max", " "
conf ,
. all defaults,
( )
:
% i s -F
accept_redirects
forwarding
proxy_arp
send r e d i r e c t s

accept_source_route
log_raarcians
rp_filter
shared_meaia

bootp_relay
mc_forwarding
secure_redirects

, all, . , ,
ethO, .
defaults
.
, cat. echo,
. ,
%

cat

icmp_echo__ignore_broadcaate

, i c m p _ e c h o _ i g n o r e _ b r o a d c a s t s 0, .. ping- .
1 "smurf').

sudo

ceh

"echo

>

icnip

echo_ignore_broadcaets"

/usr/src/linux/Doeumentation/proc.txt, SuSE Linux,


/. ,
, , .
, , N A T
. 13.21 , Red Hat ,
.
13.9.

sudo echo 1 > icmp echo ignorc broadcasts,


"permission denied" ( ). sudo. ,
echo,
. ,
(, .

343

II

13.21. , , Linux

( /proc/sys/ne*J

[-

lpv4/ip_forward
lpv4/conf/uKme/>^uc/forwarding
1

ICMP-

\/1//1_-

-
ping-

dlrects

ipv4/conf/uwe/j^ewc/*ceep{_sonrcejroute
ipv4/ip_eehoJgnore_broadcasla


all.
(,
),
echo ,
.
Red Hat IP-.
UNIX ( Windows NT)
,
.
, ,
,
(, Cisco PIX).
ipchains.
Linux- , ,
, "",
. 21 ,
,
. , ,
, . ( 21.9 , .
, ,
.)
ipchains ""
, .
, , , . , .
.
: i n p u t , o u t p u t f o r w a r d .
. , , .
f o r w a r d ,
. i n p u t
, . , o u t p u t ,

13. TCP/IP

349

.
,
.
ACCEPT. DENY. REJECT. MASQ.
REDIRECT RETURN. ACCEPT
. DENY REJECT ,
"" ,
iCMP- .
t4ASQ IP- ( Linux
NAT)". ,
FORWARD_LPV4 network t r u e
cONFIG_IP_MASQUERADE.
REDIRECT -.
,
CONFTG_IP_TP.ANSPARENT_PP.OXY. , Web- ,
Squid. RETURN .
Red Hal
ipchains, rc.firewall.
ipchains. , :
ipchains

ipchains

-F

- _ -i

-j

.
. -i -j
. ipchains (. 13.22).
13.22. Ipchoins

~
: tcp, icrop
IP- (
-s
CIDR)
-d

IP-
(
s p o r t
)
-dport (
)
~ i c m p _ t y p e
ICMP- (
)
Syslog ( "kernel",
"info")
TCP-
( )

, Red Hal NAT,


PAT (Port Address Translation ).
, NAT,
- .
,
"NAT".

350

II.

. ,
Internet, e t h O .

,
( NAT).
o u t p u t , ,
Internet.
ipchains
ipchains
ipchains
ipchains
ipchains

-A
-A
-A
-A
-A

I n p u t - i l o - j ACCEPT
i n p u t - i e t h O - j ACCEPT
i n p u t - i p p p O - s 1 9 2 . 1 6 8 . Q . G / 1 6 - j DENY
i n p u t - i p p p O - 8 1 7 2 . 1 6 . 0 . 0 / 1 2 - j DENY
i n p u t - i pppO - s 1 0 . 0 . 0 . 0 / 8
DENY

Internet telnet ( 23),


SSH ( 25 22 ), :
i p c h a i n 3 - A I n p u t - i
i p c h a i n s - A i n p u t - i pppO
i p c h a i n s - A i n p u t - i pppO

- tcp dport 23 -j
-p tcp dport 23 -j
-p tcp dport 23 -j

DENY
ACCEPT
ACCEPT

i n p u t , ,
. ,
Internet, -1
DENY, ,
:
ipchains

-A

input

-i

-j

DENY

-1

, IP- ( NAT),
, 192.168.1.0/24:"
ipchains

-A

forward -i

-s

192.168.1.0/24

-d

192.168.1.0/24

D MASQ

,
, ( 1
). , ,
.
Linux ,
NAT, Internet Linux IP-
,
.
, ipchains
,
NAT . , ipchains,
www.vviley.com/compbooks/sonnenreich.
, ipchains Linux
2.2 .

?
f o r w a r d , i n p u t .

13. TCP/IP

351


Red Hat ,
FreeBSD ( , ),
.
, 13.15.

, Linux
TOS (Type of Service ) IP
, ( ). ! , Microsoft
, .
, Windows 95, 98, NT 2000,
. UNIX-
Linux- ,
UNIX, Windows, Windows- .
UNIX- .
TOS
Linux. "IP: use TOS value
as routing key".
IP- ( NAT),
, ,
.
,
,
.
Linux -
. .

13.15. FreeBSD
FreeBSD
: ( NAT),
, T/TCP (
Web- ) .
/etc/rc.conf.
/etc/defaults/rc.conf,
.
/etc/rc.conf.local, ,
.
shell-,
.
, ,
. /etc/defaults/.
. /etc/rc.conf ,
, , ,
FreeBSD. rc.conf.local ,

352

II.

. ,
rc.conf.
/etc/defaults/rc.conf . ,
,
, ,
,
FreeBSD 3.4 40 ,
( 13),
IPv6.

, rc.conf,
,
/etc/defaults/rc.conf:
ho a t " 1_
ifconfig_xxx="inet
IP-"
defaultrouter"umB3"

# !
#
#

n e c w o r k _ i n t e r f a c e s a u t o ,
.

( ). :
n e t w o r k _ i n t e r a c e e - " l o O "
s t a t i c _ r o u t e s :
s t a t i c _ r o u t e e - " b a c k l a n 212"
I
route_backlan-"-net 10.0.2.0 132.236.212.2"
r o u t e _ 2 1 2 - " - n e t 132.236.212.64 -netmaak 255.255.255.192 132.236.212.6
s t a t i c _ r o u t e s
. ,
route_iom, route add
. ,
, routed gated. (
N1S .)

Ethernet-
, :
ifconfig inet 192.108.21.11 netmaak OxffffffOO
route add default 192.106.21.254
:
route add -net 0.0.. 192.106.21.254
route, FreeBSD
, (-net
-host), .

13. TCP/IP

353

ifconfig netstat -nr


:
% ifconfig
xlO:

l a g s = 8 8 4 3 < U P , B R O A D C A S T , R U N N I N G , S I M P L E X , MULTICAST>mtu 15QD


inet 192.108.21.11 netmask OxffffffDG broadcast 192.108.21.255
ether
00;60:97:9b:69;9a

media: 10baseT/UTP < h a l f - d u p l e x >


s u p p o r t e d m e d i a : a u t o s e l e c t lOObaseTX < f u l l - d u p l e x > lOObaseTX
< h a l f - d u p l e x > lOObaseTX LObaseT/UTP < f u l l ~ d u p l e x > lObaseT/UTP
lObaseT/UTP < h a l f - d u p l e x >

% netntat -nr
Routing t a b l e s
Internet:
Destination
default
127.0.D.1
192.108.21
192.108.21.1
192.108.21.246
192.108.21.254

Gateway
192.10B.21.254
127.0.0.1
linkl
8:0:20:77:5e:a0
0:3C:f2:f:48:0
C: 0 : c 11: 8 2 : 8 1

Flags
UGSc
UH
UC
UHLW
UHLW
UHLW

Rels
0
0
0
2
0
1

Use
18
3
0
2586
0
0

Netif
xlO
loO
xlO
XlO
xlO
xlo

Exp

1160
303
1126

netstat -nr ,
( )
. ,
.

. ,
ARP-.
, 4.4B5D , FreeBSD
. , FreeBSD
(,
MTU TCP-), .

, .
, .
S ,
, .
FreeBSD 4.0.
IPv4, IPv6.
ifconfig:
% ifconfig fxpl
fxpl:

flags=8943<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST>mtu 1500
m e t 135.197.1.116 netmask OxffffffOO broadcast 135.197.1.255
i n e t 6 E e B O : : 2 0 8 : c 7 f : f e 8 9 : 4 f 0 3 % f x p l p r e f i x l e n 6 4 s c o p e i d 0x2
ether
00:08:c7:89:4f:03
m e d i a : a u t o s e l e c t (lOObaseTX < h a l f ~ d u p l e x > ) s t a t u s : a c t i v e
s u p p o r t e d m e d i a ; a u t o s e l e c t l O O b a s e T X < u l l - d u p l e x > lOObaseTX
lObaseT/UTP < f u l l - d u p l e x > lObaseT/UTP

' >354

II.

DHCP

FreeBSD D H C P - ISC. rc.conf. / e t e / d e faults/rc.conf :


dhcpjprograrr.-'Vsbin/dhclient"

I DHCP-

dhcpflags^""

, ;
, dhclient
. D H C P
, /etc/rc.conf:
i f c o n f i g _ j w i ' e p $ e # c - " DHCP"

# DHCP

dhclient
, /etc/dhclient.eonf.
IP- ,
, ..
dhclient.conf , B I N D D H C P ISC. ,
. ,
, .
dhclient
dhclient.leases, /var/run/dhclient.pid.

FreeBSD
syscll ,
65- .
- sysctl(3).
sysctl - .
, ,
"net". . sysctl - |
grep net.
,
sysctl. ,
, IP-;
%

sysctl net.inet.ip.forwarding

net.inet.ip.forwarding:

1 . ,
-w :
% sudo s y s c t l -v net. inet. ip. fforwarding=0

n e t . i n e t . i p . f o r w a r d i n g : 1 -> 0
IP-

13. TCP/IP

355

, , N A T
. 13.23 , FreeBSD ,
.
13.9. ,
,
/etc/rc., sysct).
13.23. , ,
FreeBSD

IP-

ICMP-

plng-

rc.conf
gateway e n a b l e

lemp d r o p r e f i x r e c t l

forward sourceroute
acceptaourceroute
icmp brr.caatecho

l c m p _ l o g _ r e d l r e c t ,
1-.
, UNIX
( Windows NT), , ,
.
, Cisco PIX.
U N I X
, ,
"". ,
FreeBSD: Ipfw IPFilier.
Ipfw " " ,
Internet-, -,
. ""
TCP-, .
, Web-
FTP-, .
- dummynet.
ipfw ,
Cisco. N A T Ipfw, natd /sbin.
ipchains Linux, ipfw
. , shell-,
ipfw. ,
. deO , a e d l
. .
, . ,
, ,
.
# i p f w FreeBSD
I
ipfw -f flush

' >356

II.

DHCP- g w . e y a n c k . n e t
i p f w add 500 a l l o w i p from 1 2 8 . 1 3 8 . 1 2 9 . 1 3 6 t o
i p f w add 510 a l l o w i p f r o m 2 0 9 . 1 8 0 . 2 5 1 . 5 8 t o any
SSH
I p f w add 600 a l l o w t c p from any to any 22 v i a deO
i p f w add 605 a l l o w t c p from any 22 to any in v i a deO
t ARP-
i p f w add 1000 a l l o w udp from 0 . 0 . 0 . 0 2054 t o 0 . 0 . 0 . 0
DNS-.
Web-, DHCP- U DP-
traceroute Quake ( ).
. " " ,
DNS-
. .
IPFilter, ,
, UNCX.
ipf, ,
ipfstat. , ipnat, NAT, .

http://coornbs.anu.edu.au/~avaIon/ip-filier.htrnl
,
:
o p t i o n IPFILTER
o p t i o n IPFILTERLOG
IP Filler
NAT, ipchains Red Hat.
- ipf(l) ipf(S)
.
ipf ( /elc/ipf.rules),
:

in l o u t

[quick]

...

:
p a s s ;

b l o c k ;
l o g Syslog;

c o u n t , .
q u i c k ,
. c o u r t
l o g .
, .
,
.
ipchains
ipfw, Linux ,
. ipf
,
,
.

13. TCP/IP

357

. 13.24 ,
ipf. . -. ipf.
13.24. ^ ipf

on

p r o t o

, : t c p , udp iemp

from

: , any

to

: , any

p o r t -

,
( /etc/services)
; =
(<, >. < - , >=)

f l a g s

icmp-type

ICMP

keep state

;
, TCP-

,
, Red Hat,
i p c h a i n s i p f . , ,
Internet, e t h O
Ethernet-.
, :
pass in on ethO all
pass in on lo ail
block in quick on pppO from 192.168.0.0/16 CO any
block m quick on pppO from 172.16-0.0/12 any
block in quick on pppO from 1C.0.C.0/8 to any
telnet,
SSH-, :
block in proto tcp from any to any port = 23
pass in on pppO proto tcp from any to any port = 25
pass in on pppO proto tcp from any to any port
22
f l a g s
k e e p - s t a t e , TCP-.
21.9 - ipf(5), ,
. ,
OpenBSD, /usr/share/ipf. ipf ipnat.
NAT,
, ,

II.


13.4.
NAT, ipnat,
ipf. ,
:

ipnat (
ipnat.rules).
192.168.1.0/24 -> 128.138,198.0/26 portmap tcp/udp 20000:65000
map ppp0 192.168.1.0/24 -> 128-138.198.0/26
-. ,
Internet,
. /24 /26.
/ 2 6 ,
/24, , -
. p o r t m a p ,
45000 .
T C P U D P .
ICMP, .
ICMP-;
-. ,
1-.
. ,
, .

IP- , DHCP-
. ,
/ 3 2
. ,
0/32, ipnat
. ,
, .
map 192.168.1.&/24 -> 0/32 portmap tcp/udp 20000:65000
, NAT
.
.
t ipf - -Fa -f / e t c / I p f . r u l e a
# i p n a t -CF - f / e t c / i p n a t . r u l e a
# ipmon -D -a
-E ipf , -Fa
, -f
/etc/ipf.rules. ipnat
, /etc/ipnat.rules. ipmon ,
, ipf /dev/ipl,
Syslog.
FreeBSD ,
ipfw. ipf. ,
ipf .

13. TCP/IP

359

rc.network.
ipfw. rc.network
; , NAT
n a t d _ * :
r . a t d j p r o g r a m - " / u s r / s b i n / rpna t"
natd_enable-"YES"
natd_interface-"xxx"
IP-
natd_flags-"-f /etc/_pnat.rules"
#

.
, .

FreeBSD : ,
. . IP-
/etc/ppp/ppp.conf. ,
, .
-, ' , .
,
tun /dev/tunO, /dev/tunl ..
.conf; /etc/
, -
. ppp.deny
(, root bin),
. .shells
; . .
d e f a u l t ppp.conf ,
, ,
. ,
-, :
allow user !_
netblazer800:
s e t phone
set login "ABORT NOWsCARRIER TIMEOUT 5 ogin:ogin:
word: "
set tjuneout 120
delete ALL
add default HISADDR
,
( root),
(
).
- ( ,
).
- pppd
/etc/, options ppp.deny
,

I).

options.netblazer , chat.netblazer . FreeBSD


-:
/usr/share/examples.
-
.
pppd,
Netblazer,
,
, :
%

cat

/etc//option

* -
lock
#
asyncir.ap OxOGOOOOGO
crtscts
#
modem
#
defaultroute
f -
mru 552
# KRU/MTU 512 ( + 40 {)
mtu 552
%

cat

/ e t c / p p p / o p t i o n a .netblaater

#
128.138.198.47:128.138.243.167
netmask 255.255.255.0
/dev/cuaa2
57600
#perslst

-
# : IP-
#
* ,
#
#
#
flholdoff 5
# 5
connect "/usr/bln/chat -v -f /etc/ppp/chat.netblazer"
disconnect "/etc/ppp/hangup"
I
%

cat

/etc/ppp/chet,netblazer

ABORT BUSY ABORT

TIMEOUT
TIMEOUT
TIMEOUT
ssword:
'Packet

'NO CARRIER'

5 OK-1'-'* ATZ 0K-+f+ATHZ-OK ATDTHOMep_


60 CONNECT ''
10 ogxn:ogln: Pevi

mode enabled'

, .
, .
.
, .
- , "\ .
pppd :
%

audo pppd file

13. TCP/IP

/etc/ppp/optiona.netblazer

361

,
/etc/ppp/options, ~/. /etc/ppp/options.wfe/ .
-, pppd:
%

sudo kill

"cat / v a r / r u n / . p i d "


Ethernet-, ,
pppd Ethernet. , pppd
, .

. .up, .
-
-:
% I f c o n f i g pppO
pppO: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 552
inet 128.138.198.47 > 128.138.243.167 netmask OxffffffOO
% netstat -nr
Routing tables
Internet:
Destination
default
127.0.0.1
128.13.243.167

Gateway
128.13..243..167
127.0.0..1
12.138..198..47

Fiags
DGSf
UH
UH

Reis
3
0
4

Use
a
0
0

Netif
pppO
loO
pppO

pppstats -:
% a tats

IN
1647029

PACK
5101

COMP
4596

UNC
157

ERR
0

|
OUT
I 203582

PACK COMP UNC NON-VJ


5051 4566 210
275

COMP ,
TCP-. UNC
. RFC 1144.

route FreeBSD ,
. .
. , "" I 0.0.0.1. ,
, .

13.16.

362

Stevens, W. Richard. TCP/IP Illustrated. Volume One: The Protocols. Reading.


MA: Addison-Wesley. 199^
Wright, Gary R., and Stevens, W. Richard. TCP/IP Illustrated, Volume Two
The Implementation. Reading, MA: Addison-Wesley. 1995
, T C P / I P , .

II. *

Stevens. W. Richard. UNIX Network Programming. Prentice Hall. 1990.


Stevens. W. Richard. UNIX Network Programming, Volume 1: Networking APIs
Sockets and XTI. Upper Saddle River, NJ: Prentice Hall. 1997.
Stevens, W. Richard. UNIX Network Programming, Volume 2: Interprocess
Communications. Upper Saddle River, NJ: Prentice Hall. 1998.
, .
. STREAMS.
.
Tanenbaum. Andrew. Computer Networks, 3rd Edition. Upper Saddle River, NJ:
Prentice Hall. 1996.
- .
.
ISO,
Internet,
Salus, Peter . Casting the Net. From ARPANET to INTERNET and Beyond.
Reading, MA: Addison-Wesley. 1995.
. ARPANET Internet.
, UNIX, , !
Comer, Douglas. Internetworking with TCP/IP Volume I: Principles, Protocols,
and Architectures, 4th Edition. Upper Saddle River. NJ: Prentice Hall. 2000
TCP/IP.
, TCP/IP.
.

Hunt, Craig. TCP/IP Network Administration, Second Edition. Sebastopol, CA:


O'Reilly & Associates. 1998.
UNIX-. TCP/IP.,
UNIX ,

Sonnenreich, Wes, and Tom Yates. Building Linux and Open BSD Firewalls.
New York, NY: J.W. Wiley. 2000.
, ,
.
, ,
sudo .
.
.
Web- www.netscan.org ""
"smurP (.. , ICMP-). IP-, ,
, .
, !
,
Internet , www.isoe.org/internet/history.

13. TCP/IP

363

13 IP-.
,
.
,
. , .

, ,
, "".
,
. ,
,
.
- , 1-
, ,
. , ,
" ".
,
.
,
.
*.

LP-, .
.

' >359

II.

14.1.


, , . ,
, . .

^ |
^;

. .
Ml Ethernet-,
2 (,
Ml 2 UNIX-, ).
, . :
% n e t s t * t - r n
Routing tables
Destination
127.0.0.1
199.165.145.0
default

Gateway
127.0.0.1
199.165.145.17
199.165.145.24

Flaga
UH
U
UG

Refs
6
5
2

Dee
563131
2845294
160589

If
loO
leO
leO

.
.
, ,
, . 1 0
Ethernet-* , 1 0 (
, ).
ifconfig
[7|

ifconfig

13.10.

R, ,
IP-, .
, ,
- - : d e s t i n a t i o n
127.0.0.0. 127.0.0.1 (, ).
.
, .
.

.

14.

67

13.4.

,
, 1,
199.165.145.24. G ,
,
.
, ,
199.165.146.4. IP- 199.165.146 ,
, , ..
Ml . ,
Ethernet ( Ethernet - I
145).

IP-

Efhemei-adpecoe

Ethernet
:
: Ml
: IP

IP
: 199.165.145.17
; 199.165.146 4
: UPD

13.3.

UDP
11001010110101011101010110110101
01110110110111010100010100100010
01D11111011010101010011101010000
UDP-
(-

Ett-iemet-
. . Ethernet-noKeT
Ethernet- M l ,
IP-, Ethernet-,
. ,
, IP- .
' , ,
, (,
).
M l :
Rl% n e t s t a t - r n
Routing tables
Destination
Gateway
Flags
Keis
Use
I
127.0.0.1
127.0.0.. 2
10
UH
10233
loO
199.165.146 0
199.165..146.. 1
U
15
4529
lei
199.165.145.0
199.165..145..24
0
leO

121
default
199.165..146,.3
4
US
168589
lei
. ,
.
2 Internet. , 199.165,
.
.
, .

361 II

199.165.145 M l ,
Internet 2.
% n e t a t a t -m
Routing t a b l e s
Dest ination
127.0 0.1
199.165.146..0
199.165.145..0
default

Gatewaj
127.0.0..1
199.16! 146..4
199.165..146..1
199.165. 146..3

Flags
DH
D
DG
UG

Fers
2
15
0
4

Use
54 J
4529
121
168589

It
loO
leO
leO
leO

,
, I C M P -
.
% n e t a t a t -
Routing t a b l e s
Destination
127.O.O 1
199.165.146.0
default

Gateway
127.0.0. 1
199.165..146.4
199.165..146.3

Flags
UH
U
UG

Refs
2
15
4

Use
_543
4529
168589

If
loO
leO
leO

, (199.165.145.17),
, 2. ,
, ,
1. ICMP-,

.
199.165.145.17

199.165.146.1

UGHD

10

, ,
M l .
145.
2.

1- ''" , ,
. !,
, , ,
, . -
, ( ,
2, ,
) .
.

14.2.


, . . ,
.
. ,
,
.
, .

14.

67

, . ,
,
.
:
, "" . ,
,
(
).
,
, .

: - .
-

- :
" X
Y ,
". , , ,
, , .
,
. , , .
, ,
! ,
.
(, X
Y
Z, Y).
. , R I P (Routing Information Protocol ) , ,
15- , .

, .
, , , , ,
- " " . , R I P ,
30 . I G R P E I G R P 90
.
, B G P (Border Gateway Protocol ) ,
,
. - ,
EJGRP, ,
" ". , .

' >368

II.

, .
"" ( ).
. 14.1 - ,
.
14.1. -

_
Routing Information Protocol ( )
Interior Gateway Routing Protocol (
)
Enhanced Interior Gateway Routing Protocol
(
)
Border Gateway Protocol ( )

RIP
IGRP
EIGRP
BGP

.


,

Internet

, , .
: " X
Y, ".
,
. -
.
, .

, ,
,
, .
-,
,
( TOS IP-)
.
UNIX-, .
. 14.2
14-2

U 8
OSPF
IS-IS

. -*' , Open Shortest Path First (


)
Intermediate System to Intermediate
System ( )


( )

369


,
, ,
"". ?
? ?
, .
. 1,
.
.
,
, , ,

. 99%
.
, .
,
.
.
.

, .
. ,
. ,
. ,
.
.
. ()

, .
,

, ,
.
, .
Internet ,
,
. ( ,
. , .)
,
,
.

370

II

14.3.


, .
RIP:
RIP (RFC 1058) Xerox,
IP-. routed
- ,
. ' R1P ,
, ,
, ,
, .

RIP .
RIP "" ,
, ,
.
.
R1P UNlX-.
, SNMP-,
RlP-, . ,
UNIX- routed, RIP
" " . ,
,
.
RIP-2: , 2
RIP-2 RIP
, .
,
. ,
CIDR.
RIP, .

|\7[

CIDR 13.4.
routed -q (""
).
,
. , OSPF. RI -
. routed, "" ,
, , .
R1P-2 , .

14.

371

, . , ,
RIP.
RIP-2 ,
RIP-2,
RlP-. RIP-2, .
O S P F :

OSPF
RFC2328. " "
,
; "" "".
OSPF ,
, .
gated, .
, ,
( ).
OSPF
. gated
, Cisco.
, .
OSPF ,
. RIP
,
, ,
,
.
I G R P E I G R P :

IGRP EIGRP , Cisco. IGRP
RIP ,
, OSPF. E1GRP
, IGRP,
-. IGRP . IP-
, EIGRP CIDR.
-, , , . EIGRP
. EIGRP OSPF
.
, , , OSPF. ,
.

372

II

15IS:
IS-IS OSPF
ISO.
OSI, TCP/IP.
1S-IS OSPF 90- .,
OSI .
IETF IS-IS
TCP/IP.
OSPF . , OSI, .
M O S P F , D V M R P P I M :

MOSPF (Multicast OSPF OSPF), DVMRP
(Distance Vector Multicast Routing Protocol - ) PIM (Protocol Independent Multicast - )
, IP , .
www.cs.columbia.edu/~hgs/internet/mbone-faq. html.

ICMP-,
IP- 224.0.0.1,
. ,
,
. , -
.

14.4.

routed:
routed
UNIX,
". RIP,
RJP-2. RIP-2, routed
, gated ( ,
).
routed (-s) ""
(-q). ,
. ,
.
-s, -q, routed ""

. , , "*.

*'

UNIX (, HP-UX) gated.


routed .
: " ".

14.

67

.
,
. , ,
route.
[7f

route 13.10.
routed -t. -t
.
routed, , .
Internet , , ,
,
routed
, ; routed
-g.
, .
/etc/gateways,
routed .
gated.

14.5. gated:
gated ,
.
, , ,
.
, ,
. , gated
.
.
gated Web- www.gated.org.
gated .
, . 1992 .
Merit GateD.
. , , -,
, , -,
.
, " - " ,
"", gated.
3 .
3.5.10,
.
gated RIP ( ), OSPF IS-1S
, EGP BGP HELLO

6
I).

14.3 routed gated


. gated
, .
14.3.

rooted?

Solaris

gated

HP-UX

3.5 Beta 3

Red Hat

3.5.10

FreeBSD

3.5.11


gated
. (
14.6.
2).

/etc/gated.conf,
gdc, . , :
gdc

.
interface


. , , -
,

reconfig

checkconf

toggietrace

stop

; no
,

start

restart

;
stop, start

gated (),
.
, . ,
.
,
,

14.

67

. gdc toggletrace ,
. gdc
toggletrace .

( -t,
).
. ,
, .
.


norma]

policy

route

general
normal route
,
.
, .

UNIX,
gated . ,

. , , ,
,
.
gated.

, . ,
, , ,
: .
gated.
,
.
,
, 14.9.
,
. ,
.
.
.
,
;

( ):

, .
.

' >376

II.

.
,
.
traceoptions:
traceoptiona
[except

[ "_" [ r e p l a c e ] [ s i z e [|]
f i l e s )]
_
_] /

_ ,
. replace,
( ).
- .
, :
_, 1, _.2 .. ,
. size, files.
.
.
, /usr/local/etc/gated.log, 1 ,
3, :
t r a c e o p t i o n s " / u s r / l o c a l / e t c / g a c e c i . l o g " replace s i z e 1m f i l e s 3 a l l ;

:
options

[nosend]

[noresolv]

[syslog

[upto]

_) ;

:
nosend
.
, ,
,
noresok
DNS
IP-. DNS- ,
,
.


syslog
,
Syslog. ,
Syslog
man- syslogmasV. tyslog upto info

options

noresolv;


interfaces, :
interfaces {
options [ s t r i c t i n t e r f a c e s ] :

14.

37;

d e f i n e [ b r o a d c a s t J I [ p o i n t t o p o i n t ];
i n t e r f a c e _ [ p r e f e r e n c e ]
[passive]
[simplex]
[netmask ]
[multicast];
J;
optioBS. interface define
.
.
strictinterfaces
,
define.
, slrictinterfaces .
define , .
PCMCIA.
interface
.
, deO l e i , , d e 1
( ), .
IP- all.
passive,
,
. simplex ,
.
gated ,
.
preferences .
-
"" , ,
, .
, ,
, ,
.
gated
.
, , .
.
.

. , ,
. gated .

0. ,
preference .
. 14.4 ,
gated
1 0 , ..
:
interface {
i n t e r f a c e 10 p a s s i v e ;

);

378

II.

14.4.

, OSPF

10

ICMP

30

40

, gated.conf

60

, RIP

100

110

120


,
:
routeid

roulerid ,
BGP OSPF.
IP-
. ,
.
.
martians <
hose [allow];
[allow] [exact I r e f i n e s ] ;
mask [ a l l o w ] [ e x a c t I r e f i n e s ) ;
m a s k l e n [ a l l o w ] [ e x a c t I r e f i n e s ] ;
default [allow];
"" ,
.
,
.
, martians. gated.
.
martians
/.
mask masklen .
, .
exact refines
, :
, . ,
,
, "".
exact
, ,

14.

67

"".
, .
refines ,
, .
( ). , .

h o s t ;
default;
:
mask 2 5 5 . 2 5 5 . 2 5 5 . 2 5 5 e x a c t ;
0 . 0 . 0 . 0 mask 0 . 0 . 0 . 0 e x a c t ;
allow ,
. :
martians {
1 2 8 . 1 3 8 . 0 . 0 mask 2 5 5 . 2 5 5 . 0 . 0 ;
1 2 8 . 1 3 8 . 1 4 5 . 0 mask 2 5 5 . 2 5 5 . 2 5 5 . 0 a l l o w ;

};

128.138
, 128.138.145.
.
RIP
R1P rip:
r i p y e s I I on | o f f f[
broadcast,nobroadcast;
p r e f e r e n c e ;
d e f a u l t m e t n c ;
i n t e r f a c e
[noripin | ripin] [noripout I ripout]
[ v e r s i o n 1] I [ v e r s i o n 2 [ m u l t i c a s t | b r o a d c a s t ] ] ;
t r u s c e d g a c e w a y s _;
s o u r c e g a t e w a y s cnttco__ e;
t r a c e o p t i o n s [packets I request I response [ d e t a i l ] ] ;

>];
yes no on off.
R I P . ,
:
r i p ;
broadcast nobroadcast -s -q routed.
broadcast RIP- ,
. nobroadcast
RIP-.
defaullnietric , ,
RIP. ,

380

II.

, .
16, .. ,
RIP.
, 10.
, Interfaces,
. ripin RJP-
, noripin . ripout noripout
broadcast nobroadcast,
. noripout
-.
version , RIP-1
RIP-2 .
RIP-2 ,
, RIP-1 .
, broadcast.
gated RIP- ,
. , trusted gate ways,
.
IP-, .
sourcegateways , RIP-
, .

, .

traceoptions.
RIP. request, response packets
, .
,
detail .
O S P F
OSPF,
: .


.
OSPF ,
, .
(.. )
.
.
.
, .
, ,
.
: " X Y,

14.

67

" ( X ). , ,
, ,

.
-
, . -,
,
. ,
X. X
Y, Y 5 .
,
*.
-
, OSPF
. ,
^ , 0 (
).
,
".
.

OSPF, . ,
OSPF " "
, ja .


, ,
: " ,
1". 6 ,
30 ,
. ,
, , ,
.
OSPF ,
"*.
,
.
.
" ", ,
. 0
.
, .
. ,
NSSA (Not So Stubby Area ),
. ,
, , .
"" " ".
, .

382

II.

. ,
. , .
.
. ,
, ""
.
.
.
O S P F
O S P F ospf:
o s p f y e s I no 1 on I o f f [{
defaults [
router-prio;
}?
t r a c e o p t i o n s _;
b a c k b o n e I ( a r e a ) [
networks {
[exact I r e f i n e s ] [ r e s t r i c t ] ;
mask [ e x a c t I r e f i n e s ] [ r e s t r i c t ] ;
m a s k l e n [ e x a c t | r e f i n e s ] [ r e s t r i c t ] ;
host [exact I r e f i n e s ] [ r e s t r i c t ] ;

};

stubhosts (
c o s t ;
i n t e r f a c e _ [ c o s t ] {
enable l disable;
p r i o r i t y ;
);
I;
, .
on, off, yes . O S P F
.
router-prio defaults ,
( ) 1 .
, .
0, gated .
backbone area.
, ,
. O S P F ,
0, gated
backbone, area 0.

IP- (, 128.138.45.2).
gated IP-,

14.

67

,
IP- .
networks , .
.
,
martians, , allow
. , restrict,
. ""
.
stubhosts ,

( 1). S LIP-.
, interface
( 1) gated
( ).
disable, OSPF-.
ICMP-
gated
, ICMP-
(. 13.5).
r e d i r e c t | no | on | o f f [{
p r e f e r e n c e ;
i n t e r f a c e _ [ n o r e d i r e c t s ] I [ r e d i r e c t s ] t
trustedgatev/ _;
t r a c e o p t i o n s _;

. preference
( 30,
). redirects noredirects
.
trustedgateways , .
.

ICMP-, gated.
, ,
, .

static:
static {
gateway _ [ i n t e r f a c e _]
[ p r e f e r e n c e ] [ r e t a i n ] [ r e j e c t ] [ b l a c k h o l e ]
[noinacail];
};

384

II.


:
host
default

mask
m a s k l e n
,
. , 1
.
(
interface), .
60.
, O S P F ICMP-.
retain,
, gated.
,
, .
noinstall
, .
" ", ,
.
, blackhole reject,
, .
reject I C M P - ;
blackhole .

gated ,
. .
,
,
.
export:
e x p o p r o t o
[ i n t e r f a c e _ I g a t e w a y ^]
restrictt

e x p o r t p r o t o
[ i n t e r f a c e _ | gateway 1_}
[ m e t r i c ] {
_;

};

,
.

14.

67

proto .
:
proto s t a t i c {
ALL m e t r i c 1;
I;

1,
gated
,
RIP, OSPF.
(. ).

. gated
( ) OSPF,
(
), RIP
gated OSPF-
RIP. ,
R1P,

, ,
.
:

I:

r i p yes {
broadcast;
d e f a u l t m e t r i c 10;
i n t e r f a c e 192.225.40.253 noripout;
m t e r f a c e 192.225.55.253 r i p o u t ;
)i

386

II.

2:

3:

4:

5:

o s p f yes |
area 0.0.0.2 |
a u t h t y p e none;
networks (
1 9 2 . 2 2 5 . 5 5 . 0 mask 2 5 5 . 2 5 5 . 2 5 5 . 0 ;
};
i n t e r f a c e 192.225.55.253 cost 1 {
priority 2;
};
}i
backbone (
i n t e r f a c e 192.225.40.253 '
p r i o r i t y 2;
};
1;
I;

static {
d e f a u l t g a t e w a y 1 9 2 . 2 2 5 . 4 0 . 2 5 4 p r e f e r e n c e 140 r e t a i n ;
1;
export proto r i p
p r o t o ospf I
ALL m e t r i c 1;
I;
proto direct {
ALL m e t r i c 1;
1;
proto static {
ALL m e c n c 1;
1;

e x p o r t p r o t o ospf {
proto direct 1
ALL m e t r i c 1;
};
1?

I gated RIP. RIP-


, RIP- 192.225.55.253. .
2 OSPF. 192.225.40.253
0.
"" OSPF- ( HELLO),
. 192.225.55.253
2.
. 3
Jniernei-inni03V
192.225.40.0.

14.

67

4 5 gated ,
RIP O S P F . RIP- ,
, ,
OSPF. OS PF-
(, 192.225.55 0).
,
.

14.6.
,

/
>rj3

FQt
4

14.7.


gated Solaris. routed
(-s),
D H C P . -
, routed ""
{-q) , ( /etc/defaultrouter) (
in.rdisc).
gated , /etc/rc.confjg.d/netconf
GATED=1. routed H P - U X .
Red Hat gated ,
/etc/gated.conf. routed .
, /etc/rc.d/rc3.d/K55routed S55routed (
control-panel).
FreeBSD routed ,
rc.conf t o u t e r _ e n a b l e YES, r o u t e r
r o u t e d .
, rc.conf g a t e w a v _ e n a b l e YES. gated
/usr/ports/gated.


, ,
:

,
RfP-;

.
.
.

388

.
,
( )
. ,
.

,
, ,

II.

. ,
.
RIP, routed
, , ( ,
),
,
. gated
, ,
. , gated
RIP- , .

,
routed -<j.
gated, .
, RIP , ,
routed .
,
.
.
RIP ,
gated
RIP
.
routed ,
. gated
.
RIP,
gated, routed -.
,
.
,
, OSPF.
, Internet-, BGP.
, .


-
, , ,
,
.
, ,
. -
,
routed
""

gated
RIP

14.

389

14.8.

Cisco
, Cisco Systems, Inc.,
- .
70% , Cisco ,
,
. UNCX- .
, ,
. , ,
UNIX-.
Cisco IOS, Cisco
UNIX. ;
.
,

IOS ( ). *.
Cisco
telnet* :
% t e l n e t xor-gw.xor-com
C o n n e c t e d x o r - q w . x o r . c o m .
Escape c h a r a c t e r i s ' " J * .
User A c c e s s V e r i f i c a t i o n
Password:
EXEC:
xor-gw.xor.com>
,
show interfaces, ,
show ? v .
enable,

'#' :
xor-gw . x o r . corn*
.' , .
, .
show running,
, show config
. . :
xor-gw . x o r . c o m # show r u n n i n g
Current configuration:

.
Cisco, , ,
.

390

II.

v e r s i o n 12.0
h o s t n a m e xor-gw
e n a b l e s e c r e t xxxxxxxx
ip subnet-zero
i n t e r f a c e EthernetO
d e s c r i p t i o n XOR i n t e r n a l
ip address 192.108.21.254
no ip d i r e c t e d - b r o a d c a s t
interface Ethernetl
d e s c r i p t i o n XOR b a c k b o n e
ip address 192.225.33.254
no ip directed-broadcast

network
255.255.255.0
network
255.255.255.0

ip classless
l i n e con 0
t r a n s p o r t i n p u t none
l i n e aux 0
t r a n s p o r t input t e l n e t
l i n e vty 0 4
p a s s w o r d xxxxxxxx
login
end
. Cisco ,
U N I X NT,
. .
, T F T P

, .

, config term
xor-gw.xor.com# c o n f i g term
E n t e r c o n f i g u r a t i o n commands,
xor-gw(config)#

one p e r l i n e . End w i t h CNTL/Z.

,
show running. ,
IP- E t h e r n e t O , :
i n t e r f a c e EthernetO
ip address 192.225.40.253 255.255.255,0
<Conlrol-Z>,
. ,

write mem.
Cisco.

hostname
, .
.

14.

67

.
expect,
T F T P
UNIX-.

VTY ( PTY
UNIX-). " " .
(, , ),
. ,
, 21.9.

14.9.

.
,
.

Huitema, Christian. Routing in the Internet, Second Edition. Prentice Hall. 2000.
.
, ,
.

, John . OSPF: Anatomy of an Internet Routing Protocol. Addison-Wesley.


1998.
OSPF,
.

Halabi, Bassam. Internet Routing Artectures. Cisco Press. 1997.



.
RFC, . . 14.5.
14.5. RFC,

392

RFC

2328

OSPF Version 2

John T. Moy

IOSS

Routing Information Protocol

Hedrick

2453

KIP Version 2

Gajy Scott Malkin

1256

1CMP Router Discovery Messages

Stephen E. Deering

1142

OS1 IS I.S Intra-domain Routing Protocol

David R. Onui

1D75

Distance Vector Multicast Routing Protocol

D. Waitzman et al.

1519

CIDR: an Address Assignment and Aggregation Strategy Vince Fuller et al.

1771

A Border Gateway Protocol 4 (BGP-4)

Yakov Rekhter et al

II.


.
,
.
,
UNIX.

.
.
,
.
:


,
,
Ethernet, ATM DSL. , , , .

15.1.

,
, TCP/I
.

.

15.

393

, * ,
, .
.
()
( ).
, , . ( ) ,
,
. ,
.

15.2.

Ethernet:
80% , Ethernet
.
Ethernet (Bill Metcalfe)
. - XEROX. DEC Intel,
XEROX Ethernet .

.
Ethernet
3 /, 10 /.
Xerox Alto,
.
,
2.94 /.
3 /. ,
ARPANET, ,
ARPANET,
.
Ethernet 80- .
, , UNIX,
. 1994 ..

100 /. 1998 . : I /
10 /. Ethernet
, . , 2008 .
! . 15.1
Ethernet.

394

It

I of 15. 1 F'hernet

H o 3 B U I

IEEENO

1973

3 /

Xerox
Ethernet

1980

10 /

Ethernet 1

500


RG-11

1982

10 /

DLX
Ethernet
(Ethernet II)

500


RG-11

1985

10 /

10Base5
("Thicknet")

802.3

500


RG-11

1985

10 /

10Base2
("Thirmet")

802.3


RG-58

10 /

lOBascT

802.3

11
3

10 /

lOBascF

802.3

100 /

100BaseTX
(Fast
Ethernet)

802.3u

100 / 100BaseFX

802.3u

1 /

lOOOBaseSX

802.3z

I /

lOOOBaseLX

802.3*

1989
1993
1994

199-t
1998

2
25

5
2
20

260


(62,5 )

(50 )

550
1998

440
550
3

1998

1 /

lOOOBaseCX

802.3z

1999

I /

lOOOBaseT
(Gigabit
Ethernet)

802.3ab

25


(62,5 )

(50 )


1 5 6

.
. .

Ethernet
Ethernet ,
() ,
( ), .
(.. ),
, , ,
.

15.

395

. . " " Ethernet


C S M A / C D (Carrier
Sense Multiple Access with Collision Detection
) ;

: :

, , ;

: , ""'
-.
. ,
, "", , ,
.
Ethernet
Ethernet
, .
. Ethernet
: , . ,
, .
, , .
Ethernet- . Ethernet (, IOBase5)
,
,
*.

!
, "
", .
.

196


( ) ,
: .
,
();
.
,
(10 /, 100 / I /).
, ,
.

()
Ethernet.

, (
);

,
;

,
RJ-45;

,

, ;

,
.
. .

Ethemat-

. .
(, .
.
Anixter, . 17 5.
1 2 .
3 lOBaseT
10 /. 4

15.

397

.
Token Ring 16 /,
lOBaseT. 5,
100 / . .
5 6 1 /.
lOBaseT 3,
100 .
100BaseTX ,
5. . , .
, ,
,
.

15.10.

RJ-45,
I, 2, 3 6.
10 100 / 3.
5

RJ-45.
-
RJ-45. TIA/EIA-568A.

, .
. 15.2.
15.2. TIA/EIA-568A:
- RJ-45

5/4

3/6

1/2

7/8


, ,
.
Ethernet
ISO, Ethernet
. , ,
, (
) .
, , .
, .
, , . , .
.

398

It


, Ethernet, .

. ,
,
, , .
.

.
Ethernet ; IEEE 802.3 (10 /)
. 100 /
, lOOOBaseT .
.

. .
,
. ""

Ethernet ()
OSL. ,
.
, ,
"
. ,
, .
, .
, ,
,
.
,
, ,
*

, , ,
, " " . .

15.

399

. ,
,
. , ,

.
, ,
, ,
( , ;
). Ethernet
, , .
,
.
,
.
.

" ".
.
"" Ethernet-aapeca,
. ,
,
(. IP, AppleTalk
NetBEUI).
,
.
, .

, . , ,
Ethernet.
,

.
" ", .

( Ethernei-).
,
( ) , (). ,
,
.
,
, .
.
,
, . ,
; .
, -

400

It

"" , ,
,
.
,

.


,
() OSI.
, , IP-.

, (
),
( )
. 14.
( F D D I , Ethernet, ATM).
,
IP IPX AppleTalk.

.
. , .
. , TI Ethernet
,
Internet.
,
.
,
.

,
UNIX-, . . ,
,
.

.3.

FDDI: -
10 / Ethernet
, ,
.
9.5 (American National Standards Institute, ANSI) 80- .
F D D I (Fiber Distributed Data Interface

FDDI ISO.

15 ^

461

- ).
Token Ring
100 /. , FDDI
, .
, .
FDDI ( 10000$)
, , (,
FDDI- DEC) ,
Ethernet. FDDI- , .

80 /.
FDDI-
MTU ( ),
, Ethernet.
4352 ( ifconfig).
, ,
FDD1,

.
MTU 13.3.
FDDI
, -
100 / (. ). : - ,
.

. . FDD)
(
. )
( , ).
, ,
FDDI.

,
. ,
, Ethernet.

402

II.


9095% .
F D D I :
. ,
.
,
*

.

, . FDD1 62.5 .
FDD1 , . ,
, ,
- . ,
,
.

15.4.

ATM:
ATM Asynchronous Transfer Mode
( ), ,
Another Technical Mistake ( ).
ATM "
. ".
ATM ,
.
( ) . ATM, , ,
, .
ATM
, .
,
,
1. ATM-.
ATM 53 .
ATM (ATM Adaptation Layer, AAL).
. 15.3.
, AAL 2.
. AAL 3 4 ,
. ,
ATM,
SEAL (Simple and Efficient Adaptation Layer
), AAL 5.

/
, .

15.

403

15.3. ATM
AAL

15.5.

; ,

( IP-); 3
4

:
,
, , .
,
.25 ( , 70- ). , .25
,
.
,
,
, D D S (Digital Data Service
) 56 / 1.
"-", 24
. , ,

.
, ,
.
( ""),
. .
.
,
.
I -
. (Permanent Vinual Channel, PVC),
, .
,
,
.
, , , .
, , , ,
, .

404

II.

,
.

15.6.

I S D N : -
ISDN (Integrated Services Digital Network
) ,
. BRI (Basic Rate
Interface ).
, - ( -.) 64 /
( D-)
16 /. -
( ).
ISDN
( 30 150
, ). ,
, , RS-232. , ,
. -,
128 /.
I S D N ,
,
.
,
ISDN, ,
".

15.7.

DSL:

. , T l , , S O N E T , ATM
, .
.
, .
DSL (Digital Subscriber Line )
,
7 / (, DSL-
256 768 /).
, .
DSL- ,
T C P / I P . Ethernet . DSL , ISDN,
.
ISDN-,
"" , D S L ,
.

ISDN: "It Still Does Nothing", .. "


".

15.

400

, ,
.
DSL,
xDSL, ,
: (), S (), ()
RA ( ).
,
Internet.

.
DSL
, Internet ,
80- 90- .
, , ( ) .

, DOCSIS (Data Over Cable Service
Interface Specification
).
, ,
, .
DSL , DSL-
,
.
.
.

15.8.


,
: ,
. , ,
" "?
Ethernet . ,
, Ethernet. .
- , 80- .,
, ,
100 / 1 /.
10 /,
2004 .
, DSL
.
, DSL-
,
.
.

406

II.

. ,

, 2 II /.
. ,
, ,
.
. ,
, TCP/IP .

15.9.



Ethernet ( , ) .
,
, .

,
. (,
, )
. .
, .
.
(, ).
.
, .
,
.
. , .
,
.
. , Web-
Sniffer Technologies (www.snifTer.com).

15.10.
Ethernet, ,
. ,
,
.

5
/ . ,
, RS-232 .

15.

407

5 ,
.
,
,
.

.
: ? , .


(, ..).

, , 510%
.

, .
, -, .
.

,
,
. - , , ,
.

1993 .
(T1A/EIA-606).
,
.
:

;
;
;
;
;
.
,
(. 15.4).

408

II.

15.4. TIA/EIA-606

150

353

'

-
2
-

291

465

I0IC

I84C

.
, , , ..

15.11.
, .
.
, , ,
. ,
, , ,
.
:

, .
.
, (NFS)
,
.
, ponaimn .

, ,
. ,
.

15.

409


.
,
.
, -
. ,
.
, .
*.

,
. ,
, ,

. ,
. , ,
, ,
.

,
,
. - .
, .
.
, - . : ", ",
, , .

,
. , ,

, ,
- $ , . :
, .
-
, ,
, .
, ; ,
, .

* : , , . , .

410

II.


:
. Ethernet,
, .
, , ,
.
. , . ,

.

,
. , ,
.

- , ".
,

.
.
, ,
,
.

.

15.12.
,
, , .
" "
:

, ;

, ;

(, Internet
).
, , . , ,
, .
:

.

15.

411

, , ,
..;
, ;

IP- , ;
, ,
Internet.

, IP-
, AR1N
ICANN,
.
,
, .
(
) .
,


. ,
.
,
, "'" (, Cisco), )

15.13.
15
,
, , - .
, ,
.

AMP
Lantcch
www.amp.comwwwJantechinc.com
Anixter
Newark Electronics
www.anixier.com nw newark.com
Belden Cable
The Siemon Compan>
www.betden.comwwwsiemon.com
Krone
Black Box Corporation
www.krone.comwww.blackbox.com
-
Fluke Corporation
Acterna
www.flukecomwww.actema.com

Cisco Systems
www.cisco.com

412

II.

15.14.

Grolh, David and Jim McBee. Cabling; The Complete Guide to Network Wiring.
Sybex. 2000.

Seiferl, Rich Gigabit Ethernet. Reading, MA: Addison-Wesley. 1998,

A N SI/TIA/E1A-568-A, Commercial Building Telecommunications Cabling Standard. ANSl/TlA/EIA-606. Administration Standard for the Telecommunications
Infrastructure of Commercial Buildings, . ,
. Web- www.tiaonline.oig.
Web- (Charles Spurgeon).
Ethernet:
http://wwwhost.ots.utexas.edu/eihernei/eihernet-home.htm]

. .'*-^

Internei .
, ,
? ,
(Domain Name System. DNS),
, Internet,
.
DNS.
,
IP-
,
. DNS
.
DNS .
,
\ , .

.1.

D N S :

, ,
DNS.
: ,
DNS? , , if
: lemplateliosi.
my .domain.
1 IP-,
Internet.

II

2. .
.
3. ,
.
4. /etc/named.conf /elc/namedb/named.conf

o p t i o n s d i r e c t o r y ,
( 16.9)
IP- .

z o n e
, IP-

( 16.9).
5.

( RCS

sudo). -.
:
templatehost

IN
IN
IN

MX
MX

128.138.243.100
10 m a i l - h u b
20 t e m p l a t e h o s t

6.
.
, .
SOA (
). .
, ,
,

.
7. ,
- .
:
100

IN

PTR

templatehost.my.domain.

SOA .

IP- ,
. ,
100.243

IN

PTR

templatehost.my.domain.

IP- 128.138.243.100 (
138.128.in-addr.arpa, 243.138.128. in-addr. ).
8. , ndc reload .
9. ping Craceroute,
, . "host
unknown" ( ) , .
"host not responding" ( ) , .
, .
.
8 Solaris ndc.
BIND, named HUP,
.

16.

415


( 16.14).

16.2.

dig

D N S

,
ARPANET
,
.
ARPANET,

.
, ARPANET. DNS
, , : .
(Paul Mockapetris)
RFC882 RFC883 (1983 .),
RFC1034 RFC1035 (1987 .), , , DNS
UNIX.
DNS UNIX 1984 ,
. (Douglas Terry),
(Mark Painter). (David Riggle)
(Songnian Zhou). (Ralph Campbell),
,
DNS BSD UNIX. 1985 . (Kevin Dunlap).
DEC, ,
BIND (Berkeley Internet Name Domain
Intemet- ).
(Mike Karels), (Phil Almquist) (Paul Vixie)
.
UNIX , , Web- www.isc.ors.
ISC (Internet Software Consortium Internet) , Internet,
BIND.
BIND 8,

BIND 9
, .
ISC
, . ,
.
RFC 1034 RFC 1035 -
DNS, 30-
,
DNS ( ).
, .
DNS : " ,

416

II.

B I N D " , ,
DNS.
,
BIND. Nonel
B I N D Windows NT,
ISC. , 8.2, B I N D
NT. D N S
DNS-, UNIX, ,
. UNIX-,
D N S Windows.

16.3.

D N S

D N S :
;
,
;
"" ,
D N S ;
;
;

, Internet,
. /etc/hosts
, -
, .

, DNS.
,
.
, ,
.
,
forklift

IN

192.10.21.1

IN

MX

10 c h i m c h i m . x o r . c o m

IN

PTR

forklift.xor.com


foridift.xor.com IP- 192.108.21.7
D N S - . (
) DNS-
,
D N S .
.
( )
Internet-
DNS.

f 1< .j 16

417

D N S ,
.
.

16.4.

D N S
D N S .
.
.
DNS, B I N D . DNS
BIND
. . 16.1.
16.1. DNS BIND

<

RFC

16.11

2052

SRV.

16.11

6. IPv6

1.

2672
2673

DNAME, IPv6

16.11

2317

in-addr.arpa
( NAME)

16.111

. IPv6

, IPv6

16.7

2671

EDNS0

16.9

1996

16.12

2136

( ,
DHCP)

16.12

1995

16.13

25352541

DNSSEC (
)

16.13

245

TSIG/TKEY

, 6.,
.

,
1ETF. , ja , ,
, .
.
B I N D (8.2.2-5)
. B I N D 9
, .

418

II.

IPv6 D N S S E C
. IPv6 IP-
32- 128-. ,
Internet B I N D 9
IPv6, ,
,
IPv6 .
IPv6 B I N D 9 D N S S E C D N S .
D N S
D N S
, .
,
.
, . , ,
. B I N D 9 D N S S E C
( ) TSIG (
).

16.5.

D N S
D N S
(), ,
B I N D (). . DNS.
16-8 16.9.
D N S B I N D .
(, )
.
D N S .
,
. '." ();
, , .
,
ICANN* .

IP-, IP- .
. B I N D .

.

. - , , , " " "edu".

ICANN (Internet Corporation for Assigned Names and Numbers) no


Internet,
(. 13.1).

16

419

( "com", "org" "net")



. 16.2 \
( " c o m "
"",
,
"org" "net",
).
16.2.

com

edu

gov

mil

net

org

int

aipa

IP-


, ISO.

. 16.3.
16.3.

CrpOHQ

fill

br

de

fi

fr

JP
se

ch

hu

ua

ru

,
, "edu". a i
ac.jp.

420

II. cv

"us"
; , bvsd.kl2.co.us
, . "us"
, .. edu.us ().
"us" ,
;
Web- www.nic.us.
.
, , "md",
(MD), .
, "tv".
( "to").
- ("nu"),
("tm").
, .
. , , , . -

, .
.
, ,
.
"com" .
business,com 3,5 . . 50000$ admin.com,
, , sysadmin.com
"/Sys/Admin".
. DNS
"Colorado" "Colorado" "COLORADO".
DNS ,
, .

.
, .
DNS
DNSSEC . , DNSSEC
.
, DNS
,
. .
, IETF ,
.
, I me met,
. ,
boulder.colorado.edu boulder,
. boulder
,
.

16.

421

D N S , "boulder.colorado.edu.".
. ,
, > .
DNS
, (, )
, .
, boulder.colorado.edu www.colorado.edu flp.cotorado.edu,

"" ( , ,
"www") , ..
,
colorado.edu, ,
"Colorado" "edu".

, anchor
Internet- anchor.cs.colorado.edu.
, .



" c o m " , "". " n e t " "edu"'
Network Solutions, Inc.,
.
, . ,
.
,
,
, .
Web- www.icann.org.
Internet

DNS-
. ,
,
DNS-, .
,

DNS-.
,

CIDR-. ,

.

422

CIDR

13.4.

II.

.
,
.
. 16.11 ,
CNAME
.
DNS ( , ; . RPC 1219)
.
, .
,
.
DNS , .

. . ,
. , ,
;
(, edu.com"). , (, ..").
.
, . ,
, , "com"
,
.
RFC 1032 ,
12 , DNS
63- 255
. ,
( , , ,
).

DNS ,
,
. ,
Internet. Internet
, ,
, .. twinkies.com
playstation.com () , ;
. , DNS

. DNS
, .
"
"

, BIND .
. .
xinet.xinet.com , -- xinet.com,
xinet.

16.

423


, ,
.
,
,
DNS IP-.
Web- , RealNames Corporation.
: , ,
. , :
, .com.
.

,
.
ICANN
, .
25-
80 .
Web- www.icann.org.

CENTR (Council of European National Top-level domain Registries
). Web- www.centr.org.
. -
APNIC (Asia-Pacific Network
Information Center - );
www.apnic.net.
, ,
, . ,
, .


, ,
.
:

, ;


,
.
. . .
16.14.

424

It

16.6.

B I N D
BIND (Berkeley Internet Name Domain 11-
) ,
ISC. DNS UNIX (
Windows NT).
B I N D
. BIND 4. BIND 8
BIND 9- 80- . (
RFC 1034 RFC 1035).
1997 ., 2000 . 5. 6 7
. , 8
,
. , . .
BIND 8 4.4BSD,
(
sendmail, "" )
BIND 8 , , . BIND 9
: ,
, (
), IPv6,
. BIND 9 . ,
. ,
, . BIND 9 , .
BIND 4
"", .
. , ,
BIND 9 ,
BIND 8.
: BIND 8 9.
,
. ,
BIND 4, Perl- named-boot conf.pl, 8 9. 4 8 9.
DNS . ,
8 9,
.

,
. )
, , , ,
. BIND

I 16

425

dig,
.

d i g v e r s i o n . b i n d t x t chaos
,
. ,
vix.com:
% d i g e b b . r c . v i x . c o m v e r s i o n . b i n d t x t chaos
VERSION.BIND.
OS CHAOS TXT " f i . 2 . 3 - T 4 B "
cs.colorado.edu :
% d i g emxofl.cs.colorado.edu v e r s i o n . b i n d t x t chaos
VERSION.BIND.
OS CHAOS TXT " w o u l d n ' t : you l i k e to k n o w . . . "
B I N D .
. ,
. ,

16.9.
BIND,
/var/log . , named
Syslog ( "daemon").
grep :
Dec 13 1 6 : 3 2 : 2 7 d i s a s t e r nameri[2399j: s t a r t i n g , named 4 . 9 . 7 Wed Sep 2
0 9 : 3 9 : 1 2 GMT 1996 FHNE_14 618
Dec 13 1 6 : 3 5 : 1 3 suod named[93251: s t a r t i n g , nanied 8 . 2 . 2 - P 3 Wed Nov 10
1 7 : 2 7 : 5 9 MST 1599 nu.llert@haxi.-us / ' n f s / d e p o t / s r c / c s / B i n a / b i n d 8 . 2 . 2 - / o o ^ j /sun4-*-SunOS4/bin/named
Syslog s iaec

11.

H P - U X 11.00 ( ), SunOS ( )
, "*' 4
B I N D 8.2.2 -
"". 8.2.2-4.
named ,
, ( )
root ,
.
16.4 , B I N D
. 8.2.2- .
16.4. BIND

BIND

Solans

7 8

8.1.2

HP-UX

11.00

4.9 7

Red Hat

6.1

8.2

6.2

8.2.2- PS

. 4 4.0

8.2.2- PS

FreeBSD

426

II.

, Red Hat
"".
, .
Red Hat ,
, "". , bind-8.2-7.arch.rpm
8.2.
B I N D
BIND :
named, ;
, DNS;

nslookup, dig, host, DNS-


.
, DNS, named (
, ) . , , .
,
BIND 16.8.

nomed: B I N D
named [-.
- ,
. ,
, .
( .
, "",
"".)
,
, .
,
. . 16.5 , . , ,
.

(, . , ), (), (),
(, ) , ,
().
;
.

16.

4 2 7

16.5.
.


;


,
( NS)
, 1 ( )

, ;
,
, ;
;

,

,

, IP-aapec.
, "" DNS-,
.

,
:
. .
( ).
, ,
.
, .
; .
,
NS ( ). ,
, 16.11.

.

16.12.


,
. , .
16.10, " ".
, ;
.

, .

428

II. .

. ,
,

ndc reload (
)
, , ,
. ,
.
.
.

. DNS- ,
Internet.
, ""
.
, . ,
DNS-
DNS-.
. DNS-
.
BIND 4 BIND 8
.
named ,
, -
. BIND 9 .

, .
,
, ,
, .
,
.
.

. ,
, 10000 .

. ,
. , , ;
,
, .
,
UNIX, . ,
.
:
.
,

16.

429

, ,
. ,
( "com" "edg")
, ,
.
BIND
, .
-.
.
, .
. , ,
lair.cs.colorado.edu,
cs.colorado.edu, colorado.edu, "edu" .
, ,
: ,
.
, .

cs.colorado.edu, , . ,
colorado.edu.
..

"'*, .
- , : "
".

IP-, gethostbvnamcO-
/etc/hosts.
DNS,
, ,
.
get host byriame()
: (,
/etc/hosts), DNS , NIS
NIS+. ,
18.3, 16.16
.

BIND dig nslookup.
DNS- .
DNS
,
-. 16.14.

430

II.

16.7.

D N S
, DNS. , , .
, DNS. ,
, 16.8. ,
,
DNS.

. ,
, " c o m " , "org", "edu", "fi". " d e "
. "edu" coIorado.edu,
" c o m " adrnin.com ..

.
. ,
vangogh.cs.berkeley.edu lair cs.colorado.edu. lair
, ns.cs.colorado.edu, .
. . , . ,
(, ). ,
,
IP- .

. . DN5
. ,
cs.berkeley.edu. berkeley.edu.
. , vangogh.cs.berkeIey.edu.
,
,
. vangogh.cs.berkeley.edu
"edu".
"edu"'
berkeley.edu.
, berkeley.edu.

16.

431

,
cs.berkeley.edu.
vangogh.
, ns.cs.colorado.edu
vangogh. "edu".
berkeley.edu cs.berkeley.edu.
named UDP 53.
UDP,
512 : TCP.
TCP.

: , , , -
.
. ,
.
. ,
. DNS-
RFC 1034,
BIND. 1998 .
RFC2308,
. BIND 8.2
, BIND 9 .
, RIPE , , 60%
DNS- (
I27.in-addr.arpa
Microsoft).
DNS-,
.
:

, ;

-
13 ,
5 . , .
named DNS- .
,
13- .
?
named ,
,
(round-trip time, RTT) .
"" RTT.
.
.

432

II.

,
IP- (
):
www

IN
IN
IN

192.168.0.1
192-168-0.2
192.168.0.3

Web-, Yahoo AltaVista, .


DNS. ,
, ,
. ,
I, 2, 3 , 2, 3, 1 3, 1 , 2 .
D N S
DNS 80- .
UDP TCP.
,
. , ,
UDP,
512 .
DNS, .
.
512- UDP-,
13.
.
UDP-,
, TCP.
512- , .
- , UDP
TCP, TCP- . UDP
: .
TCP :
, ,
.
90- . DNS
( diff
; patch, ), (

) ( DHCP-). DNS,
.
90- . EDNS0 (
DNS, 0), DNS.

, .
,
DNS. BIND 9 EDNS0
, .

16. 428

16.8.

B I N D

B I N D , ,
B I N D Internet. . 16.6 , ,
. " "
"", ,
,
, rdist
rsync.

18.
BIND,
,
16.6. , BIND


BIND


"

"-

named

named
""

1


-

- --

_

, .

, ,
/etc/resolv.conf, ,
'' ", ,
.
dns, (, Solaris 7
) DNS .
16.16.

434

II.

. IP-
DHCP-, .
. :
search

...

nameserver

ip-

.
:
search cs.Colorado.edu colotado.edu .Colorado.ecu
n a m e s e r v e r 12 8 . 1 3 8 . 2 4 3 . 1 5 1
; ns
nameserver 128.138.204.4
; piper
nameserver 128.138.240.1
; anchor

resolv.eonf .
, j-
.
n a m e s e r v e r , IP-,
. s e a r c h
, .
s e a r c h , ,
, ssh foo.
( cs.colorado.edu)
foo.cs.colorado.edu. JTO ,
foo.colorado.edu, foo.ee.colorado.edu.
"cs"
,
_.s,
. .
s e a r c h resolv.eonf
:
search

colorado.edu.

cs.colorado.edu.

ee.colorado.edu.

, , s e a r c h
.
, resolv.eonf.
( ) KJUI.
B I N D 4 B I N D 8,
. Moiyr ,
4 8 ,
.
L i s t e n - o n ,
,
.
,
n a m e s e r v e r . ,
. -
,
. - .

. .
, resolv.eonf
BIND s e a r c h resolv.eonf
d o m a i n . ,

16.

435

.
d o m a i n s e a r c h . ,
.
, resolv.conf ,
, .
-. , DNS-.
. ,
. /etc/resolv.eonf. "!
. -i
resolv.conf .
DNS-, ,
.
. ,
.
, resolv.conf . , .
D N S , "".
.
, .
, ,
,
.
16.9.
. DNS.
, , .
.
, , ,
,
. ,
.

1 !

ft

J ^ Z Z X .

1 [

//

|| || || ||
\
\
\
\

1 ^

. . DN5

436

It


DNS
/etc/resolv.conf n a m e s e r v e r .
DNS /etc/hosts
NIS ( " ",
/etc/nsswitch.conf).
BIND 16.16.
, ,
18.3.
/etc/resolv.conf (, ) , IP-.
"", IP-.
, DNS . , IP-
/etc/resolv.conf ,
(.
a l l a w - q u e r y ).

DNS ,
.
/etc/rc* init.d
, ,
.
DNS.
,
-. , ,
.
, IP-. ,
DNS /etc/hosts,
hosts, ,
.
, -.
.
/etc/exports, NFS . ,
,
.
exports 1024 ;
anchor anchor.cs.colorado.edu, .
|71

NFS J7.

16.9.

B I N D
, ""
, .. (, ),
DNS-

16.

437

Ln-addr.arpa.
,
BIND.

B I N D .
,
, named.
B I N D 9, D N S S E C IPv6,
. BIND 9
,
. ,
, named
.
, ,
, ,
named. - ,

, .
named
named
. , Solaris
:
if

-f /usr/sbin/in.named
a -r /etc/named.conf ]; then
/ u s r / s b i n / x n . n a m e d ; e c h o -n ' named' > / d e v / c o n s o l e

fi
B I N D ndc
( rndc.
), named.
:
# ndc

start, stop, restart status,


. ndc 16.14.
named Syslog,
syslogd. inetd:
named,
.
inetd 28.3.

named ,
"" . , ,
.
;
DNS-,
DNS.
, DNS-

433

16.11.

II.

named (,
)
, , .
, ,
, DNS.
B I N D 4 B I N D 8
gated.conf.
: BIND 4 /cte/named.hoot, a B B I N D 8 n 9
/etc/named.conf. .
B I N D 8/9.
B I N D 4.
.

, BIND ""
, .
named.conf ,
. , .
. ""
,
.
, .
, + +
/* , . "/
II , , .
# , , .
,
. , o p t i o n s l o g g i n g . ,
;
. . 16.7 , BIND 9.
16.7. , nomed.conf

include

(
, named)

options

server

key

acl

zone

trusted-keys

controls

, ndc

logging

view

( BIND 9)

16.

439

,
, :
. IP-
:

IP- (, 199 165 145.4 );

, CIDR (, 199 165/16);

(.
a c l ) ;

!.

:
{
(

! 1.2.3.13;
128.138/16;

1 . 2 . 3 / 2 4 ; };
198.11.16/24;

204.228.69/24;

127.0.0.1;

};

1.2.3.13.
1.2.3/24.
, .
:
, .
IP- ,
,
. ,
- ,
, , 1.2.3.13
( 1.2.3/14)
.
.
, .
include
,
, .
named.conf
include:
i n c l u d e "";
, ,
d i r e c t o r y ( ).
i n c l u d e , .
named. named.conf.
, named.
options
o p t i o n s ,

. :
options {
;

435 II

named.conf o p t i o n s ,
.
B I N D 8 30- , BIND 9 50-.
.
, .
.
v e r s i o n "":

[ ]

.
. ,
, ,
B I N D . ,
,
"" ,
.
,
.
d i r e c t o r y "";

[',

'

, named
,
( ). JTOT
(, ..).
BIND (
named.conf resolv.conf) /var (
, )
/var/named
n o t i f y yes I no;
a i s o - n o t i f ;

Lyes]
[]

n o t i f y y e s , named
,
.

n o t i f y
, .
DNS
named ,
t ; - . 1 i,uiM. I NS .
- 1 I
,
NS
, .
a_se-nac. i\
.
NS.
.

16.

16. / /.

.441

BIND 4 .
, (. SOA
16.11). loealhost
r e c u r s i o n yes J no;
allow-recursion
{

__

};

I yes]
[ ]

r e c u r s i o n , named
(. 16.6).
.
a l l o w - r e c u r s i o n .
,
.
u s e - i d - p o o l yes I n o ;

[no ( V8)]

B I N D 8 named
,
. , ,
,
y e s . B I N D 9 u s e - i d - p o o l ,
,
m a i n t a i n - i x f r - b a s e yes I no;
[no ( V8)}
(. RFC 1995)
""
,
. , , , " " , .
BIND 8
, ;
m a i n t a i n - i x f r - b a s e y e s , . BIND 9
.
16.12.
check-names

master

slave

r e s p o n s e

};

1.

B I N D 8 .
, , ,
, RFC-
. , .
, , ,
( ) 64- ,
256 .

. DNS
, .
c h e c k - n a m e s
. .
, ,
. :

i g n o r e ;

w a r n , ;

f a i l .

A >442

II

f a i l ,
, ,
.
; . w a r n ,
i g n o r e . , .
transfer-format one-answer

many-answers;

[.

. D N S
( 16.11)
. ,
. m a n y - a n s w e r s , , BIND 8 I;
B I N D 9. m a n y - a n s w e r s
, ,
, BIND 8.1,
B I N D 4 .

.
t r a n s f e r s - i n ;
t r a n s f e r s - o u t ;
t r a n s f e r s - p e r - n s ;
t r a n s f e r - s o u r c e IP-;
s e r i a l - q u e r i e s ;

]
[ 1 0 ( V91]
[2]
[ ]
[4 ( V8) ]


,
( , " c o m " ,
2 ) . t r a n s f e r s - i n t r a n s f e r s - o u t
, .
t r a n s f e r s - p e r - n s ,
.
t r a n s f e r s - i n t r a n s f e r s - o u t , ,
named. t r a n s f e r s - p e r - n s
; ,
- ,
t r a n s f e r s s e r v e r .
t r a n s f e r - s o u r c e IP- , .
, a l l o w - t r a n s f e r .
B I N D 8
. s e r i a l - q u e r i e s .
.
, ,
"". 4.
;
. B I N D 9 ;
.

16.

443


, .
,
f i l e s :
[unlimited]
f i l e s ,
. , u n l i m i t e d ,
.
f i l e s named ,
. , ,
sysconf(), ,
setrlimit(), .
l i s t e n - o n p o r t __; [53, ]
q u e r y - s o u r c e a d d r e s s IP- p o r t ;
[ ]
l i s t e n - o n ,
named . q u e r y s o u r c e , named
. , IP- ,
: 53
,
U D P - , .
l i s t e n - o n
. , , , ,
B I N D 4 B I N D 8 ,
.
, named
, .
, named:
, .
l i s t e n - o r IP-.
,
. resolv.conf
IP- .
,
q u e r y - s o u r c e ,
DNS-. , DNS-
.
f o r w a r d e r s ( ; ; ... }; [ ]
forward only

first;

[first]


,
.
, , ,
. ,
. ,

,
Internet.
.

444

II.


DNS-, .
.
.
" " 16.10
.
f o r w a r d e r s - ,
.
. ( , ) .
, .
, f o r w a r d o n l y ,
,
. , .
f o r w a r d f i r s t ,
.
f o r w a r d e r s ,
, . ,
.
allow-query

__

}j

a l l o w - t r a n s f e r [ __
b l a c k h o l e [ __ ];

];

[ ]
[]

, ( )

b l a c k h o l e ,
named:
.
s o r t l i s t { __ ];

[ )

, :
. ,
,
, BIND.
, ,
r r s e t - o r d e r , , : ,
. t o p o l o g y , ,
.
.
acl
:
a c l (
__
\!

'6.

.45

,
.
a c l nanted.conf,
. named.conf
, , . : a n y , l o c a l n e t s , l o c a l h o s t n o n e ,
, ,
. , l o c a l n e t s ^
.
server
named ,
B I N D ,
, . s e r v e r
.
server

IP-

bogus yes I no;


p r o v i d e - i x f r yes
r e q u e s t - i x f r yes
s u p p o r t - i x f r yes

transfers

I
I
I

no;
no;
no;

transfer-format

one-answer

Inoj
[ y e s ( V9)]
[ y e s ( V9) ]
[ ( VB
[2 ( V9) ]
m a n y - a n s w e r s ; [VB: , V9: ]

k e y s ( : ; ... };

I;
s e r v e r , .
.
b o g u s , named
. ,
.
i x f r BIND 8
B I N D 9. 8 s u p p o r t - i x f r ,
9 p r o v i d e - i x f c r e q u e s t - i x f L
s u p p o r t - i x f r y e s .
. 9,
, ,
p r o v i d e - i x f y e s .
9 ,
p r o v i d e - i x f r y e s .
t r a n s f e r s .
t r a n s f e r s - i n , , .
, t r a n s f e r s - p e r - n s .
B I N D 8.
t r a n s f e r - f o r m a t
. ,
BIND 8/9 BIND 4.
k e y s ,
k e y
TSIG ( 16.13). ,

446

II.

, ,
. , ,
, , .
logging
named "
1 ".
Syslog ,

.
: " , ". B I N D 8
, ,
, . , .

( ),
, 16.14.
zone
z o n e "" named.conf.
named , ,
. z o n e
"" (""
,
DNS-).
z o n e , named
(,
). . z o n e
.
, ,
.

z o n e
named
zone

" _" I
type

master;

f x j . e "";
a l l o w - q u e r y { __ };
[ ]
a l l o w - t r a n s f e r ( __ }; [ ]
allow-update
{

};
[none]
i x f r - b a s e "";
[_.ixf ( VB)]
):

.
,
. ,
f i l e
DNS-pecypcax;
16.11.

16.

447

, , . , 1 l o w - u p d a t e , \
.
; a l l o w - u p d a t e ( B I N D 9). ,
DHCP-".
, BIND "
_.\
named.
i x f r - b a s e . named
.
B I N D 9
, . .Jnl .
BIND. 16.12.
( )
.
,
. B I N D 4 , ,
:
zone

"exaraple.com" {
master;
f i l e "forward/example.com";
a l l o w - q u e r y ( a n y ; };
allow-transfer { my-slaves;

};

)i
m y - s l a v e s
.

, -


z o n e
, :
zone

" 4 " [
type slave I stub;
f i l e "";
i x f r - b a s e "";
m a s t e r s { I P - ; IP-; ... );
allow-query
{
__

allow-cransfer

[
};

__

);

VB]

)?


. s t u b , s l a v e ,
NS ( ).
named , D N S . ,

*

, TSIG .

448

II. *

. ,
.
16.11.
f i l e , . .
, .
, .
,
named. ,
, .
, named .

128.138.243.151 .cs.colorado.edu.
anchor.cs.colorado.edu.cs.colorado.edu.
, - .
m a s t e r s IP- ,
. ,
.
? .
-,
, , IP-. ( ),
. , .
-, named ,
.
, .
, - ,
, .
IP- , . ,
,
, , .

masters.
' *
z o n e h i n t named
,
, :
zone

}:

"."
type
file

i
hint;
"";

" " DNS-,


("."). , named ,
. "",
, ,
"" root.cache.
, ,

16.

449



"" 16.15.
B I N D 9 ""
, .
"", .
""; D N S
, IP-
.

f o r w a r d
named :
zone

""

type
forward
forward only I

>;

forwarders

first;

IP-;

IP-;

...J

,

.
, .
key
k e y ,
.
, BIND, 16.13
.
,
, ,
64:
key {
a l g o r i t h m ;
s e c r e t ;
1;
,
named.conf ,
. ,
k e y s s e r v e r . ! , ,
.
trusted-keys
c r u s t e d - k e y s DNSSEC, RFC2065. ,
, , ,
.
. :
trusted-keys {
;

450

II. *

1;
, *.
. , 64.
t r u s t e d - k e y s ,
, .
. , DNS-,
. D N S S E C
16.13.
controls
c o n t r o l s , nde
named. , ,
.. , ndc , Internet
. :
controls {
inet

1;

1-

a l l o w

__

-. );
u n i x _ ;
[060 0]

IP- .
i n e t
UNlX- ( u n i x ) . , ,
l i n e , a l l o w ,
127.0.0.1.

: ,
.
telnet
"stop 1 '. i n e t .
ndc named UNIX- /var/run/ndc u n i x
.
, uma.sk.

, .
root, .
view
B I N D

DNS,
, . ,
. :
, ( )

16.

51


. , ,
.
,
, NS ,
. v i e w , BIND 9,
,
named.
, .
v i e w , ,
, ,
, ,
:
view _ {
m a t c h - c l i e n t s { __ };
_; . . .
1_zone; .. .
1?
,
.
.
named.conf:
, z o n e .
B I N D 9 , D N S - .
,
:
view " i n t e r n a l " {
m a t c h - c l i e n t s I ; }; //
recursion yes;
/ /
zone "example.com" (
//
type master;
f i l e "example-internal-db";
);

I;
view " e x t e r n a l " {
m a t c h - c l i e n t s [ any };
recursion no;
zone "example.com" I
type master;

\i

};

file

//
Il
//



""

"example-external.db";

,
.
a n y m e t c n - c l i e n t s , .

16.10. B I N D
namcd.conf .
:

452

, Linux;

II.

,
;
, Web-
2000 .

Linux-
, , Linux-,
DNS synack.net,
BIND 8.2.2-5.
named, con . .
.
: ,
, ,
53 ..
. , synack.net
.
: synack.net
xinetd.org.
teich.net rmtai.com.
named.conf, , ,
,
. 3
( ,
BIND).
/*

named.conf,

gw.synack.net

*/

options [
directory
"/var/named";
pxd-file
"(var/named/named.pid";

);

zone

"synack.net" {
type master;
f i l e "synack.forw";
allow-transfer { 198.11.19.15;

);

"xlnetd.org"
type master;
f i l e "xirietd. forw";
allow-transfer { 198.11.19.15;

I;

Itzone

)!

"1.168.192.in-addr.arpa"
type master;
f i l e "named.rev";

1
//

J;
zone "-" {
type hint;
file
"cache.db";

1?
zone

"teich.net"

16.

453

};

type slave;
file
"teich.net.sec";
masters < 216.103.220.218;

zone "rmtai.com" {
type slave;
file
"rmtai.com.sec";
masters { 216.103.220.218;

};

//
//
//
//

I;

(
S y s l o g ,
, ),
.

logging {
channel syslog_errors
syslog
locall;
severity error;

J.Channel moderate__debug (
s e v e r i t y debug 3 ;
f i l e "foo";
print-time yes;
p r i n t - c a t e g o r y yes;
p r i n t - s e v e r i t y yes;
);

// 3
// f o o
/ /
I I
! 1

channel no_info_raessages
syslog local2;
severity notice;

};

category parser 1
syslog_errors;
default_syslog;

);
category lame-servers { null;

} ; / /
//

category load { no_info_messages;


category default {
default_sysiog;
moderatedebug;

I;

1;
);

//

logging


localhost. /etc/hosts.


.

. , , ,
.
f o r w a r d f i r s t .
: .

454

II.

.
B I N D 8.
, ,
. , ,
named.conr "",
named .
""
localhost.
//

BIND

8.2

//
options {
directory
"/var/nameo";
n a m e d - x f e r " / u s r / l o c a l / s b i n / n a m e d - x f e r " ; BIND 8
/ /
forwarders {
128.138.243-151;
/ / mroe
128.138.243.140;
// anchor
128.138.243.137;
/ / moet
128.138.243 -138;
// v u l t u r e
128.138.236.20;
// piper

);

);
forward f i r s t ;
query-source address

pore

53;

/ / S y s l o g 1 1 3 ;
il
logging (
channel s y s l o g i n f o {
syslog 113;
severity
info;
};
c a t e g o r y l a m e - s e r v e r s { n u l l ; };
c a t e g o r y d e f a u l t ( s y s l o g _ i n f o ; };

>;

/ /
zone " - " I
type hint;
f i l e "named.cache";

>:

/ /
zone " 0 . . 1 2 . i n - a d a r . a r p a " [
type master;
file
"localhost";
n o t i f y no;

localhost

\S

cs.colorado.edu , .
(
/26),
,
C N A M E ( )

16.

455

//

BIND

8.2

options {
directory
"/var/named";
named-xfer "/usr/local/sbin/named-xfer";
forwarders { 128.138.243.151; );
forward f i r s t ;
q u e r y - s o u r c e a d d r e s s * p o r t 53;
a l l o w - t r a n s f e r J n o n e ; };

//
//

BIND 8

);
//
//
//

, " "
l o c a l h o s t ,
, .

/ /
zone " c s - c o l o r a d o . e d u " {
type slave;
file
"forward/cs.Colorado.edu";
m a s t e r s j 1 2 8 . 1 3 8 . 2 4 3 . 1 5 1 ; );
);
zone

"250.138.128.in-addr.arpa" {
type slave;
file
"reverse/250.138-128";
m a s t e r s i 1 2 8 . 1 3 8 . 2 4 3 . 1 5 1 ; };

):
zone

"245.138.128.in-addr.arpa" {
type slave;
file
"reverse/245.138.128";
m a s t e r s i 1 2 8 . 1 3 8 . 2 4 3 . 1 5 1 ; }J

1;
//

...

,
cs.colorado.edu , .. .
, ,
, .
t o p o l o g y
.
-
a l s o - n o t i f y .
D N S .
. ( )
. .

. ,
, ,
.

, ,
5 0 R I G I N , .
D N A M E .

A >456

II

#
# Sid:

BIND 8 . x c s . c o i o r a d o . e d u
n a m e d . c o n f , v 1 . 2 8 2 0 0 0 / 0 1 / 1 2 0 0 : 2 0 : 3 4 r o o t Exp $

a c l CUnets {
128.138/16;

1;

198.11.16/24;

204.228.69/24;

#
options {
directory
"/var/named";
named-xfer "/usr/local/sbin/named-xfer";
notify yes;
also-notify [
128.138.192.205; # suod
128.138.244.9;
# r^ker
128.138.243.70;
* squid
128.138.241.12;
# goober
128.138.244.100; # av-server
128.138.202.19;
nago

127.0.0.1;

BIND

}.-

query-source address * p o r t 53;


topology { localhost; localnets;

CUnets;

};

# , " "
# l o c a l h o s t , ,
# .
#
zone " c s . C o l o r a d o . e d u " {
type master;
file
"forward/cs.Colorado.edu";

);

#
zone " 2 5 0 . 1 3 8 . 1 2 8 . i n - a d d r . a r p a " i
type master;
file
"reverse/250.138.128";

{128,136.X.)

1;
zone

"245.138 .128 . m - a d d r .arpa"


type master;
file
"reverse/245.138.128";

I;
#

...

#
zone " c o l o r a d o . e d u " |
#
type slave;
file
"secondary/colorado.edu";
a l l o w - t r a n s f e r { n o n e ; };
m a s t e r s { 1 2 8 . 1 3 8 . 2 4 0 . 1 ; };

1;
zone " o p e n b s a . o r g "
t
type slave;
file
"secondary/openbsd.org";
m a s t e r s { 1 9 9 . 4 5 . 1 3 1 . 5 8 ; };

OpenBSD

1;
zone

"233 . l n - a d d r . a r p a "

16.

457

>;

type slave;
file
"secondary/233.in-addr.arpa";
m a s t e r s [ 1 2 8 . 2 2 3 . 3 2 . 3 5 ; };

, Web-
, Web-
Web-. DNS.
2000 ,
, .
( 1030 ,
160 ), . SPARC 20,
SunOS 4.1.3 BIND 8.2.2-5.
512 .
.
;
, m a s t e r , ,
. ""
localhost ! ; ,
.
- ,
, "zone
expired"' ( ) "not authoritative for zone" (
).
DNS.
//

XOR

options f
directory
"/var/domain";
query-source address 192.225,33.1
also-notify
192.108.21.2;

port

53;

I;
//

zone

};

XOR

"xor.com" i
type master;
f i l e "xor.com";

zone "creative.xor.com" {
type master;
file
"creative.xor.com";

>;

//
//

...

zone

"21.108.192.in-addr.arpa"
type master;
file "xor.rev";

XOR

I;
zone

A >8

"2.168.192.in-addr.arpa"
type master;

II

file

1;

"backlan-2.rev";

//

...

//

//

zone

setup:01/21/2000

"boulaerhospital.com" I
type master;
file
"boulderhospital.com";

J;
zone "boulderhospital.org** {
type master;
file
"boulderhospital.com";

1;
//

1750

16.11. D N S
DNS
,
. .
:
(, S0RTGIN STTL) .
, .

, RFC882, 1035, 1183, 2065.
2181, 2308 2535

D N S (
). :
[] [ t t l ] [ ]

(. 16.8).
16.8. ,

(J
*




1 ( .)
M X .

( ),
.
,

16.

459

. ,
.
, .
.

, ,
. ,
.
, cs.colorado.edu anchor "anchor.cs.colorado.edu.". anchor.cs.colorado.edu,
.
,
"anchor.cs.colorado.edu.cs.colorado.edu.".
Moiyr .
til (Time Live ) ( ),

. ,
, "".
STTL,
. BIND 9 . BIND 8, ,
/ ,
SOA.
,
DNS
, ,
, .
, , $TTL
, , ,

. : IN (Internet).
(Chaos) HS (Hesiod). Chaos ChaosNet
, Lisp-
Symbolics. Hesiod , BIND. IN ,
, . , .
Chaos:
named, dig
(. 16.6).
DNS-,
. IPv6 .
:

,
;


.
(. 16.9).

460

II

16.9. DNS

SOA
NS

DNS-
,

PTR
DNAME



IPv6 ( BIND 9)

IPv6 ( BLND 9)

MX

KEY
NXT

DNS-

DNSSEC

SIG
CNAME
LOC
RP
SRV
TXT



DNS-1


LOC NT ( LOC
NT).
. ,
, .
BIND.
. SOA
.
, SOA NS.
, , .
.
,
cs.colorado.edu.
cs.colorado.edu. anchor anchor.cs.colorado.edu.

SOA

SOA , DNS. D N S
. , DNS
;
IP-, .
1- SOA.
. . SOA
, ,
. :
;
6

IN

SOA

cs.colorado.edu

ns.cs.Colorado.eau.

16.

admin.cs.colorado.edu.

461

1999X21501
21600
1800
1209600
7200 )

;
;
;
;
;


, 6
, 30
, 2
, 2


.
cs.Colorado.edu. z o n e named.conf
SORIGIN (. DNAME)
ttl . IN (Internet),
SOA, .
"ns.cs.colorado.edu." .
"admin.cs.colorado.edu." . " . . "
( &). , @ .
,
admin hostmaster
S 0 A .
BIND 4 8:
, , named
.
SOA . BIND 9
, .

. ,
.
32- ,
. . , 2000123101 , 31-
2 0 0 0 .

, .
,
.
, SOA
, .
. BIND 4.9 BIND 8
,
, .
,
, .

, named ,
, .

. ,
. ""
, ,

46
II.

.
RFC 1982.
, , .
named
.
SOA
( ), ,
DNS.
( ) ( ).
. ,
,
.
,
.
(3600 21600 ).
,
B I N D
,
n o t i f y . , ,
.

, ,
. ,
20 60 (1200 3600 ).
,
, . ,
.
,
. ,
,
.
.
B I N D 8.2
.
. BIND 8.2
SOA .
. (.. )
$TTL . , $ t t l
,
- ( ).
5TTL,
DNS .
D N S ,
. D H C P . B I N D ,

( 16.12).

16.

463

NS

NS ,
(.. ),
.
SOA. :

[ttl]

IN NS _

:
cs.colorado.edu.
cs.colorado.edu.
cs.colorado.edu.

IN
IN
IN

NS
NS
NS

ns.cs.colorado.edu.
anchor.cs.colorado.edu.
nc.cs.utah.edu.

SOA,
NS, .
IN
IN
IN

NS
NS
NS

ns.cs.colorado.edu.
anchor.cs.colorado.edu.
nc.cs.utah.edu.

SOA cs.colorado.edu,
.
cs.colorado.edu,
,
, .. colorado.edu.
, NS
, ( ).
named.conf.
NS named
,
. ,
(colorado.edu), "cs"
.

,
.
, -
.

coloiado.edu,
"edu" .
nslookup dig,
.
.

D N S . IP- (, /etc/hosts).
. :
_ [ t t l ] IN IP-

464

II

:
anchor

IN

128.138.243.100

,
.
PTR
PTR IP-
. ,
PTR.
,
, in-addr.aipa.

, "" . ,
anchor.cs.colorado.edu anchor "cs",
"Colorado", "edu". ,
IP- "" . 128.138.243.100
100 243, 128.138.
in-addr.arpa , ,

. in-addr.arpa
IP- . ,
243 243.138.128.m-addr.arpa.
PTR :

[ttl]

IN

PTR

PTR 243.138.128.in-addr.arpa,
anchor, .
100

IN

PTR

anchor.cs.colorado.edu.

100 .
: ?
"cs.colorado.edu.". ,
"243.138.128.Ln-addr.arpa.".
, PTR
, named.
100.243

IN

PTR

anchor.cs.colorado.edu.

138.128.in-addr.arpa .
,
S0RIGIN. .
anchor.cs.colorado.edu ,
138.128.in-addr.arpa.
cs.colorado.edu 243.138.128.in-addr.arpa
DNS, .
SOA .
in-addr.arpa ,
, . 127.0.0 0.

16.

465

,
.
, 128.138.243.0/26? RFC23I7 ,
C N A M E ;
.
, PTR,
, .
, sshd ,
~/.shosts
- ,
- IP-. D N S .
IP- ,
. netstat. tcpd, sendmail, sshd, syslogd,
fingerd, ftpd, riogind IP-
.
, PTR.
-,
. ,
, " ",
,
.

MX

MX
. MX
, ,
.
21.
MX :
[ t t i ] IN MX ...
: ,
, , ,
.
piper

xterml

IN
IN
IN
IN
IN
IN

MX
MX
MX
MX
MX
MX

10
20
50
10
2 0
50

piper
mailhub
b o u l d e r . . C o l o r a d o .. e d u
mailhub
anchor
b o u l d e r . .Colorado..edu

( 0; 65535).
, bob@xterml,
. mailhub,
; anchor.
, boulder. boulder
,
( "cs.colorado.edu.").

466

II.

, , ,
.
"",
.
MX , :

- :

Internet;

- SMTP;

,
.

, .
, .
Internet,
DNS, MX. sendmail
,
, , MX. ,
, - ,
( , UUCP).
, MX ,

, , .
, .
MX.
- .
:

, ;

, ;


, .
MX -,
. ,

.
evi@cs.coIorado.edu, es.
MX cs.colorado.edu:
s

IN
IN
IN

MX
MX
MX

10
20
50

mailhub.es.colorado.edu
anchor.cs.Colorado.edu.
boulder.Colorado.edu.

, ,
sendmail. 19.8
u s e _ c w _ f i l e local-host-names, sendmail
.
DNS MX:
IN

MX

10

16.

mailhub.es.colorado.edu.

467

,
.
. .
,
.
, .
"" .
,
, , ,
.
MX.

CNAME

C N A M E . - .
. :
ftp
kb

IN
IN

CNAME
CNAME

anchor
kibbleanbits

C N A M E :

[fccJ]

IN

CNAME _

DNS- C N A M E ,

C N A M E , (,
MX, NS .) ,
,
colo-gw
moogie
www

IN
IN
IN

CNAME
CNAME

128.138.243.25
colo-gw
moogie


( MX) www moogie,
B I N D C N A M E .
, C N A M E ,
.. ,
.

C N A M E . Web-cepeepa
www
www
www

IN
IN
IN

CNAME
CNAME
CNAME

webl
web2
web3

C N A M E .
, , . BIND 8
, . BIND 9
, .
C N A M E . Web-cepBepa ,
.

468

II

C N A M E
CNAME
,
. CIDR , . ,
"" ,
. ,
128.138 ,
in-addr.arpa.
243 243.138.128.in-addr.arpa.
CIDR 13.4.
, 243 . ,
/26? ,
; - ,
PTR. , 243 Internet, /26
.

, IP- (
243) ,
.
,
. ,
. :
in-addr.arpa
CNAME, ,
. ,
.
.
( ) IP-anpeca
CNAME (
), . ,
/26 "0-63",
"64-127" . :
SORIGIN

243.136.12.in-addr.arpa.

1
2

IN
IN

CNAME
CNAME

1.0-63
2.0-63

63
65
65

IN
IN
IN

CNAME
CNAME
CNAME

63.0-63
64.64-12")
65.65-127

0-63
, ,
NS:
0-63
0-63

IN
IN

NS
NS

16.

nsl .custornerl.com.
ns2.customerl.com.

469

customerl.com ,
0-63.243.138.128.in-addr.arpa. :
1
2

IN
IN

PTR
PTR

hostl.customerl.com.
ho3c2.customerl.coiti.

,
. , , - , 128.138.243.1, C N A M E
1.243.138.128.in-addr.arpa 1.0-63.243.138.128.inaddr.arpa, .
;
.
,
. :
B I N D C N A M E
, , , ,
. R F C ,
.
, ,
,
.
C N A M E ,
,
IPv6.
,
DNAME.
, ,
named, $ GENERATE (
),
. ,
, :
SORIGIN 2 4 3 . 1 3 8 . 1 2 8 . i n - a d d r . a r p a .
SGENERATE 0 - 6 3 $ CNAME 5 . 0 - 6 3
0-63
IN
NS
nsl.customerl.com.
0-63
IN
NS
ns2.custoroerl.com.

S SGENERATE
64- C N A M E .
/ 2 6 .
C N A M E B I N D 8
9. BIND 4
C N A M E PTR,
. ,
.

LOC

LOC , , () DNS.
L O C Internet, .

470

II

, ,
, .

LOC

RFCI876.

:
[ t t l ] IN LOC [ ( [ [ ] ]} 1
, (
), N (north ), S (south
), (easi ) w (west ). ,
.
( )
( ) . ,
, ,
, _ .
,
10 , 10 .
caida.org, -,
:
caida.org.

IN

LOC

32

53

01

N 117

14

25 W 107m

30m 18m

15m

, CA1DA (Cooperative Association for Internet Data Analysis no


Internet), ,
Web- DNS.
, .
.
, ,
.
LOC ,
NT 4.0.
SRV
SRV .
,
-.
. , ,
, C N A M E "ftp'"
DNS.
SRV ,

. ,
, .

SRV MX
, DNS
.
:
.. [ J] IN SRV

16.

471

JTO , IANA
(Internet Assigned Numbers Authority
Internet);
13.3 www.iana.org/numbers.htm. t c p , u d p .
, SRV.
, MX.
,
, , ,
. SRV
, '*
,
. 0.
.
, RFC2052 (
SRV) cs colorado.edu:
ftp.
;
finger.tcp

SRV

21

ftp-server.cs.Colorado.edu.

Finger
SRV

0
79

.)

; ,
; -
ssh.tcp
SRV

1
22
old-siow-oox.cs-coloraao.edu.
SRV

3
22
new-fast~oox.cs.colorado.edu.
; ,
; ; : 8CQ0
http.tcp
SRV

0
80
www-server.cs.colorado.edu.
SRV
10 0
8000 n e w - f a s t - b o x . c s . c o l o r a d o . e d u .
;

h t t p : / / w w w . c s . c o i o r a d o . e a u ,
h t t p : / / c s . c o l o r a d o . e d u
h t t p . t c p . w w w SRV

0
80
www-server.cs.coloraao.edu.
SRV
10 0
8000 n e w - f a s t - t o o x - c s . c o i o r a d o . e d u .

;
*. tcp
* . udp


SRV

SRV
C O O

JTOM (
SSH). ( HTTP).
SSH.
. HTTP
, . finger
, ,
. , finger DNS.
, : DNS.
DNS WKS (well-known
services ). ,
, ,
. . ,
,

472

II

Microsoft Windows 2000 SRV.


DNS
.

DNS . ,
,
:
IN

TXT

" U n i v e r s i t y o f CO,

B o u l d e r Campus.

CS

Dept"

SOA NS "cs.colorado.edu.". .
RP,
,
( SOA ).
:
[ c c l ] IN ...
.
, ,
.
DNS.
. ,
, : named
.
IPv6
IPv6 IP.
. IPv6
IP-.
, ,
CIDR, NAT
,
IPv6 .
- , IPv6 (
Microsoft Windows),

,
IPv6 ,
I -.
IPv6,
128- IP- DNS.
PTR,
:
.
, IPv6,
, .
.

16.

473

IPv6 ,
IPv6 , IP-.
, I E T F : 6 ( )
D N A M E ( ).
D N A M E CNAME, ,
, , . 6 , ,
.
IPv6,
IETF,
.
.
6
:
_ I t t l ] IN 6 __) IP-
:
anchor
anchor

IN
IN

6
A6

0
48

3ffe:8050;201:9:00:20ff:fe8l:2b32.
:: 9 : a 0 0 : 2 0 f f : f e 8 l : 2b32 p r e f i x . n i y i s p . n e t .

IPv6 anchor.
, 48
prefix.myisp.net. ,
. ,
.

, 128-
6. ,
47 , 46 ..
48 .
DNSSEC,
, 100- DNS-
! ,
.

,
" ". ( )
doc B I N D 9.

DNAME

IPv6
P T R DNAME.
PTR IPv6
, D N A M E ,
.
IPv4 inaddr.arpa,
(, " c o m " "edu"). IPv6

469
II

. iri6.arpa,
.
in-addr.arpa
IP-. IPv6 ,
.
I 128 ; .
.
. IPv6
001.
, 001
, : 0010.
2;
. :
\ 1*2/3]
,
. ( 2)
( / 3 ) . , , , . . ,
, 4 (
4 ).

, , D N S - , .
. , , .
.
IPv6 001,
\[x2/3j|.ip6.arpa.
.
: ,
(3/45/80), (3/13/32/80)". ,
.
, be.
\[x3ffe8050020100090a0020fffe812b32/128].ipfe.arpa.
\tx00090a0020fffe812b32/801.\[xfff402801008/451.\1x2/3].ip6.arpa.
\[x00090a0020fffe812b32/801.\[x80500201/32],\[xfff0/13]
.\[x2/3] ..

in-addr.arpa IPv4,
, (, )
.
. 80
0 0 0 9 0 a 0 0 2 0 f f f e 8 1 2 b 3 2 .
:
, IPv6
. 13.4 ,
IPv6

16.

475

\[x3ffeB050020100090a0020ffe8l2b32/128].ip6.arpa.
\[x00090a0020fffe8l2b32/B0j[xfff402801008/45].\[x2/3].ip6.arpa.
S[x00090a0020fffe812b32/80][x80500201/32|.\[xfff0/13]
.4[x2/3].ip6.arpa.

/ 4 5 , f f f 4 0 2 8 0 1 0 8 45 48- .
, ,
D N S - .
D N A M E .
:
! [ t t l ] IN DNAME
.
. 80 ,
, ..
. ,

.
SORIGIN .
;
ip6.arpa, my-isp.nei my-domain.com.
, - .
ip6.arpa \[x2/3].ip6.arpa 13- my-isp.nei,
:
; m y - i s p . n e t
SORIGIN \ 1 x 2 / 3 ] - i p o . a r p a .
\[xfff0/13]
IN
DNAME
ip6.my~isp.net.


\Ixffro/13|.\[x2/3|.ip6.arpa, "*ip6.mvisp.nel.". , , 32-
my-domain.com. ip6.niyisp.net:
; my - d o n a i n - n e t
SORIGIN x p 6 . m y - i . s p . n e t .
\x80500201/321
IN
DNAME
ipb.my-domain.net.

"\|x80500201/321 ip6 my-isp.nei.", , D N A M E , 48-


IPv6. 48 ip6.my-domain.com
ip6.my-domain.com PTR
:
SORIGIN i p 6 . m y - d o m a i n . n e t .
\[x00090a0020ffe812b32/80]

IN

PTR

host.my-aomain.net.

,
.
128- .
- ,
.

476

II.

IPv6 ,
. IPv6 ,
. ,
, , ,
. Perl,
,
.

,
, . :
SoRIGIN

SINCLUDE
_
STTL
_
5GENERATE


.
named ,
("") ,
. ,
z o n e named.conf.
$0RIGIN.


. ,
, $ORIGIN

SORIGIN

243.138.128.in-addr.arpa

243.

$ INCLUDE,

. ,
.
STTL ill ,
.
SOA B I N D 8 $TTL
. B I N D 9 , ,
, .
B I N D 9 ,
: , ,
TTL. ,
/.
5GENERATE, B I N D 8.
.
C N A M E

16.

477

,
IP- (. RFC23I7).
.
S GENERATE - [ /] _ f ]
:
_ _
.
.
S. , .
.
C N A M E , PTR NS, B I N D S. B I N D 9 ,
, . C N A M E .

localhost

127.0.0.1 'iocalhost^oKflL?bb/ii_rfo.Me.'". localhost.cs.colorado.edu.


"localhost.", ;
.
localhost,
. ,

localhost 127.0.0.1 .
localhost 16.15.
:
, .
,
, cs.colorado.edu colorado.edu, D N S .

, -
(, ), DNS.
IP-
. ,
, .
DNS, NS
. ,
IP-, -
, .. DNS- (
),
.
:
.

478

II


NS . , Colorado edu
:
,
;

CS

ns.cs.Colorado.edu.
IN
NS
NS
piper.cs.coorado.edu.
IN
NS
ns.xor.com.
IN
IN
NS
ns..Colorado.eduIN
NS n s . c s . C o l o r a d o . e d u .

;
ns.cs
IN
piper.
IN
ns .
IN

A
A
A

128.138.243.151
128.138.204.4
128.138.200.1

" " ,
.
, Internet.
,
,
, "host unknown" (
).

, . ,
ns.xor.com
DNS-. ,
"" , -
. ,
, .
B I N D ,
.

, ,
.
,
, , . ,
.
. B I N D 8.
BIN D 4 (
). , , ,
, NS.
B I N D 8,
, B I N D 9 -. BIND 9

,
.

.
dig ,
.
d i g

16.

479

d i g ._
.
,
(.
R F C 1918)
. /src/conf/recursive
B I N D 8.
.

,
NS .

NS,
.
a l s o - n o t i f y ,
,
SOA.

named NS ,
.
, IP- ,
named.conf

NS?
? . ,

DNS. , . ,

16.12.
(,
), .
, SOA
ndc reload,
named .
( ndc restart),
, .
B I N D named
kill, ,
ndc. . ,
( HUP.
, TERM,
), ndc.

, n o t i f y .
- ,
, , SOA
( ). ,
,

A >480

II

ndc reload, ,
, , .
IP- , .
, ,
: - ,
.
,
SOA, (
), .
,
. named;
.
, .
. ,
,
,

f.cs.Colorado.edu.cs.Colorado.edu

RFC2136
API-. ; ,
DHCP. , ,
.

DNS . DNS ( BIND 4) ,


, , .
R FC1995
BIND 8.2.
, ,

. ,
( ),

( ).
TCP 53.
Syslog '"namedxfer". IETF ,
TCP. UDP. BIND

,
. . BIND 8
named-xfer,
BIND 9 named . ,
n a m e d - x f e r , ,
BIND 9.

16.

481

(, "com")
(. ),
. ,
( ,
, ).
patch:
.
BIND 8
named (
o p t i o n s ) ,
s e r v e r ,
. :
mamtain-ixfr-base true;
support-ixfr true;

# o p t i o n s
t s e r v e r


, ,
z o n e :
i x f r - b a s e _";
i x f r - t m p - f i l e " ":

#
# zone

BIND 9
, ,
named . s e r v e r
: p r o v i d e - i x f q u e s t - i x f r .
, .
,
p r o v i d e - i x f r yes;
r e q u e s t - i x f r yes;

# s e r v e r
f s e r v e r

BIND ,
. BIND 9
, ,
. ,
.
,
.
,
, .

DNS ,
.
, DHCI*
IP-
:
DNS DNS-. .

482

II. teifix

,
Internet. DNS
:
dhcp-hostl.domain.
dhcp-host2.domain.

IN
IN

192.168.0.1
192.168.0.2

, ,
IP-, , ,
,
.
,
BIND, . DHCP
BIND ,
DNS " ".
, .
, . .
DNS,
(, d h . )
.
named.conf 1 l o w - u p d a t e .
,
BTND, .
earned.
, (
, named
)

, ' .
, ,
named,
.

16.13.
DNS .
,
, , .
, Internet,
, dig, hosl
nslookup. DNS.
BIND
,
. . 16.10
, named.conf.

16.

483

16.10. nomed.conf

allow-query
allow-transfer

o p t i o n s , zone
o p t i o n s , zone

aliow-updete
blackhole

zone
options

bogus
acl

server
various

named ,
chroot.
. , ,
\'.
.
D N S S F C
.


, ,
a l l o w - q u e r y , a l l o w - t r a r . s f e r b l a r k h o l e .
D N S .
" ".
a c l 16.9.

. :
a c l oogusnets \
/ /
0.0.0.0/8;
//
169.254.0.0/16;
192.0.2.0/24;
224.0.0.0/3;

10.0.0.0/8;
);
acl

172.16.0.0/8;
192.168.0.0/16;

cunets 1
128.138.0.0/16;
198.11.16/24;
204.228.69/24;

//
//
//
//
//
//

-
, exampie.com

(RFC1918]
(RFC1918)
[RFC1918)

//
//

- Macmrosh
, LP. DHCP.
169.254.0-0/16.
,
. DSL- .
,
DNS-!

484

II

o p t i o n s
:
allow-recursion { .;
blackhole bogusnets;

)/


.
:
acl

ourslaves {
128.13-242.1;

anchor

):
acl

measurements {
128.9.160.157;
198.32.4.0/24;
192.5.5.0/24;

//
// '
//

:
allow-transer

ourslav/es;

su. t ;

,
,
Iniernei
n.slookup.
dig host.
:
% nslookup

D e f a u l t S e r v e r : .
A a o r e s s : IP-
>

Is

cs.Colorado.edu.

[ \
Can't

list

domain

cs.co_orado.ea..:

Unspecified

erto:

-

. .
DNS- ,

named
,
, named
' . -1
, - -g U I D G1D
named.
BIND 9. ,
# named - 53 -q 53 -t / v a r / n a m e d
4 named -u 53 -t / v a r / n a m e d

16.

* BIND " '


' BIND 9 *

485

53.
53 ( BIND 8) /var/named.
,
, named:
/dev/null, , ,
named.conf .. ,
, ,
/var/named
, named,
, .
root ,
.
-. -g -t. "",
"".

T S I G TKEY
DNSSEC ( )
, IETF ,
TSIG (RFC2845). . , , ,
IP-.
,
.. . .
. , , . TSIG
, ,
,
.
.
TSIG DNS- .
, .
;
DNS. TSIG
, BIND : MD5.
dnssec-keygen". BIND,
. , , ! 2.

* dnaaac-keygen - 12 -h - 1-2

128- Kcepel-2+157400000. pri vate. "Key:",


, 64.
. , ASCII-
BIND 8 dnskeygen.

46

II.

, 64.
mmencode
. ; ,
.
scp
. telnet ftp
:
named.conf . ,
, ,
, named.conf
i n c l u d e .

scp SSH; . 21.8.


, servl-serv2.key
:
key s e r v l - s e r v 2 {
a l g o r i t h m hmac-md5;
secret
" _";

1;
600,
. named. named.conf,
, :
include

"servl-serv2.key";

.
,
k e y s .
named.conf

s e r v e r _2
[
keys { s e r v l - s e r v 2 ;

);

);

named.conf :
s e r v e r _1
{
keys { s e r v l - s e r v 2 ;
):

};

a l l o w - q u e r y , a l l o w - t r a n s f e r a l l o w - u p d a t e
z o n e , :
allow-transfer

key

servl-serv2;

1;

,
aamed - I < 16.14) ,
. BIND
,
.
TKEY BIND 9.

.
-,

16.

4 8 7

,
.
, .
, , * ,
".
D N S S E C
DNSSEC DNS. ,
, DNSSEC
DNS- "
?" " ,
?".
DNSSEC : KEY, ,
, .
: ,
..
:
() , ()
""
""
, .
, ,
. ,
, . "" ,
, .
" "'
, ,
:
, ,
- ( ,
MD5), () .
-
.
i ,
.
,
^- \~ .
.
.
DNSSEC
(..
, ).
KEY.
*

,
, , , .

46

II.

.
named 1* ,
.
..
. Fe "".

. !.
B I N D 9:
* dnesec-keygen

-a

DSA

-b

768

-n

ZONE

mydomein.com.

B I N D 8
* dnskeygen

-D76B

-z

-n mydomain.com.

. 16 11 JTHX .
16.11. / dnssec-keygen dnskeygen

dnssec-keygeii
-a

DSA

DSA

- 7 6 8
-n

ZONE

7 6 8 -
mvcoma i n . :.

Tnydomain.com

dnskeygen
-D768

DSA 768-

-z

-n

myoomain.coin.

mvdomain.com

dnssec-keygen dnskeygen :
alg
003
key i d e n t i f i e r
f l a g s - 16641

, "! :
Kmydomain.com.+003+12345.key
Kmydomain.com.+003+12345.private


$ INCLUDE. SO .
DNSSEC , .
,
. B I N D 8 ,
;
. BIND 9
dnssec-makekeysel. .
dnssec-makekeysel , ( ), I T L
, ,
. ,
dnscec-maJcekayset -t 3600
Kmydomain.com.+003+12345

16 >

+64000

489

, ,
3600 ( ),
10 . 1
dnssec- make keyset , mydomain.com. keyset.
.
, ,
.
BIND 9 dnssec-signkey
:
f

nlgnkey m y d o m a i n . c o m . k e y s e t K c o m . + 0 0 3 + 5 6 7 8 9

mydomain.com.signedkcy,
("com") (mydomain.com)
. BIND 8 dnssigner.
,
. :

SIG NXT ,
.
BIND 8 dnssigner.
contrib . BIND 9
dnssec-signzone. ,
d n e a i g n e r -or m y d o m e l n . c o m - ! d b . m y d o m a i n -zo
d b . m y d o m a i n . s i g n e d -kl m y d o m a i n . c o m dsa 12345 - s t
d n s s e c - s i g n z o n e -o m y d o m a i n . c o m d b . m y d o m a i n

fr

BIND 6
t BIND 9

db.mydomain
, db.mydomain.signed.
( -st). , ,
, , .
SIG :

( DSA);

TTL ;

( );

( );

( 12345),

(mydomain.com.);

, .
,
named.conf my domain, z o n e f i l e
. db.mydomain.signed. db.mydomaln.
BIND S z o n e p u b k e y s .
, BIND 8 ,
BIND 9 :
KEY
.

: " IP- anchor.cs.colorado.edu, .

46

II.

, cs.colorado.edu
".
" "?
.
DNSSEC NXT,
,
*. , anchor.cs.colorado.edu
awesome.cs.colorado.edu anLhill.cs.coIorado.edu,
NXT :
anchor.cs.colorado.edu.

IN

NXT

a w e s o m e . c s . c o l o r a d o . e d u A MX NXT

, "anchor" cs.colorado.edu
"awesome", "anchor"
A, MX NXT. NXT
. , NXT zamboni.cs.colorado.edu
, .. cs.colorado.edu:
z a m b o n i . . cs . C o l o r a d o . e d u .

IN

NXT

c s . c o l o r a d o . e d u A MX NXT

NXT , ,
. , ,
LOC anchor, NXT,
, A, MX NXT
DNSSEC BIND 9.0,0
( 2000). ,
.
,
BIND. , , , DNSSEC.
DNSSEC
. ,
, .

, .
, ,
. , , ,
,
SIG NXT,
. , DNSSEC,
, RFC
.
BIND 9 .
RFC2535.
BIND 9 DNSSEC
BIND 9. , DNSSEC
BIND 9
, ,
DNS, . , cs.colorado.edu cs.coIorado.edu
.cs.colorado.edu.
.

1 6 .

491

DNSSEC , .
;
hosiname@com .
DNSSEC. , . , ,
.
( TSIG/TKEY) , .
, .
TSIG , DNSSEC,
,
TSIG DNS-
Microsoft , U N I X
Windows 2000 SRV :
, , .. SRV.
Microsoft IETF,
DNS
.
, GSS-TSIG.
.
Kerberos . ,
Kerberos, Microsoft,
Kerberos 5.' ,
?
Win2K SRV,
Kerberos Win2K
Kerberos. , ,
. , Microsoft
- .
, Win2K. ,
DNS. . , Win2K
.
UDP-
. , ,
Win2K TCP-, KEY
.

TCP-.
.
Microsoft, : ", , !"

1 6 . 1 4 .
named ,
.

ndc. ,

487

II. *

. dig
nslookup ,
.

named . B I N D 4 Syslog
B I N D 8
: .
, - ,
B I N D (. 16.12).
16.12. BIND

, : Syslog,
/dev/null

, named; ,

, (
BIND 9)

Syslog; DNS ,

; , Syslog


l o g g i n g namcd.cont
.
, .
, ( B I N D 9)
. ,
.
, , . , Syslog.
, /cic/syslog.conf.
l o g g i n g :
logging

_ ;
_ :
c a t e g o r y ,_
_ ;
_ ;

16.

493

-
, Syslog.
f i l e , s y s l o g ;
.
c h a n n e l {
f i l e [ v e r s i o n s _ | u n l i m i t e d ]
s y s l o g ;

I s i z e ];

s e v e r i t y :
p r l n t - c a t e g o r y yes I ;
p r i n r - s e v e r i c y yes ] no;
p r i n t - t i m e yes I no;
);
_ ,
. ,
(: 204 8, 1 0 0 k , 20m, 1 5 g , u n l i m i t e d ,
default).
Syslog ,
. ,
d a e m o n l o c a 1 0 l o cal?.
Syslog

.5.

. (
): c r i t i c a l , e r r o r , w a r n i n g , n o t i c e , i n f o d e b u g
( , s e v e r i t y d e b u g 3).
d y n a m i c ,
.
p r i n t
. Syslog
,
. BIND 9 ,
(), .
p r i n t - t i m e , Syslog .
. 16.13 , .
.
16.13. BIND

494

default syslog

info Syslog
daemon

d e f a u l t debug

named.run:
dynamic

default srderr


named i n f o

null

II. *

. 16.14 ,
B I N D 8 9. 9 .
"8/9?", ,
B I N D 8, B I N D 9.
16.14. BIND

default
general
config
parser

queries/client

8/9

dnssec

lame-servers

8/97

statistics

8/9?

panic
update
ncache
xfer-in

8/9?
8/9
8/9?
8/9

xfer-out

8/9

db/database
eventlib

8/9
8

packet

8/9?

notify
name
security

8/9

OS
insist
maintenance
load

8/9
9
8/9
8

8/9
8/9
8/9?
8/9?

response-checks

8/9?
8/9?
8/9?

resolver

network

1
2
3


, 1


, (!)
DNSSEC
, , ,
! , 2




,
,

,
3
3

"... CNAME"







, ,

BIND 8 d e f a u l t
, .

B I N D 8 /include/dns/
confcommon.h. log.h .

16.

495

BIND 9 lib/dns/include/dns/log.h bln/named/lnclude/named/log.h.


l o g g i n g BIND 8 :
logging {
category d e f a u l t ( d e f a u l t _ s y s l o g ; default_debug; 1;
category panic J default_syslog; default__stderr;
};
category eventlib { default_debugj
c a t e g o r y p a c k e t ( d e f a u l t _ d e b u g ? };

};

BIND 9 :
logging {
category default

default_syslog;

default_debug;

};

};


BIND; ,
. named ,
,
. .

. , ,
-
Iniernei, : - .
.

.
. ,

. named , .
MS. SOA
NS. ,
-
. ,
, .
TTL.
TTL 5TTL,
. ,
. BIND 8
SO *. BJND 9
, named
.
. named
.
"'' Internet.
.1. , named,
, , .

BIND 8.2 :
TTL , .

496

II

, , ,

tide.
BIND

h[Lp://vAvw.acmebw.com/askmrdns/bind-messages.him

named 0 II
,
0 . I 2
. , .
, named
-d. ,
# nmed -d2
2.
named.ruB, ( 16-16).
, .
named,
ndc trace,
. ndc notrace . , ,
:
severity

debug


3 .
, .
, .
,
, DNS.
(, )
DNS.
.
ndc
ndc (mdc BIND 9)
named. . 16 15
, , ,
named.con named.
ndc reload named
HUP. . ndc reload
,
,

16.

497

16.15. ndc

help

ndc

__

status

named

trace

trace

dumpdb

DNS nameddump.db

stats

named.stats

reload

named .conf

reload

restart

named

querylog

ndc dumpdb named


nameddump.db.
, ,
.
colorado.edu, , 16 ,
200 .
named ,
ndc stats.
named.stats.
, cs.colorado.edu (
43- ).
, ,
. , ,
.
+++

S t a t i s t i c s Dump +++ Wed F e b

180465
52669
0
475460
3
194
15686
13816
76244
130939
1
171
42
124587

15:07:18

2000

time since boot


(sees)
time since r e s e t
(sees)
Unknown q u e r y t y p e s
A queries
NS q u e r i e s
CNAME q u e r i e s
SOA q u e r i e s
PTR q u e r i e s
MX q u e r i e s
TXT q u e r i e s
LOC q u e r i e s
SRV q u e r i e s
AXFR q u e r i e s
ANY q u e r i e s

+* Name S e r v e r

498

Statistics

++

RR
320252

RNXD
23620

RFwdR
249826

RDupR
1013

RFail
3532

RFErr
0

RErr
903

RAXFR
42

RLame
10339

ROpts

SSysQ

SAns

SFwdQ

SDupQ

SErr

RQ

RIQ

RFwdQ

II


RDupQ
478/6

55547
RTCP
1605

652973
SFwdR
249826

265736
SFail
18

291448
SFErr
0

963690
SNaAns
16253J

SNXD
190644


, ,
.
(R) (S) , (Q)
(R). nsjstats.c. src/bin/named BIND 8.
BIND 9.
. Fro
grep find.
, , ,
. Unknown q u e r y t y p e s ( )
, .
ANY . ,
.
, Dup,
.
, ,
. .
BIND 8, o e a l l o c a t e - o n - e x - . t .
ndc stats, , named.memstais
. BIND 9
named.
nsiookup, dig host
nsiookup. dig host
DNS. nsiookup,
BIND dig (domain information
grope )
(Steve Hoiz). (Michael Sawyer)
BIND 9 BIND. host,
(Eric Wassenaar),
.
, ,
dig, nsiookup, host
- ,
: dig host BIND, nsiookup
.
nsiookup ,
DNS.
, ,
, .
, . . 16 16 , nsiookup.

16.

499

16.16. . nslookup

^. _..

help ?

exit

server

Iserrer

set type^xet

set debug

set d2

Is

any, .. "".

dig , nslookup.
, , .
,
( mi
nslookup j.
, MX anchor

% d i g a n c h o r . c a . o o l o r a d o . e d u . mx

% d i g 6ns 1 . b e r k e l e y . edu v a n g o g h . b e r k e l e y . edu . a n y


vaugogh berkeley.edu

% d i g - 12.32.33.5
, vangogli.
, nslookup dig
% nslookup
Default Server:
bb.rc.vix.com
Address:
204.152.187.11

> s e t typ=any
> amazon.com.
Server:
bb. re.vix.*
Address:
204.152.lB7.il
Non-authoriLetive
answers:
a m a z o n . com
nameserve: amason.com
nameserver
amazon.com
n a m e s e r v e r -amazon.com
nameserver
amazon.com
p r e f e r e n c e =
amazon.com
amazon.com
AuthoricaLive
amazon.com

A >500

A U T H 0 0 . N"S. U 0 . NET
NS2.PNAP.KET
KS1.PNAP.NET
N S - 1 . a r a z o n . con:
10, m a i l e x c h a n g e r s e r v i c e - 4 .a2iazon.com
p r e f e r e n c e = 10, m a i l e x c h a n g e r service-5.amazon.com
internet address
208.216.182.15
answers can oe found from:
n a m e s e r v e r = AUTHOO-NS.UU.NET

II

amazon.com
amazon.com
amazon.com
AUTHC 0 . N S . L'U. NE1
KS2.PNAP.NET
KS1.PKAP.NET
NS-L . a r i a z o n . com
s e r v i c e - 4 .amazon.":
s e r v i c e - 5 .amazon.coir.

nameserver
"JS2. F ^ A P . N E T
n a m e s e r v e r = KS1.PNAP.NET
n a m e s e r v e r = N S - I . a r r a z o r i - con.
Liiterriet a d d r e s s
198.. t. 65
: n : e t . r i e t a d a r e s s - 2 0 6 ..15 3 . 1 9 4 - 7
L n t e r n e t a o o r c s s - 206 .
. 94 . te~
. n c e r n e t a d a r e s s = 2 0 9 . 1 9 . t . s>4 . 2 0
.r.ternet address
109.191 c4 .56
i n t e r n e t aadresfi - 209.191 164.51

nsluokup NS. MX >


. IP- \ 1 \ -
% d i g amazon. com. any

DiG
8.3
amazon.com any
; r e s o p t i o n s : i n i t r e c u r s deLnam d n s s i
; got answer:
; - H E A D E R - o p c o a e : QUERY, s t a t u s : NOEPROF, i n : 4
; f l a g s : qr rd ; QUERY: 1, ANSWER:
, AUTHOR I "i: 5, A D D I T I O N .
; QUERY S E C T I O N :
a . - n a i o n . : : n , '-ipe
ANY,
-lass
f ANSWER S E C T I O N :
amazon.com.
Lh27mi:s
NS A17TRC0 . N S . UO. fE .
IN
a m a z o n . coir..
lh27ml1s
IN
NS N S 2 . P N A P . N E T .
a m a z o n . corr.
IN
NS N 3 1 . P N A P . N E T .
Lh27mlls
IN
NS-1.amazon.com.
.com.
lh27mlls
NS
amazon.com.
s9m22s
IN
MX 0 s e r v i c e - 4 . a i r . a z o i i . c o m
amazon.com.
59rr.2zs
1M MX 1 s e r v . c e - 5 . a m a - o r , . ~
L^9ir.29s
208.21c.182.If
amazon.com.
IN
A
; ; AUTHORITY S E C T I O N :
amazon.con.
Lhrt:is
IN
NS A U T H 0 0 . N S . U U . N E T .
amazon.cor.
lr.2 - i l s
IN
NS N S 2 . P N A P . N E T ,
amazon.com.
NS1.PNAP.NET
NS
IN
a m a z o n . coir,.
N.
IN
NS i . air.a t o n . c o r .
;l ; ; ADDITIONAL SECTION;
xN A
AUTH 0 . N S - U U . N E T .
I8.6.1.65
206.2*3.194.9'
NS2.PMAP.NET
2Qh51rr.4 4 s IN
A
MS 1. PNAP. Nc. .
:N A
zOc.. >3.194.65
NS-i.amazon.com.
59m22s
IN
A
209-I1.-64.
s e r v i c e - 4 . a m a z o n . c o m . 59ir22s
20. 9 1 . l c 4 . 5 C
IN
s e r v i c e - 5 . amazon. cor,, 59m22s
IN
. 0 ^ 1 9 . .
rotai query time:
msec
FROM: o b . r c . v i x . c o m t o SERVER: a e t a u l t
WHEN: S a n J u l
2 1 2 : 4 5 : ^ 9 2000
MSG S I Z E
s e n t : 28
r c v d : 3 38

dig lie iiK.4io4.iei


,
.
. . "
,
"".
host
\ -v
( , dig).
. ,
,
resolv.conf ,

16.

501

% b o a t amazon.com,
amazon.com h a s a d d r e s s 2 0 8 . 2 1 6 . 1 8 2 . 1 5
arnazon.com m a i l i s h a n d l e d ( p r i = l O ) b y s e r v i c e - 4 . a m a z o n . c o m
amazon.com m a i l i s h a n d l e d t p r i ^ l O ) b y s e r v i c e - 5 . a m a z o n . c o m
, ,
. ' IP-,
, , D N S .

, ,
D N S
() .
, ?
,

.
.
,
, ,
D N S ,
, . ,
3,5 ( i n f o ) ,
. 16%
,

iokyoiopIess.net. !
:
Jari 29 0 5 : 3 4 : 5 2 i p n . c a i d a . o r g n a m e d f 2 2 3 ] : Lame s e r v e r on
'www.games.net' (in 'GAMES.net'?): [ 2 0 7 . 8 2 . 1 9 8 . 1 5 0 ] . 5 3
'KS2.EX0DUS.net'

dig ( ):
% d i g www.games.net.
QUESTIONS:
www.games.net, t y p e = A, c l a s s = IN
ANSWERS:
www.games.net.
3600
A
209.1.23.92
;; AUTHORITY RECORDS:
games-net.
3600
NS n s . e x o d u s . n e t .
games.net.
3600
RS n s 2 . e x o d u s . n e t .
games.net.
.3600
NS n s . p c w o r l d . c o m .
;; ADDITIONAL RECORDS:

www.games.net .
ns.exodus.net (
), ns2.exodus.net
:
* d i g 6 n s 2 . e x o d u s . n e t www.games.net.
QUESTIONS:
www.games.net, t y p e = A, c l a s s = IN
AUTHORITY RECORDS:

502

II.


net

24 4362
244362
244362
244362

net

NS
NS
NS
NS

F.GTLD-SERVER3.net.
J.GTLD-SERVERS.netK.GTLD-SERVERS.net.
A.GTLD-SERVERS.net-

,
, l v net". , . ns2.exodus.com .
16.15.

,
, .

"*

"" named
.
. ' " B I N D 9 ,
, .
. ( B I N D 9
"" "".)
,
,
root-servers.nei. ,
dig
"". a.root-servers.net. :
% d i g @ . r o o t - s e r v e r s . n e t . ne > r o o t . c a c h e
f.root-servers.nei ,
:
% d i g . > r o o t . c a c h e

, .
.
,
. named ,
"" . ,
.
"" {
):
cs.colorado.edu.
cs.colorado.edu.
;
;

IN
IN

NS
NS

anchor.cs.colorado.edu.
ns.cs.utah.edu.

DiG 8 . 2 e f . r o o t - s e r v e r s . n e t . n s
L o t s o f d e t a i l e d d i g i n f o f o r m a t t e d a s comments h e r e . . .

16.

. 503

E.ROOT-SERVERS.NETD.ROOT-SERVERS.NET.
A. ROOT-SERVE RS.NET.
H.ROOT-SERVERS.NET.

Idlh42m
Idlh42m
Idlh42rn
Idlh42m

IN
IN
IN
IN

NS
NS
NS
NS

E.ROOT-SERVERS-NET.
D.BOOT-SERVERS.NE1.
A. ROOT-SERVERS. NET.
H.ROOT-SERVERS.NET.

2dlh42m
2dlh42m
2dlh42m
2dlh42re

IN
IN
IN
IN

A
A
A
A

192.203.230.16
128.8.10.90
198.41.0.4
128.63.2.53

,
. , .
(), NS
dig ,
, ,
, domain/named,root,
- rs.intermc.net*. . . ftp://ftp.nic.mi5/domain/named.root.
localhost
localhost local host,
.
localhost. :
0

IN

IN
IN

SOA c s . c o l o r a d o . e d u . h o s t t r . a s t e r - c s . c o l o r a d o . e d u .
1996110801 ;
;
3600
;
900
3600000
;
10800 )
;
NS
cs.colorado.edu.
PTR l o c a l h o s t . c s . c o l o r a d D . e d u .

localhost (127.0.01) ,

. ,
: 1996 . ,
"localhost" .
"0.0.127.in-addr.arpa."
127.0.01 "localViost.dewi?H-". "localhost.". ,
"localhost.", , ,
0.0.127. in-add . arpa.

D N S ,
.
.

, Network Solutions
.

504

II.

: ( ) , '* , , ,

?
-
,
.
, .
LDAP,
, ,
. ,
addhost.
LDAP.
.
addhost ) fip.xor.com.
D N S , Internet
Iniernei, DNS.
.
,
Iniernei. ,
.
[71

21.9.
"" IM
, Iniernei. , ,
IP- IP-, RFCI918
(. . 13.7 13.4J.

16.16. D N S
,
ISC BIND . ,
, BIND
,
NIS.
18. , 18 3.
Soloris
Solaris 7 S
BIND 8.1.2. " "',
/elc/nsswitcli.conf. ,
BIND, NIS, NIS+ /elc/hosts. h o s t
:
hosts:

t i l e s tins

16.

.115


/etc/hosts, DNS.
, , ,
.
N1S , D N S ,
. Sun
:
hosts:

n i s INOTFOOND=return] f i l e s

. NIS
D N S , D N S .
. ,
NIS, .
B I N D Solaris
. 16.17.
16.17. BIND Soloris

resolv.coiir
in.named
named-xfer
named.conf
named.pid
named.run
naraed.stats
named_dump.db
named-bootconf

/eic
/usr/sbin
/usr/sbin
/etc
/eic
* 1
1
1

/usr/sbin

1



in.named




BIND 4 BIND 8

/etc/named.conf BIND
HP-UX
H P - U X 11.00 B I N D
B I N D 4.9.7. ,
Solaris. nsswitch.conf , / c t c
- ( Is /elc/nssw*).
nsswitch.conf, ,
, -
. , /elc/nsswitch.hpdefaults, , nsswitch.conf
.
:
hosts:

d n s [NOTFOUND=return] n i s [N0TFOUND=return]

files

D N S , , NIS, /etc/hosts.
D N S ,
"'host unknown".

506

,
:
hosts:

files

[NOTFoUND-continue] dns

NIS, ,
D N S , c o n t i n u e
() , .
,
NIS DNS. f i l e s
, IP-,
.
. 16.18 B I N D
HP-UX.
16.18. BIND HP-UX

resolv.conf

/etc

named

/usr/sbin

muned-xfer

/usr/sbin

named.boot

/etc

named.pid

/var/run

named

named-run

/var/tmp

named.Mats

/var/tmp

nameddump.db

/var/tmp

H P - U X , /usr/newconfig, - , -
D N S . H P - U X ( 11.00)
. resolv.conf
/etc/newconfig. /nsr/newconfig, ,
/etc/newconfig, :
, BIND.
, .-
H P - U X B I N D 8 B I N D 9
, H P - U X ,
/etc/hosts D N S . hosts_to_named / e t c / h o s t s DNS.
sig named named; ^
kill ndc.
Red

Hot

Red Hat Linux 6.1 B I N D 8.2,


(. 16.19). Red Hal 6.2, FreeBSD.
8.2.2-5,
. " "
, Solaris.
. (
nsswitch, man nsswitch.conf.)

16.

507

16.19. BIND Red Hot Linux

resolv.eonf

/etc

named

/usr/sbin

named-xfer

/usr/sbin

named.conf

/C

named.pid

/var/run

named

namcd.run

named.stats

tcatna-ioe 1

named.niemstats

nameddump.db

/etc/named.conf BIND-

nsswitch.conf
:
hosts:

d n s [!UWAVAIL=return]

flies

! UN AVAIL, , , . . .
-, Red Hai, hosts
:
hosts:

d b f i l e s n i s p l u s dns

:
hosts:

f i l e s dns

Red Hal .
/etc .
named.conf man-.
FreeBSD
FreeBSD 3.4 4.0 B I N D 8-2.2-5 "
" /etc/host.conf
. ,
.
^ e t c / h o s t s
hosts

oind
# .-:*6 YP/NIC- ^
u s
; host.couf , D.NS.
/ctc/hosts FreeBSD namcd.conf
/etc /etc/namedh.
, , . 16.20.

508

II.

16.20- BIND FreeBSD

resolv.conf

named

/usr/sbin

named-xfer

/usr/libexec

named.conf

/etc/namedb

named.pid

/var/run

named

nnmed.mn

namcd.stats

named, mems tats

named duinp.db

- 1

/etc/namedb

> /etc/namcdb/named.conf
BIND.
/etc/namedb -:
(named.root),
localhost (PROTO.localhost.rev) shell- make-localhost. ,
localhost .
1- named-hootconf. /usr/sbin, named.boot BIND 4 named.conf
B I N D 8.
, named.conf /etc
-
,
.
named.conf. , FreeBSD
named
.
.
!_^ /etc/defaults/rc.conf.
-. named,
, .
, isc.org,
Solaris FreeBSD .

16.17-
D N S B I N D ,
, , Internet, " In a Nutshell"
O'Reilly, Internet.

, BIND:
bind-usens ,
b i nd - use r^-request@ i sc. org;

16.

. 509

bind-announce ,
bind-announce-requesi@isc.org:

namedroppers ,
namedroppers-request@internic.net:

bmd-workers ,
bind-workers-request@isc-org.
bind-bugs@isc.org
bind9 -bugs@isc.org.

The

Nominum

BIND

Development

Team.

BINDv9

Administrator

Reference

Manual.

BIND (doc/arm) Web-


www.isc.org.
BIND 9. , RIND Operations Guide, BOG.
,
BIND 4. BOG
BIND 8.
Albitz, Paul, and Cricket Liu. DNS and BIND, Fourth Edition. Sebastopol. CA
O'Reilly, 2001.
BIND,
(8.2.3. 9.1.0. 4.9).

Internet
mp.sys.Lcp-ip.domains BIND, 4.
(Chris Peckham)
lit t p://www. i ntac.com/~ cdp / ptd -faq
DNS (www.dns.net/dnsrd)
. (Andras
Salamon).
R F C
RFC-, DNS,
Web- www.rfc-ediior.oig.

1034 Domain Names: Concepts and Facilities ( :


):

1035 Domain Names: Implementation and Specification ( :


).

1995 Incremental Zone Transfer in DNS (


DNS);

1996 A Mechanism for Prompt Notification of Zone Changes (


);

2136 Dynamic Updates in DNS ( DNS),

510

II.

2181 Clarifications to the DNS Specification (


DNS);
2308 Negative Caching of DNS Queries (
DNS-).

2535 Domain Name System Security Extensions ( DNS.


);

2671 Extension Mechanisms for DNS: EDNSO (


DNS: EDNSO);

2672 Non-Terminal DNS Name Redirection: DNAME ( DNS: DNAME);

2673 Binary Labels in DNS ( DNS).

1535 A Security Problem and Proposed Correction With Widely Deployed


DNS Software ( DNS );

1536 Common DNS Implementation Errors and Suggested Fixes ( DNS );

1982 Serial Number Arithmetic ( );

25362541 , DNSSEC.

1183 - New DNS RR Definitions: AFSDB, RP, X25, ISDN. RT (


DNS: AFSDB, RP, 25. ISDN, RT);

1706 DNS NSAP Resource Records ( NSAP DNS);

1876 A Means for Expressing Location Information in DNS (


DNS);

2052 A DNS RR for Specifying the Location of Services: SRV (


DNS, SRV);

2168 Resolution of Uniform Resource Identifiers using DNS ( DNS);

2230 Key Exchange Delegation Record for the DNS (


DNS. ).
DNS Internet

1101 DNS Encoding of Network Names and Other Types (


DNS);

1123 Requirements for Internet Hosts: Application and Suppon (


Internet-: );

1591 Domain Name System Structure and Delegation ( DNS


);

2317 Classless in-addr.arpa Delegation (


in-addr.arpa).

DNS

1537 Common DNS Data File Configuration Errors (


DNS);

1912 Common DNS Operational and Configuration Errors ( DNS);

16.

2182 Selection and Operation of Secondary DNS Servers (


DNS);
2219 Use of DNS Aliases for Network Services (
DNS- ).

, DNS

1464 Using DNS to Store Arbitrary String Attributes ( DNS


);

1713 Tools for DNS debugging ( DNS);

1794 DNS Support for Load Balancing (


DNS);

2240 A Legal Basis for Domain Name Allocation (


mi );

2345 Domain Names and Company Name Retrieval (


),

2352 A Convention For Using Legal Names as Domain Names (


).

, NFS (Network File System),


. NFS
, ..
.
, ,
, .
Sun Microsystems
1985 . NFS
,
,
,
NFS. UNIX-
NFS, ,
Sun.

17.1.

NFS
,
, ,
, .
NFS . ,
"" .
N F S
NFS . NFS 2, 90- .
, 3.
.

7.

513

2,
, .
, .
. ,
.
3
, .
, . NFS 3 ,
NFS 2.
3 2.

.

NFS RFC (Remote Procedure Call
) Sun. -
.

TCP UDP.
NFS UDP.
80- . NFS
, UDP. NFS
,
IP-.

NFS UDP, .

NFS Iniernei.
TCP
. ,
UDP .
, TCP. ,
.
TCP UDP .
UDP. Solaris .
TCP NFS

2,
(, Red Hal) 3.
( , HP-UX).
I CP NFS 3
17.1. " " ,
.

514

II.

17 1. NFS

NKv3?

TCP?

Solaris

HP-UX

UDP

Red Hat

'

UDP

FreeBSD

U DP

TCP .
WebNFS
1996 . Sun ' N F S
, WcbNFS. N F S 3, WebNFS
(, ) ,
N F S .
. NFS.
. Web-. , , .
W e b N F S
( H P - U X )
WebNFS.
wuTv.sun.com/webnfs.

(, / lock ]
"" UNIX-CIICICM

. N F S . .
N F S : .


?
*
NFS. , lockd
staid. , ,
N F S
.


rquolad.
N F S ,
,
rquolad. ,
.

1 7.

510


UNIX
. X N.
, ,
.
6.
NFS
,
NFS
. , :
, , ,
.
, .
NFS .
/etc/passwd,
- , m a p _ m s
Red Hal.
raat n a b o d y

, .
! , NFS.
NFS ,
0, " ",
. , root
,

nobody, "" root,
NFS.
; -2 65534.
,
. Solaris HP-UX
, root -1.
, . NFS, root
su " 4 ,
.
, bin sys, ",
( '
) .
,
Red Hat
root. 17.2. ,
, sendmail.

516

, root
.

NFS,
, ,
. NFS ,
, .

.
NFS
.
,
.
,
. , ,
, ,
:
, ,
, ,
.
,
RPC ,
. NFS ,
, ( ) . ,
, ,
, .


, . ,
(, /anchor/tools , anchor),
^ anchor
" " 'anchor/tools \
, ,
"
, * , /anchor
.
, ,
.
, , /anchor. ,me/rastadon .. 1 , 17 6.
N F S

17

517

. ,
, - UNIX.
NFS
. RPC .
.
: Sun.
,
, Kerberos, RPC.
, ,
. , ,
, -
, .
Kerberos 21.8.

[^


Sun Kerberos,
N FS , !
. ,
,
,
.

.
,
.
, ,
,
.
TCP-
UDP- 2049. NFS*. ,
portmap Sun RPC,
TCP- UDP- I I I .
, ,
NFS
(VVebNFS )
21.9.

17.2.

NFS
, "" ,
. Solaris " "
.
(..
)
,

, VVebNFS, 2049. , .

518

II.

: mountd,
nfsd.
rpc.mountd rpc.nfsd ,
Sun RPC (,
portmap. 28.3).
N F S , mountd nfsd,
,
.
,
, . .
mountd nfsd
, ,
.
(
xtab,, Solaris sharetab) - ;
.
,
.
exportfs. Solaris share.
exportfs - unshare.
,
,
,

xtab sharetab.
/etc/exports, .
exportfs - Solaris
/etc/dfs/dfstab.
, share. (
shareali grep dfstab NFS-
N F S
, shareall
sh /elc/drs/dfstab.)
FreeBSD , mountd /etc/exports
, xtab exportfs
. exports, mountd H U P .
:
# kill -HOP 'cat /var/run/mountd.picT
. 17.2. ,

,
17.2.

Solaris

.
/etc/dfs/dfstab

HP-UX
Red Hai

/etc/exports
/etc/exports

FreeBSD

/etc/exports

1 7.

sbareall
/usrAbui/exportrs -
/usr/sbin/exportfs -
mountd HUP

519

NFS ,
. ;

. N F S
, ,
, .
, /users,
.
. , /chimchim/users,
/chtmchim/ijsers/joe,
qsers . ,
, Red Hat .
s h a r e d f s t a b (Solaris)
/etc/dfs/dfstab share
. , , /chimchim/users band moon (
band root) /user/share/man
chimchim rastadon. /etc/dfs/dfstab
:
s h a r e - F n f s - r w - b a n a . . com:moon..com. r o o t = b a n d . x o r . c o m
/chimchim/users
share -F n f s -o rv=chimchim.xor.com:rasradon -xor.com /us/share/man
/etc/dfs/dfstab
shareall. . , shareall
, dfstab,
,
. share
. 17.3.
17.3 shore {Solaris)

-
iw

rv-
=

=1/
nosufe
!

520

1 (
)

(
)

,
;
- nobody ( , -2)
U1D , root; nobody

" NI-S \
SLID SO ID

II.

, share,
, (. 17.4).
.
17.4 shore
.

DNS
IP-
1

jax.yyy
@

.
( , DNS)
NIS;
18.3

, /etc/networfa 1

C1DR. 3128.138.92.128/25

. 17.4, ,
: DNS,
, .
,
, ,
.
,
share -F nfs - rw0128.138.243/24:.cs.colocado.edu /users
/usr -
cs.colorado.edu. 128.138.243.

-
rw=. =.
- share(lM) N F S
share_nfs( I).
exportfs e x p o r t s ( H P - U X , R e d H a t , F r e e B S D )
exports
, . ,
H P - U X exports,
/chirnchim/users
/usr/share/roan

-access=bana:moon, roor=band
- a c c e s s ^ x o r a s a u r u s : r a s c a a o n : rr.oon, r o

, band moon
/chimchim/users. band
. ,
xorasaurus. rastadon moon /usr/share/man .
, exports ,

.
cbimchim

1 7.

521

ma N F S exports
1024 . ,
.
.
, /etc/exports,
,
H P - U X , Red Hat
Linux FreeBSD, , , .
exports HP-UX
H P - U X exports "'"
. (. 17.5)
, share Solaris.
. ,
I w - a n c h o r . c s . Colorado. edu :sioet. c s . Colorado . edu
Sol.ins -
. H P - U X
,
. ! HP-UX,
, a c c e s s :
rw,access-anchor.cs.Colorado_edu:moet.cs.colotado.edu
- , rw
. , .
H P - U X exports ,
, , .

17.5 ,
exports.
(
18.3).
17.5. exports HP-UX
a c c e s s =/

fn
'v.

root=

.-*

522

,
,"

( )
;
. :

,
,
- nobody
UID. , root. -2 (
nobody). -1 or I
;
.

II.

/eic/evports
exportfs -.
exports Red Hat Linux
Red Hat ,
, exports ,
.
, .
.
:
/chimchim/users
/usr/share/man

band{rw,no_root squash) noon(rv)


*.cs.Colorado.edu(ro)

. \
"" . . 17 6
, exports Red Hat*.
17.6. Red Hat

NIS,
18.3

* ?


, '*"

IP-

IP-/

C1DR. 128.138.92.128/25

. 17.7 exports,
Red Hat
N F S Red : . . ?*
, . ,
/users
/users/evi

*.xor.com(rw)
(noaccessl

xor.com !
/users, /users/evi. ,
; . ,
Red Hal
. *
, Linux - . . man-
exporis<5).

, ^ p u b l i c WebNFS

17.

523

17.7. exports Red Hot

rw

( )

,
, ,

rooc squash

UID GID, 0, , a n o n u i d a n o n g i d ; 1

no r o o t squash

root ()

all_squash

anonuJ.d=x

UID, ,
root

anongid=xw

GID, ,
root

secure

insecure

noaccess

, Red Hat
root, .
s q u a s h _ u l d s a l l _ s q u a s h .
mountd Red Hat inetd,
.
tepd;
21.7.
Red Hat N F S 3, ,
. ,
3, N F S 2.

exports FreeBSD
FreeBSD exports
, (
) , .
:
/chimchim/users
/chimchim/users
/usr/share/man

- m a p r o o t - r o o c band
moon
- r o -mapall=daemon x o r a s a u r u s r a s t a d o r . moon

FreeBSD ,
.

II.

, .
, .
. 17.8 .
NFS, FreeBSD
,
- a l l d x r s . ,
; .
FreeBSD
,
:
- n e t w o r k _ -mask
17 8- exports FreeBSD
.

; -
root ( UID
) nobody ( -2) . -mapiooL = Looi

-maproot-

-^

U1D :

-alldirs

; i.o

VVebNFS;
, nobody

-webnfs

=
- n e t w o r k - m a s k , ,
, .
/chimch-/users

- -network. 1 2 8 . 1 3 8 . 2 4 3 . 0 -mask 2 3 5 . 2 5 5 . 2 5 5 . 0

,
,

mounid HUP.
/etc/exports
!
.
mountd Syslog
"daemon'
nfsd:
mountd


.

17 ,

525

WbiM
^t
!<'

nfsd . - NFS.
.
nfsd , ,
nfsd
fork , ,
, .
, N F S .

nfsd,
nfsd .
"' ".
, ,
"" .
nfsd
, .
N F S
,

. N F S
NFS.
.
,
, , .
12 20. ,
( uptime)
. ,
. , .
N F S U D P -
U D P - , ,
nfsd .
o r e netstat -s.
. ,
.
nfsd
/ e t c / r c * , init
. .
Solaris nfsd - .
N F S U D P . T C P
.
H P - U X nfsd
NUM KFSD /etc/rc.config.d/nfsconf.
Bo FreeBSD nfsd -I -,
T C P UDP.
- (, nfsd -l - - 8). , , n f s s e r v f l a a s /etc/rc.conf ( /etc/defaults/rc.conf.
;

cfsd , , ,
, , NFS-.

II.

:
*'-u -t - 4").


nf s _ s e r v e r _ e n a b l e YES, NFS.

17.3.

NFS
mount
_:
, .
mount NFS- NFS-.

- biod ( nfsiod).
, .
b i o d nfsiod:

V4

biod/nfsiod

. N F S 2, n N F S 3.
NFS-,
.
.
nfsd, biod , , .
. nfsd
biod , "" . ,
.
FreeBSD nfsiod
-.

mount ,
,
/etc/fstab (/elc/vfstab Solaris),
. ,
, automount amd (
17.6).
fstab
/beast/users /usr/man beast ctiimchim.
# filesystem
mountpoint
fstype flags
dump fsck.
beast:/beast/users /beast/users nfs
rw, bg, m t r , h a r d
0
0
chimchim:/usr/man /usr/man
nfs
ro,bg,intr,soft
0
0
Solaris /etc/vfstab ,
.
.
fstab/vfstab
mkdir .

17 ,

N F S


.

527

. Solaris HP-UX
mount -a -F nfs, Red Hat FreeBSD
-F -t.
Jstab 8.3.
/ e t c / f s t a b
NFS. . 17.9.
17.9. NFS

rw

1
SHRF 2

SHRF 2
SHRF

hard

SHR 3

soft

SHRF

incr

SHRF

noint-r

SHRF 2

retrans=*n

SHRF 4

cimeo-=n

SHRF*

rsize-Ti
wsize-=n
vers=i

SHRF 4
SHRF 4
SH

nfsv3, nfsv2

pr o ,=.s
tcp
1

2
3

528

RF

-
(
-)

(
),

, ,
, ,

, ,
, , ;
,



(
)

, ,
(
, s o f t )
- (
)


NFS: 2 3 (
)
NFS: 2 3 (
)

udp
TCP ;
UDP

Solaris. HP-UX, Red Hat Linux FreeBSD


S, H, R, F .
FreeBSD, .
FreeBSD ,
.
FreeBSD -: r e c r a n s - , tx.-neo - t ,
r s i z e - , w s i z e -w.

II.

, h a r d ,
. ,
. ,
s o f t i n t r ,
N F S .
(, 20- -
18 )*.
arad (
17.8).
, ,
, T C P U D P ,
. T C P ,
. ( Solaris 32 .)
U D P , ,
8 .
( Red Hat, , I ).

urnount.

N F S N F S
TCP- UDP-. ,
( , 1024)

U N I X -
.
N F S ( -
) :
, .

17.4.

nfsstat: N F S
nfsstat,
, N F S .
nfsstat -s NFS-, nfsstat -
. :
chirachlm% n f e e t a t -
Client rpc:
calls
badcalls
64235
1595
Client nfs:
calls
badcalls

retrans
0

badxid
3

nclget

nclsleep

timeout
1592

wait
0

newcred t i m e r s
0
886

(Jeff Forys), , : " h a r d , i n t r bg,


NFS (
). s o f t !
, .
, , ,
".

17.

_>29

62613
null
0%
write
3%
mkdir
0%

3
getattr
34%
wrcache
0%
readdir
6%

62643
setaLcr
0%
create
0%
xmdir
OS

0
read-ink
2.1
remove
Ot
fsstat
Ot

lookup
30%
rename
0%

root
0%
link
0%

read
2%
syralink
o:


NFS-. 3% -,
NFS- . , ,
b a d x i d . b a c i x i d
, - 3%, , ,
, - . ,
r s i z e w s i z e
( ). b a d x i d
, t - i r e e o u t , , ,
. t i m e o
nfsstat N F S
, .

17.5.

N F S

.
UNIX,

.

. :

, ,
NFS;

,
;

, UNIX-,
, ,
,
;

U N I X , Windows,
VVeb- FTP-;
,
UNIX;


, UNIX-.

Network Appliance. Inc. (www.netapp.com). , .
Auspex .

525
II.

,
*.

17.6.


/elc/fstab /etc/vfstah
. -, /etc/fstab
.
.
-, -
,
, ,
, .
-, -
, , ,
, /usr/share/man.
.
,
, ,
.
. . , "" ()
,
.
,

, . . NFS.
,
. autofs.
.

,
, .
,
, ,
, . ,
autofs. NFS
UNIX .
,
.
Sun. a u to mount
NFS. . Red Hal
, , .

.
" ", NAS
(Network Attached Storage). "" .

17.

531

autofs automount
,
. ,
.
- , . ,
.
amd, - (Jan-Simon
Pendry) , , Sun.
automount.
UNIX-.
automount
amd , ,
.
amd, automount automount
, ".
automount,
autofs.
. ,
automount , ,
. :
amd, ,
, .

17.7.

automount:

automount Solaris HP-UX.
Red Hat

.
automount
( ): ,
".
,
.
, automount .

. /etc/auto_master.
automount ,
autofs.
.
( autofs)
auiomountd. , .

NFS- automount,
- .
NIS,
.

532

II.


, ,
automounl. -v ,
.
-t, automounl , (
,
. 5 .
,
, N F S , -
- *.


.
. . 1 , /chimchim.
:
users
devel
info

chimchim:/ch'mchim/ users
- s o f z, p r o t o - u d p chimchiir.:/chinchim/deve^.
- r o chimchim:/chimchim/info

, .
, /etc/aulo.chim) automount
, /chimchim/users. /chimchim, devel
/chimchim/info chimchim. info
, devel I 1 DP
( Solaris, *>
chimchim
,

, v
, / u s r / s r c /cs/tools. ,
/etc/auto-direct),
automount. :
/usr/src
/cs/tools

chimchim:/usr/src
-ro anchor:/cs/cools

He ,

autofs. , :
, . . Is. Is
, automount
, - i
. , .

17 ,

533

( Is
, ).

.
,
.
,
, :
# Directory
/chirnchira
/-

Map
/etc/auto.chira -proto=tcp
/etc/auCo.direct

(
) /- ( )
, .

, ,
.
, ,
,
.
, Red
Hat -. ,
.

, , . ,
-
, ,
( '"), ,
. . ,
, .

automount. ,
. Perl, .
,


automount. NFS.
automount

(, /usr/man) .

534

I!.

automount
. ,
. .
, N F S ,


, automount
,
.
.
.
Solaris automount

.
, . , , ,
,
, . ,
, -, .
, automount
,
, .
0. .
auto.direci. /usr/man /cs/tools
, :
/usr/ir.an
/cs/cools

- chimchim:/usr/share/man band(l) :/usr/man


-ro anchor,band:/cs/nools

, ,
. ( 1 )
hand
/usr/man.
automount

,
automount
.
mountd.
, , .

automount.
- h o s t s .
, automount ia :
/net
-hosts -nosuid,soft

17.

535

, chimchim /usr/share/man,
/net/chimchim/usr/share/maa.
,
, automount ,
,
.
, * &
, ,
, ..
- auiomount( 1).
Red Hat Linux
Red Hat automount, Sun

Red Hat automount , .
, automountd ,

,
, Red Hat /etc/rc.d/init.d/autofs (
automount). stop, start, reload status;
, reload.
/etc/auto.master. , ,
- auto.masler(5) autofs(5) : -
autofsf8) autofs.
Red Hat .

17.8.

amd:

amd
,
- nepeiru
(trez Zadok)
, am-utiis
Web- :
http://www.es.columbia.edu/~ezk/am-mils
amd .

" " .
, . - ,

"operation would block" (
),

536

II.

amd ;
UNIX.

amd , automount (, ""


)
amd amq,
amd (,
)

amd ,
automount , rdist
rsync.

amd ,
,
( ).
automount

a m d
amd
. , i,
)
(),
amd
17.10
17 10. ^ amd

arch

aur.odir

by

(
)

cluster

, aoirain

domain

NIS

host

host.d

, DNS

karch

( a r c h )

key

rrap

network

OS

osver

, amd
/usr/man / c s / t o o l s

17

537

.
, ,
:
/default

opts

usr/man

host~=chimchim;type:-ufs;dev:=/dev/sdlf \
h o s t !=chimchirn; r h o s t = c h i m c h i m ; r s : = / 5 {key}; \
c y p e - n f s ; f s : - $ [ a u t o d i r } / S {key}
h o s c ^ a n c h o r ; type: =ufs;dev:-=/dev/sd3c \
host!=archor;rhost=anchor;rfs:=/${key}
type=nfs;fs:-S{auLodir}/S{key}

cs/tools

s o f t , time=10, r e t r a n s = 5

.= . , , : r w , s o f t , Limeo=10, retrans=5.
== [ ^ :
,
"" $ { a ' j t o d i } $ { k e y ) .
/ d e t a u l t , ,
. . 17.11
17.11. amd

rhost

rfs

type

Tim , n f s u f s ( )

fs

opts

adaopts

remopts

, ,

a m d
amd
, ,
, , .
amd :
tf!/bin/csh
~f
cd / u s r / l o c a l / e t c / a m d
e x e c / u s r / l o c a l / b l n / a m d - x f a t a l , e r r o r , u s e r - r - 1 s y s l o g - a /cmpmnt
/amd a m d . m a s t e r . m a p >fi / d e v / c o n s o l e
, , . 17.12.

538

II.

17.12. omd

-
-
-1

Syslog

1
( )

-
/amd
amd-roaster .
1

/ .

, amd,
.
( 5 15 )
. amd .

amq.
a m d
amd ,
"" .
T E R M .

17.9.

Callaghan, . NFS Illustrated Addison-Wesley.

Pendry, Jan-Simon, and Nick Williams. "AMD: The 4.4BSD Automounter


Reference Manual." 4.4BSD System Manager's Manual, Usenix and O'Reillv.
1994

1999.

Stem, Hal, Mike Eisler, and Ricardo Labiaga. Managing NFS and NIS. Second
Edition. Sebastopol - O'Reilly & Associates. 2001.

. 17.13 R F C ,
N F S .
17.13. RFC, NFS
RFC

1094

Network File System Protocol Specification

Sun Microsystems

Mar 1989

181}

NFS Version 3 Protocol Specification

B. Callaghan et al

Jun 1995

2054

WebNFS Client Specification

H Callaghan

Oct 1996

2055

WebNFS Server Specification

Callaghan

Oct 1996

2224

NFS URL Scheme

B. Callaghan

Oct 1997

2623

NFS Version 2 and Version 3 Security Issues

M. Fisler

Jun 1999

2624

NFS Version 4 Design Considerations

S. Shepler

Jun 1999

17. -

539

,
,
. , , , ,
, .


, .
, .


-
.
UNIX-.

.
, ,
^ ,
,
- . , , (
,
). ,
.

1\ , .
, ,
.
, . ,

540

II.

,
. .
,
(N1S N I S + )
,
(LDAP).

18.1.


UNIX- ,
.

. 18.1.
18.1. .

/etc/passwd

/etc/shadow1

/etc/group

UNIX-

/etc/hosts
/etc/networks

IP-
1

IP-

/etc/services

/etc/protocols

/etc/ethers'

Etliernet-

/etc/mall/a liases

/etc/rpc

RPC-

/etc/netgroup1

/etc/prtaicap

/etc/termcap



.
,
,
.
, . 18.1,
, . ,
/etc/passwd getpwuid(),
getpwnamQ getpwent(). ,
passwd.
.

,

18. *

541

- .
, ,
.

18.2.



. ,

. , .
( UNIX-}
, NIS
NIS+,
, .
"", .
,
"". .
- , .
,
,
, .



.
(
, , ).
.
, .
, ,
, .
:
,
.

, . &
, .
,
, -
"" .
rdist:

rdist.
make:
() , ,
rdist
, ,

542

II.

, rdisl
,
rdisl , ,
.
, .

, *
, rdist
. rsli
.
,
/.rhosts .
. ,
Iniernei, .
, , ,
.
,
/ele/passwd. ,

. , . , rlogind
( rsli. rlogin ),
.
: rlogind.
rdisl , , ,
tepd. iauaib. { rlogind
.
rtp.porcupine.org. 21.7.
rdisl imeim ,
rlogind .
, ,
, \
. root.
,
/etc/passwd
, rdisl

rdisl Red Hat FreeBSD rsh
, .
ssh. . -,

. -, ,
, ,
. . ssh
, ,
, .
sshd 21.8.
,
, .
. 11.1.

18. *

543

, , rdist.
, . make,
rdist (distftle Distfile).
rdist -f .
,
.
(#).
,
:
:

->

.
rdist , \
, .
,
, , .
,
, . _
, (,
/usr/llb/* / u s r / m a n / m a r [ 123]). ",
- -
.
rdist ,
, -. , .
.
:
i n s t a l l
[-] ;
notify
_{4;
except
_;
except_pat
_;
special
[ ''
;
i n s t a l l , , rdist
. . , ,
,
,
-,
.
i n s t a l l ,
, .
.
rdist,
, .
- ,
- rdist
.
n o t i f y
. rdist
. -
,
,

544

II. *

, anchor, pete
pete@anchor.
e x c e p t e x c e p t _ p a t
, . e x c e p t
, e x c e p t _ p a t
. ,
rdist, make,
. . ,
.
s p e c i a l sh (
) .
. rdist .

. ,
.
Distfilc:
SYS_FILES - t / e t c / p a s s w d / e t c / g r o u p / e t c / m a i l / a l i a s e s )
GET_AL,L
= (chimchim l o l l i p o p b a r k a d o n )
GET_SCME
(wharnmo s p i f f )
ail:

s(SYS_F:LES)

->

${GET_ALL)

notify barb;
special /etc/mail/aliases
some:

S|5YS_FILES}

"/usc/bir/newaliases";

- > S{GET_SCMEJ

except / e t c / m a i l / a l i a s e s ;
notify eddiePspifE;

chimchim, lollipop barkadon. @
.
/etc/mail/aliases rdist
- newallases. whammo spiff
, eddie@spiff.
newaliases .
- liases

/9.4.

rsync
rsync. (Andrew Tridgell)
(Paul Mackeiras), rdist,
- .
rep, ,
rsync , rdist,


rsync

rsync.samba.org.

, rsync
,
inetd. (

1.

rsync, ;
, ) "

,
. rsh ,

rsync, . ( , rsync
rsh ssh. ,
Inetd.)
rsync ,
. ,
f t syne -gopt. p a s s w o r d - f i l e = / e t e / r e y n c . p w d / e t c / p a s s w d
lollipop::/sysfiles
/etc/passwd lollipop. -gopt
,
. lollipop::/sysffles
rsync rsync 873, reh.
/etc/rsync.pwd .
rsync
(.. , ;
" " , , ), :

rsync /etc/services;

(rsync daemon) /etc/inetd.conf;

/etc/rsyned.secrets;

/etc/rsyncd.conf.

services

inetd.conf


rsync

8"73/tcp


rsync stream t c p nowait root

/ l o c a l / b i n / r s y n c r s y n c d daemon

tcpd,
, , ,
.
rsyncd.conr.
.
rsyncd.secrets :
root:
, , rsync,

,
. ,
ssh (rsync -gopt - ssh /etc/passwd /etc/shadow lollipop:/sysfiIes ), , sshd , , !

5 4 6

II.

,
root.
, /etc/rsyncd. coil , rsync ( ) . .
:
[sysfiles]
path - / e t c
secrets f i l e = /etc/rsyncd.secrets
read only = f a l s e
uid = root
gid root
h o s t s a l l o w = _
,
.
/etc, .
rsync Red Hal. (
) rsync.sairiba.org.
expect:

. . , ,
, .
F T P

expect.
FTP 22.6.
expect Tel (Tool
C o m m a n d Language ),
(John Ousteriiout).
. expect
(Don Libes)
(National Institute of Standards and Technology, NIST).
expect (,
) .
.
, . ,
expect ,
, , .
Tel . expect Tel. , expect.
expect
Tel.
Tel .
:
.
"'' 1 .
;
.

18. *

547

expect:
s p a w n ;
s e n d ;
e x p e c t
.

, i n t e r a c t , ,
, expect ,
.
,
. (
ftp) /etc/passwd:
spawn / u s r / b i n / t p
while 1 ( expect (
"Name*: "
( s e n d ""}
"Password:"
{send
"_\"}
,n
ftp> "
(break)
"failed"
(send_user "Can't log i n . \ r " ; e x i t 1)
timeout
( s e n d _ u s e r "Timeout p r o b l e m . \ r " ; e x i t 2 }
}}
send " l e d / e t c \ r "
expect " f t p > " (send "cd p u b / s y s f i l e s \ r " }
e x p e c t " f t p > " (send "get passwd\r"}
expect " f t p > " (send " q u i t \ r " , - send u s e r " \ r " }
exit 0
. ftp ,
w h i l e (
Tel). f t p >
w h i l e , ftp .
,
; ,
.
.
-, "failed",
,
ftp "Login failed". -, t i m e o u t
,
, , , .
,
.
,
;
. w h i l e
.
e x p e c t ,
.
s e n d ,
.
( \ ) . *
. s e n d _ u s e r

548

II.

s e n d , ,
.
e x p e c t /. ,
, .
.
, ;
, .
, , ,
, t i m e o u t e o f . ()
.
expect expeci.nisi.gov.

18.3.

NIS:
NIS (Network Information Service
) Sun
80- . Sun Yellow Pages ( Sun),
.
NIS . .
, . Sun
, NIS .
90- Sun :
N1S+. . NIS NIS+ .
NIS+ , NIS, .
18.4. . 18.2
NIS NIS+ .
18 2 N15 NIS +

NIS?

NIS+?

Solaris

HP-UX

Red Hat

FreeBSD

NIS ,
.
,
.
.
NIS".
( ndbm
NIS DNS. ,

18. *

549

G N U - gdbm). ,
.
N1S
make, ypmake (
).

, , ,
NIS. , /etc/passwd : passwd.byname passwd.byuid.
,
.
passwd.
,
( ).
NIS ,
.

, .
,
NIS- ,
.
NIS.
NIS.
IP-,
.
ypset,

,
-.
Solaris Red Hat
NIS.
.

N I S ,
: . . , .
/ete/netgroup
NIS-.
netgroup :
_ _
.
, ,
:
(, , _/5)
. . ( b o u l d e r , ,)
boulder ( boulder ,
).

545

II.

. , { b o u l d e r ,
)
boulder .
.
/etc/netgroup:
bobcats
(snake,,) (headrest.,)
servers
(anchor,,) (moet,,) ( p i p e r , . )
a n c h o r c l i e n t s (xx,,) (watneys,,) (molson,,)
beers
(anchor,,) (anchor-gateway,,)
allhosts
beers bobcats servers

(kirk,,)
anchorclients

,
.
,
. , /etc/exports share ( Solaris)
,
. ,

, exports
1024 .
, .

.
,
,
.


.
; , N1S
Internet-
D N S .
,
.
N I S
( , /etc/passwd /etc/group) ""
NIS.
. V
NIS, "+@ " ,
, "+"
.
,

/etc/nsswitch.conf, . nsswitch.conf
:
passwd:
hosts:
group:

files nis
f i l e s dns
files

18. *

551

(
).
: m s , m s p l u s , f i l e s , d n s c o m p a t . (
) : NIS, N I S + .
( ' - ' ) , D N S
NIS. D N S .
,
. gethostbyname()
/etc/hosts, ,
D N S . , UNIX-rpvnn.
/etc/group.
,
.
,
hosts:

cms [NOTFOUND=returnj n i s p l u s

DNS, .

( ), NIS+
. N I S + ,
. . 18.3
. r e t u r n
c o n t i n u e ,
.
18.3. /etc/nsswitch.conf

UNAVAIL

NOTFOUND

TRYAGAIN

SUCCESS

/etc nsswitch.conf
(Is /etc/nss*). , ,
.
FreeBSD " ".
/etc/host.conf, .
N I S passwd group
.
5 .
N I S
N I S :
. . mi
NIS.
, -
.

II.

NIS ,
,
.
NIS-,
.

, . ,
. NIS ,
,
. ,

. , , ,
.
9.
NIS .
NIS-
. NIS-
-,
.
NIS ,
.
, .
, N1S.
NIS
NIS ( )
, /var/.
"NIS-" NIS- NIS-. NIS.
. ,
cssuns ndbm- /etc/passwd:
/var/yp/cssuns/passwd-byname.dir
/var//cssuns/passwd.byname.pag
/var//cssuns/passwd.byuid.dir
/ver//cssuns/passwd.byuid.pag
, ,
, . passwd
,
( ndbm).
makedbm NIS- .
. Makefile
NIS- ,
NIS-. " NlS- make.
,
, makedbm ,
.

18

553

H P - U X make ypmuke.

ypxfr. ;
,
.
ypxfr. ,
. .
,
ypxfrd,
ypxfr.
NIS
. ,
,
ypxfrd .
yppush . . ,
,
ypxfr. yppush Makefile,
NlS-,
.
ypservers.
.

ypinit ( ).
,
.

NIS ypserv ypbind.
( , );
, - .
ypbind NIS-. .
ypbind
, ( ,
/etc/nsswitch.conf) ypbind
ypserv , .
. .

| gatpwuld

'

ypbind

J
-

t
I 1 ndbm 1 -!

. . N15

554

II.

, ypbind
,
- . ypbind
,
.
(, ,
, ) ""
,
. .
NIS ,
, , ,
.
NIS . 18.4.
18.4. N15

ypserv

NIS.

ypbind

N1S.

domainname

NIS. (
)

. ypxfr (
)


,

ypxfr
ypxfrd
yppusb
makedbm
ypmake1
yplnit
ypset
ypwhich
yppoli
ypcal
ypmateb
yppa.sswd
ypcbfn
vpchsb
yppa.4Swdd
ypupdatcd*
1

ypbind
,
,
, & NlS-
,

N1S
GECOS NIS

NIS
yppasswd. vpchsb ypcbfn
NIS- ( inetd)

N IS-

N I S , .
-, ypinit .

18.

555

-,

/ete/nsswitch.conf N1S.
NIS
yplnit.
":
#
#
#
#

cd /vr/yp
domainnamc
ypinit -m
ypcrv

/*
I"
/
/"

N I S - */
"/

NIS '/

- ypinit ,
. .

, ypinit -s:
w cd /v*r/yp
# ypinit
_
# ypsarv
ypinit -s
. -
, ypserv .
crontab-.
ypxfr
( passwd.byuid)
. .
, , ,
, ,
.
- ( ).
:
f'/bin/csh -f
s e t mydomain = V u s r / b i n / d o i r a i n n a m e '
cd / v a r / y p / S m y d o m a i n
# KIS-
f c r e a c h map I " / b i n / I s " )
/ u s r / i i b / y p / y p x f Smap
end
ypxfr lperday
ypxfr_2perday ypxfr_lperhour ; NIS-
.
, NIS,
, N1S, ,
, ypserv.
. .

yppasswd, NIS
yppasswdd.

NIS, ypinit ypserv, .


, , .

556

II.

NIS

, . ,
, .
domalimame NIS-,
.
; (.
).
(^

2.
, ,
passwd, group hosts .
,
NTS.
: root, bin, daemon, wheel .. hosts
, NIS
.
N I S

Solaris NIS /etc/defaultdomain. /etc/init.d/inetinll


, , domainname,
.
ypstart , ,
ypbind ypserv.
yppasswdd ypxfrd.
ypbind
NIS, ypinit -
, .
, ypbind
-broadcast ( ).
/etc/hosts,
, NIS.
HP-UX NIS
/etc/rc.config.d/namesvrs. NIS_DOMAIN NIS, NISJCLIENT
. NI5MASTER5ERVER NIS_SLAVE_SERVER ( ) 1.
yppasswdd ypxfrd .
Red Hal NIS N IS DOMAIN
/etc/sysconfig/network. ypbind, ypserv yppasswdd
chkconfig:
If chkconfig ypbind on
ypbind NIS (
),
/etc/yp.conf:
ypserver

.
/etc/hosts.

18. *

557

Bo FreeBSD NIS n i s d c m a i n n a m e
/etc/rc.conf. :
nisdoittainname^" c s s u n s "
ypbind. ypserv yppasswdd

nis_client_enable,
nis_server_enable

n i s _ y p p a s s w d d _ e n a b l e YES.
/etc/passwd /etc/group '+'.
NIS

18.4.

NIS+: NIS
N I S + NIS.

.
, . ,
,
, .
N1S+ N I S (
). NIS+ ,
NIS .
(, HP-UX),
.
NIS+- , -
(Frederick P. Brooks. Jr.) The Mythical Man-Month
( " -"), , " ".
, ,
.
.
. ,
.
, Sun .
NIS N1S+ .

553

NIS+
, D N S NIS.

.

, ,
.

N I S + , NIS,
( ) .

. N I S +

NIS. NIS+ .
NJS+ UNIX- ( NIS-).
NIS+
.

, NIS+.
NIS+ NIS
, NIS+ .
,
,
( ) .
- NIS+,
, .

NIS+ Sun Secure RPC. ,


,
. NIS+
,
, UNIX

, N1S+ (, , )
.
, . ,
(, NIS),
nobody. "" Secure RPC
(, ) , . NIS+
root .

NIS+ ,
.
,
, ,
UNIX-.
NIS+ DNS, ,
. DNS NIS+
, :
, .
, cs.colorado.edu colorado.edu. anchor.cs.colorado.edu.
, NIS+
, DNS- . , ,
DNS- xor.com, NIS+
xor.com, marketinfi.xor.com , ,
. DNS NIS+ ,
.
NIS+
.
NIS+,
.
, "" NIS+ ,
o r g d i r groups dir
, org dir.
"" N1S+ groups_dir.
,
.

18. *

559

, org_dir.marketlng.xor.com ,
marketing.xor.com.
: hosts.org dir.market ing.xor.com /etc/hosts
NIS+.
( ).
N1S+ :
. , , ,
. ,
, ,
, NIS--

18.5.

LDAP:
, UNIX, . . ,
?
, ?
, .
, ,
. , ,
. :

:

;

, ;

.
, IETF
, LDAP (Lightweight Directory Access Prolocol
). LDAP
, , .
, ..
.
LDAP .
OSI ,
80- .
OSI ,
" ", ""
TCP/IP. CM IP
(Common Management Information Protocol
); LDAP.
LDAP ,
T C P / I P
.500, OSI-. ,
.500 UNLX -
. , LDAP
, (,
L ).

560

II.


. LDAP
2, ,
, L D A P
, , , DNS. 3,
, .
(
Internet, sendmail,
), LDAP .
, LDAP
. Java 90- ., LDAP
-,
,
. ,
.
, L D A P
.
. " ".

LDAP
Understanding LDAP. (Heinz Johner) IBM.
P D F www.redbooks.ibm.com. ,
, ;
.
RFC, LDAP.
. 18.5.
3 ;
2. ,
LDAP ,
. ,
HTTP.
18.5 RFC, LDAP

1777

Lightweight Directory Access Protocol (v2)

2251

Lightweight Directory Access Protocol (v3)

2252

LDAPv3: Attribute Syntax Definitions

2253

LDAPv3: UTF-8 String Representation of Distinguished Names

2254

The Stnng Representation of LDAP Search Filters

2255

The LDAP URL Format

2256

A Summary of the X.500 User Schema for Use with LDAPv3

2307

An Approach for Using LDAP as a Network Information Service

18

561

RFC2307
UNIX , passwd group,
LDAP. "",
, ,
LDAP , NIS N1S+.
L D A P
LDAP , Netscape
Open LDAP LDAP (www.openldap.org). . 2000 . ,
OpenLDAP. , Web-,
, .
.
LDAP sendmail 19.4.
OpenLDAP slapd,
slaprd, (
N1S). , .
LDAP 3 ,
.
- LDAP 1 ( ),
.
ypldapd, PADL
Software LDAP NIS.
LDAP ,
N1S, NIS. , .
Web- www.padl.com.
- LDAP
, LDAP /etc/nsswftch.conf
PADL
nssldap, . .
,

pamldap, LDAP
.

562

, ,
. , , 5
: "",
, ,
IDA sendmaii
.


, .
sendmaii , ,
, .
,
, .
Internet . IETF
.
. , ,
. ,
, , . , .. ,
.
, , - ,
.
: , ,
, . "",
.

19.

563

, ,
.
, .
. Internet
, , , . , , 25
. ,

( America Online
30% ).
. , . (
19.10.)
( 100 ) ,
.
,
, .
,
, sendmaii, cnaNfy
Postfix. ,
. ,
.
19.1.

, /,

, ,
, LDAP

sendmaii: , ,

sendmaii

sendmaii

sendmaii

3" 9
8.
-- 10
II
>

12

: , , ,

, ,

13

Postfix, sendmaii

14

,
, . 19.2. , .

559

II.

19.2.

sendmaD

5, 6

sendmail

3, 6, 7, 8, 9. 12

3, 4, 6, 7, 8, 9, 11

10

11

I, 3

3. 8

8, 9

sendmail
UNIX-,
. (Eric Allman) . : 5 (V5), IDA 8 (V8). 9. 5 IDA
.
8 (, 8.11),
, , , 9.
sendmail
Sendmail, Inc.
.

; .
sendmail ,

.
Postfix, 19.13.
.

19.1.

:
, ;
, ;
,
*,

, (, IMAP POP).
.
,
S M T P . .

19.

56

. .


. ,
M I M E (Multipurpose Internet Mail Extensions
Internet)

( ). M I M E .
, ".
,
, ,
"". " F r o m " ,
.
/bin/mail
.
:

/bin/mail UNIX;
/usr/ncb/mail B S D " .
nih nmh Rand Corporation,
exmh,
(Brent Welch) Scriptics;

pine (www.washington.edu/pine);
elm (David Taylor), Elm Development Group (Kari Hurrta).
FTP- ftp.virginia.edu;
mutt (Michael Elkins),
FTP- ftp.mutt.org,

, MIME ,

. .
/usr/ocb/raail /1/11 /bin/Mad , System V.

566

II.

rmeil VM ,
emacs XEmacs;
Netscape Communicator Netscape Communications ;
Eudora Qualcomm Macintosh
, Windows;
Outlook Express" Microsoft Windows.


, . ,
.
Windows Macintosh
i- .

.
. 19.3
.
-.
/etc.
19.3.

bin/mail

Mail.

.tnailrc

.mhjjrofilc
maildehvery

ncb/roail
*mb

pine

pinexonf

pinerc

elm

Ub/elm.rc

.elm/elmrc

mutt

Mtittrc

.muttrc

Netscape

Eudoni

Outlook Express

MIMb

POP

IMAP

SMTP

/
/

pine sendmail.
SMTP.
,
"".

"'SMTP" .
,
,
.

Outlook Express
, Microsoft Outlook.

19.

''



, -
.
, ,
.
SMTP (Simple Mail Transport
Protocol ), RFC821, ESMTP (Extended SMTP),
RFC1869, 1870, 1891 1985.
UNIX (PMDF, Postfix,
smail, qmail, exim, zmailer .), ,
(75% ) sendmaii.


. , , .
. /bin/mail
. /bin/sh ,
. sendmaii
,
mail.local smrsh.
procmail ( 19.8;
Web- wvAvprocmail.org).
mail.local , .
, HP-UX.
, chown.
Solaris mail.local,
Solaris 7.


America Online
, UNIX
. ,
, .
,
.
/var/spool/mail /var/mail. ,
.
. ,
, (
).
, /var/spool/mail /var/mail,
.
775 ( mail},

II.


, imapd spop,
, Macintosh UNIX, UNIX, iMAP (Internet Message Access
Protocol Internet) POP (Post
Office Protocol ) . (
19-3.)


.
. :

, ;

,
;

..
RFC2476


,
,
.
, .
, ,
. ,
,
. ,
( , ).
, "From" "Date"
"Message-Id". ,
, (,
).
,
587,
25, .
587,
: 25, ,
. , ,
.
, .
sendmail ,
. sendmail 8.10
. c a n o m f DAEMONIC)PTIONS ( 19.8).
sendmail ,
: 25 587 ( )
.

19.

''

19.2.


sendmail.
. :

,
, .
" F r o m " "",
.
sendmail.
/,
RFC822.
, ,
, .
,
.
,
. ASCII-,
.
, ,
,
, . ,
, , .

,
.
, .
: - ()
- ().
, ,
.
. UUCP-
-. a Iniemei- .
I me met- :
.
@ .
..
DNS-. , evi@boulder.colorado.edu '"evi" , "boulder" , colorado.edu
.

DNS

16.

. ,
- .

570

II.

, . ,
.
19.4. -

UUCP

mcvax!uunet!ucbvax!hao!boulder!laiiievi

evi@lair

@_
<@ !,@2>...@(>

11%1%2<

<? _ >

sendmaii
. ,
- . " "
( . 19.4) ,

-.
sendmaiT.

,
.
, " " , " F r o m "
"Subject*1, .
RFC822.
. ,
"-", ,
. ,
"X-Joke-of-ihe- Day" ,
.
, . ,
, , .
,
, .
.
From e v i Wed Jan 19 1 9 : 0 1 : 1 1 2DD0
R e c e i v e d : (from e v i @ l o c a l h o s t ) b y xor.com ( 8 . 9 . 3 / 8 . 9 . 3 ) i s TAA17820;
Wed, 19 J a n 2000 1 9 : 0 1 : 1 1 -070D(MST}
O a t e : Wed, 19 Jan 2000 1 9 : 0 1 : 1 1 -0700 (MST)
From: Evi Nemeth <Evi .NemeLh(?xor. com>
M e s s a g e - I d : <200001200201.TAA17820Gxor.com>
To: t r e n t @ x o r . c o m
S u b j e c t : xor.mc
Cc: evi@xor.com
Status: R

19.

571


evi, trent. "From"
mall.local,
. "Status"
evi, sendmail ( ). ,
, "Received^.
.
, , ,
. , Internet.
, , .
() .
,
1:

From e r i c @ k n e c h t . s e n d m a i i . o r g

/bin/mail mail.local
, ,
-.
,
"From" ( ).
. ,
, "From:".
"From'',
.
2:

Return-Path:

3:

Received: from anchor-cs.Colorado.EDU (root@anchor.cs.colocado.edu


[ 1 2 8 . 1 3 8 . 2 4 2 . 1 1 ) b y c o l u m b i n e . c s . c o l o r a a o . e d u ( 8 . 9 . 3 / 8 . 9 . 2 ) w^tfi
ESMTP i d HAA21741 f o r < e v i @ r u p e r t s b e r g . c s . c o l o r a r i o . e d u > ; F r i , 1
O c t 1 9 9 9 0 7 : 0 4 : 2 5 - 0 7 G 0 (MST)
Received: from [nroe.colorado.edu (mroe.colorado.edu
1 2 8 . 1 3 8 . 2 4 )
b y a n c h o r . c s . c o l o r a d o . e d u ( 8 . 9 . 3 / 8 . 9 . 2 ) w i t h ESMTP i d
HAA261/6
f o r < e v i @ a n c h o r . c s . c o l o r a d o . e d u > ; F r i , 1 Oct 1999 0 7 : 0 4 : 2 4
- 0 7 0 0 (MST)

eric@knecht.sencwiail.org

5:

Received: from Knecht.sencunail.org I-cnecht.senamail.org


[209.31.233.1601) by mroe.cs.Colorado.edu ( 8 . 9 . 3 / 8 . 9 . 2 ) with
ESMTP I d HAA09899 f o r < e v i B a n c h o r . c s - C o l o r a d o . e d u > ; F r i , 1 Ocr
1 9 9 9 0 7 : 0 4 : 2 3 - 0 7 0 0 (MST)

6:

Received: from k n e c h t . s e n d m a i l . o r g ( l o c a l h o s t , 1 2 7 . 0 . 0 . 1 ] ) by
k n e c h t . s e n d m a i l . o r g ( 8 . 9 . 3 / 8 . 9 . 3 ) w i t h ESMTF i d GAAI8984;
F r i , 1 O c t 1 9 9 9 0 6 : 0 4 : 0 2 - 8 0 0 (PST)

2 .
, "From".
, "Return-Path",

36
.
, ,
"Received" , .

II.

"Received" ,
( ).
, "Received",
, , .
"Received" -,
-, sendmaii (
) -,
-, -, ,

.
sendmaii. , ,
.
6 , localhost
( ,
exmh, ) knecht
. 5
, knecht mroe.cs.colorado.edu, evi@anchor.cs.colorado.edu. nsiookup
dig , anchor MX,
mroe, . 5
(evi@mroe.cs.colorado.edu)
, (evi@anchor.cs.colorado.edu)
MX 16.11.
mroe sendmaii 8.9.3,
09899.
anchor.cs.colorado.edu ( 4),
evi@ruperlsberg cs.colorado.edu ( 3). (
19.4).
.
,
,
. ,
,
. MX,
.
5 4 "for <evi@anchor.cs.colorado.edu>".
, ,
. , , ,
(, ),
.
"Received" ( 3) "for
<evi@rupertsbeig.cs.colorado.edu>". sendmaii, ,
anchor. rupensberg.cs.colorado.edu
columbine. DNS ,
rupertsberg MX,
columbine. , rupertsberg
. , .

19.

ll

573

columbine, sendmail
8.9.3, (
21741).
7:

Message-Id:

<1999100011404.GAA189640knecht.sendmail.crg>

7 .
,
, .
8 : X - M a i l e r : exmh v e r s i o n 2 . 0 . 2 2 / 2 4 / 9 8
9 : : Evi Nemeth < e v i @ a n c h o r . c s . c o l o r a d o . e d u >
10: From: E r i c Allman <eric@sendmail.com>
l i s CC: e r i c @ s e n d m a i l . c o m
12: S u b j e c t : Re: h i
13: Date: F r i , 1 Oct 1999 0 6 : 0 4 : 0 2 - 8 0 0

8
exmh. . ,
"-", . ,
, , - ,
.
9 13 . "Subject", -,
, . "''
( ). "'Date"
.
"'Received", ,
.
"Received" ,
. .
sendmail.
"Received" -,
.
"ident", .
"From" ( ).
knecht , (identd), "ident" .
. .
, , .
, sendmail
.
exmh columbine
.

19.10.

574

II.


knecht


mroe


anchor


columbine

. .

19.3.

[7}


,
, . ,
.
,
. :

,
, ;

IMAP POP"
, Macintosh .
.
,
: MX DNS
,
, , : , ..
MX 16. .
:


IMAP POP.
, ,
.
. , ,
.

1.

19.

575

-.
- ,
.
sendmaD . sendmail smtpd smtpfwdd (
Web- www.obtuse.com). .
smtpd .


,
, , , .
.
. .

_
. . ( 1]
, .
,
Internet. ,

sendmail. .
, ,
.
, -
. ,
- ,
,
. ,
sendmail.
.
,
. ,
.
.
, , ,
MX

II.

. . ,
,
.
UNIX-
sendmaii , .
Internet.
UNIX-
Internet.
sendmaii.

rdisl rsync

IS. 2.

, Microsoft
Exchange Lotus Notes
Internet, ,
. .

. . ( 2)
, ,
, sendmaii, MX

.

,
, .
1 aliases, n a i l d r o p
LDAP.

IMAP POP.
, ,
.
. ( , (

, .)

19.

577

,
/var/spool/mail NFS.
NFS ,
. , , NFS,
sendmail ,
, ( sendmail
, ).
NFS (,
) , .
, . .
, ,
,
: /var/spool/mail
NFS.
I M A P P O P
IMAP POP , , .
, . - ,

.
IMAP (Internet Message Access Protocol
Internet), ,
, . ,
.
IMAP :
, .
IMAP ,
. ,
UNIX-, . (
IMAP
Web- www.imap.org.)
POP (Post Office Proiocol ) ,
, , , .
( ) (
).

. .
( POP www.cudora.com/qpopper.)
IMAP
www.washingLon.edu/imap. ,
IMAP- /etc/services
/etc/inetd.conf. , ,
IMAP
,
.

578

II.

19.4.


".
, ,
.
,
, , , .
sendmaii , : LDAP. NIS NIS+, Neilnfo
( NeXT/Applc), ,
,
.

,
LDAP. .
root
, , .
, ,
,
.
LDAP
.
.
sendndinail LDAP .
DNS. DNS IP-,
, .
LDAP ,
1 .
(/etc/hosts /etc/aliases) .
LDAP , 18.
. ,
, 19.S. LDAP sendmaii
, , 19 9
.
. (
, ):

(-);

/clc/mail/aliases ( );

forward (-).

.

.
.forward,
,

19.

''

, .. sendmail.
aliases, .forward
. , sendmail .
aliases*
ch: e v i
e v i : evi@mailhub
authors:
evi,garth,scott,trent

, , nemeth.
evi .
, evi, mailhub.
, , , authors,
evi, garth, scott trent. ,
, nemeth. evi@mailhub.
/etc/il/aliases ( /usr/lib/aiiases /etc/aliases).
aliases sendmail.
aliases,
, NIS .
N1S IS.
aliases :
_;

!, 2,

...

_ ,
, ,
.
.
aliases
/etc/passwd.
david;

dvid6somewhere_else,edu

david -
. (
adduser) passwd,
aliases.
/etc/mail/aliases postmaster,
,
. ,
sendmail.
Mailer-Daemon postmaster.
, root, , . bin,
sys, daemon, nobody hostmaster (
) ,
. scndmall/aliases

,
.

II.

sendmaii ,
.
"Received" ,
( 25)".
.
sendmaii "" (hop), "" (bounce)".

, ;

, ;

, .
, .
sendmaii
.
, D o n t B l a r e S e n a m a i i .
, ,
sendmaii ,
, .

: i n c l u d e : . ,
, aliases,
.
, aliases

aliases,
chown ,
. , aliases
:
sabook.:

: include: /usr/local/raail/usah. readers

usah.readcrs ,
, NFS"** , JTOI
.
, \ ,
(""') "
w n e - s a b o o k: v i .

25 .
, "", " ".
: , ,
, .
"" hare NFS ,
sendmaii "".
. . .

19.

581

aliases
.

, .
(
),
. :
complaints:

/dev/null


, .
aliases .forward ( ,
: i n c l u d e : ) . ,
, /etc/passwd@hosi.domain,
.
LDAP

^, ),
, ..
.
aliases,
,
(SUID)
.
sendmail D e f a u l t User
inailnull. daemon
UID G1D. S.
.forward,

. ,
/etc/passwd.
/etc/shells. , root,
4644 4600. .. SUID
.


.
:
autoftp:

"1/usr/local/bin/ftpserver"


, ,
aliases .forward, ,
: i n c l u d e : . aliases
sendmail.
.forward

II.

. /etc/passwd,
/etc/shells.
sendmaii
,
. ,
D= .

.
//sh .
srnrsh,
sendmaii ( 19. ).

,
:

postmaster: trouDle, evi


postmistress: postmaster
MAILER-DAEMON: p o s t m a s t e r
hoscmaster:
trent
abuse: postmaster
webmaster: t r o u b l e , t r e n t
root: trouble, trent
u s e n e t : newsmaster
""
trouble:
;include:/usr/local/mail/trouble.alias
trouDletrap:
"/usr/local/mail/logs/troublemail"
trar:
troubletrap,:inclcde:/usr/iocal/mail/tmr.alias
It
diary:
"/usr/local/admln/diary"
info: "i/usr/local/bin/sendinfo"
f l ,
sa-class:
real-sa-classPriag
real-sa-class:
:include:/usr/local/adm/sa-ciass.list

,

: trouble.
. ,
. :

. postmaster MAILERDAEMON ( RFC).


hostniastcr abuse, webmaster.

19-

583



:
trouble .
trouble@anc!ior ! rouble@boulder
, anchor
boulder /elc/mail/aliascs

. ,
t_KOuiiiMi'ep
trouble.alias
.
linr.
. tmr
,
troubletrap, ,
- tmr
,
, .
,
qucucinh, rnh.
sa-class , ,
, ; nag.
sabook, ,
,
.
diary ,
diary

( , ..).
, .

(
).

aliases ,
. -
(
POP (MAP),
.forward . sendmail

.forward, F o r w a r d P a t n . .forward ,

II.

,
.
.forward ,
,
:
eviGipn.cai.ca .org
evigxor.com

\mcbryan,

"/home/mcbryan/archive",

mcbryanGflaupil.gmd.de

evi
, ipn
CAIDA (-! xor.com.
, ,
:
,
, .

, ! aliases .forward.
,
.forward, aliases.
( ),
, .
.forward
. sendmaii , .forward
(..
), .forward .
, .forward
.
(.. ,
).
, sendmaii
, ,
, .forward.
,
/cte/mail/aliases,
.
sendmaii , FEATURE ( 1 r e d i r e c t 1 ) , .
@_.RDI RECT. .
,

.
sendmaii
.forward. , , sendmaii.
.forward
F o r w a r d P a r . h , ,
. generic.m-l (
19.9)
.forward.

19.

''

aliases
.forward. ,
, " ".
(, ,
aliases), .forward , .
, ,
aliases,
evi:

evigboulder

.forward boulder,
evi@anchor. cs

" ". , evi.


boulder .forward
Hnchor "cs". aliases
anchor boulder..
25 .
,
" "
.
, aliases
.forward.
, ,
postmaster
: .

aliases ,
sendmail .
aliases.
Berkeley DB ndbm,
UNIX.
, .
, /ctc/mail/aliases, aliases.db
( DB) aliases.dir aliases.pag (
ndbni) dir
pag. .
aliases
newaliases, sendmail
(-bi), . newaliases
, ,
.
sendmail,
dbm/iidbm, Berkeley DB,
. ,
, DB.

, , ,
"" sendmail.

II.

NIS, sendmaii ,
DB.
NIS 181
Berkeley DB
(Keith Bostic) (Margo Seltzer);
Web- wwv/.sleepycat.com. (
), ndbm
,
.


,
, ,
. Usenet,
.
aliases,
.
, sendmaii
. .
:
mylist:
:include:/etc/mail/inelude/mylist
owner-mylist: raylIs-request
mylist-request: evi
owner-owner: postmaster

mylist ; /elc/mail/include/mylisl
. ,
,
: evi

" " ,
(mylist-request) " Re I um-Path" , . mylist-request
, . owner-mylist ( ITO evi)
owner-owner.

, (bounce).
,
.
owner-owner (.. postmaster).
,
, mylist
,>_.1_@11_. , , .
,
.
, ,
.. :

Majordoino (v/ww.greaicircle.com);

19.

587

Mailman {www.lisi.org);
ListProc (www.cren.nei);

Smart List (www.procmaiI.orgi;

LISTSERV Lite (www.lsoft.com)*.


FAQ-
(Norm Aleks) FTP- rtfm.mit.edu (
mail/list-admin). , ,
.
,
.
Smart List
, a ListProc . ,
, - .
.
(ListProc), ,
(Majordomo, Mailman, Smart List, LISTSERV Lite). Majordomo n
LISTSERV Lite .
,
, .

() , .
(ListProc, Mailman, LISTSERV Lite),
(SmartList, Majordomo).
Majordomo. , ,
Mailman. ListProc LISTSERV Lite
, : , .
Smart List,
procmail, .
.
.
Majordomo
Majordomo Perl ,
Web- www.greatcircle.com.
(Brent Chapman),
(John Roujllard). (Chan
Wilson). . Majordomo 2
-, .
Majordomo ,
majordom daemon.
( 8 ),
majordomo .
"" sendmail
( .fTRUSTED_USERS).
JvJ

"" 19.11

Majordomo majordomo.cf.
Perl,
LISTSERV

II.

, , . conf-lest

Majordomo aliases
sendmaii.
Majordomo (
sendmaii }.
Majordomo .
majordomo.aliases, .
.
( ). ,
Majordomo, .
_@_
majordomo@iiwi_vx/fl , ( )
"unsubscribe _" "unsubscribe _ "

, .
, ,
. 19.2.
, , , ,
- .
"unsubscribe"

~ rcquesi@UMx_yzia.

,
, , .
Mailman
Mailman , t 1.0
1999 ). Web- www.lrst.org
GNU-. (John Viega).
(Ken Manheimer)
(Barry Warsaw). Majordomo, Mailman
, Python (www.pvthon org).
Mailman Majordomo: "",
( ,
), . Madman
, Majordomo.
Mailman .
Web-.
! ()
, ,

19.

''

ListProc
ListProc .
1991 . (Anastasios Kotsikonas)
1994 . ,
, 1998 . - .

, .
ListProc Web- www.cren.na.
(2000S , ).
ListProc
.
Smart List
SmanList (Stephen van den Berg),
procmail. Smart List
Web- www.procmail.org.
procmail. procmail.tar.gz
Smart List, tar.gz.
Smart List II .
. procmail
. "",
, ,
. SmanList
passwd (smart . , list),
"" sendmail.
SimnLLst led.

.
LISTSERV Lite
LISTSERV Lite LISTSERV,
L-Soft International, Inc.
(Eric Thomas). LISTSERV ,
10 500
. listscrv,
. lisLscn
Web- ,
.
LISTSERV Lite Web- www.lsofi.com.
, UNIX Linux.
.
, , .

.
LDAP
LDAP (Lightweight Directory Access Protocol
) ,

II.

. ,
.
, LDAP
, ;

sendmail (, - );

( , ..);

(, SuSL
Linux);

NIS;

(Pluggable Authentication Modules, ).


. LDAP ,
LDAP ISO .500.
, , ..
"L"
. I 2 .
3 . ,
. I 2 ,
3.
I DAP ,
, sendmail . sendmail LDAP
, .
. LDAP
sendmail .
. , LDAP,
www.openldap.org OpenLDAP.
, LDAP,
. (
I.DAP 18.)
LDAP termcap.
. ( )
LDAP , LDAP.
, ,
LDAP. ,
LDAP (slapd OpenLDAP)
( r o o t an)
"-^,1=*, dc=net"
dc ,
, , synac.nci
. \ ( )
. .
sendmail (
), LDAP

19.

591

LDAP
.
,
( ), dn ( ),
( ), ( ), u i d ( , ).
sendmaii :
mailLocalAddress
mailRoucing^ddress
mailHost
Idap.conf slapd:
#
I
BASE
HOST
PORT

I d a p . c o n f .
dcsynack, dc^nec
gw.synack.net
3B9

:
dn; uiG=]on, d c = s y n a c k , d c - n e t
objectClass: metLocalMailRecipient
m a i l L o c a l A d d r e s s : 30n@Synack.net
aiaiiRoutingAddress s t a b i l e j @ c s . C o l o r a d o . e d u
u i d : }on
mailLoc a l A d d r e s s . , ,
m a i l R o u t i n g A d d r e s s . o b j e c t C l a s s
: RFC. LDAP . gw.synack.nei

jon;

stabilejfics.Colorado.edu

, ?
aliases,
. aliases
(
: i n c l u d e : ) .
( ) - . LDAP- ,
( aliases),
.
sendmaii LDAP 19.8. 19 9
LDAP .

19.5.

sendmaii
sendmaii
.
(Eric Alfman),

572

. ,
.
.
, ,
, .
, sendmaii

.
. , ,
, .
sendmaii ,
.
, sendmail.cf.
sendmaii , -
.
SMTP Internet.
sendmaii :

,
;

, ;

.
sendmaii , .
sendmaii
sendmaii 5 1983 .
(Lennart
Lttvstrand) () 1987 . IDA
sendmaii . (Neil Rickert)
(Paul Pomes). , King James Sendmaii (KJS),
(Paul Vixie) DEC
19891993 . IDA sendmaii,

. IDA KJS ,
sendmaii 8 (
1993 ).

sendmaii, ,
8. - ,
Sendmaii, Inc.
sendmaii.
.
,
Institutionen far Datavetenskap, IDA.

19.

''

, , sendmad
, 19.5.
sendmail 8.11
5 IDA, . 8
4, ( ).
, sendmail
. , "",
"", " ", "", -'
", " " , "", "", '"",
"", "", " ", ''
.
20 .
"Sendmail Installation and Operations Guide"
(Bryan Costales), .
sendmail,

. 19.5 sendmail.
. , sendmail.
, Web-
www .sendmail .oi^g.
19.5. sendmail,
( 2000 rojaJ

sendmail.org

8.11.0

8.11.0

Solaris 7

8.9.3'

8.91

HP-UX .00

S.B.6

Red Hai Linux 6.2

8.9.3

FreeBSD 4.0

8.9.3

/etc/mail

/usr/lib

/etc/mail

/usr/sbin

/etc/mail

8.9.3

/usr/sbin

/etc

8.9.3

/usr/sbin

/etc


sendmail . ''Release
Notes" vAvw.sendmail.org "".
4
( UNIX).
gcc Web- www.gnu.org.
, sendmail .

#

589

/usr/sbin/sendmail

-d0.1

-bt < /dev/null

II.

,
,
. -d (
19.12), -bt
, /dcv/null ,
.
:
Version 8.9.3
C o m p i l e d w i t h : MAPREGEX LOG MATCHGECOS MIME7T08 MIME8T07
NAMEDBIHD NDBM NETINET NETUNIX NEWDB NIS NISPLUS QUEUE
SCANF SMTP USERDB XDEBUG
- = = = = = SYSTEM IDENTITY ( a f t e r r e a d c f ) "
( s h o r t d o m a i n name) Sw - k a t r o o
( c a n o n i c a l d o m a i n name) S j = k a t r o o . S e n d m a i l . C O M
{ s u b d o m a i n name) m
Sendmail.COM
( n o d e name) Sk - k a t r o o . S e n d m a i l . C O M

sendmaii MX DNS,

NAMED BIND ( ).
sendmaii

sendmaii. , ,
,
, sendmaii.
,
, (, )
.
:
sendmaii.
/usr/sbin /usr/lib root (
4755);

/etc/ mail/send mail. cf.


;

/var/spool/mqueue.
( 700, root);

sendmaii (aliases, mailq. hosLstat .):


(smrsh mail.local),
/usr/libexec.
www.sendmail.org.
Build,
Build install.

,
, NIS, NIS+, Neil Hesiod. ,
, Berkeley DB,
Makefile NEWDB. Makefile,
site.config.m4.

19.

''

sendmail. ,
LDAP site.conng.m4 :
de f i n e ( " c o n f M A P D E F ' ,
'-DLDAPMAP 1 J
define!*confLlBS',
*-lldap -liber')

:
t eh ./Build - - site .config .4

sendmail inetd.
-
. if
[-f /usr/sbi-n/sendirail -a -f /etc/mail/sendmall.cf];
then
(cd / v a t / s p o o l / m q u e u e ; rm -f [ r T x ] f " j
/ u s r / s b i n / s e n d m a i l - b d -q30in (
e c h o -n ' s e n d m a i l " > / d e v / c o n s o l e
fi


, .
,
sendmail. " "
(. -lid).
, Internet.
nullclient 19.8.
/etc/rc ( BSD-)
/etc/inlt.d/sendmail ( Sysiem V).
,
.
. ,
(. " ").
, sendmail.
, /usr/lib, /etc, /usr/ucblib /usr/share.
8.10 ,
/etc/mail". ,
- .

, . ,
, .
,
.
IS.

. sendmail.pid 1
.

596

II.


. sendmaii
. Solans, ,
. UNIX

,
: a l i a s e s h o s t s . h o s t s
: d n s , n i s , n i s p l u s f i l e s .
( ) sendmaii
.
sendmaii /etc/mail/service.switch. :
aliases

f i l e s nisplus nis

t
I n i s / n i s +

hosts

dns n i s p l u s n i s f i l e s

h o s t s d n s , sendmaii
MX DNS, n i s


sendmaii ,
-.
, , . . 19.6.
19.6.
sendmaii

-bd

, 25

-bD

, , 1

-bb

( , baststat)

( ,
purgestat)

-bi

( ,
newaliases)

-bp

( , maflq)

-bt

-bv

-bs

SMTP- (
, 25)

,
.

19.

''

, sendmail
(-bd>.
25" .
-q, .
, -q30m -qlh * 30
I .
sendmail ,
.
, ,
. ,
, ,
. RFC1123 30 .
, .
sendmail , sendmail.cf,

sendmail,
(HUP). sendmaii.pid, sendmail , .
, () .
sendmaii.pid
kill -HUP

h e a d -1 sendmail.pid"

PID- ,
mc-
confPID_FILE:
define(confPID_FILE,

"/var/run/sendmail-pid')

BSD- PlD- /var/run/sendmail.pid.


/etc/sendmail.pid.


,
. /var/spool/mqueue.
root, 700" ,
,
.
sendmail
. mqueue ql, q2 q3
/var/spool/mqueue/q*,

, sendmail. DAEMON_OPTIONS.

csh, 711 D-
, (
).

II.

.
*
,
.
, . ,
sendmaii. , sendmaii
. ,
, . 19.7.
19.7.

qf

df

If

qf ,

Tf

, 32

Qf

Xf

qf, dl" xf,


. qf
. , , ,
- , , .
, .
, , qf df. sendmaii

tf. xf Tf .
, ,
Qf ,
.

-, (
/var/spool/mqueue /var/spool/news
). -, . ,
"" .
sendmaii
(conf IN _F R LOCKS). ,
, , , ,
, "try again later"
( ). ,
.
UNIX ,
.
, ,
.

19.

''

,
- "
sendmail
"" . ,
,
,
sendmail .
DNS- MX 16.1 /.
:
kill
# mv

"heed -1 sendmail.pid"

queue

1oggedqueu

/*

If m k d i r m q u e u e
/*

8 chown r o o t m q u a u e
tf chinos 7 0 0 m q u e u e
fr /uar/sbin/sendmall -bd - g l h

*/

*/

, sendmail :
# /usr/lib/sendmail

-oQ/var/spool/cloggedqueue

-q

,
, .
, .
,
,
:
#!/bin/esh -f
foreach suffix (0 1 2 3 4 5 6 7 8
mka^r c l o g S [ s u f f i x j
mv ? f w 5 ( s u f f i x } c i o g S j s u f f i x }
sendmail -oQclogS(suffix}
end

9)

.
,
sendmail
/, .

, sendmail. ,
aol.com
, ,
,
19.12.

Sun Microsystems . , ,
* , .
.

II.

19.6.

sendmaii
sendmaii sendmaii.cf /etc/mail ( /etc
/usr/lib). :

.
,
.
,
.
sendmaii .
\ ,
4
, ,
, 4
.
4 , ,
8090% .
: 98%.
4 .
,
- -
.
,
sendmaii. "Sendmaii"
O'Reilly, ,
"Sendmaii Installation and Operations Guide" (
doc/op ) README ( cf)
4
4 ,
4.
4. sendmaii

:

Linux- , :
> , , sendmaii;

, Web-.

sendmaii " " ,


. . ,
, .

19.

''

m4
,
. 4
, .
sendmail.
in4 :
{1,

2,

-)

.
-
. , 4
, ,
*. . , 4
.
4 . ,
. ,
sendmail,
. 19.8.
19.8. 4 ,
sendmoil

define

! 2

undefine

include

dnl

divert

d n l
, f- .
4
sendmail.
. d n l .
sciidntail 4 ,
7 Bell Labs, UNIX.
, , .
G N U - .
4 .
I And then d e f i n e t h e
, d e f i n e
.
d n l :
dnl t And t h e n d e f i n e t h e . . . .
*

c h a n g e q u o t e ,
, ,
.

II.

,
sendmaii
sendmaii cf,
4 ,
README , . 19.9 19.9. , sendmaii

cf

mc- ( )

domain

4-

feature

hack

rti4

ostype
mailer


4 ,

ah

, 4

cf/cf - , ,
.
cf cf.examples cf
- . Makefile
Build. mc-
sendmaii. ,
Build, , cf-
mc-,
.
mc-
,
,
. foo.com.
foo.mc.
cf. ( 4 ) foo.cf,
/etc/mail
sendmail.cf.
,
- :
divert(-1)
- f i l e f o o .
d i v e r t 10)
VERSIONID("SldS')

19.

''

,
:
divert(-1)


4. ( "#'), d i v e r t .
VERSIONID (
RCS). .

- ( OS ) (
MAILER):
OSTYPEI'linux')
define(*confCOPY_ERRORS_TO',
MAILER('local')
MAILER C s m t p ' l

'postmaster')

, c o n f Y_ERRORS_TO. , ,
, .
.
Build,
cf:
t

./Build foo-cf

, foo.cf .
/etc/mail/sendmail.cf.
. /etc
/usr/lib.
ef/domain
4-, .

. ,
(
: , ..). ,
.
, sendmail
, ,
, .
, .
"" .
, , -
, .
, , , , /1.
,
(, )
, cf
, , .

II.

19.7.


sendmaii
sendmaii .

{, OSTYPE),
4 (, d e f i n e ) . c o n f ,
, (, confCOPY_ERRORS_TO).
( VERS ION ID)
../_//.4. , OSTYPE( l i n u x ' )
../ostype/linux.m4.

. .
VERSIONID
1 CVS, RCS SCCS. ,
, ,
4-,
. VERSIONID. CVS/RCS
:
VEFSIONID

("SldS'l

SCCS :
VERSIONID('%W*

()

%G%')

CVS/RCS SCCS,
. sendmail.cf
.
, , sendmaii
(
, ).
SCCS %W% , a %G%
.
, .
OSTYPE
ostype ,
.
. ,
,
, sendinail, ..

OSTYPE",
VERSIONID.
OSTYPE? , cf/m4.

Build.

19.

''

ostype

4. ,
define("ALIAS_FILE*,

Vusr/lib/aliases')

aliases.
mc-.
ostype , ,
( ).

aliases
domain.
README, .
, ostype.
. 19.10.
, (
).
19 10. ,
ostype

no

ALIAS_FILE

/etc/mall/aiinscs

HELP_FILE

/eic/mail/helpfile

STATUS_FILE

/etc/ raall /statistics

QUEUE_DIR

/var/spool/mqueue

L0CAL_MAILER_PATH

/bin/mail

LOCAL_SRELL_PATH

/bin/sh

LOCAL_MAILER_MAX

LOCALMAILER_MAXMSGS

SMT P_MAI LERMAX

SMTP MAILER MAXMSGS

sendmail aliases
NlS-.
, NIS,
. ,
define{"ALIAS_FILE', " " / e c c / a l i a s e s , n i s : m a i l . a l i a s e s ' ' )
: /etc/aliases, ,
, NIS-, meil.aliascs.
AUS 18.
sendmail
, ostype
sendmail.org,

cf/README.
, ,

II.

(, ,
).
ostype
. 19.11.
19.11. ostype

Solaris

solarisZ.m4

OSTYPE r s o l a r i s 2 * I

HP-UX

hpuxll.m4

OSTYPE("hpuxll)

Red Hat

linux.m4

OSTYPE("linux')

FreeBSD

bsd4.4.ni4

OSTYPE r b s d 4 . 4")

DOMAIN

DOMAIN
(cf/domam/;iw/_$(3tt,fc.m4)
:
DOMAIN(' ')
,
. ,
(Computer Science department) cs.m4:
DOMAIN(

CS')

OSTYPE, DOMAIN
.

. , cf-
-, .
,
.
-, ,
,
, , ,
.
19.9.
MAILER
MAILER ,
. ef/mailcrs sendnmil.
: l o c a l , smtp, fax, use net. procreail.
qpage, c y r u s . pop, phquery uucp. :
MAILER(local*]
MAILER("smtp')
l o c a l prog,
smtp, esmtp, dsmtp, smtp8 r e l a y .

19.

''

- ,
(, USENET_MAILER_ARGS FAX_MAILER_PATH), , , ,
.
. MAILER
.
p o p spop,
POP,
RFC 1460. p o p - , UNIX-. c y r u s
IMAP
- .
MAILER ( " u u c p * )
UUCP-.
u s e n e t
Usenet ,
USENET_MAILER_*
ostype, .

.USEN. ,
. ,
-

"Organization:

University

of

Colorado"

USENET_MAILER_ARGS
"Organization" . ,
Usenet . ,
u s e n e t , .
f a x HylaFAX,
(Sam Leffler), .
@ -.
, , .
,
/etc/remote
/etc/phones.
HylaFAX

Web-yjne wwv.hylafax.org.

HylaFAX sendmail
HylaFAX /usr/Iocal/bhi.
, FAX_MAILER_PATH.
. -
PostScript ( HylaFAX)
GNU- ghostscript.
ghostscript Web- www.gnu.org.
q p a g e Quick Page
. (
Web- www.qpage.org.)

VERS ION ID, OSTYPE,

DOMAIN

MAILER

, .

II.

19.8.


sendmaii
, ,
,
sendmaii. ,
,
, ,
.
FEATURE
FEATURE
( ) 4-
feature. FEATURE
seBdmail,
. ,
sendmaii 4 ,
FEATURE .
FEATURE ,
. :
FEATURE (_ , , ,
...)
_ _.ni4 cf/feature,
, .
FEATURE cf/README.
.

usecwfile

w sendmaii , .
,
, localhost.
, w
,
.
u s e _ c w _ f i l e w
/etc/mall/local-host-names ( sendmaii.cw,
confCW_FILE).
sendmaii , , . sendmaii cw-
, HUP,
cw- , .

FEATURE{"use_CW_ile')

local-host-names.

FEATURE("us e _ c w _ f i l e ' . " ' )


.

19.

''

redirect
- ,
,
. r e d i r e c t . , , (Joe Smith)
(oldsite.edu)
(newsite.com). r e d i r e c t
FEATURE{'redirect')


amithj:

joefinewsite.com.REDIRECT

, smith], ,
joe@newsite.com.
.
o l w o y s o d d d o m o i r i
a l w a y s add domair , sendmail
,
. , ( lynda@cs.coIorado.edu), barb@netrack.nei.
evi. a l w a y s add_domair
, barb ": evi.
, barb
. evi, 1
netrack.net ,

a l w a y s add domain evi evi@cs.coiorado.edu
, linda.
,
, alias
passwd ( , ,
).
( ) , ,
.
a l w a y s _ a d d _ d o m a i n
,
.
MASQUERADE_A3, a l w a y s _ e . i d d
main , , a tu
. , aliases
passwd
, .
riocononify
DNS.
. ,

610

II f .

,
,
FEATURE ( ' n o c a n o m f 1 )

DNS .
(. ).
,
.
DNS , ,
, n o c a n a n i f y .

sendmaii , , . ,
.
,
makemap
sendmaii .
IMAP- POP-
}'
.
,
: dbm/ndbm (
UNIX) Berkeley DB ( ,
). .
Berkeley DB,
.
:

dbm (dbm/ndbm):

h a s h (Berkeley DB):

b t r e e (Berkeley DB).
, ,
h a s h ,
makemap
. .

makemap:
m a k e m a p h a s h /etc/mail/access < /etc/mall/acceee

,
, wo
. makemap ,
/elc/mail/access.db.

makemap ( sendmaii
HUP ).

,
. -

19.

611

h a s h /1//_..
, makemap
FEATURE ,
DATABASE_MAPJRYPE:
define{-DATASE_MAF_T ' ,

'dbm)

access.db
mc- :
FEATURE

('access_db',

'hash

/etc/mail/accesa1)

' ,
:
FEATURE

(' a c c e s e _ _ d b ' J

(.db),
.
makemap
, .
.
m a i l e r t a b i e , g e n e n c t a b l e v i r t u s e r t a b l e . a c c e s s _ o b ,
. u s e r _ d b ,
.
mailertabie
m a i l e r t a b i e , }',

, .
,
,
. m a i l e r t a b i e
, UUCP, DECnet BITNET, ,
,
m a i l e r t a b i e .
m a i l e r t a b i e .
_

_:_

,
" ". m a i l e r t a b i e
;
. @_ .
. ,
MAILER.
m a i l e r t a b i e , mc-
:
FEATURE{"mailercable)

612

II.

genericstable
g e n e r i c s t a b l e ("generics table" )
. ,

trent@xor.com

irent heLn@xor.com. ,
. . .
, .
,
g e n e r i c s t a b l e
, . ,
g e n e r i c s t a b l e , masquerade_envelope allmasquerade.
g e n e r i c s t a b l e , g e n e r i c s .
g e n e r i c s , GENERIC_DOMAIN
, GENERIC_DOMAlN_FILE.
g e n e r i c s t a b l e :
GENER1C_DOMAIN_FI L E ( " / t / m a i 1 / 1 o c a l - h o s e - n a m e s ' )
FEATURE(*genericstaDie'>

,
. g e n e r i c s t a b l e
sendmaii,
.
virtusertable

. v i r t u s e r t a b l e
.
, Web-
(.)
).
,
:. ,
%1
.
'
1nfo6foo.com
info@bar.corr.
30eSbac.com
@baa.orq

foo-xnfo
bar-info
error:No such user
3ane@elsewhere.c0m

Pbaz.org

%l@elsewhere.com

f
#





j a n e
t

, , cw-
( V i r t H o s t ) sendmaii
Internet . DNS
sendmaii ,
, sendmaii

19.

''

,
" cw v i r t u s e r t a b l e "
,
:
DNS- MX.
;
cw- , MOI
; VIRTUSER DOMAIN ( VIRTUSER_D0MAIN_FILE);

sendmail
.
:
FEATURE(virtusertable')

19.9
t u s e r t a b l e
I d a p r a u t i n g
,
LDAP.
v i r t u s e r t a b l e
,
.
LDAP ,
,
sendmail LDAP. mc-
:
FEATURE(ldap_routing')
LDAPROUTE_DOMAIN('')

definet"confLDAP_DEFAULT_SPEC",

' - h -b ')

sendmail ,
LDAP ,
)'. LDAP_ PEFAULT_SPEC LDAP
,
, ,
: o = s e n d m a i l - c o m , c=US. LDAP
3S9. -
LDAP_DEFAULT SPEC.
sendmail LDAP:

m a i l L o c a i A d d r e s s .

r n a i l R o u t i n g A d d r e s s .
sendmail m a i l H o s t . )
, r n a i l R o u t i n g A d d r e s s , .
, MX .
m a i l H o s t .
, LDAP- ( , '
, c n = r o o t , o=ser m a i l , con, c=US)

II.

d n : u i d = e r i c , o = s e n n a i l . c o m , c=US
objectClass:
metLocalMailRecipient
mailLocalAddress: eric@sendmaii.org
mailRoutingAddress: ericfieng.sendmail.com

, , eric@sendmaiI.oig
( MX sendniail.com),
eric@eng.sendmail.com. LDAP-

mailHost:

mailserver.sendmail.com

eric@sendmail.oig
eric@eng.sendmail.com ,
MX mailserver.
LDAP
@,
, (
virtusertable).
M A S Q U E R A D E A S
MASQUERADE AS ,
"" . ,
.
@_. @ . , - ,
.

. , , xor.com
xor.com, , , xor.com, wejb@xor.com. , xor.com,
, , .
. , .
(, root, postmaster, hostmaster,
trouble, operations, Mailer-Daemon .)
. EXPOSE DJLJSER.
,
MASQUERADEAS('xor.com')
EXPOSEDUSERI'root')
EXPOSE D^US E R ( ' M a i 1 - D a e m o n )

@.,
root postmaster.
-.
MASQUERADE_AS.
, :

MASQUERADE_DOMAIN,

MASQUERADE_DOMAIN_FILE,

MASQUERADE_EXCEPTI0N,

l x m i t e d _ m a s q u e r a d e ,

19.

615

a l l m a s q u e r a d e ,
m a s q u e r a d e _ e n v e l o p e ,

m a s q u e r a d e _ e n t i r e _ d o m a i n .
MA5QUERADE_AS
a l l m a s q u e r a d e m a s q u e a d e _ e n v e l o p e . l i m it e d _ m a s q u e r a d e MAS QUE RADE_DOMA IN.
. MASQUERADE_DOMAiN , . w,
u s e _ c w _ f i l e
. l i m i t e d _ m a s q u e r a d e
w
,
a l l m a s q u e r a d e
, m a s q u e a d e _ e n v e l o p e
* ,
. l i m i t e d j n a s q u e r a d e ..
MAIL_HUB SMART

HOST

, ,
.
, , .
, ( )
. MAIL_HUB,
SMART_HOST.

, MAIL HUB
_:, _ ,
. , r e l a y . :
define{"MAIL_HUB',

"smtp:mailhub.cs.Colorado.edu')

SMART_HOST , .
,
DNS. , MAIL .
, , r e l a y . :
define("SMART_HOST',

'smcp:rcailhub.cs.colorado.edu')

"", "From", "" "". .


, .
, sendmail . ,
,
.

616

II.


, .
.

, ,
. , ,
. , ,
: , ,
,
.. , ,
. .
.
sendmaii.
, . 19.12 ,
4 . ,
FEATURE.
. , , MASQUERADE_AS, ,
.
, .
.
1912.

1
5

0
1

MASQUERADE_AS

IImaquerade

MASQUERADEDOMAIN [__FILEj

masquerade e n t i r e domain

I1CX.

03

..

limitea_xasquerade

03

masquerade e n v e l o p e

genericstable

,1,1@.

mailertable

virtusertable

@.

Idap

@,1.

mailhub

smarthost

5
X
2

X
I
3

, , , 3 , ,
, .
m a s q u e r a d e _ e n v e l o p e
,
, .

19.

617

nullclient
n u l l c l i e n t ,
,
. mc-
:
OSTYPE I )

F E A T U R E ( ' n u l l c l i e n t ' , "_ ')


n u l l c l i e n t ,
.
". ,
, .
sendmail .
,
. ''-"
, , EXPOSED_USER
rool.
. n u l l c l i e n t ,
MX, .
cw- ( /etc/mail/local-lioslnames)
.
''-" .
, .
sendmail -bd. SMTP-
25. -q30m ,

.
n u l l c l i e n t .
- ,
.
l o c a M m t p smrsh
/bin/mail
UNIX. l o c a l l m t p ,
, LMTP (Local
Mail Transpon Protocol ),
RFC2033. mail-local,
sendmail.
/usr/libe\ec/mail.local, confEBINDIB
.
smrsh ,
sendmail.
, /bin/sh smrsh
,
sendmail -bt. , . ,
n u l l c l i e n t , 5 .

618

II.

.
. , smrsh.
/usr/adm/sm.bin ( ).
smrsh "" (,
)
.
smrsh,
mail.local. , :
FEATURE('local_smtp',
/usr/iibexec/mail.local'1
FEATURE{'smrsh',
*/usr/libexec/smrsh')

smrsh 19.11.
local procmail
i o c a l ^ p r o c m a i l procmail (
).
. procmail.
procmail ,
/bin/mail niail.locat.
,
,
procmail sendmaii. Web-
www.procmail.oig. l o c a l _ p r o c m a i l
, procmail. .
sendmaii. .
procmail:
FEATURE { " i o c a l _ p r o c m a i l ' ,

/usr/local/bin/mymaiier')

LOCAL *

- * ,
LOCAL. 19.9.

( D sendmaii)
d e f i n e 4. ,
,
cf/README.

:
d e f i n e ( * confTO_QOEUERETURN',
7')
de f i ne(''TO_QUEUEWARN'.
'4 h " )
define("conEPRlVACYFLAGS1,
"noexpn')

r o n f T O QUEUERETUFN , , .
confTO_QUEUEWARN ,

-1 19 *

619

, .
.
7 4 .
,
SMTP- EXPN ( ). c o n f P R l VACY_FLAGS .
4 :
define<"confPRIVAC_FLAGS',
noexpn, n o v r f y ' ' )
19.11.

,
. ,
, .
.
,
, , .
, ,
. 19.13 ( 150 ). .
c o n f . , FALLBACK__MX
confFALLBACK_MX.
, : ,
, /
.
, .
19.13.

.
, t/etc/majl/local-hostnames)
""
PY_ER RO RS_TO
()
JO
DOUBLE_BOLNCH_ADDRSS
,
/dev/null,
, ( p o s t m a s t e r )

1 M1N_FREE_BL0CKS
(100)
_ ESSAC E_S IZE
()
- ()

I D E N T

; 0.
(5s)
I MAX_DAEMON_CHILDREN
* ( )
, ,

sendmail .
" ".

615

II.


MCICACH E_SIZE
MCI_CACHE_TIMEOUT
HOST_STATUS_DIRECTORY
FALLBACK_ MX

QUEUE_LA
5


TCP- (2)
, ( 5 )
( )
, ;
"" ( )
, ,
^)
, (12* _)

MIN_QUEUE_AGE

, ,
(0)

D0NT_IN1T GROUPS

,
, NIS ( f a l s e )
,
,
"From" ( r o o t , daemon)
, SMTP ( a u t h w a r n i n g s )
( )
; ( )

TRUSTED_USERS

PR1VACY_FLAGS
MAX_HEADERS_LENGTH

MAX_M IM E_H EAD ERS_LENGTH


( )
" " ,

( )
;
MAXRCPTSPERMESSAG E


( )
sendniafl.
DONT_BLAM E_SEN D MAIL
;

( s a f e )
AUTH_MECHANISMS
SMTP Cynis SASL ()

DEF_AUTH_INFO
( )
LDAP_DEFAULT_SPEC
LDAP.
, ,
( )

CONNECTION RATE THROTTLE

19.

''

HCST_STATUS_DIRECTORY ,
.
sendmail
, .

. (. 16)
. ,
/etc/mail/.hoststat ( ):
define("confHOST_STATUS_DIRECTORY' ,

' .hoststat)

FAI.I.BACK_MX .
, .
, ,
. ,
de fine('confFALLBACKMX',

*mai i b a c k u p . x o r . c o m )

,
, mailbackup.xor.com .
,
, . , sendmail ,
, :
DAEMON_OPTIONS P o r t = 2 5 , N a m e = M T A ' )
DAEMON O P T I O N S ( ' P o r t = 5 8 7 F N a m e - M S A , M - E 1 )

8.10.

19 9



(, , ),
. ,
Birr ,
, .
, ,
, . .

"", .
"" ,
, .
, .
.

II.



,
Linux- (gw.synack.net)
: xinetd.org, teich.net cubecast.com
synack.net.
LDAP.
v i r t u s e r t a b l e ,
g e n e t i c s t a b l e .

gen e r i c s t a b l e ,
.
g e n e r i c s t a b l e (
outmap) :
bbraun
stabile]
teich

robgsynack.net
jon@synack.net
oren@teich.net

DNS Realtime Blackhole


( d n s b l ) . ,
,
g e n e r i c s t a b l e ,
noAb3oeaniejib@synack.nei b@gw.synack.net.
gw.mc:
divert(0)
VERSI0N1D(*@(#)synack.net.mc 8.7 ( B e r k e l e y ) 5 / 1 9 / 1 9 9 8 ' )
OSTYPE(linux)
DOMAIN(generic)
FEATURE(dnsbl)
FEATURE(virtusertable,
"/etc/mail/inmap*)
FEATURE(genericstable,
'/etc/mail/outmap')
GENERICS_DOMAIN_FILE/etc/mail/local-host-names')
MASQUERADEAS(synack.net)
FEATURE(*masquerade_envelope1)
FEATURE('1dap r o u t i n g ' )
LDAPROUTE_DOMAIN("synack.net1)
d e f i n e ( ' confLDAP_DEFAULT_SPEC', ' - h g w . s y n a c k . n e t - b d c = s y n a c k , d c = n e t * )
MAILER(local)
MAILER(smtp)

/etc/mail/local-host-names ( sendmail.cw) ,
. use_cw_f i l e , ,
generic ( ).
, /etc/mail/relay-domains
. ,
gw.synack.nei . LDAP
Idap.conf, LDAP, LDAP :
BASE d c = s y n a c k , d c = n e t
HOST g w . s y n a c k . n e t
PORT 3 8 9

19.

''

LDAP
:
dn: u i d - r o b , dc-synacx., d c - n e t
objectClass:
inetLocalMailRecipient
maiiLocalAddress: rob@synacx.net
mailRoutingAddress: bbraunSsynack.net
uid:rob
dn: u i d - w e b m a s t e r , dcsynack, d c - n e t
objectClass:
inetLocalMailRecipient
m a i i L o c a l A d d r e s s : webmasterfi synaok. n e t
inailRoutingAddresa: bbraun0eynack.net
uid:webmaster
dn: u i d - t e i c h , dc-synack, d c - n e t
objectClass:
inetLocalMailRecipient
maiiLocalAddress: teichfisynack.net
mailRoutingAddress: orenGteich.net
uid:teich
dn: uid-=xinetd, dc~synack, d c - n e t
objectClass:
inetLocalMailRecipient
maiiLocalAddress:
xinetdGsynack.net
mailRoutingAddress: xinetd
uid:xinetd

rob webmaster orcn .


,
Majordomo. /etc/mail/aliases :
x i n e t d : "|//local/majordomo/wrapper resend -1 t e s t x i n e t d - i i s t "
xinetd-list:
:include:/usr/local/maj ordomo/iists/xinetd
xinetd~ow n e t : bbraun
owner-xinetd: bbraun
x i n e t d - r e q u e s t : bbraun
xinetd-approval: boraun

, . ,
sendmaii.
.
, sendmaii DNS-
MX .
, sendmaii

Sendmaii. Inc. ,
sendmaii. ,
"" . ,
.

II.

:
,
dn 1 . ,
-.
, .
sendmall.com
smf-cllent.mc .
smtp.sendmail.com,
(DNS- CNAME) katroo.sendmaij.com
CNAME .
.
. 1998 .
, , sendmatf ,
,
divert(-1)
#####
##### S e n d m a i l , I n c . ; . 9 . 3 .
divert(0)
VERSIONIDCe ( # ) s m i - c l i e n t . m c 1 . 0 (Sendmail) 1 0 / 1 4 / 9 8 ' )
OSTYPE C b s d 4 . 4 ' )
FEATURE( n o c a n o n i f y ' )
undefine("ALIA5_FILE')
d e f i n e ( * MAIL_HUB',
"smtp.sendmail.com')
define('SMART_HOST',
'smtp.sendmail.com')
define('confFORWARD_PATH', * ' )
MAILER("local1)
MAILER('smtp1)

MAIL_HUB SMART_HOST
smtp.sendmail.com. DNS-
MX .
( MX), .
.forward ,
. . n o c a n o n i f y ,
DNS .
sendmail.com
sendmail.com, ,
.
,
. , ,
divert(-1)
##*## k a r r o o . ; . 9 . 3
divert(0)
VERSIONIDl'fi(t)katroo.mc
2 . 1 (sendmail) 10/19/98')
OSTYPE("solaris2')
DOMAIN('generic')
MASQUERADE_AS('sendmail.com')
MASQUERADEDOMAIN("sendmail.com')
u n d e f i n e 'BITNET_RELAY')

19

625

undefine(*UUCF_RELAY * J
d e f i n e ( ' c o n f C H E C K A L I A S E S ' , "True *)
define(*confCOFY_ERRORS_TO',
'Postmaster'}
d e f i n e ( * confEBINDIR*, ' / u s r / l i b " }
d e f i n e ( " c o n f E R R O R MODE,
m')
define('confHOST_STATUS_DIRECTORY',
'.hoststat')
define(~confNO_RCPT_ACTI0N',
'add-to-undisclosed')
define('confPRIVACY_FLAGS', a u t h w a r n i n g s , n e e d m a i l h e l o , n o e x p n , n o v r f ' )
define("confTRUSTEDJJSERS', "majordomo')
de f i n e { ' c o n fMAX DAEMON CHILDREN', ' 3 0 ' )
FEATURE("allmasquerade')
FEATURE("masquerade_entire_domain")
FEATURE('mas q u e r a d e e n v e l o p e 1 )
FEATURE('always_add_doroain')
F E A T U R E ( " l o c a l l m t p *>
define('LOCAL_MAILER_FLAGS', "SXfronz9PE')
FEATURE("mailertable',
'hash /etc/mail/mailertable')
FEATURE('virtusertable',
'hash / e t c / m a i l / v i r t u s e r t a b i e ' )
M A I L E R ( " l o c a l *)
MAILER('smtp')
L0CAL_C0NFIG
: '
*t
* a o l . c o m msn.com'
'#
* j u n o . c o m , "
K c h e c k a d d r e s s r e g e x -@
~[0-9]+<(aol|msn)\.com|[0-9][<]*<8juno\.com)\.?
" #"#$### , " : " '
CtRejectToLocalparts)
f r i e n d you
CJRejectToDomains}
public.com
LOCAL_RULESETS
HTo: $>CheckTo
SCheckTo
R S = ( R e j e c t T o L o c a l p a r t s ) 0 S * 5 # e r r o r S: "553 Header e r r o r "
R$*$={RejectToDomains} S t e r r o r 5: "553 Header e r r o r "
HMessage-Id: $>CheckMessageId
SCheckMessageld
R< ?+ @ S+>
OK
RS*
S t e r r o r S: "553 Header e r r o r "
LOCAL_RULESETS
SLocal_check_mail
' # '
RS*
S: S>ParseO S>3 SI
RS+
S: S ( c h e c k a d d r e s s SI S)
R6MATCH
S # e r r o r S: "553 Header e r r o r "
LOCAL__CONFIG, ,

.
, ,
.
- ,
, . .
cf/README.

II.


katroo.mc.

generic.m4.

sendmail

. :
divert(-1)
# # # # # # # # g e n e r i c . m 4 d o m a i n '
divert(0)
VERSIONID I " $ I d : g e n e r i c . m 4 , v 8 - 1 5 1 9 9 9 / 0 4 / 0 4 0 0 : 5 1 : 0 9 c a E x p $ ' )
define('confFORWARD_PATH', * S z / . f o r w a r d . S w + $ h : S z / . f o r w a r d + S h :
Sz/.forward.Sw:$z/.forward')
define{'confMAX_HADERS_LENGTH', " 3 2 7 6 8 ' )
FEATURE('redirect')
FEATURE ( ' use_cw__f i l e ' )
EXPOSED U S E R ( ' r o o t ' )
, confFORWARD_PATH,
, .


XOR Inc. ,
.
. sendmail.com.
.
:
divert(-1)
f r # # # # x o r - c l i e n t . m c ;
x o r . c o m .
divert(0)
VERSIONlD("(t)tcpproto.mc8.5 (Berkeley) 3 / 2 3 / 9 6 ' )
OSTYPE( b s d i ' )
define{'confPRIVACY_FLAGS', ' n o e x p n ' )
FEATURE("nullclient',
'xor.com')
.
( n u l l c l x e n t ) . .
. XOR
W e b - .
L D 4 P g e n e r i c s t a b l e .
X O R ,
v i r t u s e r t a b l e . g e n e r x c s t a b l e

.. aliases,
3000 .
,
100000. S u n O S .

.
1- 1
.

19

'27

,
d i v e r t . ,
( '#').
sendmaii 8.9.3
( 8.10) . , .
VERSIONID((#)xor.mc3.0 (trent) 3/29/99')
OSTYPE('sunos4.1')
d e f i n e confPRIVACY_FLAG S " , * n o e x p n , n o v r f y ' )
define('confMESSAGE_TlMEOUT', ' 5 d / 7 2 h " )
define('LOCAL_MAILER_PATH 1 , ' / u s r / b i n / m a i l . l o c a l * )
d n l ##### ,
define(*confMCI_CACHE_SI2E', ' 1 6 ' )
define('confMCI_CACHE_TIHEOUT', "I0m')
define{"confCHECK_ALIASES', "False")
d e f i n e confDOMAIN_NAME', " x o r . c o m " )
d e f i n e I'confMAX_MESSAGE_SIZE', " 5 0 0 0 0 0 0 " )
define(*confDAEMON_OPTIONS", -Port-NNN)
d e f i n e ! ' c o n f Q U E U E _ L A ' , 25)
d e f i n e ( * confREFUSE_LA", 30)
FEATURE(always_add_domain)
FEATURE(use_cw_file)
FEATURE(virtusertable)
GENERICS_DOMAINCxor.com')
FEATURE(genericstable)
FEATURE('masquerade_envelope")
FEATURE('redirect')
FEATURE("access_db',
'hash -o / e t c / m a i l / a c c e s s ' )
MAILER(local)
MAILER(smtp)
LoCAL_RULESETS
# #*### ; .
,
. sendmaii
,
.
.

19.10. sendmaii

, " " ,
. , - , ( ,
) , .
, ,
, .

, (.. )

628

II

. , ,
.
.
, , ,
. .
,

.
, 150 1
( ),
,
.
, . , , ,
, . , 30 , 40 .
,
" r e m o v e " (),
. , ,
, . ,
.
,
, .
, ,
""
. ,
-
.
, , 50-
VRFY
.


. sendmail ,
P n v a c y O p t i o n g o a w a y .
- :
VRFY , EXPN,
, R C P T .
,
, .
sendmail
,
,
, , - ,
.
.

, .
,
, .
,

19-

629


.
, .
.
" "
sendmail .
, sendmail 9.
,
.

,
,
, .

sendmail
, , .
,
. ,
,
, ,
, , .
sendmail 8.9
"" ( ).
sendmail 25
. ,
Internet .
, .
, ,
( ) .
.
: , . ,
, ,
. , .
ORBS (Open Relay Behavior-modification System
) IP-
, .
sendmail " ,
. .
ORBS .
, \
.
Web- ,
(
2000 ). ORBS ,
15%.

630

II

sendmaii 8.9
, RELAY
, , /etc/mail/relay-domains, . ,
sendmaii,

ORBS
, , "'' .
. , .
, ,
? .

,
. U U C P - ,
(-, , Windows) .
, ,
.


. IP- -
.

, ,

U U C P
)
( POP (MAP ).
, .
IP-, ,
.
sendmaii \ ,

, .
. ,
. a c c e s s d b .
. >
.

FEATURE ( E e l a y _ e n L i r e _ d o m a i n ' )
;
P.ELAY_DOMA IN (* , . . . ' )
;
RELAY D O M A I N _ F I L E ( ' _ ' ) ,
;

FEATURE ( r e l a y h o 5 t s _ o n l y ' ) RELAY_DOMAIN


a c c e s s _ d b .
,
SMART HOST MAIL_HUB
. ,
;
FEATURE(* r e l a y _ e n t i r e _ d o m a i n )

19

631

, , RELAY_D0MAIN,
,
FEATURE('use_cw_file')
, , .
,
.

FEATURE { " p r o m i s c u a u s _ r e l a y ' ) "" ;


FEATURE (' r e l a y _ b a s e d _ o n _ M X ' )
, MX ;
FEATURE (" l o o s e _ r e l a y _ c h e c k ' ) "" ;
FEATURE r e l a y _ L o c a l _ f r a m ' ) , " F r o m " .

p r o m i s c u o u s _ r e l a y
- . ,
.
.
r e l a y _ b a s e d _ o n _ M X ,
, MX
. MX
,
D N S . MX,
.
l o o s e _ r e l a y _ c h e c k ""
, .
r e l a y _ l o c a l _ f sendmail
, ,
,
. , ,
, .
,
- sendmail ( cf/README),
. ,
, .
ordb.org abuse.net.

, U U C P .
" " , U U C P ( BITNET DECnet):
FEATURE uucp', "reject*)
undefine(* UUCP_RELAY')
undefine("ITNET_RELAY' )
undefine("DECNET_RELAY')
.
,
, LUSER_RELAY-
, . ,

632

II.

sendmaii,
""
( ""). .
,
, .
e r r o r :
define{'LUSERRELAY1,
'error:No such u s e r ' )


sendmaii , . ,
, .
.
,
.
:
FEATURE("aceess_db1,

"

_ ' J


_ ,

h a s h / e t c / m a i l / a c c e s s . ,
makemap.
#

makemap

hash

/etc/mail/accees

<

/etc/mail/access

, ,
. :
cyberspamrner.com
5 5 0 Spam n o t a c c e p t e d
okguy@cyberspammer.com
badguyeaol.com
sendmail.org
128.32
170.201.180.16
horlivesexG
friendG

OK
REJECT
RELAY
RELAY
REJECT
5 5 0 Spam n o t a c c e p t e d
5 5 0 You a r e n o t m y f r i e n d !

,
. 19.14.
19.14. ,

RELAY

REJECT

DISCARD

;
, RFC821 1

ERROR:

. ,

ERROR: . .

XJCJC .
R F C 1893

550 .

19.

633


okguy c y b e r s p a m m e r . c o m ,
, . ,
sendmail.org 128.32.0.0/16 (
) , . badguy aol.com.
, hollivesex friend ,
.
IPv6 .
@ hollivesex friend ,
.
550 R F C 8 2 1 . , R F C 1893, . 4
, 5 .
. 19.15,
1 9 . 1 5 . ( RFC 1893)

4.2.1

5.2.1

4.2.2

5.2.2

4.2.3

5.2.3

4.2.4

5.2.4

4.3.1

5.3.1

4.4.4

5.4.4

44.5

5.4.5

C o n n e c t , From,
. C o n n e c t , . From
, .
.

, , ,
.
:
From:spammer@some.domain
To:friend.domain
Connect:friend.domain

REJECT
RELAY
OK

, , s p a m m e r @ s o m e . d o m a i n , ,
, " " .
, friend.domain,
. (. - ).
friend.domain ,
"" DNS.

.

634

II.

500
. , IP-.

' '
-
,
FEATURE("blacklist_recipients')
:
nobody@
printer.mydomain.edu
userGhost.mydofnain.edu

550 Mailbox d i s a b l e d f o r t h i s u s e r
550 T h i s h o s t d o e s n o t a c c e p t m a i l
550 M a i l b o x d i s a b l e d f o r t h i s u s e r

, nobody
, ,
.
d n s b l
"" ,
M A P S (Mail Abuse Prevention
System ;
Web- mail-abuse.org), D N S - FEATURE!'dnsbl')
sendmaii ,
. I P - R e a l t i m e B l a c k h o l e List.
, M A P S
, , , .
""
DNS-
IP-,rbi.maps.vix.com

in

DNS.

127.0.0.2

D N S rbl.maps.vix.com,
, d n s b l
, 1)

( sendmaii

IP-

Di\S

16.

d n s b l .
.
, "" ,
, .
, ( D N S ,
). :
), d u l .
. r s s - , .
EATURE{'dsnbl', " r b l . n i a p s . v i x . c o m ' , ' R e j e c t e d - see
www.mail-abuse.org/rbl/*)
r'EATURE ( ' d s n b l ,
dul.maps.vix.com', "Dialup - see
www.mail-abuse.org/dul/')
FEATURE("dnsbl', " r e l a y s . m a i l - a b u s e . o r g ' ,
"Relay - see
www.mail-abuse.org/rss/')

19,

635


,
sendmail;
. , sendmail
(, ": friend@public.com")
, .

, .
, Melissa ( 1 9 9 9 .)
" I m p o r t a n t M e s s a g e F r o m . . . " . , Melissa
, sendmail.com
:
sendmail,
( Web- sendmail.com,
www.sendmail.org).
,
,
sendmail ( k n e c h t ) . sendmail ( c f / c f A n e c h t . m c )
- .
,
:

, public.com;

, "friend" "you";

,
- 99;

X-Spanska,

' " I m p o r t a n t M e s s a g e F r o m . . . " ( Melissa);

" a l l . n e t Fred C o h e n . . . " ( P a p a ) ;


);

"ILOVHYOU"

"ilovevou"

aol.com m s n . c o m ;

j u n o . c o m
.

L0CAL_C0NFIG
LOCAI-_RULESETS t m e - .
divert
4 sendmail
.
e r r o r ( "user u n k n o w n " ) , d i s c a r d .
" " ,
, ,
.

636

II.



. . ,
,
. , ,
.
,
. , "
", ,
. .
Web-, .
,
, . ,
" "
.
""
, .
, .
, , :
"" .
.
,
. .
,
,
, " ,
". ,
, .
,
, Web-,
mail-abuse.org abuse.net. w w w . s p a m r e c y c l e . c o m
;
, - .
Web- .
-. Web-, , ordb.org,
spamcop.net www.cauce.org.
, .
.
, .


,
, . ,
,
( ,
- ).

19-

637

,
. .

"Received" ,
.

"Received", "Dale".
.

"Received",
, ( ,
, ).

" R e c e i v e d " , , , .


"Received"-


"From".

, "Received" ,
.

,
DNS.

"From"

"Message-Id"

,
- , 10000000
. - :
, , " " ( , .
"" ).
.
.
I : From m r k t n e t 7 7 @ k a y a k . m s k . r u Thu Nov
4 2 2 : 1 0 : 4 8 1999
2: Received: f r o m g a i a . e s ([195.55.166.66]) byxor.com (8.9.3/8.9.3)
w i t h ESMTP i o WAA26343 f o r < e v i @ x o r . e o m > ; T h u , 4 Nov 1 9 9 9 2 2 : 1 0 : 4 2
- 0 7 0 0 (MST)
3: From: m r k t n e t 7 7 e k a y a k . m s k . r u
4 : R e c e i v e d : f r o m d e E a u i t b y g a i a . e s ( 8 . 8 . 8 + S u n / S M I - S V R 4 ) i d GAA03907;
r r i , 5 Nov 1 9 9 9 0 6 : 3 1 : 1 0 - 0 1 0 0 (Etc/GMT)
5 : D a t e : F r i , 5 Nov 1 9 9 9 0 6 : 3 1 : 1 0 - 0 1 0 0 (Etc/GMT)
6: Received: from l o g i n _ 0 l l 5 5 6 . w g u k a s . c o m (mail.wgukas.com
[ 2 3 3 . 2 1 4 . 2 4 1 . 8 7 ] ) b y ( 8 . 8 . 5 / 8 . 7 . 3 ) w i t h SMTP i d XAA01510 f o r
i r a k l i n 3 2 1 P t h a x g h k l o . u m . d e ; Thu, 4 November 1999 0 0 : 2 1 : 5 9 -0700
(EDT)
7: To: m r k t n e t 7 7 @ k a y a k . m s k . r u
8: S u b j e c t : J u s t R e l e a s e d ! M i l l i o n s CD Vol. 6A
9: Comments: A u t h e n t i c a t e d S e n d e r is <userll556@wgukas-com>
10:Message-Id:
02202108722648597456@sa_ghklo.um.de
/*

*/

Do not r e p l y to t h i s message To be removed from f u t u r e m a i l i n g s :


m a i l t o : g r e g l 1 4 8@usa . n e t ? S u b j e c t R e m o v e

638

1 /bin/mail
. msk.ru , kayak.msk.ru . 2
"Received".
"Received", ,
\ o r . c o m 3 "From'",
sendmaii - " " ,
.
4 "Received"
g a i a . e s . .
sendmaii 8.8.
( Sun). 6 "Received"
" D a t e " , , ,
sendmaii . , ,
233.214.241.87 D N S .
7 ( " " ) .
.
9, , ,
.

, wgukas.com,
.
. . .
10 . , ,
sa_ghklo.um.de. (
), , .
, . gaia.es. .
"'" mail-abuse.org, .
gregll48, , ,
, . g r e g l l 4 8
, ,

.

. : , ,
, .
, " F r o m " , " " .
, .
, ,
, 40
1 5 , 195 .
:

? . ,
,
?
.
I:
2:

From ^ m d e l n o G a p e x m a i l . c o m Thu Nov I I 1 0 : 3 1 : 4 1 1999


Received: from s a t u r n . g i o b a I c o n . c o m (sacurn.globalcon.com
[ 2 0 9 . 5 . 9 9 . 8 ] ) b y x o r . c o m { 8 . 9 . 3 / 8 . 9 . 3 } w i t h ESMTP i d KAA15479;
T h u , 1 1 Nov 1 9 9 9 1 0 : 3 1 : 3 0 - 0 7 0 0 (MST)

19.

639

3: Received: from Hamilton ([168.191.61.20]) by8aturn.globalcon.com


(Poet.Office MTA v3.1.2 release (P0205-101c) ID# 0-358BlU1500L100S0i
with SMTP id AAA148; Thu, 11 Nov 1999 12:33:24 -0500
4: Date: Thu, 11 Nov 1999 02:39:57 +0000
5: Subject: Free Information On "Debt ReductionI
6: Message-Id: <yjsul. lnmqgaasnjymgqaac(?hamilton>
7: From: F,Pepper@pmail.net
8: To: benfranklinGonehundred.net
2 "Received". 3
, traceroute, xor.com
hamilton (168.191.61.20) saiurn.globaIcon.com (209.5.99.8), ,
. 168.191.61.20
Sprint, - ,
. 209.5.99.8
, . , saturn.globalcon.com
.
sendmail, P o s t . O f f i c e 3.1.2 (
www.openwave.com).
4 , , , 2 .

saturn.globalcon.com. , ,
. , ,

, , I n t e r n e t .
( ), 5

.
6 "Message-Id"
, " h a m i l t o n " .
hamilton, , ,
3. " M e s s a g e - I d "
'<>' ,
. , .
8 .
.

F.Pepper@pmail.net. pmail.net
I P - , whois . p m a i l . n e t
British t e l e c o m - , ,
,
( hostmaster,
D N S IP-, 3 ).

.
SpamCop ,

, ,
, .
,
Web- spamcop.net, ,
, .

640

II.

.
,
.
S p a m , -
. , " R e c e i v e d 1 ' gaia.es
, wgukax.com . , gaia.es I P - , ,
, , ttd.net. ,
S p a m C o p ,
. .

. SpamCop.
Received: from suni.cskwam.mil.pl (cskwam.mil.pl) [148.01.119.2] by
maill.es.net with smtp (Exim 1.81 &2) id 12oBHL-Q00494-00; Sat,
6 May 2C0C 13:34:23 -0700
Possible spammer: 14 8.81.119.2
"nsiookup cskwam.mil.pl" (checking ip) [show] ip not found;
cskwam.mil.pl discarded as fake,
"dig cskwam.mil.pl mx" (digging for Mail exchanger) [show] "nsiookup
cskwam.mil.pl" (checking ip) [show] cskwam.mil.pl not 148.81.119.2,
discarded as fake,
"nsiookup sunl.cskwam.mil.pl" (checking ip) [show] ip = 148.81.119.2
Taking name f r o m I P . . .
"nsiookup 148.81.119.2" (getting name) [show] 148.81.119.2 sunl.cskwam.mil.pi
"nsiookup sunl.cskwam.mil.pl" (checking ip) [show] ip = 148-81.119.2
"nsiookup 2,119.81.148.rbl.maps.vix.com." (checking ip) [show]
noc found
"nsiookup 2.119.81.148.relays.orbs.org." (checking ip) [show] xp =
127.0.0.2
blocked by ORBS
Chain test:maill.es.net -? maill.es.net
Chain verified maill.es.net
maill.es.net
148.81.119.2 has already been sent, to ORBS
Received line accepted
[ s h o w ]
Web-
S p a m C o p . , , .

19.11. sendmaii
Internet
sendmaii,
, ,
. sendmaii,
D N S IP.
,
.
,
, sendmaii
. 8.11
S M T P - S S L ( S e c u r e S o c k e t s Layer
) . S S L sendmaii T L S
(Transport Layer Security )

19-

641

STARTTLS SMTP.
,
.

sendmail. S A S L .
sendmail ,
, , , .forward
aliases, . ,
,
.
D o n t B l a r n e S e n d m a i l . ( " sendmail 1 1 ) ,
.
D o n t B l a m e S e n c ^ a i l . s a f e .
sendmail/conf.c.


sendmail : D e f a u l t U s e r , T r u s t e d U s e r R u n A s U s e r .
D e f a u l t U s e r .
. /etc/passwd " m a i l n u i r "sendmail"
D e f a u l t t i s e r . U I D G I D ,
1, "daemon".
"mailnull" /etc/passwd
, ,
"nogroup".
.
T r u s t e d U s e r

. aliases.
TRUSTED__OSERS
sendmail, , " F r o m "
*.
R u n A s U s e r UID. sendmail , 25.
, 1024,
, , sendmail
root.
UID.
,
sendmail .
, ,
r o o t . *
R u n A s U s e r , . R u n A s U s e r ,
, ,
TRUSTED USERS ,
. , M a j o r d o m o .
" m a j o r d o m " TRUSTED USERS.
daemon root.

642

II

..
, .


sendmaii
. ,
. 19.16, .
19.16. sendmaii

/ var/spool/mqueue

RunAsUser

700

/ /var. /var/spool

root

755


mqueuc

/etc/mall/*

TrustedUser

644

/etc/mail

TrustedUser

755

/etc

root

755

mail

sendmaii
(, ,
, , ,
)
,
" " chown (
, S y s t e m V)*.
, sendmaii
.forward.
Majordomo.
, , / u s r / l o c a l ,
;
.
,
#

sendmaii

-v - h i

-bi , .
sendmaii . f o r w a r d ,
, (
).

DontBlanieSendmail.

chown , . . ,
.

19-

643



smrsh, /bin/sh,
mail.local, /bin/mail. 19.8.
sendmail.
mc-
FEATURE <* smrsh', ' __ smrsh')
FEATURE (' local_lmtp', " ___11.1 1 ' >
,
: /usr/libexec/smrsh /usr/libexec/mail.local.
smrsh , /usr/adm/sm.bin".

.
, '<' . sm.bin ,
.
smrsh
vacation eric
cat /tc/paeewd

/usr/adm/sm.bin/vacation eric
, cat
sm.bin
vacation eric < /etc/paasvrd , <
S a f e F i l e E n v i r o n m e n t sendmail ,
, aliases .forward
.
chroot,
/, a / s a f e .
,
/etc/passwd,
/safe/etc/passwd.
S a f e F i l e E n v i r o n m e n t ,
,
. ,
.
/home,
, .

. , "" 4 .

sendmail


S M T P ;

sm.bin procmail,
. procmail .

644

II

S M T P - ;

. 19.17 .
/sendmail/conf.c .
19.17. P r i v a c y O p t i o n s
__

public

needmailhelo

SMTP- HELO ( )

SMTP- EXPN

novrfy

SMTP- VRFY

needexpnhelo

( EXPN)
HELO

needvrfyhelo

( VRFY)
HELO

noverb1

"" EXPN

restriccrnailg ,
mqueiie,
restrictqrun
noetrn

mqueoe

authwarnings

"Authentication-Warning" (
)

noreceipts

nobodyreturn

goaway

SMTP- (EXPN, VRJFY ..)

EXPN .forward
. n o v e r b , ,
, .
ETRN ESMTP, .
.

mc- " " "


define("confPR1VACY_OPTIONS, *"goaway, authwarnings, restrictmailq,
restrictqrun'')
a u t h w a r n i n g s .
: 4

sendmaii chroot
, sendmaii ,
chroot
/jail ("").

19-

645

, in /dev/null,
/ e i c (passwd, group, resolv.eonf. s e n d m a i l . c f , , m a i l / * ) ,
sendmail , sendmail.
.
sendmail *

chroot /jail

/uar/ebin/sendmail

-bd

-q30m

' *
" " ,
,

-, SMTP-
, ,
, .
sendmail ,
,
.
M a x D a e m o n C h i l d r e n sendmail.
sendmail
, " "
SMTP. M a x M e s s a g e G i s e ,
, " "
.
, .
.

C o n n e c t i o n R a e ' f h r o t t i e
.
sendmail , M a x R c p r s P e r M e s s a q e
,
, - .
.
( 25000)
,
pine.
,
.

, , 1000
" "
pine .
, .
" ?", ,
, ,
" " . .
, .
sendmail ,
,

,
.

646

II


, , " ". sendmaii 8.10 S M T P - , - . 8.10
,
. 8.10
, A u t h M e c h a n i s m s .
.
,
, ,
. ,

. ,

- , . ,
, .
a u t h w a r n i n g s j>cndmail
"Authentication-Warning" , .
.
,
, .
identd
sendmaii - , iileBtd ,
. ,
. , identd ,
.
(, ,
), identd
,
sendmaii .
identd :
.
, , , .
,
identd,
. ,
,
. , ,
. sendmaii
I D E N T ,
:
The o r i g i n a l message was r e c e i v e d at Wed,
rGbenji.Colorado.EDU

9 Mar 1994 1 4 : 5 1 -0700 from

[128.138.126.10)

:
From:

cs.Colorado.EDU

19-

647

: ,
! ,
, , , .
,
.


,
\( , TLS.
.
, ,
.
S M T P
,
,
.
sendmaii.
.
, , S / M I M E P G P . RFC.
PC .
(Phil Z i m m e r m a n n ) .
.

PGP

21.8.

SASL:
sendmaii 8.10 ( )
S M T P - , RFC2554.
SASL (Simple Authentication and Security Layer).
SASL ,
. sendmaii
imapd Cyrus. SASL
:
,
U N I X , Kerberos .. SASL
: .
,
sendmaii 8.10 .
2000 . , ,
sendmaii.
8.11.
Cyrus SASL :
ftp://ftp.andrew.cniu.edu/pub/cyrus-mail

, Web-
(Claus Assmann), SASL sendmaii:
http://www.sendmail.org/~ca/emaiJ/auth.html
RFC2487
sendmaii STARTTLS SMTP

643

II.

TLS SSL, Web-.

19.12. ,
sendmail
, .

mailstats.

confSTATUS_FILE ostype sendmail


, .
, .
/etc/mail/statistics,
/var/log/sendmail.st
/usr/Iib/sendmail.st. .
,
,
.


11. /.

. , ( )
( ) .
S t a t i s t i c s f r o m Wed Nov 17 0 0 : 5 6 : 3 0 1999
msgsfr
0
0
5399
4244 9
4184

bytes

1'

37455
383837

iTiSqsto
2015
2
20
72865

bytes to
5314
4
20
450631

irisgsrej
0
0

421292

74 922

455969

4225

ie

4207

Mailer
prog
filelocal
esrctp

:
( m s g s f r , b y t e s _ f rorc), ( i n s g s t o . b y t e s _ t o ) . ( m s g s r e j ) .
, .


, 4, -
.
. ,
, .
.
, ,
( , m a s q u e r a d e _ e n v e l o p e ,
MASQUERADE_AS).
sendmail , , .
.
D N S - NS .

19,

649

sendmaii
UNIX-.
, 1 .
, a j- . 0.
, 127
0 99 (
68 ) .
sendmail/TRACEFLAGS , ,
. .
sendmaii - d x . i \
^ ( )

v /
. 19.18.
19.18.
-

, ( , 1 10)

D N S (
v. 7)

11

( )

12

mi

17

MX

21

( , 2
12)

27

(
. 4)

44


( , 4)

60

( G e n e Kim) ( R o b Kolsiad) Perl-cue c h e c k s e n d n i a i l . sendmaii


, ( ).
.

,
.
checksendmait

-
wwK.harker.conL


sendmaii -v. ,
.

645

II

/usr/ueb/niail.
, , ; sendmail
a n c h o r 53% mail -v evigxor.com
S u b j e c t : just testing, pleaaa ignore
hi
Cc:
evi@xor.com... Connecting tio xor.com via esmtp..
220 xor.com ESMTP Sendmail 8.9.3/8.9.3; Fri, 2b Nov 1999 17:42:57
-0700 (MST)
> EHLO anchor .cs .Colorado .edu
250-xor.com Hello anchor.cs.Colorado.EDU 1128.138.242.1], pleased
meet you
250-8BITMIME
250-SIZE 5000000
250-DSN
250-ONEX
250-ETRN
250-XUSR
250 HELP
> MAIL From: <evi@anchor ,cs .Colorado .edu> SIZE^57
250 <evi@anchor.cs.Colorado .e<iu>. .. Sender ok
> RCPT To :<evi@xor .com>
250 'evigxor.com>,.. Recipient ok
> DATA
354 Enter call, end with "." on a line by itself
> .
250 RAA00511 Message accepted for delivery
evi6xor.com... Sent (RAA0051 Message accepted tor delivery)
Closing connection to xor.com.
> QUIT
221 xor.com closing connection
sendmail anchor sendmail
x o r c o m .
F S M T P

S M T P

S M T P . SMTP-
telnet - 25 sendmail
< bd). S M T P -
. 19.19.
S M T P 14 ,
. .
RFC821 (. R F C 1123).
R F C 1869. 1870. 1891 1985 S M T P - ESMTP.
, sendmail. S M T P ,
E S M T P . sinap. E S M T P
L H L O , HELO.
. ,
S M T P .

19-

651

19.19. SMTP

H E L O _

, S M T P

E H L O

, E S M T P

MAIL From: _

R C P T : _ {

( )

VRFY

(..

EXPN

)
,
.forward

DATA

QUIT

RSET

HELP

S M T P -

R C P T


sendmail
Syslog.
" m a i l " " d e b u g " "crit".
"sendmail''.

Syslog

11.

confLOG_LEVEL,
, , sendmail
.
.
, , Syslog , .
/etc/syslog.conf , , , . . 19.20
sendmail Syslog.
19.20. sendmail
Syslog
'

"alert" "crit"

2
3
4
5~10

"crit"
"err" "warning"
"notice"
"info"

>=11

"debug"

647 II.

19.13. Postfix
Postfix - I B M
T J . W a t s o n R e s e a r c h C e n t e r . Postfix
sendmaii. ,
, ( ) .
Postfix qmail, ( D a n B e r n s i e i n ) . Postfix
, , , .
, Postfix ,
(
). ,
,
P C R E (Perl C o m p a t i b l e R e g u l a r Expression).
,
sendmaii- Postfix sendmaii ,
aliases .forward P o s t f i x ,
sendmaii.
Postfix E S M T P
U U C P .
. Postfix , sendmaii.
, D B dbm,
LDAP, N I S Net Info.

Postfix
Postfix ,
, ;
, ,
..
UNLX- .
sendmaii,
.
Postfix
:

Maildrop :

Incoming ;

Active
;

Deferred , .

.
, Incoming Deferred ,
Active.
Active ,
. ,
-.

19,

653

, , Postfix
,
.
, , ,
, , . (
HOST_STATUS_DIRECTORY sendmail).
. Postfix
. ,
/. S U I D .
;
,
, . Maildrop
( ) ,
Postfix .
, ,
, Postfix
, , .

p o s t d r o p S G I D . M a i l d r o p
.
,
"bugtraq".
Postfix , , master.cf,
. master.cf
,
. .
, main.cf. . main.cf sendmail.cf;
m a s t e r . c f sendmail,
.
,
:

postfix ( root):

postalias newaliases;

post c a t , ;

postconf m a i n . c f :

postdrop Maildrop;

post kick
postlock, post log
,

post ( m a k e m a p ) :

postsuper ( ).

Postfix

mail.cf .
\

II.

B o u m e shell.
, sendmaii.
.
,
. m y h o s t n a m e
, :
myhostname

..

my d o m a i n m y h o s t n a m e ; Postfix
. , :
mydomain

, m y h o s t n a m e m y d o m a i n .
.

mynetworks

, . :
mynetworks - 1 2 8 . 1 3 8 . 2 4 3 . 6 4 / 2 6 ,

127.0.0.0/8

Postfix C I D R - .
i n e t _ i n t e r f a c e s , Postfix ( ).
,
.

: m y o r i g i n , m y d e s t i n a t i o n n o t i f y c l a s s e s .
m y o r i g i n ,
. :
m y o r i g i n - Smyhostname
myorigin = Smydomain
# sendmaii
m y d e s t i n a t i o n ,
. u s e _ c w _ f i l e sendmaii , ,
. :
m y d e s t i n a t i o n = Smyhostname l o c a l h o s t . S m y d o m a i n
m y d e s t i n a t i o n = Smyhostname l o c a l h o s t . S m y d o m a i n Smydomain
mydestination = /etc/mail/local-host-names
n o t i f y_z l a s s e s ,
( postmaster).
:
notify_classes = resource,

software

,
Postfix. . 19.21
.

19-

655

19.21. n o t i f y _ c l a s s e s

bounce
2bounce
delay
policy
protocol
resource
software


( )
( )
( )
( SMTP-)
( SMTP-)
(, .
)
Postfix

Postfix , .
Postfix .
,

.\

U U C P - ;

" " ;

,
, sendmail.
, seBdmBil.
( r e l o c a t e d _ m a p s ) . aliases .forward ,
sendmail. l u s e r _ r e l a y
"user u n k n o w n " .
,
sendmail.
, Postfix
,
, .


Postfix ,
" " MAPS. . 19.22
Postfix, .

REJECT,
.
1-, ,
- Web-:
/"friendS.*$/

550 S t i c k t h i s i n y o u r p i p e 5 0

friend,

/ ~ f i e n d @ ( ? I m y s i t e . c o m ) . * $ / 550 S t i c k t h i s i n y o u r p i p e $ 0

656

II

19.22. Postfix,
header_checks
smtpd_client__reatriction3
smtpd_sender_reatrictiona
8mtpd_recipient_restrictiona
emtpd_helo_requ i red
smtpd_helo_restrictions
amtpd_etrn_restrictions


, "" ..


SMTP- HELO
DNS-
,

" " MAPS,


main.cf :
maps_rbl_domalna
. . v I ,
dul.maps.vix.com
relays.mail-abuae.org
smtpd_client_reatrictiona

reject_maps_rbl

Postfix
Postfix ,
sendmaii,
. conf Postfix .
" "
' @. @.
/etc/postflx/maln.cf
:
m y o r i g i n - Smydomain
/etc/postflx/main.cf :
m y o r i g i n - Smydomain
m y d e s t i n a t i o n - Smyhostname,localhost.Smydomain,Smydomain
,
,
. main.cf,
master.cf.
/etc/postfix/main.cf :
m y o r i g i n = Smydomain
r e l a y h o s t - Smydomain

S M T P - /etc/postfix/master.cf:
#smtp
inet n
n
smtpd
N F S ,
Postfix main.cf master.cf

19-

657

,
, , B I T N E T
U U C P .
:
myorigin
Smydomain
m y d e s t i n a t i o n = S m y h o s t n a m e , l o c a l h o s t . S m y d o m a i n , Smydomain
t r a n s p o r t maps *= h a s h : / e t c / p o s t f i x / t r a n s p o r t
:
m y o r i g i n Smydomain
transport^maps = hash: /etc/postf i x / t r a n s p o r t
,
/etc/postfix/transport :
.bitnet
srntp: m a s t e r
. uucp
smtp:master

19.14.

Costales, Bryan and Eric Allinan. sendmail, 2nd Edition Sebastopol, CA:
O'Reilly. 1997.
1000 .
, .
, ,
, .
.

Avolio, Frederick . and Paul A. Vixie. Sendmail Theory and Practice. Digital
Press. 1995.
,
sendmail, / , sendmail.

Clayton, Richard. " G o o d Practice for Combating Unsolicited Bulk Email. 1 '
R I P E / D e m o n Internet. 2000. http://www.ripe.net/ripe/docs/ripe-206.html
Internet.

Schwartz, Alan and Paula Ferguson Managing Mailing Lists. O'ReilJy, 1998.
.
sendmail - . Sendmail':
An Internetwork Mail Router.
no
Sendmail Installation and Operation Guide,
doc/op sendmail.
/README
, sendmail.
R F C 8 2 2
, R F C 1123 . ,
sendmail.
RFC82I S M T P , RFC1869,
1870, 1891 1985 - ESMTP.

658

II

R F C 9 7 4 MX D N S
.
RFC, ,
:

R F C 18911894 ;

R F C 1985 ;

RFC2033 -

RFC2034 S M T P ;

LMTP;

RFC2045 M I M E ;

R F C 2 4 7 6 ;

RFC2487 S M T P TLS;

RFC2554 SMTP-.

Postfix W e b -
vAvw.porcupine.org.


, , ,
. , "
- ,
".
, , . :

, ;

Ethernet
, , .
. .

.
,

,

.
.
.


,

655

II.

. ,
.
,
. ,
.

20.1.


,

T C P / I P .
, .
T C P / I P .
,
, D N S , N F S H T T P
,
13 14.
, :
ping, t r a c e r o u t e . n e t s t a t , t c p d u m p s n o o p a r p ,
, ;
13.6.
, . !
,
.
.
""
.


,
.

" "
, - ,
,
,
, ,
.

.
: , ,
, ,
..
.

. ,
, .

.
. .
.
13.2, T C P / I P

20.

661

, . . H T T P TCP, ,
, IP,
Ethernet, .
, , .
( ),
, .

ping ( 1 2 7 . 0 . 0 . 1 ) ?


IP-?

ping ?

ping , ?

, telnet
ssh9

ping

DNS7

, , - , .

20.2.

ping:
ping . I C M P - E C H O R E Q U E S T . ,
ping ,
.
ping .
, ,
(
) ,
.
. ,
- I C M P , , ,
,
.
ping .
, "
" . ping - s Solaris ,
.
, < C t r l - 0

,
telnet, , D N S .

662

II

:
%

ping

beest

PING b e a s t ( 1 0 . 1 . 1 . 4 6 ) : 5 6 d a t a b y t e s
64 b y t e s from 1 0 . 1 . 1 . 4 6 : icrnp_seq=0 t t l = 2 5 5 t i m e = 0 . 8 0 8 ms
64 b y t e s from 1 0 . 1 . 1 . 4 6 : icmp_seq=l t t l = 2 5 5 time=0.400 ms
64 b y t e s from 1 0 . 1 . 1 . 4 6 : icmp seq=2 t t l = 2 5 5 t i m e = 0 . 3 9 0 ms

beast ping s t a t i s t i c s
3 p a c k e t s t r a n s m i t t e d , 3 p a c k e t s r e c e i v e d , 0% p a c k e t l o s s
r o u n d - t r i p m i n / a v g / r a a x / s t d d e v = 0 . 3 9 0 / 0 . 5 3 3 / 0 . 8 0 8 / 0 . 1 9 5 ms
beast IP-,
- ( ,
). ,
, . beast
.
ping ,
. ,
,
, ping, ,
IP.
,
, .
ICMP- . . IP ,
, .
,
. ,
, ,
, - , -
" ",
.
, t r a c e r o u t e
( ), ,
-.
ping , ,
, .
, ,
.
,
,
, ,
.
, ping,
. ,
, .
-
IP U N I X . - ,
,
.

20.

663

1- ,
.. ping
1 M P .
ping -.
,
( . 1500 Ethernet),
.
,
, A T M .
R Solaris H P - U X
ping:
% ping cuinf.Cornell.edu 1500
Red Hat Linux FreeBSD -s.
, FreeBSD
root"
# ping

1500 cuinfo.cornell.edu

ping . -,
, . ping
. -
-, ping
. -
IP ,
. ,
. ,
H T T P D N S . .

20.3.

traceroute: IP-
traceroute. (Van Jacobson).
,
IP- .
.
:
traceroute

,
. ,
.
.
, jaguar traceroute drcvil

% traceroute drevil
t r a c e r o u t e t o d r e v i l ( 1 9 2 . 2 2 5 . 5 5 . 1 3 7 ) , 3 0 hops ir.ax, 3 8 oyne p a c k e t s
1 xor-gw2 (192.108.21.254)
0 . 8 4 0 ns 0 . 6 S 3 ,T.S 0 . 6 7 1 rr.s
1998 . Ping of Death ( "
"), UNIX Windows. ,
plng-, -
.

664

II.

2
3

xor-gw4 ( 1 S 2 . 2 2 5 . 5 6 . 1 0 )
d r e v i l (192-225.55.137)

4 . 6 4 2 ms
7 . 9 5 9 ms

4 . 5 8 2 ms 4 . 6 7 4 ms
5 . 9 4 9 ras 5 . 9 0 8 ms

, jaguar
drevil .
,
. Internet
10 12.
traceroute
T T L (Time Live ,
) ,
T T L . ,
T T L , - I C M P - .
traceroute T T L
1. , (
xor-gw2), , .
jaguar ( - ,
IP- . traceroute
D N S .


PTR).

DNS

16.11

(,


, T T L 2.
T T L .
I C M P - .
. ; T T L
.
I C M P -
, " " -. ,
, traceroute -,
, . ,
IP-, .
traceroute T T L ,
.
,
. traceroute

,
traceroute colorado.edu
xor.com.
r u p e r t s b e r g i

tracexroute

xor.com

t r a c e r o u t e : Warning: scor.com h a s m u l t i p l e a d d r e s s e s ; u s i n g 1 9 2 . 2 2 5 . 3 3 . 1
t i a c e r o u t e t o x o r . c o m ( 1 9 2 . 2 2 5 . 3 3 . 1 ) , 3 0 h o p s max, 4 0 b y t e p a c k e t s
1 cs-gw3-faculty.cs.coloradc.edu (128.138.236.3) 1.362 ms 2.144 ms 2.76 ms
2 cs-gw-dnu.cs.colorado.edu (128.138.243.193) 2.720 ms 4.378 ms 5.052 ms
3 engr-c5.C0J.0rad0.EDU ( 1 2 8 . 1 3 8 . 8 0 . 1 4 1 ) 5 . 5 8 7 ms 2 . 4 5 4 ms 2 . 7 7 3 ms
3 hut-enar.Colorado.EDU ( 1 2 8 . 1 3 8 . 8 0 . 2 0 1 ) 2 . 7 4 3 ms 5.643 ms 2 . 7 7 2 ms
b cuatir.-gw.Colcrado.EDU ( 1 2 8 . 1 3 8 . 8 0 . 2 ) 5.587 ms 2 . 7 8 4 ms 2 . 7 7 7 ms
204.131.62.6 (204.131.62.6)
5 . 5 8 5 ms 3 . 4 6 4 ms 2 . 7 6 1 ms
7 border-frori-BRAN.coop.net (199.45.134.81) 5.593 ms 6.433 ms 5.521 ms
fi c o r e - g w - e t h - 2 - 5 . c o o p . n e c ( 1 9 9 . 4 5 . 1 3 7 . 1 4 )
5 3 . 8 0 6 ms *
1 9 . 2 0 2 ms
9 xor.com (192.225.33.1)
1 6 . 8 3 8 ms 1 5 . 9 7 2 ms 1 1 . 2 0 4 ms

20.

660

, , colorado.edu,
( e s - g w 3 - f a c u l t y c u a t m - g w ) .
204.131.62.6,
D N S - . , coop.net,
xor.com.

. , -
.
, .
traceroute I C M P - , , ""
traceroute
.
,
,
, . ,
, .
.
,
traceroute
.
I C M P - .
,
, .
, -
.
U D P - , traceroute
1-.
.

. . ,
C S M A / C D (Carrier Sense Multiple Access
with C o l l i s i o n D e t e c t i o n
). (, Ethernet) .
,
( ) .
! N .
, ""
, .. , . " " ! ! . ,
,
(,
): ,

.
traceroute ( ),
-
D N S . ,
, D N S ,
traceroute ~ I P - .

666

II

20.4.

netstat:

netstat
, ,
.
, . netstat ,
.
netstat. :


, netstat
T C P - UDP-. ,
, , .
n e t s t a t -". :
% netstat -
Active Internet connections (including servers)
Proto
Recv-Q Send-Q
Local Address
Foreign Address
tcp4
0
0
V*
*.6013
tcp46
0
0
*.60l3
*.*
0
tcp4
0
nimi.ssh
x o r , .com. . 4 1 0 5
tcp4
0
20
nimi.ssh
x c r . .com. . 1 6 1 2
0
tcp4
0
*.13500
tcp4
0
0
nimi.ssh
1 3 5 ,. 1 9 7 .. 2 . 1 1 4 . 8 8 3
tcp4
0
0
nimi599
x o r , .com. . t e l n e t
tcp4
0
0
* .ssh
tcp46
0
* .ssh
0
tcp4
0
0
nimi.ssh
1 3 5 ., 1 9 7 ., 2 . 1 1 4 . 7 7 6
tcp4
0
*.CVSup
0
udp4
0
0
*.syslog
* .*
udp4
0
0
*.ntalk
* .*

(state)
LISTEN
LISTEN
ESTABLISHED
ESTABLISHED
LISTEN
ESTABLISHED
ESTABLISHED
LISTEN
LISTEN
ESTABLISHED
LISTEN

nimi. S S H ,
telnet- ,
. ,
t c p 4 6 . , IPv6.

_. ,
.
(
/etc/services). -
UNCX-, , , .

20.

662

. , D N S netstat
, -.
S e n d - Q R e c v - Q ,
.
. ,
. ,
netstat ,
, , 0.
T C P .
U D P .
: ESTABLISHED ()
, LISTENING () , ( - ) , TIME WAIT
( ) , .

, , ,
. netstat
,
T C P . ,
SYN SENT, ,
.
netstat ,
S Y N W A I T . , ,
.
.
0

12.


netstat -i . ,
, , evolve,
Solaris:
1 netstat -i
Name Mtu
Net/Dest
loO 8232 l o o p b a c k
hrr.eO 1500 e v o l v e
hmel 1500 e v o i v e - b l

Ipkts
11650
16438
94852

Ierrs
0
0
1

OpKLS
11650
18356
379410

Qer r s
0
0
13

Collis
0
110
487

. p k t s
O p k t s ,
. T e r r s
O e r r s :
, -
.
\ % .
,
.
,
, , .

668

II.

;
.
, netstat
. C o l l i s ,
".

(OpJcts).
hmeO 0,6%. hmel 0,13%.
" " 5%, 15%
.
,

.
. FreeBSD.
solaris% netetat -i 1
hp-ux% netetat 1
redhat% netetat -i -c
freebsd% netstat 1
input
packets
139^1549
512
464
516
452
336

errs
1216
0
1
0
1
0

[Total)

14757869
99
94
101
87
71

output
errs
16
1

0
0
0

colls
1431629
27
40
26
14
19

20% 30%. ,
.
netstat
. netstat -i
, , :
, ,
.
.
. ping
netstat


netstat - . ,
, Solaris
.
% netatat - -
Routing Table
Destination
Gateway
192.225.4 4.0
192.225.44.88
-92.168.3.0
192.168.3.12
10.0.0.0
192.168.3.252

F l a g s Ref
U
3
U
2
UG
0

Use
1841
117
4

Interface
hmeC
hmel
hmel

, Ethernet.

20.

664

default
127.0.0.1

192.225.44.254
127.0.0.1

UG
UK

0
0

91666
543

loO


, IP-. - IP-.
F l a g s , : U
(up) , G (gateway) , (host) (
, ). D ( ) ,
I C M P . G
,
. :
T C P - ,
.
.

13.5.

netstat .
.
(0.0.0.0), d e f a u l t .



netstat -s , .
: IP, I C M P , T C P U D P .
netstat -s, -; .
.
ip:
2313683 t o t a l p a c k e t s r e c e i v e d
0 bad h e a d e r c h e c k s u m s
1642600 p a c k e t s f o r t h i s h o s t
25743 p a c k e t s s e n t from t h i s h o s t
0 o u t p u t p a c k e t s d r o p p e d due t o n o b u f s ,

etc.

,
. ,
- ( )".
icmp:
57 c a l l s to xcmp_error
Output histogram:
e c h o r e p l y : 157
destination unreachable:
Input histogram:
echo r e p l y : 6
destination unreachable:
e c h o : 157

57
4

-m netstat Solaris FreeBSD


.

670

II.

Lime e x c e e d e d : 14
157 m e s s a g e r e s p o n s e s g e n e r a t e d
-, -
. , "destination unreachable" ( ) , , . . ,
, ,
,
tcp:
25087 p a c k e t s s e n t
25499 p a c k e t s r e c e i v e d
31 connection requests
30 c o n n e c t i o n a c c e p t s
56 connections e s t a b l i s h e d {including accepts)
64 c o n n e c t i o n s c l o s e d ( i n c l u d i n g 13 drops)
4 embryonic c o n n e c t i o n s dropped
,
.

20.5.


tcpdump. snoop nettl
, .
,
. , , - , T C P - ,
.
,
.
,
.
, (
) ,
. ,
Ethernet, Token Ring,
.
,
,
" " .

. , , ,
.
.

|7|

15.2.


, , .
,
/ ,

20.

671

. ( p r o m i s c u o u s m o d e )
,
.
, ,
, U N I X ,
.
.

,
(
) ,
.

.
, root.

, .

.
, ,
" "
.

snoop: Solaris
Solaris snoop.
,
, , ..
, ,
' .
, netstat -i (
). -d . ,
netstat -i ( ,
E t h e r n e t hmeO). - V
, -
.
snoop ,
- . } - , ,
host, port, tcp, udp ip, and, or not.
.
snoop,
evolve
c h i m c h i m . ,
:
# snoop host chimchim and host
e v o l v e . x o r . c o m - > x o r . c o m SMTP
x o r . c o m -> e v o l v e . x o r . c o m
e v o l v e . x o r . c o m - > x o r . c o m SMTP
e v o l v e . x o r . c o m - > x o r . c o m SMTP
xor.com -> e v o l v e . x o r . c o m

672

ovolv

SMTP R

EHLO
R 250-

and tcp port 25


220

x o r . c o m ESMTP S e

evolve.xor.com\r
xor.com Hello ev

II

e v o l v e . x o r . c o m -> x o r . c o m SMTP
x o r . c o m -> e v o l v e . x o r . c o m
x o r . c o m -> e v o l v e . x o r . c o m
e v o l v e . x o r . c o m -> x o r . c o m SMTP
x o r . c o m -> e v o l v e . x o r . c o m
e v o l v e . x o r . c o m - > x o r . c o m SMTP
xor.com -> e v o l v e . x o r . c o m

MAIL FROM; < r o o t @ e v o l


SMTP R
SMTP R 2 5 0 < r o o e v o l v e . x o r
RCPT TO: < n e d 8 x o r . c o m >
SMTP R 2 5 0 < n e d 0 x o r . c o m > . . .
DATA\r\n
SMTP R 354 E n t e r mail, end

: "
, chlmchim evolve
T C P - 25".
, .
, .
, ,
, (
).
telnet ,
snoop,
. , ,
evolve ,
:

s n o o p not: h o s t e v o l v e


:
# s n o o p host: m r h a t

DNS-

mrhat,

grep DNS

grep

nettl: HP-UX
H P - U X ,
nettl*- ,
, ,
. .
, H P - U X .
tcpdump.
nettl N e t w o r k T r a c i n g a n d L o g g i n g (
) H P - U X .
.
, .
/ e t c / r c . c o n f i g . d / n e t t l NETTL 0 .
nettl
/etc/nettlgen.conf.

tcpdump:
tcpdump, , Red H a t L i n u x F r e e B S D
: " n e t t l e "
" ; , ".

20.

673

.
H P - U X , Solans .
snoop.
tcpdump
. ,
-i . D N S
, -.
, D N S
,
tcpdump. -v
, - w .
-w. .
-.
tcpdump.
jaguar.xor.com. host j a g u a r
( ) , jaguar.
i tcpdump host jaguar
1 3 : 4 0 : 2 3 j a g u a r . x o r . c o m . 1 6 9 7 > x o r . c o m . d o m a i n : A? c s . c o l o r a d o . e d u .
13:40:23 xor.com.domain > jaguar.xor.com.1697: A mroe.cs.colorado.edu
1 3 : 4 0 : 2 3 j a g u a r . x o r . c o m . 1 6 9 8 > xor.com.domain: PTR? 5 . 9 6 . 1 3 8 . 1 2 8 . i n - a d a r . a r p a .
1 3 : 4 0 : 2 3 x o r . c o m . d o m a i n > " j a g u a r . x o r . c o m . 1 6 9 8 : PTR i r . r o e . c s . c o l o r a d o . e d u .
.
jaguar xor.com D N S .
.colorado.edu.
, . mroe.cs.colorado.edu.
, IP- mroe.

- . tcpdump. ,
, .

20.6.


,
.

.
,
.
- ,
. ,
,

,
T C P / I P . S N M P (Simple Network M a n a g e m e n t Protocol
). ,

674

II.

, .

, , .
, ("") ("") .
; S N M P


. S N M P .
.
D M T F (Distributed Management Task Force
), , W B E M (Web-Based Enterprise M a n a g e m e n t
, Web-Tex), D M I (Desktop Management Interface
) C I M (Conceptual Interface Model
). , D M I ,
- ( ) S N M P . , ,
S N M P .
S N M P ,
- ("") - (""). (
, S N M P ,
.) ,
,
,

. , .
,
.
, ,
,
,
.
.
S N M P ,
. U N I X -
, ,
.
S N M P " "
,
. , . .

20.7.

S N M P :
9 0 - . S N M P ,
.
S N M P . ,

20.

675


S N M P - .
S N M P , , ,
, .
S N M P
. .

S N M P
S N M P ,
. , .
;

. (Management Information Base, MI )
,
, S N M P . ,
, (Object Identifier, OID).
, S N M P
, " " .
S N M P -
, .
,
, .
S N M P .
S N M P . - , . .
,
( ,
-).
, O I D .
, : 1.3.6.1.2.1.1.3.
:
iso.o^g.dod.internet. mgmt.mib-2.system.sysUpTime
S N M P
. ,
iso.org.dod.imernet.mgmt ( O I D 1.3.6.1.2).
S N M P T C P / I P
( M I B - I ) :
, ,
(IP, I C M P , T C P , U D P .). RFC1213 ,
, MIB-1I.
,

SNMP-,

MIB-H.
. 20.1 MIB-II.

676

II

2 0 . 1 . 1-
1

system.sysDcscr

: , ,
.

sysiem.sysLccation

system.sysContact

systcm.sysName

( D N S - )

imerfaccs.ifNumber

Intcrfaccs. ifTable

ip.ipForwardmg

1. , 2

ip.ipAddrTable

IP- ( . )

Ip.ipRouieTable

icmp.icmplnRedirects

. I C M P - n a x e

icmp.icmpinEchos

ping

tcp. tcp CormTable

udp.udpTable

UDP-,

iso.oig.dod.internet.mgmt.mib-2.
.
.
MIB .
, . S N M P - n e p e . MIB
( Ml -II) S N M P -
U N I X .
.

S N M P
S N M P :
g e l ( ) , g e t - n e x t ( ) , set ( ) t r a p
().
get s e t
, OID.
get-next M f B .
.
( trap) , , .
, "
" , ,
,
. ,
,
S N M P - .
, .
.

20.

677

S N M P

,
-
?.
" " (community
n a m e ) . , , : "".
, , " ",
.
3 S N M P
.
, .

R M O N : Ml
R M O N (remote monitoring )
(.. ,
- ). " "
.
, ,

.
tcpdump.
R M O N R F C 1757,
1995 . "
R M O N " . .
,

S N M P - .
. R M O N
.

20.8.

S N M P

SNMP-.
"public",
"private" "secret".
,
, . ,
S N M P , ,
, .
Solaris H P - U X
SNMP-.
UCD-

FreeBSD

/ u s r / p o r t s / n e t / u c d - s n m p . Red H a t
S N M P .
Solaris H P - U X ,
U C D , , .

678

II.

SNMP- Solaris
Solaris . S N M P -
D M I .
S N M P - /usr/lib/snmp/snmpdx, /etc/snmp/conf/snmpd-conf.
Ml ,
. ,
( s y s d e s c r ) , ,
( t r a p ) , ( r e a d - c o m m u n i t y , w r i t e - e o m m u n i t y ) . snmpdx.
.
snmpdx
/etc/snmp/conf/snmpdx.acl. IP- ,
S N M P .
( " ")
.
S N M P . ,
.
Solaris
, D M ! .
/usr/lib/dmi/dmispd. D M I - . /usr/lib/dmi/snmpXdmid SNMP-
DMI dinispd.
snmpXdmid SNMP- snmpdx.
S N M P / D M L ,
/ v a r / d m i / m a p . .
,
snmpXdmid.
DMI- , D M l -
.
/ e t c / r c 3 . d / S 7 7 d m i /etc/rc3.d/s77dmi.
snmpXdmid, snmpXdmid.conf
snmpXdmid.conf.orig

S N M P HP-UX
,
Hewlett-Packard ,
HP OpenView.
, S N M P -
H P - U X .
H P - U X "" 1 .

.
/usr/sbin/snmpdm.
. /usr/sbin/snmpd.
snmpdni

20.

679

/etc/SnmpAgent.d/smnpd.conf.
,
snmpd.
snmpd.conf .
:
# S N M P - d i s a s c e r . x o r . c o m
get-community-name: -community
set-community-name: D8j4kL.2nG
trap-aest:
jaguar.xor.com
trap-dest: ov.xor.com
l o c a t i o n : F i r s t f l o o r l a b m a c h i n e room
contact:
root@disaster.xor.com
g e t - c o m m u n i t y - n a m e s e t - c o m i r . u n i t y - n a m e
. , ,
,
. , s e t - c o m m u m t y - n a m e , .
t r a p - d e s t IP- S N M P - ,
.
, .

location contact

sysLocation sysContact MIB-1I.
- . snmpd:
snmpd

-m


, . 20.2.

2 0 . 2 . s n m p d HP-UX

SNMP-

16

32

64

, H P - U X S N M P - Syslog.
/var/adm/snnipd.log;
-I.

680

II.

SNMP- U C D
S N M P -

. . - U N I X -
SNMP-
( U n i v e r s i t y o f C a l i f o r n i a a t Davis, U C D ) .
U C D
S N M P UNIX.
,
S N M P - . S N M P - ,
S N M P - . ,
. Web-
ucd-snmp.ucdavis.edu*.
S N M P , U C D -
S N M P - .
Ml ,
, , , . ,
UN IX-
S N M P - . S N M P
,
.
/usr/sbin/snmpd.

, /etc/sump.
snmpd.conf; .
,
s n m p d . l o c a l . c o n f .
snmpd.conf
, .
configure U C D
. -I, s n m p d .
, -s
Syslog.
snmpd . 20.3.
-. -V. -d -D,

.
,
Perl S N M P . ,
, P A N " " .
2000 . Source Forge
N e t - S N M P . Web-; nec-snmp.sourceforge, net. . .
C P A N (Comprehensive Perl Archive Network Perl- )
Perl.
www.cpan.org.

20.

681

2 0 3 . snmpd UCD

20.9.

-I /i

. ,I

SNMP-

-d

S N M P -

-V

-D

-h

snmpd

-s

pet Syslog


S N M P - : U C D .
0 1 D .
M R T G ,

SNMP-\.

N O C O I . . *
, .

U C D
S N M P - .
U C D . . 20.4.
20 4 U C D

srnnpgel

SNM -

snmpgctiiext

snmpset

SNMP-

s run table

SNMP-

snmptranslate

0 1 D
M I B

snmptrap

snmpwalk

6ajy Ml , 0 1 D

.
, , ,
snnipgcl, . (
siimpget , . 9 )
snmpwalk. 0 1 D ( . \ , M l ),
get-next O I D .

682

II.

snmpwalk jaguar ( public , "


"):
% smnpwalk jaguar public
system.sysDescr.0 = Linux jaguar 2.2.12-20 #1 Mori Sep 27 10:40:35 EDT 1999
system.sysUpTime.G - Timeticks: (86516617) 10 days, 5:52:46.1?
system.sysName.O = jaguar
system. sysLocation. 0 *= Second Floor Machine Room
interfaces.ifNumber.0 - 2
interfaces.ifTable.ifEntry.ifIndex.1 = 1
interfaces.ifTable.ifEntry.ifIndex.2 - 2
interfaces.ifTabie.ifEntry.ifDescr.l - "loO" Hex: 6C 6F 30
interfaces.ifTable.ifEntry.ifDescr.2 - "ethO" Hex: 65 7A 68 30
interfaces.ifTable.ifEntry.ifType.1 = softwareLoopback(24)
interfaces-ifTable.ifEntry.ifType.2 = ethernet-csmacd(6)
interfaces.ifTable.ifEntry.ifMtu.1 - 3924
interfaces.ifTabie.ifEntry.ifMtu.2 - 15G0
interfaces.ifTable.ifEntry.ifInOctets.1 = 12590602
interfaces.ifTabie.ifEntry.iflnoctets.2 = 2287718531
interfaces. ifTable. ifEntry. J.fInUcastPkts.1 - 7557b
interfaces.ifTabie.ifEntry.ifInUcastPkts-2 = 79730602
interfaces.ifTabie.ifEntry.ifInErrors.1 = 0
interfaces.ifTabie.ifEntry.iflnErrors.2 - 218
interfaces, if Table. ifEntry. ifOutOctiets = 12591593
interfaces.ifTabie.xfEntry.ifOutOctets.2 = 3374588125

. 10 e t h O .
snmpwalk ; 1

M R T G :
M R T G (Mulii-Roiuer Traffic Grapher
), (Tobias
Oetiker) , S N M P .
Perl.
.
M R T G
S N M P . .
. -, ,
, . ,
M R T G ,

,

.
-, M R T G S N M P - .
S N M P - U C D M R T G
.

20.

683

. , M R T G .
,
.
, M R T G ,
RRDtool. .
, . , M R T G , RRDtool
.
.
RRDtool
Cricket, (Jeff Allen).

S N M P
.
Perl
.
Web- (ee-staff.ethz.ch/~oetiker)
M R T G . R R D t o o l Cricket.

. . MRTG

N O C O L :
N O C O L (Network Operation Center O n - L i n e
) .
,
,
Web-cepnepa. ( ),
.
,
" " . Perl .
: ,
Web-,
curses .

II

, .
.
,
N O C O L . , 100.
www.netplex-tech.com".



, .
(
),
.
.
S N M P .
,
SQL-, D N S Web-.
.

Web-.
,
, X M L - .
,

. . OpenView
Hewleit- Packard ,
.
,
. ,
M R T G N O C O L .


"" ping-,
S N M P - .
D N S , .
, ,
' ' " .
. ,
.
,
. ,
?
.


, Cisco Works

Netplex Technologies : S N I P S (System a n d Network integrated Polling Software


). . .

20.

685

.

, ,

20.10.

Cisco Online. Internetworking Technology Overview: SNMP.


co.com/univercd/cc/td/doc/cisintwk/ito_doc/snmp.htin

http://www.cis-

H u n t . Craig, and Gigi Estabrook. TCP/IP Network


Edition. Sebastopol: O'Reilly & Associates. 1998.

StaLlings, William. Snrnp, Snmpv2, Snmpv3, and Rmon / and 2,


Reading, MA: Addison-Wesley. 1999.

Administration,

Second

Third Edition.

R F C .
,

S N M P .

686

R F C 1155 S N M P (
..).

RFC1156 1-1 ( O I D ) .

R F C I 1 5 7 - S N M P .

RFC1213 M1B-II ( O I D ) .

R F C 1901 - R F C 1910 - S N M P v 2 .

RFC2011 M I B IP S N M P v 2 .

RFC2012 M I B S N M F 4 2 .

RFC2013 Ml U D P S N M P v 2 .

RFC202I R M O N 2 SMIv2.

RFC2570 S N M P v 3 .

II

21

U N I X
, UNIX-
- .
U N I X - , , ,
. Iniernei
" ".
- UNIX-, ,
. ,
U N I X , .

U N I X ,
if .
, U N I X

.

U N I X , ,
: , , U N I X , ,

-
.

\ , >

.
.


I n i e r n e i " " (198S .). ,
(

21

687

), . ,
- (Robert Morris. Jr.), -"",
Internet.
"" ,
.
: ,
. (
, ).
U N I X ,
, , , . ,
- :
, ,
.
, ,
.
,
U N I X .
.
, ,
Internet.
, , , .
:
=

1,072
, .

21.1.



. .
, .

.
. .

, .
, .

. ,
. .

, , ,
.

,
. ,
, - .

.
. , , .

688

II.

( )
UNIX-.
UNIX.
,
. ,
, ,
.. .
,
.

. 27
RFC2196.
"",
. -
, "".
.
. ,
. ,
.
FTP- ,
,
.
. , tripwire, tcpd crack ( 21.7).
.
, . , ,
.
UNIX- . ""
,
,
. ,
"" 50000$
.
,
, -
.
.

,
. ,
- ( ,
, )

21.2,


, UNIX-, , .

21.

689

,
.
. ( )
. , America Online
. ,
. " "
" ".
( ).
.

. , Internet,
, .
.
! :
.

. UNIX
( , , )
, .

,
. ? ,
. ,
""
.

.
.
, .
, , :
,
.. .. ,
, . .
,
.

,
, .
,
, ,
-
, . , COPS ( 21.7),
.

21.3.

/etc/passwd
/etc/passwd ( /etc/shadow)
.
.

690

II.

. .
.
/etc/passwd 6.
FreeBSD /etc/passwd /etc/masler.passwd .
. /etc/master.passwd
6.2.

( ) ,
. /etc/passwd, daemon (
,
), (*)
, ,
.
, /etc/passwd ,
, HI
":
perl -F: -ane 'print if not 5F(1];' /ecc'passwd

,
,
,
/etc/passwd (
did) .
.
/etc/passwd /etc/group ,
,
root. /ctc/shadow.
/etc/master.passwd FreeBSD
.
UNIX . , ,
, ,
,
. .
,
, , ,
. , ,
, .
,
, , ,
. , ,
.

Perl 5

21.

691

. .
..
8
. .
6.1.
passwd.
,
.
npasswd, (Clyde Hoover)

h Up ://www, utexas.edu/cc/unix/softwa re/ passwd
-

Solans passwd.
,
.
/etc/default/passwd.
Red Hat
(Pluggable Authentication Modules. )
passwd ,
/etc/pam.d/passwd.

http://parc-power.nei/mongan/Linux-PAM/index.htmI

/etc/passwd :
, . , Is ,
/etc/passwd
,
.

/etc/passwd
.
21.7.
? 80- .
*, crypt()"\
. 80- .
""
. I99S . (John Gilmorej
Electronic Fromier Foundation
(Paul Kocher) 56- DES " "

1984 . HEP -, DES (Data Encryption Standard ). , DES


;
.
" crypt, ,
.

692

56 . , 1
56- D E S .


.
, , /etc/passwd . ,
, " " (
/etc/shadow). UNIX-,
, .
HP-UX
. ,
.

, .
(, guest demo)
, .
,
. ,
,
.
, ,
.

27.1.

root .
!
sudo (. 3.4).

, , , . ,
, . ,

, ,
, ,
, . ,
.
root . "" ,
, .
sudo,
.

21.

693


(;
, date, sync
Ipq

root ,
0. /etc/passwd
, ,
.
, ,
, "
", /etc/passwd
,
0. , who w,
, /etc/utmp,
, ,
,
.
Cnaceinte -. , ":
perl

-F:

-ane

'print

if

not

SF[2J;'

/etc/passwd

passwd.
0
,
.
, ,
passwd,
. ,
.

21.4.



, . ,
root, ,
SUID (Sei User ID
), , .
. , .
,
,
SUID. ,

* Perl 5 .

694

II.

,
.

. .
, . , , ,
: , ,
, ,
SUID
,
/etc/passwd ,
.
: UID.
/dev/null

SUID SGID (Set Group ID ) - nosuid
mount. ,
.

SUID. , ,
SUID-
, .
, 21.7,
, find:
/usr/bin/find
/bin/mail

, - u s e r root -perm -4000 - p r i n t


-s "Setuid root f i l e s " netadmin

'

netadmin , ' root


SUID.

21.5.


UNIX- ,
, , .
,
"" .
" ".
/dev/hniem

(, ps).


,
, ( kmem), SGID.
,
/dev/kmem .

21

" 695

,
, ,
. /dev/kmem
, . ,
, .
SG1D ,
/dev/kmcm.
/dev/drum /dev/mem,
.

, /dev/kmem.
/etc/passwd /etc/group
( root) .
644. - (
daemon). , /etc/passwd.
, passwd (
root) SUID
, "", .1
, FTP.

FTP-.
, .
1-- 22.6.
FTP- *"ftp/etc/passwd
( ),
Is. .



. - . ,
. '"
.

21.6.


,
. ,
, "",
.

Syslog ,
.
,

.
.

w\

696

Sysfog //

II.


,
, "" .
, .
TTY-
. Solaris
/etc/default/login*, HP-UX Red Hat /etc/securetty,
FreeBSD /etc/ttys.
/etc/hosts.equiv -/.rhosts
liosts.equiv ~/.rliosts "" ,
( rlogin) (
) . ,
UNIX,
, .
rslid riogind,
.rliosts liosts.equiv
/etc/inetd.conf. ,

rlogin, rsh . SSH
(. 21.8).
,
riogind. telnet. ,
.
, rlogin ( SSH!),
.rhosts /etc/hosts.equiv,
.
( root)
/etc/hosts.equiv
rliosts , .
, , ,
. 3 .
, "" .
rexd, rexecd tftpd
rexd Solaris ( , HP-UX)
. DH
(
/etc/inetd.conf). "" .
.
rcxccd .
- ,
, , ,
"" ,
. .
/etc/default/su.

. 23.

21.

6 97

tftpd FTP (Trivial File Transfer Protocol ).


. ,
. tftpd
,
fingerd
finger :
% finger evi
L o g i n name: evi.
In r e a l l i f e : Evi Nemeth
Direct.ory: /beast/users3/evi.
Shell:
/bm/tcsh
On s i n c e Jan 22 07:07:55 on ttyp3 from x o r - t r a i n 4 . x o r . c o m
50 m i n u t e s I d l e Time
Mail l a s t r e a d S a t J a n 2 2 0*7:08:57 2000
No P l a n .

, finger
.
fingerd. fiuger

@. ,
,
fingerd /ctc/inetd.conf"
N I S
.
, NIS (Network Information Service;
Yellow Pages). Sun
,
, /etc/group, /etc/passwd /etc/hosts.
, "' ",

. NIS NIS+
NIS ,
.
NIS IS.

netadmin
~netadmin. -
,
( scph
. scp SSH,
21.8

* , fingerd
, , .

698

II.

N F S
NFS 17.1 showmoimt - ,
*< .
,
.
sendmail
sendmail ,
.
,
.
sendmail.
, , ,
sendmail, ( ,
). Web- www.sendmail.org.
sendmail 19.


. ,
,
. ,
.
10.

, .

,
.
turkey, - Usenet.
,
.
, UNIX
,
, . ,
, :

;
;


.
: , -
.

21.

699


Internet. , ,
.
Internet.
: ,
, Usenet.
- "",
w\v\v.deja.com.

21.7.


,
, .
.
:
.
, T C P
UDP- ".
"" .
,
.
,
, .
, , :
% - hostl.uexample.com
S t a r t i n g nmap V . 2 . 1 i b y F y o d o r ( f y o d o r G d h p . c o m , w w w . i n s e c u r e . o r g / r u n a p / )
Interesting ports on hostl.uexample.com (10.10.2.1):

13
19
21
23
25

State
open
open
open
open
open
open
open

Protocol
tcp
rep
tcp
tcp
tcp
tcp
rep

Service
echo
discard
daytime
charaen
ftp
telnet
smtp

513

open

ccp

^.ogin

Nmap

run

completed

IP a d d r e s s

(1

hose

up)

scanned

in

second

-sT nmap
TCP- " . nmap , ,
.
13, . IP-
, , IP-
.
(
1024) "" . -

700

II.

, hostl.uexample.com
,
: ftpd (ftp), riogind (login) , ,
sendmail (smtp). , .
state () open () ,
, unfiltered ( )
filtered () ,
- .
. ,
.
Web- www.aexample.com:
% - hoctl .uexamplo . com
S t a r t i n g v . 2 . 1 2 b y F y o d o r ( f y o d o r @ d h p . c o m ,
(Not s h o w i n g p o r t s i n s t a t e : f i l t e r e d )
Port
53
BO
179
443
Nrnap

State
unfiltered
open
unfiltered
open
run

Protocol
tcp
tcp
tcp
tcp

completed --

www.insecure.org/nmap/)

Service
domain
http
bgp
https

IP a d d r e s s

(1

host

up)

scanned in

122

seconds

, Web-.
D N S
B G P , , .
( D N S B G P ),
.
TCP- UDP-
-,
. ,
TCP- ( ),
.
,
.
,
.
,
.
TCP/IP. , -:
% - disaster mrhat lollipop
S t a r t i n g V.
Interesting
Remote

operating

Interesting
Remote

121

2.12 by Fyodor

ports

ports

operating

on

system guess:
on

(fyodor@dhp.com,

disaster.xor.com
HP-UX

mrhat.xor.com

system

guess:

BSDI

www.insecure.org/nmap/)

(192.108.21.99):
11.00

(192.108.21.2):
4.0

701

Interesting
Remote
Nmap

run

ports

operating

on

lollipop.xor.com

system

completed

guess:

Solaris

IP a d d r e s s e s

(192.108.21.48):
2.6

(3 h o s t s

up)

2.1
scanned

in

seconds

.
, ,

.
S A I N T :
SAINT (Security Administrator's Integrated Network Tool )
, SATAN (Security
Administrator Tool for Analyzing Networks
), 1995 .
. SATAN (Dan
Farmer) (Wietse Venema)
World Wide Digital Security, Inc.. Web-
(www.wwdsi.com) . !
nmap. SAINT ,
, .
UNIX .
, , .
SAINT ,
,
(, Nessus. ) ,

SAINT Web-, Web-.
nmap , ,
. , SAI NT
Samba ( ),
Windows-. Samba
26.
Nessus:
(Renaud Deraison) Nessus,
SAINT. Nessus , ,
.
Web- www.nessus.org.
( 1.0) Nessus
, .
,
,
- ,

702

II.

Nessus.
, .
crack:
,
,
.

, . crack,
(Alec Muffett),
.

,
crack.
,

,
, Internet ..
, .
?
crack
5.0.
ftp://coast.cs.purdue.edu/pub/tools/unLx/pwdutils/crack/
:
.
.
tcpd: Internet-
tcpd, "TCP-".
TCP-, lelnetd, riogind
fingerd. , ,
.
. tcpd ftp.porcupine.org.
Red Hat F:reeBSD (
/usr/ports/security/tcp_wrapper).
tcpd
. inetd
/etc/rnetd.conf,
tcpd.

. , /etc/inetd.conf

t e l n e t stream

tcp

nowait

root

/usr/sbin/xn.telnetd

in.telnetd

:
telnet

stream

tcp

nowait

root

/usr/sbin/tcpd

in.telnetd

inetd 28.3.

21.

703

(
/etc/syslog.conf) :
Nov
Nov
Nov
Nov

12
12
12
13

0 8 : 5 2 : 4 3 chiffichim i n . t e l n e t d [ 2 5 8 8 0 ] : c o n n e c t f r o m t i n t i n . C o l o r a d o . E D U
19:19:44 chimchim i n . t e l n e t d [ 1 5 5 2 0 J : c o n n e c t from c a t b e l l y . c o m
23:48:45 chimchim i n . t e l n e t d [ 1 9 3 3 2 ] : connect from a t d t . x o r . c o m
20:14:57 chimchim i n . t e l n e t d [ 2 3 6 2 ] : connect from 130.13.13.11

- HP-UX
HP-UX Inetd,
. /var/adm/
inetd.sec. :

a l l o w ! deny

_\

_> i

...

, /etc/services
/etc/rpc.
(, moomjn.xor.com).
. .
"192.108.21.*" ,
"192.108.21.1-50" .
(#)
.
. .
, .
,
, sprayd
:
login
sprayd

allow
deny

192.108.21.*
192.108.21.5

192.225.33."
freddy.xor.com

inetd HP-UX
, -I
Syslog "facility" "info".
"notice
C O P S :
COPS (Computer Oracle and Password System
) ,
UNIX. .
, COPS
,
. , ,
,
. ,
- .
COPS (
),
:
, :

704

II.

/etc/passwd /etc/group;
-;
.
COPS
,
:
ATTENTION:
Security Report
Warning!
Warning!

Root

from

host

reja.xor.com

d o e s n o t own t h e f o l l o w i n g f i l e ( s ) : / e t c
(or c u r r e n t d i r e c t o r y )
is in root's path!

Warning!
/ v a r / s p o o i / m a i l is _World_ w r i t a b l e !
Warning!
/etc/utmp is _World_ w r i t a b l e !
Warning!
U s e r r a n d y ' s home d i r e c t o r y / h o m e / s t a f f / r a n d y i s mode
Warning!
Password f i l e , line 8, no password:
runmailq::33:10:,,,:/home/staff/runmailq:/bin/csh
Warning!
/usr/bin/uudecode creates setuid files!
Warning!
Password Problem: Guessed: beth s h e l l ; / b i n / c s h

077?!

COPS Kuang.
.
hup://dan.yo5emite.ca.us/cops
tripwire:
tripwire, (Gene Kim)
(Gene SpafFord) ,
,
,
. , tripwire , /bin/login ,

tripwire , . ,
(, /etc/utmp),
,
.

.
,
tripwire,
" ".
.
tripwire ,
.
:
# tripwire
T r i p w i r e ( t m ) ASR ( A c a d e m i c S o u r c e R e l e a s e } 1 . 3 . 1
File I n t e g r i t y Assessment Software
(c) 1992, Purdue R e s e a r c h F o u n o a t i o n ,
(c) 1997, 1999 T r i p w i r e
Security Systems,
I n c . A l l R i g h t s R e s e r v e d . Use R e s t r i c t e d t o

21.

705

Authorized
## Phase
* I Phase
ft Phase
## Phase

Licensees.
1:
Reading configuration f i l e
2:
Generating f i l e l i s t
3:
Creating file information database
4:
Searching for inconsistencies

##
#t
##
#1

Total

f i l e s scanned:
Files added:
Files deleted:
Files changed:

20344
0
0
1

##
##

Total

file

violations:

II
changed:

ti

#t
#

Phase

-rwxr-xr-x root
5:

t# Attr
bin/tcsh
st_ctime:

262184

Generating
Observed

Sat

Jan

Jan

(what i t i s )

22

22

12:04:42

observed/expected pairs

12:04:42

2000

2000

for

Expected

(what

Fri

14

May

/bin/tcsh

changed
it

files

should

05:11:41

be)

1999

! tripwire ,
/bin/tcsh
. .
/bin/tcsh " ",
root.

( siggen. tripwire) JTO .

, tripwire
.
tripwire :
,
. , ,
- Tripwire. Inc.,

. Web-
www.tripwiresecurity.com.
:
(The Coroner's
Toolkit ),
. ,
.
Solaris, Red Hal FreeBSD, HP-UX ().
,
. ,
. mactime.
,
.
,
, , ,
www.fish.com/securiiy.

706

II.

21.8.


UNIX
W W W
. , ,
. .

, . ,
. , .
?
.
.
, .
, ,
,
".
,
, , .
, .
.
, ,
,
, .
,
, -
. .
.
Kerberos:
Kerberos.
, ,
. Kerberos ,
"" ,
, .
.
DES. Kerberos . .

. , Kerberos.
(
) Kerberos.
, , "",

, , : 'RSA Labs" Frequently Asked Questions. about Today's Cryptography"


(www.rsasecurity.com/rsalabs/faq) - sci.crypt,
FTP- rtfm.mit.edu.

21

707

. , Kerberos
UNIX :
,
.
Kerberos
.
Kerberos . ,
( web mit.edu/kerberos).
, Kerberos Solaris
HP-UX, FreeBSD .
Cisco,
. Microsoft
Kerberos Windows 2000,
.
Kerberos
, , :
"Designing an Authentication System: a Dialogue in Four Scenes" ( , ),
(Bill Bryant;. ,
.
http://web.mil.edu/kerberos/www/dialogue.litmI
FAQ-:
http://www.nrI.navy.mil/CCS/people/kenh/kerberos-faq.html
Kerberos,
. , Kerberos
, .
,
. ,
. Kerberos
, SSH SRP (. ).
.
P G P :
PGP (Pretty Good Privacy),
(Philip Zimmermann), , . PGP ,
.
,
.
,
Network Associates (www.nai.com). PGP. .
Web- www.pgpi.org.
PGP . ,
UNIX ,
. , 88-
,

708

II.

, PGP ,
- .
Windows- PGP, UNIX- pgp
38 .
, Internet,
PGP.
- ,
PGP. , , ,
PGP ,
.
, .
S S H :
SSH (Secure Shell), (Tatu Ylonen),
rlogin, telnet.
.
SSH it IETF.
tripwire, SSH
(SSHI) (SSH2).
.
, .
, SSH2
, .
SSH1, .
SSH1 ftp.ssh.com/pub/ssh.
, . OpenBSD
,
,
. OpenSSH Web-
www.openssh.com. , ,
.
,

SSH ,
RSA.
2000 .
SSH sslid
! : ssh.
, scp. .
ssh-keygen,
, ,
X Windows.
sshd
. .
. ,
, "Y.rhosts, ~/.slosts, /etc/hosts.equi>
/etc/sliosts.equiv,
. rlogin . ,

21

" 09

. - sshd

. ,
( )
/elc/ssh_Jknown_hosts
~"/.ssh/known_hosts . (
/etc/sshhostkey. ),
.
, .
, .
sshd
.

,
.
(
).
. , sshd
. ssh
telnet, ,
. ,
( 8 ), (,
crack) . ,
, .
/etc/sshd config
""*,
. ,
, . 21.1.

2 1 . 1 . , ^ / e t c / s s h d _ c o n f i g

cation
RhostsRSAAuthentxcation

IgroreRhosts
Ignore RootRhos s

RSAAutherit x c a t i o n

PasswordAuthentication

,

"/.shosls, /etc/shosts.equiv
.

RhostsAuthentJ.


~/.shosts .

~/.rbosts hosts.equiv"

root
.rhosls .shosls

, "/.shosls shosts.equiv .
i g n o r e R h o s t s .

710

II.

,
, , :
RhostsAuthenticaLion no
RhostsRSAAuthentication no
RSAAuthentication
yes
PasswordAuthentication
yes

SRP:
SRP (Secure Remote Password), By
(Thomas Wu) , , ,

. , SSH,
.
,
. ,
SSH,
telnet ftp. ,
.
telnet ftp. SRP
. , .
, UNIX
DES SRP, SRP
/etc/passwd. SRP
( Web- srp.stanford.edu)
(/etc/tpasswd). SRP-
passwd,
.
O P I E :
, SSH SRP.
,
, .
, . SSH
,
.
OTP (One-Time Password ),
RFC 1938.
: , ,
.
, . -
. 11
. ,
, .
OTP-
OPIE (One-time Passwords In Everything
). S/Kev
Bellcore ( Telcordia Technologies),

21.

711

- - . OPIE OTP-
telnetd ftpd,
. OPIE www.inner.net/pub/opie.
, OTP- ,
. ,
. , telnet,
,
. , (
sudo, ), ".
SSH,
OPIE.
, :
,

21.9.


.
. :
, .

, , Iniernei ( ,
), .
, ,
, (
) , .
(, Cisco). ; , ,
.
,
.
Red Hal FreeBSD (.
13.14 13.15).
.
,
UNIX- " ,
, PIX
Cisco.

: -,
OTP
.
,
, Windows . Windows \
- ? : Windows
.

712

II.


""
/etc/services ( - ). ,
, ,
".
"". ,
1 1023
, root.
1024 .
, (, TCP U D P )

. ,
192.108.21.200 SMTP-,
, TCP-
25 TCP-
".
.
, FTP. - FTP
: , .
, . . Iniernei FTP,
TCP-,
, .
FTP-cepeepa 22.6.
,
, ,
(, XII 6000).
,
(,
telnet ),
Internet.

, , SMTP. ,
, .
, ,
. Internet
,
. ,
, . ,
Internet
.
mefd.
2S.3.
25 SMTP, /etc/scrvices.

21.

713

FTP
. ,
,
.
FTP- ,
. , FTP-
.



,
.
, .

, . 90- .
,
. , ,
.
, Iniernei.

:
( )
, -
.
, , ,
. , , '
FTP-, , 4cpei
, ,
.
, , .
, .
,
. , -,
,
.
"
"?
, "" . , , . ,
.
.



. .

7.

II.

,
. , , ,

, , crack, tcpd. nmap, COPS
tripwire. ,
"" .
Internet,
Internet- !. ,
FTP-,
SMTP-
Internet- ,
.
, , "" .

21.10.

. .
,
- ,
.
CERT
Internet-""
D A R P A (Defense Advanced Research Projects Agency

) C E R T (Computer Emergency Response
Team " ")
, . C E R T
,
. ,
.
" -".
, . C E R T
, ,
.
"",
,
. "" " CERT".
Web- www.cen.org comp.security.announce.
. ,
http://www.cert org/contuct_cen/cenmaillist.html

21

715

SecurityFocus.com B u g T r a q
SecurityFocus.com . ,
, .
, .


.
.
BugTraq
. ,
listserv@securityfocus.com :
SUBSCRIBE B U G T R A Q ,
, ,
. Web- BugTraq .
S A N S
SANS (System Administration, Networking and Security Institute
)
, , . Web-
www.sans.org ,
SecurityFocus.com CERT:
, , , .
SANS
, .

^
[


,
, .
.
Web-. , "" ,
'.
Internet Web-, www.securitvfocus.com,
, ,
-.
Sun.
, security-alert@sun.com.
'subscribe cws ".
Web- sunsolve.sun.com.
Hewlett-Packard Web- : us-support.external.hp.com europe-suppon.extemal.lip.com
. ,
, . ,
"maintenance/support" (/)
"search technical knowledge base" ( ).
.
"". ,

711
II.

_
(tj

..
FT,
w7

"maintenance/support"
''support information digest" "notifications". ,
, , .
Red Hat
www.redhai.com/suppon/errata.
, Red Hat. ,
Linux. Red Hat.
FreeBSD
www.freebsd.oig/security.
FreeBSD, .
" " (security officer),
.
Cisco
, www.cisco.com/warp/public/770. ,
Cisco, majordomo@cisco.com,
"subscribe cust-security-announce".
Web-

, Internet. .
, ,
,
"".
Web-
-Force (xforce.iss.net) Internet Security Systems,
F -.
,
"" .
, www.yahoo.com,
.
"Computers and Internet", , UNIX,
.

21.11.
: . ,
.
, "" .
, ,
, .

"".
,
- ,
, , ,
. (:
. , ?!)*

"" , .

21

" 717

. , ,
60% , ,
" ". ,
, .
, , ,
1: .
- . -
. , :
.
.
2: .
. . ,

. '"
", .
3: .
,
''". . ,
,
.
4: . ,
( ) ''" ,
. .
5: . ,
"" .
. Compromise FAQ ISS
, "" .

http://xforce.iss.net/securiLyJibrary/faqs/coinpromise.php3
6: .
. . , .
. ,
.
7: .
"",
. . ,
, .

- , .
90% , , .
8: ,
- . .
, .
9: .
" ", CERT
( cert@cert.org).

Web- www.cert.org.
, :

718

II.

"" ,
;
"",
;
, ;

IP- , ;
;
.

, -.

21.12.

Bryant, William. '"Designing an Authentication System: a Dialogue in Four


Scenes". web. mil.edu/kerberos/www/diaIogue.html.
CERT
Coordination
Center.
"Intruder
Detection
Checklist".
www.cert.org/tech_tips/intruder_detection_checkIist.html.
CERT
Coordination
Center.
"UNIX
Configuration
Guidelines".
www.cen.org/tech_tips/unix_conriguration_fuidelines.htmI.
Cheswick, William R., and Steven M, Bellovin. Firewalls and Internet Security,
Second Edition. Reading, MA; Addison-Wesley. 2000.
Curtin. Mali, and Marcus Ranum. "Internet Firewalls. Frequently Asked
Quest ions". www. interhack. net /pubs/fwfaq.
Fanner. Dan. and Wietse Venema. "Improving the Security of Your Site by
Breaking Into it". 1993. www.fish.com/security.
Fraser, ., Editor RFC2196: Site Security Handbook, www.rfc-editor.org.
GaiTmkel, Simson, and Gene Spafford. Practical UNIX and Internet Security.
Sebastopol: O'Reilly & Associates, 1996.
Kerby, Fred, et al. "SANS Intrusion Detection and Response FAQ".
www.sans.org/newlook/resources/I DFAQ/I D_FAQ.htm.
Mann, Scott, and Ellen L. Mitchell. Linux System Security: The Admmisirator's Guide
to Open Source Security Tools. Upper Saddle River, NJ: Prentice Hall PTR. 2000.
Morris, Robert, and Ken Thompson. "Password Secunty: A Case History".
Communications of the A C M , 22 (11): 594-597. November 1979- UNIX System Manager's Manual. 4.3 Berkeley Software Distribution.
University of California, Berkeley. April 1986.
Pichnarczyk, Karyn. Steve Weeber, and Richard Feingold. "'UNIX Incident
Guide: How to Detect an Intrusion". Computer Incident Advisory Capability.
U.S. Department of Energy. 1994. http://www.ciac.org/cgt-bin/index/docunients.
Ritchie. Dennis M. "On the Security of UNIX". May 1975.
UNIX System Manager's Manual. 4.3 Berkeley Software Distribution. University
of California, Berkeley. April 1986.
Schneier, Bruce. Applied Cryptography: Protocols. Algorithms, and Source Code
in C. New York, NY: Wiley. 1995.
Thompson. Ken. "Reflections on Trusting Trust". A C M
Turing Award Lectures: The First Twenty Years 1966-1985. Reading, MA: A C M
Press (Addison-Wesley). 1987.
Zimmermann. Philip R. The Official PGP User's Guide. Cambridge: MIT Press,
1995.

21.

719

^ ^

Web-
Internet


. UNIX - ' ", - Internet.
80- . UNIX
,
. 90- .
'' ",
- . UNIX
, .
Internet, ""
() ,
*.
: W W W , FTP .

22.1.

Web-
90- . UNIX ,
W W W . " "
(
),
. UNIX " ".
,
.

, , UNIX,
. Web-

, Web-, ASP (Application Service Provider


).

715

II.

, Web-. Web- (HTML), , FTP, SSL,


-
, ,
Web-.

Microsoft Windows. .
, ,
, UNIX.
,
" Web-". Windows UNIX.
,
" !" " !".
, , , ,
UNIX Web-.
UNIX . UNIX .
,
-,
Web-. Windows
(
, -where). :
UNIX ,
- , Windows.

22.2.

Web-
Web- .
W W W HTTP (HyperText Transfer Protocol
) TCP/IP,
,
. ,
, , , . HTTP
- , Internet,
SMTP ( ) FTP ( ).
Web-cepeep , HTTP-. UNIX- Web-, , -
80 ( HTTP),
, .
Web-, Netscape Internet Explorer,
Web- . () , ( )
, .
HTTP , ,
, HTTP.

22 Web- Internet

72 3


HTTP.
, , Web- ""
HTTP ,


,
HTTPS (Secure H T T P HTTP). ,
SSL (Secure Sockei Layer
) TCP- 443.
, .

U R L (Uniform Resource l ocator )
Internet.
:
:
:
TCP/IP ():
();
( ,
".htm" ".htm!").
URL- . .

www.apacne.org
/foundation.

http://www.apache.org/foundatiori/FAQ.htmI

FA . html.
*

. . UPL-
. 22.1 , URL-.
22.1. URL

http
https
ftp

722

- hup:// adm i . com/indcx.html


HTTP
- 1://ad in in .com/order.shiml
1 ITP/SSL
- ftp://ftp.xor.com/adduser.tar.g2

II.

mailto

mHilto:sa-book@adimn .com
no
Usenet news: alt.cooking

news

telnet

- teLnet://spot.acme.com

Idap
file

LDAP

ldap://ldap.bigfoot . m:389/cn= Herb

( file://etc/syslog.conf

Internet)

HTTP
HTTP - ,
.
( ).
"-" URL-. ,
.
( H T T P 0.9 1.0; HTTP 1.1
).
HTTP , Web-
telnet. 80 Web-.
HTTP-.
GET,
. G E T /,
, , , . H T T P
,
.
% telnet localhost 80
Trying 1 2 7 . 0 . 0 . 1 . . .
Connected to l o c a l h o s t . x o r . c o m .
Escape c h a r a c t e r i s ' ] ' .
GET /
<. i n d e x . h m l >
Connection closed by f o r e i g n h o s t .

C G I - : W e b -
, HTTP-
, " ". ,
, , .
CGI (Common Gateway Interface
).
CGI , , ,
, HTTP
. CGI-
, Perl
HTTP-.
,
- .
F O R T R A N Internet!

22 Web- Internet

72 3

, CGI- Web-
.
.
. CGI-
,
,
, HTTP-, .
CGI-
. CGI-
, CGJ-
www.w3.org/Security/Faq/www-security-faq.html.

, (
, )
(
) . , ,
, Web- ( ,
HTML-,
).
, ,
. ,
. ,
U N 1-.
. .
,
,
Load Director Cisco Alteon ACEswitch.
, ,
.
.

22.3.

HTTP-
Web-cepnep ! Web-

DNS.

UNIX HTTP-
(, FreeBSD Red Hat HTTP-
Apache). ,

. ,

724

II.

.
Netscape Apache*.
HTTP- Web- webcompare.iniemet.com.
,
;
;
:
;
;
;
-;
.
Apache .

.
A p a c h e
HTTP Apache ,
Web- www.apache.oig.
.
configure ( ). ,
.
, Apache. --prefix:
%

./configure prfi*=/uer/local/apache/

Apache
-enable-module= -disabIe-module= configure.
,
(. 22.2)
22.2. Apoche,

auth dbm

D B M

aulli_db
usenrack

" .

/ ()1
DB
/ ()1
,
"cookie''

rewrite

URL-,

expires

proxy
1

Apache - (

)
( ).

Apache , ""
httpd Web- NCSA ( 1993 .).

22 Web- Internet

72 3

. 22.3 , .
, .
22.3. Apoche,

asis


HTTP-

autoindex

, HTML-crpa (, index.btinl)

env

CGI

mcludc

(
)

userdir

HTML-

ire/Configuration, Apache, www.apache.org/


docs/mod/index.himl.
configure make make
install .
FreeBSD Apache
, /usr/ports (
27.9). Apache
/usr/ports/www/apachl3 make.
A p a c h e

. conf
(, /usr/local/apache/conf).
: httpd.conf, srm.conf access.conf.
httpd.conf , Apache (httpd) . TCP-,
HTTP- ( 80).
HTTP-,
. httpd.conf
, ,
.
(
).
, ,
srm.conf. DocumentRoot.
.
, ,
, "" URL- (, hup://
www.xor.com / ~ steve).
access.conf ,

726

II.

.
httpd , .
:
,
cgi-bin.
cgi-bin. ,
""
.
ExecCGI srm.conf.
Apache
httpd
, . ,
, Web-cepBep
.
:
% /usr/loc&l/apache/apachactl start
, httpd
, localrc()
/etc/rc.local,
.
if

- / u s r / l o c a l / a p a c h e / h t t p d
/usr/iocal/apache/apachectl
e c h o n ' w w w _ s e r v e r 1

];
then
start

fi

22.4.


UNIX- Web- (, www.acme.com). W W W
1
Web-,
, Web-
.
,
.
, .
.
, (
H T T P 80), IP- .
Web-.
, . : UNlX-
IP-, .
''" .
Internei.
UNIX- Web-. ( :
, Intel.

22 Web- Internet

72 3

,
Web-.
.)
H T T P 1.1 ,
( " , IP-"),
IP- Web-
.
IP-, ,
(,
Web-).
,
( IP-
) (
IP-). ,
.

.
TCP/IP.
UNIX;

Apache .
Solaris
Solaris ( "
"),
. , . h m e O : i . h n i e 0 : 2 ..
256
. ,
ndd xp_addrs_per_if (
ndd 13.12).
,
ifconfig, (
.)
. ifconfig

, , Solaris,
(Virtual Private Network, VPN), Internet-
hir.eD.
, , : /etc/hoslname.hmeO /etc/hostname.hmeO:I.
% 1 -1 /etc/boat*
-rw-r--rw-r

728

1
1

root:
roo:

10
LD

Nov
4 10:19
Dec 2 1 19;34

/ e t c hostname.hrr.eD
/ecc/hosnname.hmeC:1

II.


/etc/hosts, IP-.
:
4 cat /otc/hostnamo-hmaO
overkill

% cat /c.fcc/hoBtnamci. famqQ : 1


206.0.1.133

% grep overkill /etc/hoste


10.1.2.9

overkill

overkill.domain


( ,
):
% ifconfig -
hmeO: flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST > mtu
1500 i n e t 1 0 . 1 . 2 . 9 n e t m a s k f f f f f f O O b r o a d c a s t 1 0 . 1 . 2 . 2 5 5
hir.eO : 1 : E l a g s = 8 6 3 < U P , BROADCAST, N O T R A I L E R S , RUNNING, MULTICAST> m t u
1500 i n e t 2 0 6 . 0 . 1 . 1 3 3 n e t m a s k f f f f f f B O b r o a d c a s t 2 0 6 . 0 . 1 . 2 5 5

HP-UX

HP-UX 11.00 , "", , . Solaris. lanO


, 10:1
. I" IP-.
( )
ifconfig IP-,
.
HP-UX 10.20,
"", ' i (alias
.
Red Hot
Red Hat
.. Solaris HP-UX. ,
Ethernet e t h O ,
eth0:0, eth0:l ..
ifconfig. ,
# ifconfig ethO:0 128.138.243.150 netmaek 255.255.255.192 up
eth0:0 128.138.243.128/26
,
/etc/sysconfig/nctwork-scripts.
ifcfg-eth0:0, ifconfig
;
DEVICEethO:0
IPADDR=128.138.243.150
NETMASK=255.255.255.192
NETWORh=l28.138.24 3 . 1 2 8
BROADCASTS 2 8 .] 3 8 . 2 4 3 . 1 9 1
ONBOOT^yes

22 Web- Internet

72 3

FreeBSD
FreeBSD ("IP-") alias ifconfig. ,
IP- 1:
# ifconfig xio inet 192.168.0.1 netmask 255.255.255.255 alias
,
ifconfig :
% ifconfig
: flags=8e43<UP,BCAST,RUNNING,SIMPLEX,MCAST> mtu 1500
i n e t 1 9 2 . 1 0 8 . 2 1 . 9 netinask O x f f f f f f O O o c a s t 192.108.21.255
inet 192.160.0.1 netmask O x f f f f f f f f beast 192.168.0.1
e t h e r 00: 60-.97:9b: 69:9a
media:
lObaseT/UTP < h a l f - d u p l e x >
supported

media:

autoselect

lOObaseTX < h a l f - d u p l e x >


10ioaseT/UTP lObaseT/UTP

lOObaseTX

<full-auplex>

lOObaseTX lObaseT/UTP
<half-duplex>

<full-duplex>

IP-,
.
ifconfig delete:
# ifconfig inet 192.168.0.1 delete

, rc.conf:
ifconfig_xl0_lias0"inet

ifconfig_xlO_aliasl=,'..."

192. 1 6 8 . 0 . 1

netniask

255.255.255.255"

aliasCi .
A p a c h e

ifconfig
Apache ,
.
V i r t u a l Host
httpd.conf.
V i r t u a l H o s t . :
<VirtualHost
192.225.33.37>
S e r v e rAdmin webmas t e r P w w w . c o m p a n y . com
DocumentRoot
/usr/local/apache/hcdocs/company
ServerName www.company.com
ErrorLog
logs/www.company.com-error_lcg
TransferLog logs/www.company.con-access log
</VirtuaIHost>

192.225.33.37
/usr/Iocal/apache/htdocs/company.

725 II.

22.5.

-
Internet
. , ,
, .
""?
. , ,
,
Internet . ,
, Web-
,
.
. ,
.
Squid (
)",
- UNIX
, HTTP. FTP, Gopher SSL.
. Web- (
Netscape Internet Explorer) Squid,
Internet. (
) . -
,
.
, -,
Internet .
-
, .
( Squid).
, Squid
. Squid ,
,
. Squid
ICP
(Internet Cache Protocol Internet).
,
Internet-
.
, ,
( 10 100 /).
Squid
.
, -
,
. ( ).

""? , " ".

22. Web- Irfernei

731


.
Squid . Internet ,

Web-. ,
40%.
Web- .
S q u i d
Squid ,
UNIX-.
, ,
. : 256 20 .
Squid www.squid-caclie.org.
configure,
. ,
/usr/local/squid
, 1= configure.
make all,
make install.
/usr/local/squid/etc/squid.conf QUICKSTART. ,
, squid.conf
/usr/local/squid/bin/squid -z,
,
Web-. ,
/Bsr/Iocal/squid/bin/RunCache, - Squid
.
Squid
- Web-

22.6.

FTP-
FTP Internet.
.
, Internet " -",
,
.
FTP- ,
. ,
HTTP. ,
,
.
- H T M L
.
FTP-
ftp.
ftpd. FTP-

732

II.

, ,
.
ftpd iuetd, ,
/etc/inetd.conf /etc/services. FTP- , ftpd
1 chroot. , ~ftp,
. ,
ftpd SUID,
root, .
inetd 28.3,
,
FTP-:
ftp ;
bin. etc pub ~ftp;
Is "ftp/bin;
/etc/passwd /etc/group ^ftp/etc;
passwd group, ;

~ftp/etc/passwd ;
R ~ftp
ftp.
.

/bin/false.
FTP-
~ftp chroot),
bin etc ,
ftpd. chroot ~ftp/bin
~ftp/etc /bin /etc. ftpd
Is /etc/passwd
/etc/group "ftp/etc.
passwd
root, daemon . ,
FTP-.
, , *.
21.3.
~ftp/bin/ls
, III.
.
.
~ftp/pub ,
.
, Is ,
~ftp
. .
inkpasswd passwd
.

22 Web- Internet

72 3


chroot

. . 22.4.
22.4 ftp

JT^ij

VJv

22.7.

-ftp

root

555

~ftp/bin

root

555

~ftp/bin/U

root

III

"" ftp/etc

root

555

~ftp/etc/passwd

root

444

""ftp/etc/gronp

root

444

~ ftp/pub

root

755

Solaris , Is
ftp/usr/bin "ftp/bin nsr/bin to ""ftp/usr/bin.
chroot ).
Solaris ,
Is "ftp
.
- ftpd.
/etc/netconfig ~ftp/etc.
HP-UX /etc/group /etc/logingroup.
"ftp/etc.
FreeBSD, Red Hat
, ~ftp
, -
,
.
-, ftp
passwd ( FreeBSD
) pwd rnkdb. - pwd.db).

Usenet
Usenet , 70-
("")
ire , ,
. Usenet
" ", , Web- .
Usenet Web-. Usenet,
.

734

II.

Usenet "" .
, , *. ("") , . >
. . ,
, . ,
, .
Usenet
( )
100 ( ).
,
50%.
Usenet -
MPEG, .
.
, Usenet
" , ".
I ,
, 35 .
. ,
Internet (

)
". ,
,
.
Usenet
Usenet, (www .su mews, com
www.giganews.com).
,
.
( )
.
, .
,
.
.
(
) , , .

.
(Sprint.
WorldCom, AT&T ..).
.
** ( 97%) "all",
"alt.binaries" (92%).

22 Web- Internet

72 3

, ,
,
.
, ,
.
,
, .
, :
, ,
". ,
. ,
. ,

.
Usenet
,
,

.
.

. 22.5.
2 2 . 5 .
?

INN

Web-
, - www.isc.org

Diablo

, - www.openusenet.onj
,

Dncws

, - netwinsite.com
,

Cyclone

Typhoon/Breeze

discussion.openwave.com

discussion.openwave.com

Usenet?
, Usenet. W W W
, Usenei.
.
, / Usenet
, .
,
, Usenet
, " , , ".
, , , .

736

III

,
- ASCII-.
, .
.
, ,
- . .
.
- .
,
.
, ,
Ethernet,
-.
.
,
, UNIX-
. , . - ,
.
BSD- (Ipd.
Ipc, Ipr .), System V (Ipsched, Ipadmin, Ip ..),
.
, ,
, (!pd BSD Ipsched
System V). .
,
. , HP-UX Ipr.
, System V.

23.

/39

,
, BSD System V.

, , ,
.

23.1.

-
,
.
, ,
.
,

.
.
dpi
. ,
,
. , dpi. ,
() . ,
. , "300x600 dpi"
300
600 .
PDL
P D L (Page Dcscripiion
Language) .
. ,
PDL, , ,
, .
,
.
.

PDL
(bitmap) ,
. ,
( ,
). ,
, PDL
.
, .

.
RJP

740

(Raster Image Processor. RIP)


,
P D L
, .

III.


, ,
PDL-
.
.

.
,
" " .
,
. , ,
, ,
,
. PostScript , . System V
.
23.3.
PostScript PostScript
P D L UNIX-. Adobe
Systems Incorporated, . PostScript
,
.
PostScript, , .
.
. PostScript- , %!. UNIX- ,

.
PCL
PCL (Printer Command Language)
Hewlett-Packard PostScript.

Hewlett-Packard. UNIX-, ,
,
HewlettPackard PostScript- .

23.2.


UNIX
. (, . ) , ""
(, PostScript, PCL ).
, Windows {
WinPnnters) UNIX.

23

741

"" PDL.
, ,
.
UNIX- .

.
7. ""
,
.
-.
,
, , ,
.
, ,
.
Red Hat Linux ( )
/ d e v / p a r p o r t O : FreeBSD / d e v / l p t O .
Universal Serial Bus (USB)
UNIX. USB , Windows, UNIX
. , ,
FreeBSD Linux - USB.

,

.

, , . ,
.
,
1 lpr,
.

, . JTO

,
, .
,
. , -
.
Ipd-cepBep UNIX-

/42

III.

. BSD-.
lpd-,
.
,
- 9100.
BSD System V,
LPRng. ,
LPRng 23.6.
PostScript
PostScripi-, ,
UNIX, . , , ,
, .
,
PostScript, ,
"" PDL. .
. , .
ghostscript.
PostScript- PDL-. .
, " "
ghostscript . ghostscript . LPRng
.
ghostscript 23.8.

23.3.

BSD-
BSD
- . , ""

. BSD

.
Ipd -
.
Red Hat FreeBSD
BSD
.

BSD- Ipd,
/usr/lib
. Ipd
() Ipd,
. . Ipd
/etc/prmtcap ,
.

23

743

, Ipd,
lpr.
/dev/printer.
,
. 1 -,
.
PRINTER.
, .
, .
, , Ipq Iprm, -
PRINTER.
lpr ,
,
(/etc/printcap). lpr ,
.
" " /var/spool/_.
lpr .
cf (control file) ,
*.
, , .
,
999
df (data file)
. ,
. lpr Ipd
.
, Ipd printcap
:
printcap , , Ipd
, , (.. ).
,
Ipd Ipd
Ipd
.
"
" (FIFO),
1. ,
,
,
.
, Ipd

, . Ipd -, . ,
,
.
- .
lpr tf (temporary fde).
lpr tfxxx cfxxx.

744

III.

, . Ipr



: Ipq, Iprni Ipc. Ipq
, .
Iprni (

). ,
, .
1 : ,
.
, .
2 3 . 1 . BSD

Ipq

/usr/bin

Ipr

/usr/bin

Iprni

/usr/bin

Ipc

/usr/sbin

Ipd

/usr/sbin

Iptest

/usr/bin

ASCII-

Ipunlock

/usr/bin

"" ( Red
Hat)

printtool

/usr/bin

(
Red Hat)

Iptcontrol

/usr/sbin


( FreeBSD)

Ipd: BSD-
Ipd ,
/etc/printcap, .
- ,
, .
Ipd, -1.
Syslog "ipr". -I
.
,
BSD
* ,

.
, .

23.

745

/etc/hosis.equ /etc/hosts.Ipd.
. , -
/etc/hosts.equiv "" -
/etc/hosts.lpd
. ,
LPRng
hosts.equiv 21.6.
lpr:
BSD.
. lpr.
, (, cnscripi
netscape), . lpr.
1
. -# ,
, -h .
, , -5 ,
, .
, thesis howlcr-lw.
:
%

lpr

-Phowler-lw

-#2

thesis

Ipq:
Ipq -
, . Ipq :
* Ipq
a n c h o r - - I j i s r ea d y a n d p r i n t i n g
Rank
Files
Owner
Job
active
garth
314
domain.2x1.ps
1st
kingery
286
standard
input
2nd
evi
12
appendices
3rd
garth
13
proc
4 th
14
scout
periodic
5th
garth
16
standard input

Total
296778
17691
828

Size
bytes
bytes
bytes
43229 b y t e s
16676 b y t e s
489 b y t e s

,
. ,
; . 1st. active,
, .
,
. ;
,
Iprm 1.
lpr , .
(. ,
), s t a n d a r d i n p u t .
.
-
. .

746

III.

Iprm:
Iprm Iprm _,

Ipq. Iprm , . Iprm .
Iprm
, ,
root, ,
.
,

Iprm
, .
-
dfA621xinet
cA621xinet

dequeued
dequeued

, Iprm .
( ,
,
Iprni. . ganh@bou!der ganh@sigi.
.
Iprm
( ,
TranScript Adobe). ,
, -
,
.

- ps
. Ipc . ,
Ipd ,
. ,
Ipd.
Ipc:
Ipc :
$
;

:
:

;
Ipd;

. ! .
, Ipc
. ""
, 1 " "
, , : ,
,

23.

747


, .
1 ;
, .
,
1.
1 .
ha 1 [ I

help ,
, 1.
.

disable


.
, .

/\nr/spcol//lock .
start
stop

start , stop
.
, , .

/var/spool/wpwiwep/lock. ,
.
stop,
.
abort

abort , stop,
.

down
up

, .

.
down ( )
.
/\/&//$ ,
Ipq , ,
. up down
clean

748

III.

,
.
, .
topq _
topq _

lopq
, , _.
tart

,
"". , "", ,
Ipq : "No daemon present".
, restart stop/start, :
, restart
.
atatua

:
, ,
, .
,
1> at-at.ua
:
queuing is enabled
printing
is enabled
no entries
no daemon p r e s e n t


; , ""
Ipd
.
/etc/printcap
/etc/printcap BSD- .
,
.
/etc/printcap ,
/etc/termcap /etc/remote.
, (|).
, .
= #, ,
.
, ,
"".
: , . , . /etc/printcap

23.

749

(#).
, , ,
.

.
/etc/printcap
. ,
printcap

HP

LaserJet

5 r e m o t e p r i n t c a p .

CS

Department.

a n c h o r - l j I c e r 1 1 - 5 6 I L a s e r J e t 5M in c e r l a b : \
:lp^/var/spool/lpd/anchor-lj/.null:\
:sd~/var/spool/lpd/anchor-lj:\
:lf=/var/adm/lpd-errs:N
:rw:mx#0;rm^anchor:rp^anchor-1j:

, c e r . a n c h o r - 1 ] , 1 - 5 6 L a s e r J e t 5
in c e r l a b .
, , R
, .
,
'

(- , , cer);
( , a n c h o r - l j ) ;
( , LW P l u s in c e r l a b ) .
(1). (sd)
( I f )
, - (r-.v),
(inx. ),
(rm) ().
, , ,
"1 . "ip" ,
.
printcap
" " BSD printcap.
printcap - ,
.
. 23.2.
printcap
(sd). (If)
). , ,
(rw).
.

750

III.

23.2

prinlcop

sd

sd=/var/spool/lpd/howler-Iw

if

l~/var/iog/lpr

Ip

lp-/dev/lpC

a i

af=/usr/adm/lpr.acct

rrn

r m = o e a s t . x o r . com

rp

rp=howler-1w

of

of=-/usr/libexec/lpr/lpf

if

if=/usr/sbin/stylascii

rax

mx#0

sh

sh

sd:
.
( JTO
/var/spool) ,
( a r . c h o r - l j )
,
: .
.

775. ,
daemon
:
lock s t a t u s . s t a t u s
. Ipd Ipq.
lock .
Ipd , ,

Ipc

lock
If:
, , , .

. - " " /var/adm/lpderrs.
, ?

//.

23.

751

, Ipd
Syslog.
Syslog.
printcap .
.
1:


. , ,
SCSI-, /dev.
. printcap
(.. , " " ; .
23.8), 1 ( d u m m y )
( ,
).
ipd ,
1 , ,
.
, 1 .
,
.
rw:

( r w ) ,
, . - ,
,
.
af:

, , , .
,
,
.
.

/\//-accl.
,
( ), ,
, .


. PostScript-
,
.
:
,
. ( -) .
PostScript- P C L -
.

7 5 2

III

, ,
,
)' .
.
,
, (0 ), ,
,
.#0). , ,
=0.

,

LPRng.
rm :
,
. ,

.
. Ipd ,

. , , ,
.
printcap " " (,
)
, , ( ,
). rm ,
,
. .
, /etc/printcap , , ,
, .
:
, howler-Iw-local
howler-Iw. howler-lw " "
, , . ,
. Ipc,
howler-Iw-local.
o f . If, nf:
,
( /usr/lib/lpf),
, ,
. U N I X
,
, . ,
, , ,
trofT
.
, ,
. , , , ,

23.

7 5 3

.
, ,
,

.
, , shell,
- , ,
,
.
lpr ,
, .
,
.
/ e i c / p r i m c a p i f . o f , ,
.
, , Ipd
-
, . ,
; ,
, .
/ e t c / p r i n t c a p , . of
(
, ) ,
. ,
.
,
: .
,
.
, .
,
.
(,
guest ) ,
, Ipd

Post S c r i p t - -

, :
#!/bin/csh -f
/ u s r / l o c a l / b i n / t e x t p s $*

/usr/local/bin/psreverse

, Ipd

/etc/priittcap. lextps.
. PostScript
( ), .
($*)
.

754

III.

, psreverse,
.

printcap


, . , .
, ,
, .
printcap
: ,
.

,
b r .
:
, , , >


.
7.
printcap
. .
. , (#)_ , b r # 9 6 0 0
9600 /.
fc fs:
(. )
,
.
- ,
tty ( 4, I) ,
.
, .
, : f c f s . f c (flag c l e a r )
, , a f s (flag set )
, . ,
, , .
(
).

tty.

xs :
-
, . xs
, fc fs

23.

755

,
,
.

.

printcap
Ipr/lpd :
printcap.
, ,
, printcap , .
,
. printcap
:
: nn="laser. C o l o r a d o . e d u : \
, .
printcap , -,
.

.
:lo-Roora 423, Engineering building:\
,
" , 423 " .
20.


" " , (Sean ),
B S D
, ,
, ,

printcap :
mp3-local;\
: sd=/var/spool/lpd/inp3-local: \
:lf-/var/log/lpd-errs:\
:if-/usr/local/lib/mp3-play:\
:lp/dev/null:\
:mx#C:
- , amp,
stdln, , , mpS-play,
:
#'/bin/sh
exec /usr/local/bin/amp -

756

III.

23.4.

System V
, System V
,
. ,
, .
System V Solaris
H P - U X . . ,
.

, - , 1, , 1.
1 , . Ipsched ,
,
,
. System V
. 23.3.
23.3. -

accept

/usr/sbin

cancel

disable

/bin

enable

Ip
8
0>

/bin

Ipadmtn

/usr/

Ipmove

/usr/sbin

Ipsched

/usr/lib

Ipshut

/usr/sbin

Ipscbed

Ipstat

/bin

reject

/usr/sbin

Ipfilter

/usr/sbin

Ipforms

/usr/sbin

lpusers

/usr/sbin

Ipget

/bin

Ipset

/bin

Ipalt

/bin

Ipr

/bin

BSD-

/usr/sbin

.2

V)

g
Q_ Ipana
X ipfence

23.

/usr/sbin

757


,
14 , . ,
(
). , , ,
. , ,
.
,
.
,
- . , ,
. Ipsched ,
, ,
. ,
.
" "
" " ,
.

1
1 , . 1
(
, )
.
/var/spool/lp/request/c3, ,
1.
- ,
, 1,
,
.
" " .
1 -d ,
_,
_ . -d ,
1
L P D E S T , . , 1
,
, ,
, . (, ,
Ipadmin -d.)
Solaris, , ,
Ipadmin -d, 1 ~ .printers, /elc/priniers.conf . , Federated Naming Service* ,
.

-, Federated Naming Service. Solans


/etc/hosts, DNS, NIS, NIS+ LDAP. ;
.

758

111.

Ipsched Ipshut:
Ipsched
,
1. Ipsched ( / u s r / s p o o l / l p / l o g )
.
Ipsched / u s r / s p o o l / l p / l p g
/usr/spool/Jp/oldlog .
:
*** LP LOG: Jul
prl-107
-112
-117
prl-llB
prl-119
pr-132

12:05 *****

garth
scott
evi
garth
garth
evi

prl
prl
pr2
prl
prl
prl

Jul
Jul
Jul
Jul
Jul
Jul

6
6
6
6
6
6

1 2 :: 1 0
1 2 ;: 2 2
1? .42
1 2 :: 2 5
1 3 :: 3 8
1 3 :: 4 2

.
, .
, , , ,
.
, , p r l 2.
. g a r t h
p r l . .
s c o t t evi, , ,
.
- Ipsched
( , lpadmin). / u s r / l i b / l p s h u t
Ipsched , ,
1. ,
,
. Ipsched.
/usr/Jib/lpsched.
/usr/spool/lp/SCHEDLOCK ,
, Ipsched.
Ipsched Ipshut,
, S C H E D L O C K
.

lpadmin:
lpadmin
.
, ,
.
/usr/spool/lp.

: " !". ,
:
.
Solaris
Ipsched
, , .

23.

/ 9

ipadmin
Ipsched, Ipadmin,
Ipshut, Ipsched.
,
. .
, :
# /usr/sbin/Ipadmin - -^ { - [ -
J - } [ - ] [{ -1 I - }]
( ,
),
. ,
. 14- .
.
/dev.
-, - -i ,
.
,
. System V
BSD,
.
:
- .
,
, .
Ipadmin
.
-

,
. ,
,
/usr/spool/lp/model. ,

/usr/spool/lp/model/wo^ewb

/usr/spool/lp/interface/_.

-I

, . Ipadmin
,
Ipadmin,
/usr/spool/lp/interface, .

Ipadmin

H P - U X ,
.
,
( - -osm
).
, Ipadmin
:
- Ipadmin,
. ,
.
-
, .
.

760

111.

, .
14 .
~
,
. ,
, .
, reject,
. Ipmove cancel
. lpadmin - -
, , " " .
-
, .

, .
1 ,
( accept, .
).
,
( , ).
,
# / / f l b i n / l p a d m i n -p"howlex-lw, jralphie-lw" -ceng-printera
howler-lw ralphie-lw eng .
,
. , lpadmin.
. 23.4.
23.4. lpadmin

-pnpufimep

__

-i

-
-I
-\

, 1
, , ,

-D " "
1

, lpadmin I, .

23.

761

Ipadmin

# //lib/Ipadmin -phowler-lw -v/dev/tty06 -mPostScript -cpr


,
howler-lw /dev/tty06
. ,
PostScript. , Ipadmin
.

# /us/sbin/Ipadmin -dpr

) .

# /usr/sbin/Ipadmin -phowler-lw D"LaserJet named howler"


howler-lw.

if //ebin/lpadmin -howler-lw -rpr -cfast


howler-lw fast.

# /us/sbin/Ipadmin -xhowler-lw
howler-lw.
- , .
Ipadmin ,
Solaris H P - U X (. ).
Ipstaf:

Ipstat .
,
. -
. ,

% Ipstat -phowler-lw
howler-lw

is

now

printing

pr-125.

enabled

since

Jul

12:25

phowler-lw. Ipsched
Ipstat -.
% Ipstat -
scheduler

is

running

, . Ipstat
. 23.5.
*

"-Iw"
Apple LaserWriter.
.

762

III .-,

23.5. Ipstot

Ipsched

-d

-.1

-t

cancel:
cancel ,
.
( Ipstat),
( ,
).
, cancel 576 576. a cancel howler-lw
, howler-lw.
cancel :
1. bin, 6775,

, . ,
, .
, ,
.

accept reject:
(,
- ),
, ,
, . reject.
.
t /uer/lib/ject -"howler-lw will be down until Tuesday" howler-lw
Ip howler-lw.
- , ,

,
:
% /uar/bin/lp -dhowler-lw myfile
Ip:

cannot

23.

accept

howler-lw

requests

wi^.1

be

tor

down

destination

u n t i l

"iiowier-iw"

Tuesday

763

accept Ip
. accept
, Ipadmin,
,
.
, accept reject
.

enable disable:
disable Ipsched
. reject, disable
1
,
, enable.
disable ;
, -. reject, disable
-,
. , howler-lw

# /bin/diaablo -"Being cleaned, back in 5 minute" howler-lw



# /bin/enable howler-lw

Ipmove:
,
, .
Ipmove. . ,
I /uer/abin/lpmova howler-lw-324 howler-lw-325 anchor-lj
324 325 howler-lw
anchor-lj.
. ,
# //ebin/lpmove howler-lw anchor-lj

howler-lw
anchor-lj. Ipmove
: reject. ,
1
howler-lw.
H P - U X Ipmove ,
Ipsched. Ipshut.


Ipsched,
.
,
,

764

III .-,

. , ,
shell, .
Ipsched
:
^ [ . ..]
:

_ , 1;

, ;

( );

;
, .
;
.
/dev/null,
,
lpadmin -v.
BSD
. System V :
,
( ,
" " ).
,
, ,

.
,
. ,
,
.
,
- , PostScript-. .
.
,
0;
I 127. ,
.
,
disable. , ,
, .

, 1 ?
, 1 .
/usr/spool/lp.

23.

65


,
.
,
,
.
, .
.
dest ( dest ,
).

lpshut

Ipadmin

-xhosair

If f i n d / u s r / s p o o l / l p - n a m e h o s a r - e x e c rm - r f
t Ipsched
tf Ipstat -t

{}


. , Ipadmin -
. find
, .
Ipsched , Ipstat
, dest .

23.5.


,
.
:

,
;

Ipd;

Ipd

,
BSD. ,
, " System V"; ,
,
BSD.
,
. , ,
7 , 15,
.
" " . , IP-.
.
-,
- D H C P - . ,
.

DHCP

13.7.

IP- .
" " ,

766

III .-,

,

) ' ping,
; , .
,
. beast " "
I p d - , howler-lw.

Soloris
Solaris 2.6. S n n
.
Solstice Printer Manager,
Solsiice A d m i n S u i t e ,
Adminiool (
/usr/bin/admintool). .
, .
Solaris .
Ipfiltcr
".
Ipset Ipget
. Ipset ,
; ! lpadmin.
, ,
.
Ipusers
, Ipfornis
.
,
\ .
Solaris B S D " S u n O S / B S D Compatibility Package",
Solaris. , ,
Ipd ( .
Solans
. printcap /etc/printers.conf
/ctc/lp.
/etc/lp/plinters/printername.
^/.printers,
.
Ipsched
/lp/logs/lpsclied.
System V,
Solaris
(.. . . Ipstat - a n c h o r - l j . Ipstat - p a n c h o r - l j ) .
. ,
- ( ) .

11 , System V (
Solaris),

23.

6 7

Solans ,
. ,
, . ,
<
, -"
. ,
Ipadmin - I . - I P o s t S c r i p t . s i m p l e
PostScript-. - , " "
. - I simple
, Ipadmin
-. "" ,
.
,

terminfo, / u s r / s h a r e / l i b
, .
P o s t S c r i p t - PS:
#

Ipadmin

- h o w l e r - l w

PS

,
Solaris /etc/lp/interfaces,

, Ipfilter:
t

Ipfilter

-f 1 1

-1



, .
S o l a n s / d e v / t e r m / a / d e v / i e r m / .
1.
| :

chown

# chmod

1
600

/dav/tarm/a
/dav/tarra/a

^ 3 , 1"* ,
padmin
, , .,
(PostScript ) ,
Ipadmin :
i

Ipadmin - -v /dpv/t.ia/n
-I _ -D ""


, :
# *
# accept _
, Ipstat .
:
# Ipstat

768

III

Solaris BSD-
Solans
lpd- ),
lpadmin Solaris -
/
shell, , ,

,
# lpadmin - howler-lw -a beaatA 1 howler-lw -I PostScript,aimple
-T PS -D "howler-1* via baaat"

, .' (
'\lhowler-lw") , ,
:
# enable howler-lw
# accept howler-lw
, :
# lp -phowler-lw /etc/motd
# lpafat -phowler-lw
Ipd. , , ,
, T C P - Solaris
/
nelstandard: ,
, -v.
/dev/null.
lpadmin - netstandard
, PostScript-
dinger-Iw , Post Script-
T C P - 9100:
d lpadmin - dinger-lw -v /dev/null -I PoatScript -T PS -m netatandard -o protocol=tcp -o deatdinger-lw:9100 -o timaout-15
netstandard Ipd-
BSD; lpadmin - protocol=bsd.
lpadmin -s.
BSD-
Solaris in.Ipd,
inetd
Ipd 1- . In.Ipd
/etc/prinlers.conf,
, lpadmin, . lpd-.
in.lpd /etc/inetd.conf.

23.

769

HP-UX
*
System V, H P - U X
. H P - U X ,
- Ipsched.
Ipana . , ;
,
. ,
Ipana, Ipsched -.
lpfence ,
, . , .
, , ,
Ipalt.
1,
,
, .
Solans, Ipadmin H P - U X
-,
. ,


. ! .

, HP LaserJet 4
)' , /dev/ttyp2

Ipadmin. :
t /usr/abin/lpshut
-
/usr/lib/lp/model,
Ipadmin -m:
# /usr/sbin/lpadmin -phowler-lw -mlaserjet -v/dav/ttyp2
,
:
# /usr/lxb/accept howler-lw
# /bin/enable howler-lw
# //ebin/lpsched
HP-UX BSD-
H P - U X
, rmodel,
Ipd. rmodel
Ipadmin -. , howler-lw
beast :
# /usr/abin/lpshut
I /us/abin/Ipadmin -phowler-lw -v/dev/null -mnnodel -ormbeast
-orphowler-lw -ob3
/usr/lib/accept howler-lw

770

III .-,

# /bin/enable howler-lw
# /uar/abln/lpached
rmodel orni, ob
, BSD-.
Ipd-
rmodel rip. , rip, r c a n c e l r l p s t a l
,
.
,
rlpr, 23.8.
B S D
H P - U X . rlpdaemon,
Ipr/lpd. rlpdaemon inetd.
, ,
; rlpdaemon
, /etc/hosts.equiv /usr/spool/lp/.rhosts.

Red Hat
, Red Hat. BSD-. , Red
Hat, , printtool,
/etc/printcap.
Ipunlock, .
priiutool , , Ipd, S M B ( W i n d o w s )
N e t W a r e ( N C P ) . : printtool
, /etc/printcap ,
, ,
printtool.
, Red Hat
. . Red Hat Linux
G N U - ghostscript, , Aladdin
Enterprises.
, ghostscript.
Aladdin ,
,
PostScript. ,
Red Hai ,
A l a d d i n g h o s t s c r i p t w w w . a l a d d i n . c o m .

Red H a t R H S ,
printtool. ,
, :
howler-lw|howlilaserjet:\
: sd=/var/spool/lpd/howlei:-lvJ: \
:mx # 0 : \
: lp=/dev/parport.C: \
: sh;

23.

771

,
,
.
,
. .
, , /dev/ttySO ( S1
), /dev/parportO,
,
, .
- ,
printcap.
Red Hat
BSD,
/etc/printcap :
h o w l e r - l w | 1 | 8 - 6 [ " L a s e r J e t 5,
called howler-lw
:lp~/var/spool/lpd/howler-lw/.null:\
:rm-beast:rp=howler-lw:\
: sd-\/var/spool/lpd/howler-lw:mx#C;

on

beast":

.null
.
# mkdir
t touch
fr chown
I chgrp
It chmod

/var/apool/lpd/howler-lw
/var/apool/lpd/howler-lw/.null
-R daemon /var/apool/lpd/howler-lw
-R daemon /var/apool/lpd/howler-lw
775 /var/apool/lpd/howler-lw

Ipd-cepBep (
" " ), ,
, .
, :
* Ipc tart howler-lw
* Ipr -Phowler-lw /etc/td
# Ipq -Phowler-lw

,
, .
/etc/hosts.Ipd ,
.

FreeBSD
FreeBSD / e t c / p n n t c a p

,
. printcap, , Red Hat, FreeBSD (
, , FreeBSD).

772

III.

FreeBSD .
. N 0 YES ,
/etc/rc.conf:
Ipa_enable="NO"

Run

the

l i r e printer

daemon.

, FreeBSD (
, , Iptcontrol). .
Iptcontrol ,
,
, ,
.
(/dev/lptO) ,
Iptcontrol :
t

I p t c o n t r o l -i -u

Iptcontrol
. , . ,
Iptcontrol .
F r e e B S D . www.freebsd.org.

F r e e B S D JTO
/dev/lptO ,
printcap
Red H a i ( . ) .
FreeBSD
, /usr/libexec/lpr/lpf. . .
Post S c r i p t - .

F reeBSD , Red H a l ,
. .

23.6.

LPRng
I P R n g JTO , B S D - .
LPRng.
(Patrick Powell) A S t A n Technologies,
B S D System V.
I P R n g 1 ,
. B S D
System V
BSD. , 1
1, cancci Iprm
.

B S D . .

23.

7 7 3

root
lpr-, Ipd-.
, .
L P R n g ,
. , L P R n g
, LPRng,
.
,
BSD-.
LPRng
.
,
, ".
Ipd / e t c / h o s t s . l p d .
. LPRng Kerberos 5. SSL P G P .
, LPRng
,
System V. L P R n g
,
.
,
LPRng? ,
,
B S D . System V, .

, LPRng,
, .
, LPRng
. .

LPRng
Ipr L P R n g
. -s,
Ipr L P R n g .
.
.
Ipr L P R n g . -V
D { - D 5
).
LPRng
, .
,
printcap.
, U N I X , LPRng...

774

III .-,

, ,
@4<_.
%. :
% Ipr -Phowler-lv@beast%8552 _
Ipr. Ipq,
Iprm Ipc LPRng. ,
printcap.
,
P R I N T E R . ,
/etc/printcap. printcap ,
, Ipd.conf.
Ipq LPRng .
-s, -I -L,
, Ipq.
, ( - t ).
, ,
. - D 5
, ,
.
, Ipc LPRng
.
MOTVT ,
. Ipc,
L P R n g .
! LPRng ,
.
,
,
.

LPRng
LPRng Web- www.astart.com.
. ,
FAQ Web-.
LPRng .
LPRng , disable-setuid
configure :
If ./configure disable-setuid
, Ipd
515, root
Ipd :
chmod 4755 /usr/local/sbin/lpd
Makefile LPRng 3.6.12
make Solaris 2.7. LPRng
, p a t h

23.

775

, make G N U .
make Solaris ( / u s r / c c s / b i n ) .

/etc/lpd.conf: Ipd

Ipd

I PRng

/ e l c / l p d . c o n f . 185
.
.
, /etc/printcap.
Ipd.conf
Ipd.conf
L P R n g . .
,
m a n - Ipd.conf.

/etc/lpd.perms:
/etc/Ipd.perms
.
, Ipd.perms.


ACCEPT R E J E C T , .
,
, , , .
, ,
evi beast , ,
howler-lw
ACCEPT SERVICE=P, R,M,Q REMOTEHOST-OeasL REMOTEU5ER=ev_
PRINTER-howler-lw
, n 3 VICE
, . . 2 3 . 6
.
2 3 . 6 . S E R V I C E

/etc/lpd.perms

1 ( )

>
lpr


Iprm


Ipq

Ipd

""

Ipd.perms - I P R n g .

III.

ACCEPT REJECT . - .

printcap
, printcap LPRng
printcap BSD
, printcap
LPRng.
LPRng
printcap.

.
. ,
.
.
, LPRng
checkpc.
/usr/local/bin printcap.
, .
checkpc -f,
(
). - D 5 checkpc
.

BSD,
LPRng ,
.
.
( of printcap)
( z f ) LPRng -.
BSD ,
. L P R n g
. .
x f ,
, .
-Y Ipr.
LPRng lpbanner. pclbanner
psbanner. , PCL- Post Script, .
, .
.
LPRng , ilhp.
.
Hewlett-Packard,

.

23.

777


-
.
,
PostScript

,
. ,
, .
,

.

LPRng. ./UTILS/accounting.pl
, ,
printcap,

23.7.


Ipd 5 1 5
T C P . ,
Internet .

Ipd telnet -
515 , ,
Ipd .

(-, ) ,
. :

(.. ) ( );

-
);

(
, ..);

- (
, , ..);


);

- ( ).

.
-
, .
, .
, , ,
, .

III

,
, ,
.

23.8.


B S D - , Svsiem V , ,
,
.
,

. .
, . ,


.
.

ripr
L P R n g .
,
ripr.
,
B S D (Ipr, Ipq Iprm).
, , .
ripr
( ) Ipd.
,
. ripr
iruffula.coin/rlpr.
UNIX.

ghostscript
ghostscript
P o s t S c r i p t , PostScript
. -
, ,
o a i e ghostscript ,
. . Web-yx'ie www.glwstscnpt.com.


nipage PostScript,

.
,

23.

779

, , ,
.

en script
Adobe enscrlpt. PostScript- .
,
" " PostScript-. , enscript ,
.
Adobe ,
-
. G N U - enscript
Adobe. G N U -
enscript ,
,
, PostScript .
G N U - enscript
peopIe.ssh.fi/mtr/genscript

(Markku Rossi) ,
4. " " G N U - enscript
configure :
# ./configure with-media-Letter
enscript.
enscript
,
,
.

23.9.


, . . , -
, , M S - D O S .


,
.
, ,
. ,
,
.

780


. - .

III .-,

,
,
. ,
. BSD-
printcap sh " " ,
System V
.


. ,
, . ,
( , , ),
, .


, , . ,
,
.

WYSIWYG-,
, .
PostScript
ghostscript. r o f f -
xditsee, xdvi.
.
, ,
, .


,

.
" ",
. ,
" "
" " , ,
. 10
,
25 ,
.
( , ..) v
. .
PostScript-, PC Macintosh. ,
( )
HP A p p l e .

23.

781


,
.
,
. ,
, .
- .
.
, ,
. , ,
. V


.
, . Web
,
.



.
, .
, telnet, H T T P
S N M P
IP- , ,
, S N M P , . , .
, .
,
HP JetDirect JeiDireci Telnet Client, ,
IP. telnet-
:
% telnet howler-lw
> paaewd
Enter

Password[16

character

max.;

to d i s a b l e ! :

>

junk#bond

Password s e t t o : n e w p a s s

>

111

'

U N I X
. -
,
VAX.
.

, U N I X .

" *'

- ,
/ ,
, , , . UNIX, U N I X
(,
).
,
.

. ,

. .

24.1.


,
.
, .
1012% .

24.

783

, . ,
""
,
-
. ,
. , , ,
. , : ,
, .
" " .
. .

21.12.

,
.
, - - ,
.
, ,
" " , .
. , ,
.
.

24.2.



, .

, ,
.
,
, . .
: "'
? "
, ,
.
,
.


,
.

, .
, .

/-

III.



, , -.
,
. , ,
. , , ,
,
, .

.
, .

, ,

,
.
, ,
, . "
" (
), , , , .

, .

.
: ,

.

24.3.


""
.
,
- . ( : SCSI,
, , , ... !
?)
, ,
, . .
( , ,
)


.
,
. ,
, (

24.

7 8 5

!), .
,
, ,
. ,
: , .
.

( ).
, ,
, .


,
, (SCSI, Ethernet
..) .
(
) . , , , ,
.
,
.
; , .
. ,
.
( ) , .
, -
, . , (,
).

4.


.
. ,
,
. -

.

5.



, S I M M (Single In-line Memory
Module ) D I M M
(Dual In-line Memory Module

III.

). , ,
256 512 .
,
-
. ;
". , .
,
.

.

24.6.

, ,
.
,


. ,
.
,


,
.
, ,

. ,
.

,
.
- ,
( ,
, ).
, ,
.
.
,
. . ,
, .
:

,
.

,
, , (,
) "",
. .

.
.

24.

781

!
( , ,
).
,

.
, ,
(,
, ).
. ,
.

24.7.


, ,
. , ,
,
.


1 7 20* 4 5 % . ,
.
27"
45*.
45" (
), 7 .

40
60%. , ,
. ,
, .


" "
""
( ),
.
, , , .
,

, . ,
,
: 300 ( B T U )
, 1100 .
,
.

788

111.


, U N I X -
,
8 0 - . ,
,
.
,
, .
, ,
, ) .
.

.
:

, ( );

;
;

().


, (
),

.

. ,
, .
B T U / (British T h e r m a l U n i t
),
3,412 / ( * ) . ,
25- ,
450 . :
( 2 5 ) ( )
V
/ V

"
\
=
* /

38385-^


,
.
40- . ,
:
( ^
"" _) ( A 4 I 2 B T U \
\
/ V /V /

24.

_ 3276Ti'

783


- . 300 B T U / . ,
. :

(.
14
V

\( 300 \
_ 2 00

! I
1 = |1
/ \* /



,
. , ,
, 20000 B T U / . :
20000 B T U / (, )
B T U / ( )
+ 38385
3276 U / ( )
1200 B T U / ( )
62861 B T U / ( )
.
12000 B T U / .
( 50%).
;
(62681JfflJ)

7 ( , . 5 ) . 7,84 ,

, , .


(
, ) ,
.

. ,
.
Phonetics Sensaphone
,
, , ...
( ) .
Web- www.sensaphone.com.

24.8


, "" .
,
.

,
.

784

III .-,


(Uninterruptible Power Supply. UPS).
U P S RS-232.
,
,

, 13%
, ,
. U N I X - ,
. 24
. .
\/[


2.5.

, ,

Energy Star.
, (Environmental
Protection Agency ) . , Energy Star
.


U N I X - " - ,
Windows, .
,
.

-10,
. -10 ( ) Web-
www.xl0.com.
.
MasterSwitch Web-
Ethernet-.

Web-
www.apcc.com

24.9.


-,
, ,

? , " "
" ". ,
7 .

.

, , 3060
, ,

24.

791

;
.
,
( ,
, ).
.
.

24.10.
,
. ,
. . 24.1
,
.
24.1.
^

T O R X

(-

)

( )


RJ-45

5
RJ-45
RJ-45

SCSI
-


,
1



1 , .

7 9 2

111.


, .

,
, , ,
. .
, . -
. . ,

, , : ,
!

( )
. -
, ,

. ,
.
, , Internet.

!
, . ,
.
,
: "
- , . ,
!!! 1 '.
- , . . ,

""

"".
.

25.

7 9 3

. U N I X
. ,
100'% ,
.
. .

.
, ,

.
.

. , ,
, , , : " ". , ,
.

25.1.


, .

, . ,
, . ,
.

, .
(
, , ,
), (,
, ).

U N I X - W e b -
, ,
L o c a l D i r e c t o r C i s c o ( w w w . c i s c o . c o m ) ACEswitch
A l t e o n N e t w o r k s ( w w w . a l t e o n w e b s y s t e m s . c o m ) .
.
.
, .
,
. ,
"" .

794

,
- . , ,
RAID, .
, -
, . RAID
,
, ( )
.

III .-,

,
.
netstat. 20.4.

,
, .
12.

.
.
.
.

25.2.

,

.
"" .
,
. ,
,
:

-,

.
, ,
, ,
.
, . ,
,
, ,
. .

( ) .
.
100% . " "
- 95%. , 90%
! , .
.
,
. .

(, ) .
.

25.

7 9 5

UNIX-
. ,
, .

. 7
"" .
U N I X
,
.

.
, ,
" " .
,
,

, .


, . ,
.

25.3.



, . ,
.
, .
( ) .


;
,
. ,
.
. ,
, ,
.
vmstat,
Solaris H P - U X s a r -
: ( ),
, . :
% - 5 5
13:33:40
%usr
*sys
twio
%idle
13:33:45
4

27
11
13:33:50
7
9
83
0
13:33:55
77
9
13
0
13:34:00
2
25
3
71
13:34:05
0
0
0
100
Average

796

49

10

36

111.

sar - ,
( % ) ,
( % ) . ,
- (
), %wio,
% i d l e .
vmstat . ,
, :
1

vmstat

w

10 0


0 0

re
0
67
96
16
1

page
mt pi ffr de sr in
0 0 0 0 0 0 4
2 0 0 0 0 0 26
0 0 0 0 0 0 39
0
0 0 0 0 64
0 0 0 0 0
0 11

faults
ay cs
22 19
751 52
1330 42
1626
99
216 20

cpu
US ay Id

2
53
22
7
1

1 97
4T 0
71 7
74 19
11

. ,
,
.
,
u s , sy i d .
us , sy ,

- ( vmstat
sy
f a u l t s ) .
, , ,
50%
.
. cs
, ..
.
.

, .
, ,
.
,
.
,

. ,
, .
, .

99% .
,
.
.
,
. , ..
. .

25.

797

, " "
. , " " .
uptime:
% uptime
2:07pm u p 4 : 0 2 ,

5 users,

load average: 0.95,

0.38,

0.31

,
, . ,
, .
, . ,
- (
).
.
,
.
, ,
- .
,
.
6.0
.
,
nice.

4.1.


.

, , (
, , ).
UNIX-
,
. ps
(-aux Red Hat FreeBSD, -elf H P - U X
Solaris). ,
70% - ( .
ps ). -

.
ps top.
, ps. " " ,
"
top 4.8.

top ,
.

798

111.

U N I X
,
4 .
,
, " '1.
(1 512 ),
.
U N I X ,
, , ,
"".
L R U (least r e c e n t l y u s e d ) ,
, ,
.
, U N I X
, " ".
L R U , .
,
. ,
( ,
" "
). ,

.
" '1
( ),
.
.
, , ;
,
*
,
. ,
, .
, " "
" " , .
-
,
" " .
"" . " "
, ,
, .
" " , , , ,
.
,

. , , .
,
. ,
, .

25

/9

( ) , .
,
, .
, -
( ),
, , .

, . "", " ",
.
, .
,
. ,
, .
,
. .
"" ,
, ,
(, ,
nice),
. ,
,
.
, ,
, , , .
<7>
,
. , nice ,
.


, ,
. , ,
"", .
,
.

:
. R
, ,
.
,
.
.

swap -1 Solaris, s p a w i n f o H P - U X , swapon -s R e d Hai
p s t a t - s F r e e B S D . Solaris s a r - ( ,
, ), -
, swap -I.
% s w a p -1
svapfile

ZCi

dev

swapl

blocks

free

111.

/dev/dak/cOtCdOsl
%

32,1

16

164400

162960

- 5

17:58:52
17:58:57

freemem
361

% petat
Device
/dev/wdOslb
/dev/da
Total

freeswap
179616

IK-blOcks
70784
104B920
1119448

Used
0
0
0

Avail
70656
1048792
1119448

Capacity
0%
0%
0%

Type
Interleaved
Interleaved

pstat ,
swap -I s a r - 5 1 2 - . ,
, ,
:

___


vmstat:
% vmatat 5 5
procs
rr-error
b w
swap
free
0 0
1034
?16
0 0 0
341764
11064
0 0 0
351752
1296
0 0 0
360240
14520
15712
1 0 0
366648

re
0
0
1
0
0

}'

page
p i f r d e s r
1
0 0
0
0
3
0
0
26
1
1 1
0
0
69
0
9
9
30
6
0
0
0
0
4
0
0
73

disk
SO s 6 s 4
0
0
0 0
0
0
1
0
0
0
2
0
0
1 0
0
0
0 36 0

fa
in
132
150
173
138
390

ults
sy
111
215
358
176
474

cs
58
100
156
71
237


. p r o c s ,
, /,
, .
w - , ,
.
s w a p
. f r e e ( )
.
3% ,
.
. ( ).

re ( )
;

mf
);

pi

fr

de

" " ;

sr

, .



d e . 100,

25.

80

, ,
vmstat
vmstat - S
,
.
,
. ,

. . ,
, .
, f r e e

,
, i .
.
,
. ,
, ,
.
. ,
.
,
.
, .
- ,
, :
(, )
(, )
, ,
50
. 75
, . ,
"",
.



iostat. vmstat,
,

. ,
. vmstat.
iostat ><
% ioetat 5

tin
0
0
2
3
1

802

tty
tout
1
39
26
119
16

5
sdO
kps tps serv
5
1
18
0
0
0
3
0
13
0
0
0
5
1
19

kps
14
2
8
19
0

sal
tps serv
2
20
0
1
21
2
13
0
0

nf s i
kps tps serv
0
' 0
0

0
0
0
0
0
0
0
0
0
0
0

cpu
u s sy VJI - O
0
0
0 99
0
0
0 I0L
0 ICJ
0
0
! 98
0
1
0
0
0 10L

III .-,

( : t t y , sdO, s d l ,
n f s l c p u ) . iostat
- ( Solaris).
t t y .
-, ,
. t i n
t o u t ,
.
k p s , t p s
s e r v : , ( ),

.
, ,
k p s t p s , :
, . .
, ,

( , , ).
iostat - D ,
:
% iostat -D 5 3
rps
0
9
11
8
0

sdl

sd2

wps
0

Util
1.3

r p s wps u t i l
0
0
0.3

0
0

15.6
0.0

41.1
48.4

1
0
0

0
1
0
0

1.8
2.0
0.0
0.0

r p s wpS u t i l
0
0.5
0
1
2.4
0
0
0
0.0
0.0
0
0
0
0
0.0

sd5
r p s wps u t i l
1
1
4.2
6
3
3
0

e 34.8
li 32.6

9.2
0
0.0


.
, ,
, .
,
, .
, . 50100 .
, ,
5% .
,
. ,
,
,
. ,
.
,
,
, , , .

25.

8 0 3


, , .
, (, , ).
, Web-cepeepa
.
,
SCSI.

.
'
,
. ,
swapon, swap,
( . 8). , ,
. ;
, .
/ t m p ""'
,
. ,
.
, ,
. ,
. - , tmpfs (Solaris), r a m ( R e d H a t ) mfs ( F r e e B S D ) .
,
.
.

,

,
.
.


S o l a n s ;
. .. (Adrian Cockcroft).
Sun
.
S y m b E L ( SE) ,
.
" ",
Solaris.
Sun ,
Web- Sun :
h u p : / / w w w . s u n . c o m / s u n - n - n e t / p e r f o rm a n c e / s e 3

804

III .-,

procinfo:
Red H a t
Red H a t procinfo,
. vmstat,
. ,
.
, p r o c i n f o -.
5 .
% procinfo
Linux 2 . 2 . 5 - 1 5
Memory:
Mem:
Swap:

(root0porky.devel.redhat.com)

Total
30756
133016

Used
23908
224

Free
6848
132792

Bootup:

T u e May 2 1 2 : 2 6 : 1 3 2 0 0 0

user
nice
system
idle
uptime

0:08:15.35
0.0%
0:00:00.00
0.0%
0:10:46.41
0.0%
30d 2 : 0 6 : 4 0 . 8 9 100.0%
30d 2 : 2 5 : 4 2 . 6 4

irq
irq
irq
irq
irq

0
1
2
6
8

:
:
:
:
:

260074265
8
0
3
2

Shared
9084

Buffers
12496

Load a v e r a g e :

page in :
page out:
swap in :
swap o u t :
context :

timer
keyboard
cascade
[4]

(gcc egcs-2.91.66)

:
:
:
:

iredhat]

Cached
3968

0.08 0.02 0 . 0 1 1/26 16173

774301 d i s k 1:
177675
183
60
7221B65

i r q 10
i r q 13
i r q 14
i r q 15

#1

3032801
1
1905415
5

229922r

109442w

etitO
fpu
ideO
idel

rtc

pstat: F r e e B S D
, F r e e B S D , pstat.
,
.
. .
:

(-1);

, , ps (-),

(-;

( - t ) ,

(-),

(-s),

(-).

pstat - ,
m a x u s e r s . , ,
m a x u s e r s ,
. 12.

25.

805

25.4.

! !
,
.

. ,
. 90%
,
, .
, ,

"""
, , ,
.
, , ,
.
ps top
. , 50% .
.
, , 10%.
- ( ps), ,
,
.
uptime, vmstat
sar -, , - .

, v m s t a t s a r -g,
.
: ,
, - ,
.
, ps . , , ,
.
,
" .
kill - S T O P .

, - . '.'
, .

,
.

, ,
,
. p s ,
. ,
, .

806

III .-,

, ,
. renice
, ,

nice.
- .
renice .
, , ,
.
: .

. setrlimit.
limit shell.
,
%

l i m i t

32m


32 .
renice ,
. " " .cshrc.
, .
. ,
,
.
20.
, c e n t ,
, . ,

- ,
, .
, , .
,
. U N I X -
N F S , N I S . D N S ..
- , ,
-. , ,
-
gethostent().
D N S ,

25.5.

Cockcroft, Adrian a n d Richard Pettil. Sun Performance and Tuning: Java and
the Internet. Upper Saddle River, NJ: Prentice Hall 1998.

Loukides, Mike. System Performance Tuning. Sebastopol: O'Reilly. 1991.

25.

807

^ ^ I
a^Htalutcwi^Arttejt

;|i
1
1

Windows

i j l i x ^ ^

, Windows
. ,
. , U N I X
T C P / I P Internet, Windows
.
" " .
,
Windows- U N I X . ,

. Windows , , ,
- . U N I X
.
,


UNIX.

26.1.



U N I X , U N I X - (
UNIX), ,
Windows*.

, Linux,
.

III.

, Windows:

Windows. N F S CIFS.

N F S
N F S (Network File System)
U N I X ,
Windows.
, NFS- Windows,
-, - , -,
, C I F S .
[7[

NFS 17.

C I F S
C I F S ( C o m m o n Internet File System
Internet) S M B (Server Message Block
). S M B D O S , -
Microsoft , /
N e t B I O S (Network Basic Input/Output System
-). IBM Sytec
N e t B I O S
.
S M B N B T
( N e t B I O S over T C P ) , NetBIOS. , MVS V M S
U N I X Windows. .

S a m b a : C I F S U N I X
Samba
G N U - C I F S U N I X . (Andrew Tridgell) ,
"" SMB.
,
1992 .
Samba .
, ,
Windows, U N I X . Samba .
U N I X -
Windows-
".
C1FS :

, "Microsoft networking".

26. Windows

809

("" ).

S