Академический Документы
Профессиональный Документы
Культура Документы
-
-
2011
681.3.06
32.973.26-018.2
78
. .
78
Linux: 4- ., . . .: -, 2011.
752 .: . ( )
ISBN 978-5-9775-0712-7
Linux, , , , . Linux
: , WWW, FTP, INN, Proxy, NTP,
, . Linux , ,
X Window, , .
Linux- , , , TV- . . Fedora Core 14,
Linux. 3G-,
.
Linux
681.3.06
32.973.26-018.2
:
.
.
ISBN 978-5-9775-0712-7
. ., 2011
, "-", 2011
............................................................................................................................ 1
.............................................................................................. 1
............................................................................................ 1
................................................................................................................ 2
....................................................................................................... 3
I. LINUX .................................................................................. 5
1. Linux ................................................................................... 7
FreeDOS ............................................................................................................................. 8
Windows NT (Windows 2000, Windows XP, Windows 2003 Server,
Windows 2008 Server, Windows Vista, Windows 7) ........................................................ 9
Embedded Windows ........................................................................................................... 9
Windows CE (Windows mobile) ...................................................................................... 10
Mac OS X ......................................................................................................................... 10
iOS .................................................................................................................................... 10
UNIX ............................................................................................................. 10
FreeBSD, OpenBSD, NetBSD .......................................................................................... 11
Linux ................................................................................................................................. 11
Embedded Linux ............................................................................................................... 12
Android ............................................................................................................................. 12
MeeGo............................................................................................................................... 12
QNX .................................................................................................................................. 12
Symbian ............................................................................................................................ 13
Linux................................................................................................. 19
............................................................................................................................. 20
2. Linux ....................................................................................... 21
................................................................................................................................... 21
.............................................................................. 21
.......................................................................................................... 22
..................................................................................................... 23
IV
..................................................................................................... 24
................................................................................................... 24
................................................................................................. 25
Web- ...................................................................................................... 25
............................................................................................................. 25
Oracle OpenOffice ........................................................................................................ 26
OpenOffice.org .............................................................................................................. 27
Koffice ........................................................................................................................... 27
GNOME Workshop ....................................................................................................... 27
.................................................................................................................... 28
Windows ....................................................................................................... 28
..................................................................................... 28
Kylix .............................................................................................................................. 28
KDevelop....................................................................................................................... 29
Glade ............................................................................................................................. 30
Rhide ............................................................................................................................. 30
Eclipse ........................................................................................................................... 30
Lazarus .......................................................................................................................... 32
- ............................................................................................. 32
............................................................................................................................ 32
............................................................................................................................ 33
.............................................................................................................................. 33
................................................................................................................................ 34
............................................................................................................................. 34
3. ................................................................................................ 35
Debian .................................................................................................................. 36
Red Hat ................................................................................................................ 37
Slackware............................................................................................................. 38
Gentoo ................................................................................................................. 38
LiveCD .................................................................................................... 39
USB Flash ............................................................................................... 40
............................................................................................... 40
............................................................................................................................. 41
II. LINUX ................................................. 43
4. . ............................................................. 45
.................................................................................. 45
.............................................................................................................. 45
(OSI) ..................................................... 46
TCP/IP ................................................................. 48
OSI TCP/IP ........................................................ 48
......................................................................................................... 49
TCP/IP ................................................................................... 49
() ............................................................. 49
IP .................................................................................................................. 49
IPv4 ................................................................................................. 50
IPv6 .......................................................................................................... 51
IPv6...................................................................................................... 52
............................................................................................................ 53
......................................................................................... 53
.................................................................................... 53
TCP/IP ................................................................................................. 54
ARP/RARP................................................................................ 56
ICMP ............................................................................................................ 56
................................................................................ 59
TCP .............................................................................................................. 59
UDP ............................................................................................................. 60
.................................................................................... 60
FTP .............................................................................................................. 61
SMTP ........................................................................................................... 61
Telnet ........................................................................................................... 61
NFS .................................................................................. 61
IPX ............................................................................................................... 61
NetBIOS....................................................................................................... 62
.................................................................................................. 62
............................................................................................................................. 63
5. .................................................................... 64
Linux ................................................................... 64
................................................................................................................................. 64
................................................................................................................ 65
.......................................................................................................................... 65
...................................................................................................................... 65
...................................................................................................... 65
......................................................................................................................... 65
...................................................................................................................... 65
......................................................................................................................... 66
....................................................................................................... 66
............................................................................................. 66
..................................................................................... 67
.......................................................................................................... 68
............................................................................................... 69
.................................................................................... 70
............................................. 70
................................................... 72
VI
(VFS)....................................................................... 73
.................................................................................. 73
VFS ......................................................................................................... 73
Ext2 ............................................................................................... 74
Ext2 ............................................................................. 74
Ext2 ...................................................................... 74
Ext2 ..................................................................................... 75
........................................................................ 77
Ext2 ..................................................... 77
......................................................................... 78
Ext3............................................................................................ 79
Ext4............................................................................................ 79
ReiserFS .................................................................................... 80
............................................................................................................................. 81
6. Linux ............................................................................... 82
Linux .............................................................................................. 83
(Root) ............................................................................................. 83
/bin .................................................................................................................. 84
/boot ................................................................................................................ 85
/dev ................................................................................................................. 86
/etc................................................................................................................... 86
etc/rc.d ................................................ 93
S99windows/etc/sysconfig ............ 94
etc/X11 X Window System ........................... 101
etc/sgml SGML XML ................................ 101
/home ...................................... 102
/lib ......................... 102
/lib64 ..................... 102
/lost+found .................................................................................................... 102
/media
.................................................................................................................... 103
/mnt
....................................................................................................................... 103
/opt ........................................ 103
/proc procfs ... 103
proc/_PID- ............................................................................. 105
proc/ide IDE-, ...................................... 105
proc/net ........................................................................... 105
proc/parport .................................................................... 106
proc/scsi SCSI-, ................................... 106
proc/sys ...................................................................... 107
proc/tty ............................................................................................ 107
/root root () .... 108
VII
VIII
IX
ISDN-.......................................................................... 132
PCBIT ISDN (pcbit) .................................................................................... 133
Teles ISDN (teles)........................................................................................ 133
DigiBoard (digi) ........................................................................................... 133
/ Baycom (baycom) ....................... 133
......................................................................................... 133
Ethernet (ether) ....................................................................................... 134
(sound) .............................................................................. 134
(lp) ............................................................................................... 135
init .................................................................................................................... 135
init /etc/inittab............................................................ 136
..................................................................... 140
rc.sysinit ................................................................................................................... 140
rc................................................................................................................. 142
rc.local ..................................................................................................................... 145
, ...................................................... 145
, ...................................... 146
, .......................... 146
............................................................. 147
......................................................................................................................... 148
........................................................................................................................... 148
8. Linux ........................................................................ 149
.................................................................................................... 149
? .......................................................................................... 149
................................................................................... 149
.......................................................................... 150
............................................................................................ 150
............................................................................... 150
............................................................................................. 150
........................................................................................................................... 151
............................................................................................. 151
BIOS ............................................................................................................................ 151
............................................................................................ 152
.................................................. 152
xlock vlock .......................................................................................... 152
............................................. 152
............................................................................................... 153
.......................................................................... 153
root ............................................................................... 153
................................................................ 154
................................................................................. 155
Ext2(3,4) ..................................... 155
Ext2 ........................................... 156
............................................................................................... 156
............................................................................ 157
SSH.............................................................................................................................. 157
PAM ............................................................................................................................ 157
CIPE ............................................................................................................................ 157
Kerberos ...................................................................................................................... 158
CFS TCFS ................................................................................................................ 158
......................................................................................................... 158
......................................................................................................... 158
.................................................................................................... 158
Packet Sniffers............................................................................................................. 159
................................................................................................... 159
DNS ............................................................................................................................. 159
identd ........................................................................................................................... 159
........................................................................................................ 159
.................................................................................................... 160
" " .......................................................................... 160
SELinux/AppArmor ........................................................................................................ 160
NFS ......................................................................................................... 161
Firewall ........................................................................................................................... 162
................................................................................................... 162
...................................................................................... 163
.......................................................................................... 163
.......................................................................................... 163
RPM- ................................................................................... 164
....................................................................................................... 164
........................................................................... 165
............................................................... 165
.......................................................................................... 165
....................................................................................... 165
..................................................................................................... 165
............................................................................................. 166
.................................................................................... 166
........................................................................................................................... 166
9. RPM- DEB- ................................................................................... 168
RPM............................................................................... 169
........................................................................... 170
RPM ...................................................................................................... 170
RPM ........................................................................................................ 171
, ..................................................................... 171
..................................................................................................... 172
RPM ..................................................................... 174
.............................................................................................................. 174
XI
............................................................................... 175
() ............................................................................ 176
............................................................................................................ 177
.............................................................................................. 177
...................................................................................... 177
......................................................................................................... 178
..................................................................................................... 179
.............................................................................................. 179
.................................................................... 180
RPM ................................................................................ 180
PGP.............................................................................................................. 181
.............................................................................. 181
FTP/HTTP ...................................................................................................... 181
................................................................................................ 182
RPM ......................... 182
Yum .............................................................................. 186
............................................................................................... 187
Yum........................................................................ 187
................................................................................................. 187
...................................................................................................... 187
.............................................................................................. 187
Yum .................................................................................................... 187
Midnight Commander ..................................................................................................... 188
purp ................................................................................................................................. 189
Kpackage......................................................................................................................... 190
GnoRPM ......................................................................................................................... 190
Yumex ............................................................................................................................. 192
DEB- ................................................................................................................... 192
DEB ...................................................................................................... 193
DEB ........................................................................................................ 193
, ..................................................................... 193
DEB- ......................................................................................... 193
APT .............................................................................................................. 194
................................................................ 194
....................................................................... 194
...................................................... 195
................................................................................................... 196
..................................................................................................... 196
............................................................................................. 196
Aptitude........................................................................................................................... 196
............................................................................................................ 196
................................................................................................ 197
..................................................................................................... 197
.................................................................................................. 197
XII
............................................................................................... 197
........................................................................................................ 197
............................................................................................................. 198
........................................................................................................................... 198
III. LINUX .................................................................... 199
10. ..................................................................... 201
...................................................................................................... 202
...................................................................................................... 202
................................................................................................ 202
.................................................................................. 203
...................................................................... 203
........................................................................................ 204
/.................................................................................................................. 204
/bin ............................................................................................................ 204
/boot .......................................................................................................... 204
/dev ............................................................................................................ 205
/etc ............................................................................................................. 205
/home ......................................................................................................... 205
/lib ............................................................................................................. 205
/lost+found ................................................................................................ 206
/mnt ........................................................................................................... 206
/opt ............................................................................................................ 206
/proc .......................................................................................................... 206
/root ........................................................................................................... 206
/sbin ........................................................................................................... 207
/tmp ........................................................................................................... 207
/usr............................................................................................................. 207
/var ............................................................................................................ 207
....................................................... 207
.............................................................................. 207
................................................................................... 210
......................................................................................... 211
........................................................................................................................... 212
11. .............................................................................................. 213
............................................................................................ 213
.................................................................................................. 214
............................................................................................................. 216
........................................................................................ 219
............................................................................ 219
XIII
................................................................................................ 221
..................................................................................... 222
................................................................................................. 222
................................................................................. 226
................................................................................................. 226
........................................................................................................................... 226
12. ................................................................................... 227
.................................................................................................. 227
.................................................................................................... 228
, .............................................................. 229
............................................................................................................................ 230
........................................................................................................................... 232
IV. LINUX ..................................................... 233
13. ....................................................................................................... 235
apropos ........................................................................................................................... 235
Man- ................................................................................................................... 235
whatis .............................................................................................................................. 235
HOWTO ................................................................................................ 236
-HOWTO .............................................................................................................. 236
Fedora ................................................................................ 236
Slackware .............................................................................................. 236
Alt Linux ........................................................................... 236
Debian ................................................................................................... 236
........................................................................................................................... 237
14. ........................ 238
/, .............................................................. 239
() ........................................................................................................... 239
......................................................................................................................... 240
, ................................................................................................................. 240
cal ............................................................................................................................ 240
date .......................................................................................................................... 240
...................................................................................................... 241
................................................................................ 241
..................................................................................................... 243
............................................................................................................................. 249
dig ............................................................................................................................ 249
elm ........................................................................................................................... 249
finger ........................................................................................................................ 249
XIV
XV
XVI
....................................................................................................................... 264
apropos .................................................................................................................... 264
man .......................................................................................................................... 264
whatis ....................................................................................................................... 264
......................................................................................................................... 265
banner ...................................................................................................................... 265
bash .......................................................................................................................... 265
bc ............................................................................................................................. 265
chvt........................................................................................................................... 265
clear ......................................................................................................................... 265
cpp ........................................................................................................................... 265
csh ............................................................................................................................ 265
echo .......................................................................................................................... 265
env ............................................................................................................................ 265
g77 ........................................................................................................................... 266
gawk ......................................................................................................................... 266
gcc ............................................................................................................................ 266
id .............................................................................................................................. 266
login ......................................................................................................................... 266
logname ................................................................................................................... 266
make ......................................................................................................................... 266
nohup ....................................................................................................................... 267
openvt....................................................................................................................... 267
perl ........................................................................................................................... 267
printenv .................................................................................................................... 267
reset ......................................................................................................................... 267
resizecons................................................................................................................. 267
startx ........................................................................................................................ 267
strings ...................................................................................................................... 267
strip .......................................................................................................................... 268
subst ......................................................................................................................... 268
su .............................................................................................................................. 268
true ........................................................................................................................... 268
es ............................................................................................................................ 268
........................................................................................................................... 268
V. LINUX ................................................... 269
15. .............................................................................................. 271
..................................................................................................... 272
............................................................................................... 272
ASCII .......................................................................................................... 272
XVII
XVIII
XIX
XX
XXI
XXII
XXIII
XXIV
XXV
................................................................... 464
at .................................................................................................................................. 465
batch ............................................................................................................................ 465
cron .............................................................................................................................. 465
........................................................................................................................... 467
30. ........................................................................ 468
........................................................... 468
...................................................................... 469
................................................................................ 470
................................................................................................... 471
Stunnel ......................................................................................................................... 471
............................................................................................................... 471
.................................................................. 471
Stunnel , SSL.................................................... 472
.......................................................................................................... 473
....................................................................... 473
SATAN........................................................................................................................ 473
Portsentry .................................................................................................................... 473
.......................................................................................... 474
...................................................................................................................... 475
........................................................................................................ 476
NeTraMet .................................................................................................................... 476
NeTraMet ...................................................................................... 476
NeMaC .......................................................................................... 476
........................................................................................................ 477
syslogd............................................................................................................. 477
................................................................................................ 477
............................................................................................... 477
................................................................................... 479
klogd ................................................................................................................ 479
..................................................................................... 480
Rootkit ......................................................................................................................... 480
rootkit .................................................................................................. 481
............................................................................................ 482
RPM .............................................................................................. 482
rootkit .................................................................................................. 482
................................................................................................... 483
LIDS ................................................................................................................................ 483
................................................................................................................... 483
LIDS .......................................................................................... 485
........................................................................................................... 485
.................................................................................................... 487
XXVI
XXVII
.......................................................................... 514
......................................................................................... 515
ipchains ....................................................................................................... 515
ipchains ........................................................................................................... 516
............................................................................................ 517
.................................................................................. 518
......................................................................... 518
................................................................ 519
.............. 519
................... 520
ICMP- ............................................................................. 522
......................................... 522
smurf- ............................................................................ 525
................................................................ 525
"" ....................................................... 530
.......................................................................... 530
............ 530
................... 531
........ 531
........................................................................................ 531
: IP-
................................................................................................................. 532
................................................................. 533
........................................................... 534
.................................................................................................... 535
..................................................... 535
.............................................................. 536
...................................................................................................................... 536
Iptables ............................................................................................................................ 536
................................................................. 538
........................................ 539
.......................................... 539
mangle .......................................................................................................... 540
nat ................................................................................................................ 540
filter .............................................................................................................. 541
iptables ................................................................................... 541
ipchains ....................................................................................................... 541
..................................................................................... 542
.................................................................................................... 543
TCP- ......................................................................................................... 544
UDP- ........................................................................................................ 544
ICMP- ...................................................................................................... 545
......................................................................................... 545
XXVIII
................................................................................................ 547
ACCEPT ................................................................................................. 547
DNAT ...................................................................................................... 547
DROP ...................................................................................................... 547
LOG ........................................................................................................ 547
MARK ..................................................................................................... 548
MASQUERADE ...................................................................................... 548
MIRROR ................................................................................................. 548
QUEUE ................................................................................................... 548
REDIRECT ............................................................................................. 548
REJECT .................................................................................................. 548
RETURN ................................................................................................. 548
SNAT ....................................................................................................... 548
TOS ......................................................................................................... 549
TTL .......................................................................................................... 549
ULOG ..................................................................................................... 549
iptables ............................................................................................................ 549
Iptables-save ................................................................................................................ 549
Iptables-restore ............................................................................................................ 549
........................................................................................................................... 550
33. ....................... 551
................................................................................................... 551
................................................................................................. 552
................................................. 552
.............................................. 552
................................................................................................. 553
........................................................................... 553
pppd ........................................................................................................ 555
diald .......................................................................................................... 557
: /etc/diald/connect ............................................... 558
: /etc/diald.conf ........................................... 560
-: /etc/diald/standard.filter ...................................... 561
................................................................................... 561
............................................................... 562
............................................................................... 562
...................................................................................... 563
................................................................................................. 563
proxy- .............................................................................................. 563
Transparent proxy ....................................................................................................... 564
................................................................................................... 564
( ) ............................................ 564
..................................................................................... 565
XXIX
XXX
.................................................................................................. 594
............................................................................... 595
............................................................................... 595
tar ................................................................. 595
cpio .................................................................................... 596
.......................................... 597
.......................................... 597
dump ............................................................. 597
dump .................................... 598
, dump .............................................................. 598
AMANDA ........................................................................................................ 599
mt mtx ...................................................................................................... 599
buffer ........................................................................................................... 599
.................................................................................. 599
........................................................................................................................... 600
36. Window ......................................... 601
X Window (X Org) ....................................................................... 601
X- .................................................................................. 601
Files ............................................................................................................ 603
Keyboard .................................................................................................... 603
Pointer ........................................................................................................ 603
Device ......................................................................................................... 604
Screen ......................................................................................................... 604
............................................................................. 604
X Window ................................................................. 605
Window Manager .............................................................................. 605
.......................................................................... 606
GNOME ..................................................................................... 606
KDE K Desktop Environment ................................................................................ 607
........................................................................................................................... 608
37. ......................................................................................................... 609
........................................................................................ 609
CUPS ............................................................................................... 610
LPD .......................................................................................... 610
LPD ....................................................................................................... 611
......................................................................................................... 613
LPRng ......................................................................................... 613
netcat ........................................................................................ 613
PDQ ................................................................................................. 613
PDQ ...................................................................................................... 614
PPR .............................................................................. 614
XXXI
........................................................................................... 615
- ..................................................................................... 615
Ethernet- .......................................................................................... 617
............................................. 617
........................................................................................................................... 621
38. ......................................................................................................... 625
Linux ............................................................... 630
SANE .......................................................................................... 631
(frontend) SANE ........................................ 632
Xsane ....................................................................................................................... 632
xscanimage .............................................................................................................. 633
QuiteInsane .............................................................................................................. 633
FlScan ...................................................................................................................... 633
scanimage ................................................................................................................ 633
TkScan ..................................................................................................................... 633
saned ........................................................................................................................ 633
scanadf ..................................................................................................................... 633
scanlite ..................................................................................................................... 633
xcam......................................................................................................................... 633
Staroffice v7/ OpenOffice 1.1 ................................................................................. 633
NSane....................................................................................................................... 634
VueScan ...................................................................................................... 634
........................................................................................................................... 634
VI. ................................................................................................... 623
39. "" ....... 635
Linux .......................................................................................................... 635
Linux ................................................................................................................... 636
Linux Palm ............................................................................................................... 636
pilot-xfer .................................................................................................................. 637
X Window ................................................................................... 637
Linux PocketPC........................................................................................................ 637
Linux TV-.......................................................................................................... 639
wmtv ............................................................................................................................ 642
kWinTV ....................................................................................................................... 642
LIRC ............................................................................................................................ 643
Real Video Linux ................................................................................ 643
SANE ............................................................................................................... 643
TV-out ..................................................................................................... 643
................................................................................................. 645
USB Flash-, ............................................................................ 645
XXXII
................................................................................................ 646
UPS ( ) ................................................................ 646
........................................................................................................................... 647
40. ................................................................................................. 649
..................................................................................................................... 650
DOSEmu...................................................................................................................... 650
DOSEmu ................................................................................ 650
Wine ................................................................................................................................ 655
Cedega............................................................................................................................. 655
CrossOwer Office ........................................................................................................... 656
WINE@Etersoft .............................................................................................................. 656
................................................................................................... 656
VMWare ...................................................................................................................... 656
............................................................................................................... 656
Win4Lin ...................................................................................................................... 657
VirtualBox ................................................................................................................... 657
XEN ............................................................................................................................. 658
KVM............................................................................................................................ 658
........................................................................................................................... 658
41. ............................................................................................. 659
........................................................................................... 659
........................................................... 659
X Window........................................................................................................ 661
Linux................................................................................................................. 665
XMPS ...................................................................................................... 665
avifile-player ........................................................................................... 666
xmms ....................................................................................................... 667
XMMP LinuX MultiMedia Player ..................................................... 667
MPlayer ................................................................................................... 667
XINE ....................................................................................................... 668
CD-R/CD-RW- ....................................................................................... 669
CD-ROM ........................................................................................ 670
CD .................................................................................................. 670
CD ....................................................................................... 670
Audio-CD........................................................................................................ 671
.................................................................................................. 671
......................................................................................... 671
.................................................................................... 671
K3b .......................................................................................................................... 671
Eroaster .................................................................................................................... 673
D Bake Oven ......................................................................................................... 673
........................................................................................................................... 673
XXXIII
42. ,
.................................................................................. 675
Wget ................................................................................................................................ 675
Wget ........................................................................................................... 676
..................................................................................... 676
........................................................................... 677
.wgetrc ............................................................................ 677
Wget ........................................................................ 679
MLdonkey ....................................................................................................................... 681
MLdonkey ...................................................................... 682
Transmission ............................................................................................................... 682
Vuze............................................................................................................................. 683
........................................................................................................................... 683
43. ......................................................... 684
root ........................................................................................................ 684
............................................................................ 684
..................................................... 684
root ................................................... 686
....................................................................... 686
......................................................... 687
LILO .................................................... 688
LILO 01010101010........................... 688
LILO , L ....................................................... 688
LILO , LI ...................................................... 688
LILO , LIL? .................................................. 688
LILO , LIL .................................................... 689
LILO , LIL- .................................................. 689
LILO .......................................................... 689
LILO ..................................................................................... 689
BIOS ........................................................... 689
(MBR) ............................................. 690
........................................... 691
............................ 691
................................................................................................ 691
,
................................................................................................................. 692
.................................................................................. 692
............................................ 692
"getcwd: cannot access parent directories" ............................................ 693
SIG11 ..................................................................................... 693
.......................................... 694
XXXIV
............................................................................ 694
"unable to find swap-space signature" ......................................................... 694
........................................................................... 694
..................................... 695
....................................... 695
mount ........................ 695
....................................................................................... 696
................................................................................................... 696
......................................................................................................... 696
.................................................................................. 696
/ ................................................................................. 697
.................................. 697
, ................................ 697
........................................................................................... 697
Window
....................................................................................................... 697
........................................................................................ 698
, ......................... 698
................................................................................................................ 698
................................................................................................. 698
........................................................................................................................... 698
.......................................................................................................... 699
1. ........................................................ 701
2. .............................................................................................. 703
................................................................................................................ 703
................................................................................................................ 704
........................................................................................... 705
.................................................................................................................. 706
.............................................................................................. 707
, , . "", . - , , ,
. ,
. , , Linux .
. ,
, ,
, . , . ""
"...
Cisco ". , , .
- 45
"" .
, , . ,
Linux .
- , . ? , , ( ,
Windows),
Linux (
). " " " 21 "
, , , , , , . ,
"" Linux , , , "".
.
. ,
.
I Linux.
, , ,
Linux .
:
, , . ,
.
,
.
II , "" Linux, , , .
, ;
, Linux ; Linux, , , ,
. , ,
, . .
III ,
, , " ". , , " ",
Fedora Core.
IV . () . , -
, , !
, "" , Linux/UNIX
, .
V. , . . ,
, ,
. , . ,
, ,
, . Linux,
: , FTP, HTTP, DNS, NFS, Proxy,
. .
VI , .
, , TV , . .
,
, ,
Linux .
,
, , , alexey_stahnov@ukr.net.
.
I
Linux
Linux
, . , MP3-, , .
. : , , Linux.
.
:
;
;
(Embedded) ;
.
, , .
? :
Windows NT (Windows 2000, Windows XP, Windows 2003 Server, Windows 2008
Server, Windows Vista, Windows 7);
Embedded Windows;
Windows CE;
Mac OS X;
UNIX;
FreeBSD, OpenBSD, NetBSD;
Linux;
Embedded Linux;
QNX;
Symbian;
iOS;
MeeGo;
Android.
, , .
I. Linux
, ,
. , , , , .
,
:
(-);
( ) ;
( ,
PC-) ( , PC-, Macintosh, Sun, PowerPC);
;
;
, ;
, ;
;
. .
. . , "
" " , ?"
,
( ). . .
FreeDOS
, MS-DOS.
GNU.
BIOS ,
.
1. Linux
Embedded Windows
"" Windows. : Embedded Windows Windows CE. Embedded Windows Windows 2000, Windows XP
, "" , , "". .
, .
I. Linux
10
Mac OS X
Apple. Macintosh, X86. UNIX-, POSIX-,
. , .
NFS (Network File System). , , Macintosh, PC- . : 512 ,
5 .
iOS
Apple iOS , ,
Apple.
OS X. , . . , ,
Apple.
UNIX
,
UNIX. -: AT&T, DEC, Sun, Hewlett-Packard, IBM,
SCO . , UNIX 30 , UNIX ,
.
UNIX AT&T, . UNIX -
1. Linux
11
, , .
, , .
, ,
, .
,
UNIX. , UNIX, , ,
. UNIX-
(, BSD,
Linux). POSIX
UNIX
. UNIX ,
. , UNIX , .
,
. ,
. ,
, , ,
. ,
- , .
. ,
, UNIX.
Linux
POSIX- UNIX- . . UNIX . -
I. Linux
12
Linux , , , . Linux
(Free Software Foundation, USA) GNU (The GNU General Public License, GNU). Linux, ,
( 57 ), , , . , - DVD, , - . ,
UNIX, Linux. ,
,
, , ,
. , "" Ext2 (Ext3, Ext4). , , "" - .
Embedded Linux
Linux , -, , .
, .
Android
Linux ,
. Google.
MeeGo
Linux, . Intel Nokia.
QNX
QNX QNX Software Systems. UNIX-, POSIX, , . 99,999% (" ").
,
1. Linux
13
.
. . ( ). : 386- , 8 .
QNX "QNX Real Time Platform",
(www.qnx.com). : Pentium-200, 32 , 100 .
Symbian
Symbian Inc. EPOC Psion, .
Symbian Inc,
. . , .
,
, .
Linux, Windows 9x
Windows NT/2000/XP 90% PC- , , , , .
"" (
, Linux ,
).
? ? "" "" . . , .
,
, "". ,
. . " " ,
, -
. . , , , ,
, . .
,
. , , .
, ,
, , . .
: , - . .
14
I. Linux
Mac OS X Windows 7,
Windows XP, DOS, Windows 2008 Server, UNIX, BSD-, Linux QNX.
- (, Microsoft Windows XP ).
( , , )
. , , ,
. , Linux
KDE GNOME , ,
(. . , ), , . Windows , , "" (Advanced Users) , ,
, ,
.
, ,
:
1. (User Friendly).
2. ( ).
3. .
4. ( ).
5. .
6. , .
7. .
. . , , . ,
, , . . , , ,
, - , . . , , , 386-,
. ( , , . .) .
, , , ,
,
. ,
. .
1. Linux
15
. , (
) . . , ? ,
. . .
. . . , . 4, , . .
, ,
.
:
DOS , . 7;
Windows 3.1 . 1 , . 3 5, . 7;
OS/2 . 1 3, . 2 ( ),
. 4, 5 7;
Windows 9x . 1, . 3, . 7;
Windows NT (Windows XP, Windows Vista, Windows 2003 server) . 1, . 2 ( ), . 3 4 , . 7;
Mac OC . 1, . 2 ( ),
. 36, . 7;
Mac OC X . 1, . 2 ( ),
. 37;
UNIX- , . 1, ,
UNIX-
;
FreeBSD, OpenBSD, NetBSD UNIX-
;
Linux , . 2, 3, 6 7;
BeOS , . 7;
QNX .
, .
Mac OS X ,
, Apple ( , -
).
. QNX , . : Windows, UNIX, " " UNIX: FreeBSD, OpenBSD, NetBSD Linux.
16
I. Linux
Windows-
Linux.
-, Linux Windows .
Windows 7 Home Basic
90 ., Windows 2008 Server 740 . , Microsoft Office,
200 . , -,
. ,
. ,
. ,
57 . . .
. Microsoft -
,
,
Excel 2010, Excel 2000 .
(35 ) 13 . .
, Linux 515 ., 23 ,
. Linux , 20 . ( ). ,
Linux . , , Microsoft,
- Microsoft. -, Linux
. Linux , . , Web-,
Linux ,
, ,
15 . , . , , Linux , , , . ,
.
. , 90 .
-, Linux . Windows .
Intel , Linux. Windows 9x/ME Pentium-166
64 , Windows NT/2000/XP
Pentium II 350 128, 256
.
1. Linux
17
, .
Linux ,
. , , (,
, ) ,
(
: , ),
.
(, , ), . , Linux (
, )
, CD-ROM, , Flash- , .
Linux
. WIN-, , ,
. . . . LiveCD USB Flash- ,
Linux , .
, , . Linux . , Windows
.
" ", "". UNIX . , ,
UNIX- . Linux
, . , ,
, -,
Linux. , , .
. Microsoft
. ( ) , . ,
" ".
( , 3040 % )
. Windows ,
, . , , ,
18
I. Linux
Windows, , , . Linux
.
.
,
. Linux ,
.
. , Windows Windows 3.1x
Windows 95, , Linux ( UNIX) Windows , -
Windows .
, , ,
: 500
5 , , , , .
Linux 1,44 . - 80150 . Windows XP,
Windows 2008, .
. Windows
( ).
, . , , . ,
Linux , . .
,
. , , , . , , .
,
, . ,
, , , , . -
, Linux,
.
, Windows Linux, . Linux . , ,
Linux , , .
, Microsoft Office,
-, , -
. . , , ,
, , .
1. Linux
19
, ? , .
, ? Sony Play Station
Microsoft Xbox.
. ,
,
, , . -
. - .
Windows 1 800 000 (!!!) , . , Windows NT , , ,
, UNIX. Linux , . , ,
.
, Linux.
Linux
Linux.
UNIX. Linux
UNIX, .
, Linux , .
Linux , 95% , .
Linux , , .
Linux (99,99%) .
intranet- " ", , .
.
, Linux.
, , .
, 486- .
, .
,
, , .
I. Linux
20
Linux . -
Linux .
Linux , .
Linux, .
.
, QNX:
www.qnx.com QNX Software Systems, QNX.
, FreeBSD:
www.freebsd.org FreeBSD;
www.freebsd.ru .
, Linux:
www.linux.org.ru Linux;
www.linux.org Linux;
www.linuxdocs.org Linux;
www.linuxrsp.ru ;
www.redhat.com Red Hat;
fedoraproject.org Fedora;
www.debian.org Debian;
www.slackware.com Slackware.
, Windows:
www.microsoft.com Microsoft;
www.winfiles.com Windows.
, Apple:
www.apple.com Apple;
www.apple.ru Apple.
Linux
, Linux. ,
, . ,
, , . , .
, (, , ), , ,
, . , , . , ,
, . ,
,
"". Linux
, , . , , . Linux
,
. , , UNIX (Linux)
"-", .
. , " ".
Linux "" TCP/IP, . , ,
, .
, , Linux
I. Linux
22
UNIX , , Linux , .
, "" ,
, , "" .
.
, . ,
Linux. ,
UNIX -.
? , ,
Web-, FTP, . ( )
DNS, proxy-, , .
Linux , , , "" . , .
, , Web- : Links, Lynx, w3m , Mozilla, Opera, Konqueror, Galeon, Firefox, Nautilus .
, ,
: Pine, Mutt, Elm, Thunderbird, Kmail, Evolution, Sylpheed, Balsa, Gnus,
Aethera . .
-,
.
-, . "" NFS,
Mars - Netware, Samba -
Microsoft. , ,
2. Linux
23
. - ,
( ).
Linux . , ,
Linux, , , , Web- , ,
- . ,
linuxconf, Webmin, , GNOME KDE,
.
Web-.
ICQ -: licq, kicq, GNOMEICQ, micq, .
" ", DOS, , . Linux
Linux, , . .
, , X Window.
, , Midnight
Commander ( Norton Commander), . 2.1.
I. Linux
24
, . , X Window. ,
. Linux,
, ,
.
Web- . , . vi, UNIX,
vim, joe, pico, jed, Midnight Commander EMACS.
X Window . , Gnotepad,
, , ,
. Kedit, Gedit, Kwrite,
Kword, Ted, Abiword, OpenOffice . .
, Linux ,
- . ( ) Windows,
UNIX-. Windows, Linux (UNIX)
(X Window) : X- . - ( ,
. .) " ",
, ,
.
.
IceWM AfterStep (
2. Linux
25
, CorelDRAW Photoshop.
, . , Gimp
, , , Windows, StarDRAW , StarImage
, KimageShop .
Web-
Web- , HTML-.
Linux, , HTML- . , , HTML-, OpenOffice, Amaya,
GINF, WebMaker ( , ) Quanta Plus (
, ).
,
Linux . ,
, Linux
, "" . ,
, ,
. - : Microsoft Office, , ,
, .
, :
();
;
( );
;
I. Linux
26
;
;
. .
, ,
.
, .
Microsoft Office,
, ,
. , ,
Microsoft Office.
Linux, Microsoft Office , ,
. ,
Microsoft.
Linux .
, . .
Oracle OpenOffice
StarOffice.
Star Division, Sun Microsystems,
GPL Linux-.
OpenOffice StarOffice.
Sun Oracle .
OpenOffice ( ):
Writer ;
Calc ;
Impress ;
Draw ;
Base .
Microsoft Office , (,
Word Excel).
Oracle OpenOffice OpenOffice.org:
Unicode ;
;
Adabas D;
;
;
;
Microsoft Office StarBasic.
2. Linux
27
OpenOffice.org
, StarOffice.
. Oracle OpenOffice , (, , ) ( , . .). OpenOffice
Alt Linux, Linux, Windows. OpenOffice Pro (www.i-rs.ru "-") , , .
Koffice
, KDE.
Koffice:
KSpread ;
KPresenter ;
KChart ;
Krita ;
Karbon14 ;
KFormula ;
KWord WYSIWYG- ;
Kivio ;
Kexi Access;
Kplato .
KDE-, KDE- , , Microsoft Office, CSV RTF.
.
GNOME Workshop
, GNOME, :
AbiWord ;
Achtung ;
Balsa ;
Dia , Microsoft
Visio;
Eye of GNOME ;
Evolution , Microsoft Outlook;
Gfax ;
GIMP ;
GNOME-DB ;
I. Linux
28
Gnucash ;
Gnumeric ;
Guppi ;
MrProject ;
Sketch ;
Sodipodi ;
Toutdoux .
, Linux : IBM DB2, Informix, Oracle,
Sybase SQL Anywhere, Interbase, FireBird, PostgreeSQL, MySQL, SAP DB.
, ,
, .
Windows
Windows ( ) Linux:
Citrix MetaFrame, Mainsoft's MainWin, Win4Lin, VMWare, BOSCH, Wine, Cedega,
CrossOver . : Windows 9x,
Windows. DirectX. (Wine . , OpenGL
.) Linux , OpenGL, , DirectX, . , ,
.
Linux, UNIX, "" , , C/C++,
, , (
) .
. ! - , ,
Linux: C/C++, Pascal, Perl, Java, Lisp, Rexx, Fortran . .
. Borland Kylix Linux- Delphi (Windows).
Kylix
, Delphi ,
Linux.
Kylix
2. Linux
29
KDevelop
KDE
Qt. . ,
MS Visual C++ (. 2.2). a2ps,
Khexedit, KTranslator . . .
GNU Compiler Collection, C,C++, Pasccal, Fortran, Perl, Python, PHP, Java, Ruby Ada.
. 2.2. KDevelop
I. Linux
30
Glade
GTK+ (. 2.3).
. 2.3. Glade
Rhide
DOS Turbo Vision. C, C++, Assembler, Pascal Fortran. gdb , Turbo Debugger.
, , .
Eclipse
. ,
. Java, .
2. Linux
31
. 2.4. Eclipse
. 2.5. Lazarus
I. Linux
32
Lazarus
Free Pascal.
-.
Delphi.
, , ,
.
, , WAV- MIDI-,
MPEG-3, -CD.
( ), , . , RedHat .
- . .
.
. KDE
CD-, Windows. ,
, , GNOME.
, , . Linux , , (. 2.6). , KDE GNOME ,
.
. 2.6. GMIX,
2. Linux
33
KDE GNOME
WAV-. MPEG-3,
mpg123 ,
. MP3- KDE
GNOME, XMMS ( Winamp Windows) KJukeBox. MP3, , (Grip, ),
, ,
( ). Vorbis .
,
TV-. Linux, ,
USB TV-. ( , Linux, , - .) . KDE
aKtion, AVI, MPEG, Quick Time, FLI/FLC-. ( ,
, ) (
) .
( BMP ). .
, MPEG-4 (DivX),
Mplayer Xine.
Linux . , Miro, . . ,
.
. , , . , - .
. Linux
, , , , , . . ,
, ,
.
, .
- Linux . Sony PlayStation, Nintendo Windows.
Linux . ( ) , Linux ,
I. Linux
34
, Linux .
. , Linux ,
, . , KDE, GNOME OpenOffice. . , , ,
Linux. , Linux .
www.freshmeat.net ,
Linux .
www.openoffice.org OpenOffice.
koffice.kde.org Koffice.
www.kdevelop.org KDevelop.
www.borland.com Borland, Kylix.
www.gnome.org GNOME.
www.kde.org KDE.
www.mozilla.org Mozilla.
www.opera.com - Opera.
www.linuxdocs.org Linux.
www.linux-ve.chat.ru , Linux.
www.citforum.ru ,
Linux.
www.linux.org.ru , Linux.
www.applix.com - Applixware.
www.mysql.org MySQL.
www.interbase.com Interbase.
www.idsoftware.com Doom, Quake, Quake II, Quake III.
www.lokigames.com , Windows- Linux.
www.linuxgames.org.ru , Linux.
. ? ?
?
, ,
,
. , , , , , , .
,
, -
( , ).
. , ""
.
. , , . , , , .
.
, .
, . () , , , ,
. .
,
. ,
:
;
, ;
"" ( ,
, . patch , );
I. Linux
36
;
-, ;
;
,
23 ;
;
;
-,
() .
. ,
. ""
. "" "" , , , .
,
:
;
,
,
, ;
, ,
. .;
, .
, ,
, .
distrowatch.com.
Linux: Debian, Red Hat,
Slackware, Gentoo (Source Based distributive) , "".
Debian
, Debian, DEB.
- Debian. Web-: www.debian.org. , "stable", "testing"
"unstable". ("unstable") . ,
("testing") ,
, . ("stable") .
, , -
2.
37
.
.
Adamantix , .
Amber Linux , .
Damn Small Linux LiveCD- 50 .
StormLinux , . Web-: www.stormlinux.com.
Symphony OS , .
Knoppix Klaus Knopper. ,
LiveCD, . , LiveCD- . Web-: www.knoppix.org.
Bonzai Marcus Moeller. Debian KDE, 180 . Web: http://www.gnulinux.de.
Ubuntu , Debian
Canonical Ltd. . " "
Debian. , ,
:
Kubuntu KDE;
Xubuntu Xfce;
Edubuntu ;
nUbuntu ;
Ubuntu Studio -.
Red Hat
, Red Hat RPM
.
Red Hat Red Hat. . . . Web-: www.redhat.com.
Fedora Red Hat, " ".
Red Hat , , . Web-: www.fedoraproject.org.
ASP Linux (ASP, Advanced Server Platform) SWsoft. , . Web-: www.asplinux.ru.
AltLinux Alt Linux Team. , ,
. ,
I. Linux
38
Slackware
, Slackware, TGZ.
Slackware Patrick Volkerding, Walnut Creek CDROM. . ,
Linux. , , ( ). Web-: www.slackware.com.
SuSE Linux Novell. . Web-: www.novell.com/linux.
OpenSUSE SuSE ,
OpenSUSE, Nowell.
Yast2.
VectorLinux .
LiveCD-. Web-: www.vectorlinux.org.
Gentoo
( , Gentoo ,
) ,
. , Gentoo,
. , -
2.
39
. Gentoo .
Gentoo Linux Daniel Robbins, Stampede Linux
FreeBSD. "" FreeBSD Gentoo
"portage". Web-: www.gentoo.org, www.gentoo.ru.
Calculate Linux , Linux/UNIX, . Linux Active Directory.
Web-: www.calculate-linux.ru.
Linux From Scratch (" ") , [ .], .
www.linuxfromscratch.org.
. ( LiveCD .)
-:
Beyond Linux From Scratch LFS;
Hardened Linux From Scratch LFS ;
Automated Linux From Scratch LFS BLFS;
Cross Linux From Scratch -.
Web-, .
LiveCD
LiveCD
. Linux,
-, -.
( ,
, , , ), (
, -,
). "" , --
(185 ) - (50 ).
LiveCD, , , . .
Knoppix Klaus Knopper. , LiveCD,
. ,
LiveCD . ,
"" . ,
KNOPPIX Remastering HOWTO, , "". Web-:
www.knopper.org.
I. Linux
40
Cool Linux . -
. -
, CD-ROM CD-RW. Web-:
www.coollinux.sourceforge.net.
Slackware LiveCD Slackware. , . Web-: http://www.slackware-live.org.
Fedora LiveCD Fedora.
Eagle Linux ISO- 22 .
, , . Web-: http://eaglelinux.w32.net.
LNX-BBC Linux Bootable Business Card.
, -.
,
. Web-: http://www.lnx-bbc.org.
MoviX . , "" mplayer: avi, DivX, mpeg, mp3,
ogg/vorbis . Web-: http://movix.sourceforge.net.
GeeXboX MoviX , TV-out,
.
USB Flash
LiveCD, ,
.
USB-. Mandriva 2 GB Flash- Mandriva Linux.
KDE, Open Office, Mozilla Amarok, K3b, Gimp .
Domn Small Linux 50 . , LiveCD,
- Flash-.
:
, , . "",
-. ""
, .
2Disk Xwindow Linux Debian 2.2
. , UNIX. X Window, PPP
, alloywm, Web- chimera, chat,
xfm, iptables, inetd crond, DHCP ,
xedit , , xpaint.
2.
41
, . . .
: 486DX c 32 M . Web-: http://www.thepub.nildram.co.uk/
mirrors/2diskxwin/.
Alfalinux Giancarlo Erra.
Slackware, .
Web-: http://alfalinux.sourceforge.net.
Embedded Linux , . HTTP+CGI-, FTP-, Telet- TFTP-, lynx snarf. dialup Ethernet, SNMP-. : i386 CPU 16 M .
. Web-: http://www.dobit.com/emblin.
Ulric's Router Construction Kit
, 2.4.x. Web-: http://siag.nu/urck.
Linux Router Project Dave Cinege.
( 2003 ,
LEAF Project http://leaf.sourceforge.net/). Web-: http://linuxrouter.org.
Freesco
. Web-: http://www.freesco.org/, http://freesco.linux.kiev.ua/.
. ,
. , Fedora Linux.
, . FAQ Linux, , .
,
( ).
, Red Hat. () .
distrowatch.com , .
www.debian.org Debian.
www.redhat.com Red Hat.
www.slackware.com Slackware.
www.gentoo.org, www.gentoo.ru Gentoo.
www.knoppix.org Knoppix.
www.ubuntu.com ubuntu.
fedoraproject.org Fedora.
www.asplinux.ru Asplinux.
www.altlinux.ru ALT Linux.
opensuse.org OpenSUSE.
www.linuxfromscratch.org ,
Linux-, .
II
Linux
.
, . , " ". .
, ,
.
, :
(OSI);
TCP/IP.
, (. 4.1).
4.1.
,
TCP/IP
IP (Internet Protocol,
)
TCP/IP. IP
II. Linux
46
4.1 ()
(Node, Host)
. ,
Telnet
, ,
(OSI)
1983 (International Organization for Standardization, ISO)
(Open System Interconnection, OSI).
.
1. (Physical Level).
2. (Data Link Level) (
" ").
3. (Network Level).
4. (Transport Level).
5. (Session Level).
6. (Presentation Level).
7. (Application Level).
4. .
47
,
.
OSI , , , . , "" ,
, :
. . 4.2 OSI.
(. 4.3).
4.2. OSI
. , , , . .
( )
( )
4.3.
()
5, 6, 7
, OSI
GOSIP (Government Open Systems
Interconnection Profile, ),
II. Linux
48
OSI
. :
;
"" ;
;
TCP/IP .
OSI , , , .
TCP/IP
TCP/IP (Transmission Control Protocol / Internet Protocol, / -)
, : , .
,
:
1. (Network interface layer).
2. * (Internet layer).
3. (Host-to-host Layer).
4. / (Application/process layer).
OSI TCP/IP
, TCP/IP OSI (. 4.4).
4.4. TCP/IP OSI
TCP/IP
OSI
()
"" , ,
. .
4. .
49
,
.
TCP/IP
TCP/IP :
(Internet Protocol, IP ) -
- TCP/IP.
;
(Internet Control Message Protocol,
ICMP) IP, , ;
(Address Resolution Protocol, ARP) MAC-
(Media Access Control). ;
(User Datagram Protocol, UDP) IP;
(Transmission Control Protocol, TCP) ( ) IP;
(FTP, Telnet, IMAP, SMTP .).
TCP/IP . 4.5.
4.5. TCP/IP
FTP
TCP
UDP
()
IP
ARP/RARP
SMTP
NFS
SNMP
ICMP
, , . .
()
()
TCP/IP TCP/IP, ARP/RARP ICMP.
IP
IP 1970- , . IP (
II. Linux
50
IPv4, IPv6). - ,
IPv6, , ,
IPv4.
IPv4
IP . :
(VERS) IP.
4 6;
(HLEN) IP 4
, 32- .
20 ( 32- ),
(IP OPTIONS);
(SERVICE TYPE) 1 . (PRECEDENCE). 0
( ) 7 ( ).
, . D (delay) , , T , R ;
(TOTAL LENGTH) 2
;
(IDENTIFICATION) 2 ,
. ;
(FLAGS) 3
( Do not Fragment, DF
), ,
( More Fragments, MF , );
(FRAGMENT OFFSET) 13
, .
/ ;
(TIME TO LIVE) 1 ,
.
IP.
,
4. .
51
( ). ;
(PROTOCOL) 1
, (,
TCP, UDP RIP);
(HEADER CHECKSUM) 2 , ;
(SOURCE IP ADDRESS) (DESTINATION
IP ADDRESS) (32 ) ;
(IP OPTIONS) ,
. , . ,
32- .
, , 65 535 , , IP-.
, , IP.
MTU (Maximum
Transfer Unit). , Ethernet MTU, 1500 ,
FDDI 4096 .
IP- ,
, . ,
.
,
. , ,
, , ICMP
.
IPv6
IPv6:
IPv4 1970-
. ,
;
, (, ), ,
. .
II. Linux
52
IPv4
;
.
, IP
. ,
, .
IP
IETF (Internet Engineering Task Force, ). IETF IPv6
IPv4. , , ( , ) .
IPv6
IPv4:
128- (16 );
.
( ) IPv6 ;
;
.
, .
IPv6
IPv6 128 16 . 6 4 :
Unicast .
.
;
Cluster . , (, ).
, (, );
Multicast , .
, .
IPv4, IPv6 ,
.
.
,
, Provider-Assigned Unicast.
IPv4 IPv6
, 0000 0000 . 4
4. .
53
, . .
. .
,
. , .
. , , ,
. ,
. . ,
.
(Interior
Gateway Protocol, IGP) (Exterior Gateway Protocol, EGP).
, " ". , ,
. .
:
RIP (Routing Information Protocol) . .
routed,
UNIX-;
OSPF (Open Shortest Path First) .
. .
, RIP, ; gated;
IGRP (Interior Gateway Routing Protocol) . CISCO;
EGP (Exterior Gateway Protocol) .
. BGP;
BGP (Border Gateway Protocol) .
EGP,
;
II. Linux
54
;
RIP, OSPF IGRP ; EGP BGP .
TCP/IP
IP :
, (, Ethernet), , .
, , - (Media Access Control) . MAC- () , . . , Ethernet-
MAC-.
- 6- : 3
-, 3
;
IP-, 4 ( IPv4) 16 ( IPv6).
.
. IP- : .
(Network Information
Center, NIC), ;
-, tosser.mail.ru. , , ,
, . - , FTP.
IP- : . .
, , , ( , IP-). IP-
( ), , 192.168.44.2.
. 0.0.0.0, 127.0.0.1, 255.255.255.255 .
(. 4.6). (,
, ).
IP- InterNIC, 45 IP-,
-.
. :
10.0.0.010.255.255.255
172.16.0.0172.31.255.255
192.168.0.0192.168.255.255
4. .
55
4.6.
126
...
128191
...
192223
...
254
224239
, ,
240254
* "" , .
, A, B C .
, B, 256
C.
IP- :
, ,
. , 0.0.0.145 145 ,
0.0.0.0 ;
127... ,
. 127.0.0.1
localhost;
, - 255, . , , 192.168.3.255,
192.168.3, , 255.255.255.255,
(,
).
:
_.3.2.1
: www.rambler.ru, www.yahoo.com.
. ,
, , .info, .shop, .name. ,
com, org, net, mil ,
: ru , ua , uk .
. com .
.
, lib.ru, (odessa.ua),
com, org, net, mil, ,
II. Linux
56
. : ,
, , .
ARP/RARP
, IP- IP, MAC- (, "-"). MAC- IP- ARP
(Address Resolution Protocol) .
, . ARP
.
, MAC- . ARP,
.
IP-.
RARP (Reverse Address Resolution Protocol, ).
ICMP
ICMP (Internet
Control Message Protocol) IP,
,
. ICMP- IP . ICMP-.
. , , , .
. 4.7 ICMP-.
4.7. ICMP-
.
0,
1, 4 5.
2 3
4. .
57
4.7 ()
,
DF (
)
.
0,
1, 4 5.
2 3
.
,
.
,
, .
, , .
,
. , 0
- .
- .
-
. ,
,
, -.
, 0
II. Linux
58
4.7 ()
0,
1
.
, ,
, ,
.
.
, . 0
,
13
.
,
.
32 , ,
(UT). , .
,
.
,
, .
,
0
14
15
.
, IP- .
IP- .
,
, .
,
0
16
11
12
4. .
59
TCP UDP IP
. , (port number), , . 2 .
, RFC1700 (Request For Comments,
, ). . 4.8.
4.8.
Echo
20
FTP-data
21
FTP
23
Telnet
25
SMTP
53
Domain
DNS
80
HTTP
WWW
110
POP3
119
NNTP
123
NTP
161
SNMP
179
BGP
TCP
TCP . .
TCP:
.
;
.
;
II. Linux
60
""
, ,
. , "" .
;
.
, TCP, . , .
UDP
UDP . , ,
UDP, , .
. , , . UDP , TCP.
, UDP:
DNS;
, NTP;
, BOOTP.
, ( , . .)
.
TCP.
, . ,
, ,
. "" , RFC.
( TCP),
(
UDP). (, SMTP, HTTP),
.
4. .
61
FTP
. .
, , . .
. " "
FTP TFTP, , , .
SMTP
. . , ,
telnet 25- (SMTP) .
Telnet
. ,
( , . .). . , . . ( ) . SSH.
NFS
, Sun,
"". ,
100 ,
, . NFS
, NFS "" .
IPX
IPX (Internet Packet Exchange) , Novell NetWare. ,
, Novell TCP/IP, TCP/IP "" NetWare. IPX - .
IPX IDP (Internet Datagram
Protocol), - Xerox. IPX
.
IPX , :
RIP;
SPX (Sequenced Packet Exchange),
;
II. Linux
62
Echo;
;
PEP (Packet Exchange Protocol);
SAP (Service Advertisement Protocol).
Linux (Mars),
NetWare, , NetWare.
Linux, IPX.
NetBIOS
Microsoft.
Microsoft
TCP/IP.
, RFC (Request For
Comments). . 4.9 .
4.9.
RFC768
UDP
RFC791
IP
RFC792
ICMP
RFC793
TCP
RFC821
SMTP
RFC826, RFC903
ARP/RARP
EGP
RFC854
Telnet
RFC950
RFC959
FTP
RFC1058
RIP
RFC1094
NFS
RFC1157
SNMP
RFC1178
RFC1180
TCP/IP
RFC1208
RFC1219
4. .
63
4.9 ()
RFC1234
IPX- IP
RFC1245, RFC1246,
RFC1247, RFC1583
OSPF
RFC1267
BGP
RFC1597
IP-
RFC1700
www.rfc-editor.org , RFC.
, ,
. , . ""
(, FAT 16/
FAT 32). , Linux.
Linux
Linux Minix, , ,
( ,
). ( 1990, 386- ,
120 ) Minix . ( 16-,
64 , , 14 )
.
"Extended File System" (Ext FS ),
"Second Extended File System" (Ext2FS ). Ext3 , Ext2, Ext2.
Ext4.
: ReiserFS JFS IBM, XFS SGI.
Linux.
, ,
. Linux , , . .
5.
65
(
, , . .), . Linux :
;
;
;
(FIFO, PIPE);
(soft link);
(Socket).
.
. .
.
. , ,
, .
. . " Ext2".
Linux . . : .
( ),
. , .
.
, , .
,
,
.
, .
(, ).
II. Linux
66
, ,
"" :
ls l , .
.
, .
, ,
. , .
TCP/IP.
Linux , : , . ,
, . Linux.
( ) (
/ ) , .
, .
( ) .
( root).
chmod.
(- ,
) :
, ,
. .
( ) , . ,
. , , 644, , , .
, ,
.
5.
67
;
.
:
;
.
:
;
.
, , ,
ls. ls l 5.1.
5.1
lrwxrwxrwx
1 root
root
4 31
-rwxr-xr-x
1 root
root
93 22
2010
4odb_clean
-rwxr-xr-x
1 root
root
93 22
2010
4odb_clear
-rwxr-xr-x
1 root
root
95 22
2010
4odb_create
-rwxr-xr-x
1 root
root
97 22
2010
4odb_destroy
-rwxr-xr-x
1 root
root
89 22
2010
4odb_dig
-rwxr-xr-x
1 root
root
93 22
2010
4odb_grant
-rwxr-xr-x
1 root
root
-rwxr-xr-x
1 root
root
99 22
2010 4odb_odmsdump
drwxr-xr-x
1 root
root
99 22
2010 t
97 22
2010 4odb_metadig
, , ,
, .
test ( l , , ). t
( d , (directory), ). . .
(, , . .). : rwx (, , ).
, .
, . :
Sticky bit (Save Text Attribute) "" ;
SUID (Set User ID) ;
SGID .
II. Linux
68
.
Sticky bit
.
Sticky bit , , , ,
,
.
SUID SUID , , , . ""
, ,
. , ,
passwd, ( root) SUID, (/etc/passwd), root.
SGID SUID,
.
SGID , , , .
, , ls. ls l:
-r-s--x--x
1 root
root
13536 12
2010 passwd
, SUID- ( s ).
,
.
,
. ( , ).
Linux ( UNIX):
;
(inode);
;
( );
;
.
5.
69
Linux . .
Minix ,
( ,
30 ) ( 64
).
Xia Minix, .
Ext Ext2.
.
Ext2
Linux. .
Ext3 Ext2. . .
Ext4 Ext3. 1 (260 ).
, Ext4 (
), .
VFS . -
(MS-DOS, Ext2, xia . .)
Linux.
Proc ,
.
Sysfs .
ReiserFS Linux.
Devfs ,
.
.
Linux
.
, UNIX.
msdos MS-DOS.
umsdos MS-DOS
Linux , Linux , , , , , .
() Linux MS-DOS.
iso9660 CD-ROM.
xenix Xenix.
II. Linux
70
.
NTFS , Windows Nt/2000/XP.
. 5.1 ,
.
5.1.
Minix FS
Xia FS
Ext FS
Ext2 FS
Ext4 FS
64
64
64
16 T
30
248
255
255
256
mkfs. . mkfs .
, mkfs, . mkfs
man ( ).
,
.
, , . , , :
1. - .
2. .
5.
71
.
. " "
( ) ( , Zip100 Zip250),
, , . " " ( ),
. , .
( UNIX) .
Linux
.
Linux , , DOS/Windows, , .
( )
,
. -
, ,
. /
: mount umount.
mount , . ,
, , ( , CD-ROM, floppy). , .
:
mount /dev/hda1 /mnt.
( ),
, .
/etc/fstab,
.
. ,
, .
, . Flash-
CD/DVD ( ).
umount. .
:
umount /dev/hda1
umount /mnt/floppy.
72
II. Linux
. Linux ""
, , Flash ,
.
root. . :
KDE GNOME CD/DVD-ROM
Flash-;
root, / ;
sudo, mount ;
mtools,
MS-DOS;
, , ( ) /etc/fstab;
, , PAM
pam_console.
.
.
( Reset, ) .
fsck. , ( ) .
,
. Ext2 , , . , /etc/fastboot.
, . fsck .
fsck , , .
5.
73
fsck (
,
read-only), . . ,
-
, .
badblocks.
, fsck .
(VFS)
VFS ,
.
Linux -, .
/. .
( ,
). , (
) .
, . , , .
, ,
, .
.
VFS
,
(, , ,
). , : , .
,
. . ,
/.
II. Linux
74
: ,
, , . , ,
, .
: . , , . ,
,
, .
Ext2
Ext2 (The Second Extended File System,
) ,
Ext (Extended File System), .
Ext2
Ext2 UNIX:
;
;
;
.
Ext2 , . (
255 ). Ext2
root, .
Ext2
Ext2 ,
, .
Ext2
: 1024, 2048 4096 .
/, .
Ext2 .
. , .
.
60 .
Ext2
. read/write,
5.
75
Ext2
, Ext2 .
(primary, Fdisk Microsoft)
,
.
(1, 2 4 ).
( ).
.
, , .
. (. 5.1).
, . ,
, 1024
1024 . .
II. Linux
76
(Superblock)
(Group Descriptors)
(Block Bitmap)
(Inode Bitmap)
(Inode Table)
. 5.1.
.
,
, . , , ,
. :
SHORT (1 );
USHORT (1 );
LONG (4 );
ULONG (4 ).
1 (. 1.1).
(Group Descriptors). 1 (. 1.2).
(Block Bitmap) , , - . , .
, .
(Inode Bitmap)
,
.
. ,
. , ,
, .
(i_mode) ,
.
.
5.
77
, , ,
.
. Ext2 i_block .
i_block
15 . 12 (EXT2_NDIR_BLOCKS [12])
,
. 13- ( ), . 14-
i_block (double indirect block), , ,
, ,
.
i_block
, . . , .
Ext2 /
. / , .
Ext2, ,
8 . ,
.
Ext2
,
:
mke2fs ,
Ext2;
tune2fs ;
e2fsck ;
ext2ed ;
debugfs .
e2fsck ,
. e2fsck .
, .
78
II. Linux
e2fsck , , 1B 1D ,
.
. ,
.
"." ( ) ".." ( ), "." .
. e2fsck
. ".." . ,
, /lost+found.
e2fsck
. /lost+found.
e2fsck
. ,
, , , .
,
, , (, ).
, , , .
fsck ,
, .
, , . , ,
.
, . ,
, (). , () , , , . .
,
.
.
, , ,
5.
79
,
: ,
.
Ext3
, Ext3 . FAT 16/FAT 32 , .
. , ,
Ext2
Ext3 . ,
, . Ext2 : , . .
Ext4
Ext4 Ext3.
, .
Ext3 .
.
( 128 M) . inode, .
48- . 4K
c .
(multiblock allocation).
, , .
, .
.
(delayed allocation).
.
, . .
32000 . Ext3 32 000 .
inode (directory inodes reservation).
inode. ,
II. Linux
80
inode, , .
inode. inode ( ) 128 256 .
(nanosecond timestamps).
, inode:
25 2514 .
inode. inode , inode . , , NFSv4 , .
inode (EA in inode). , ACL, SELinux ,
. , inode,
4 .
(Journal checksumming).
.
(persistent preallocation). Ext4 . , , .
, .
(online Defragmentation).
e2fsprogs.
(uninitialised groups). . fsck. ,
, , ,
, . , 210 .
, , .
ReiserFS
,
Ext2 :
, .
, . ,
( , ),
.
ReiserFS " "
"B+Trees", , .
5.
81
. ReiserFS
: , . . .
, ReiserFS , . . . ReiserFS
.
e2fsprogs.sourceforge.net Ext2.
www.nongnu.org/ext2-doc/ Ext2.
ftp.uk.linux.org/pub/linux/sct/fs/jfs/ Ext3.
xgu.ru/wiki/Ext4 Ext4.
www.atnf.csiro.au/~rgooch/linux/docs/vfs.txt
.
www.osp.ru/pcworld/2000/02/064.htm . , , . .
www.opennet.ru/docs/RUS/fs/ ReiserFS,
tmpfs, devfs, Ext3 XFS ().
http://xgu.ru/wiki/Ext4 Ext4.
Linux
Linux. ,
Red Hat.
Linux,
. UNIX Linux
"Filesystem Hierarchy Standard Version 2.3 final", Filesystem
Hierarchy Standard Group, edited by Rusty Russell, Daniel Quinlan and Christopher
Yeoh, January 28, 2004.
.
(shareable,
) / .
, :
, , . . , ;
, , ;
, , , ;
() , .
, . 6.1 ,
.
6.1.
/usr/opt
/etc/boot
/var/mail
/var/lock/var/run
/var/spool/news
6. Linux
83
, -
. , ,
.
Linux
. 6.2 .
6.2. Linux
(Root) .
/bin
/boot
/dev
/etc
Host-
/home
/lib
/lost+found
/media
(, CD-ROM)
/mnt
/opt
/proc
proc,
/root
root
/sbin
/srv
/sys
sysfs, /proc
/tmp
/usr
/var
(Root)
.
"" . , ( Linux
II. Linux
84
: DOS/Windows
, ) ,
. , , ,
, (backup) . /usr, /opt, /var ,
, . Slackware
(
), Red Hat
/boot.
, :
(, );
,
- .
;
.
/bin
, , . , /bin
,
(single mode).
, . /bin
. ,
,
/usr/bin.
, /bin (
):
cat ;
chgrp ;
chmod ;
chown ;
cp ;
date ;
dd ;
df ;
dmesg ;
echo ;
false " " (unsuccessfully);
6. Linux
85
hostname ;
kill ;
ln (, ) ;
login ;
ls ;
mkdir ;
mknod ;
more ;
mount ;
mv ;
ps ;
pwd ;
rm ;
rmdir ;
sed ;
setserial ;
sh Bourne;
sty ;
su (user ID);
sync (flush) ;
true "" (successfully);
umount ;
uname .
sh, sh .
, /bin :
csh C shell;
ed ;
tar ;
cpio ;
gzip GNU;
gunzip GNU;
zcat GNU;
netstat ;
ping ICMP- .
/boot
, , . /boot , ,
(user-mode).
master boot
. /etc. , ,
II. Linux
86
kernel.h-2.6.3
map
message
module-info@
module-info-2.6.2-2 os2_d.b
System.map@
System.map-2.6.2-2
vmlinux-2.6.2-2*
vmlinuz@
vmlinuz-2.6.2-2
/dev
. /dev
makedev,
. makedev.local,
. Linux Allocated Devices, .
/etc
,
.
. /etc /opt, , /opt.
/etc :
/cron.d cron;
/cron.daily cron anacron;
/cron.hourly cron anacron;
/cron.monthly cron anacron;
/cron.weekly cron anacron;
/default , shadow
;
/gnome , GNOME ( GNOME
GNOME);
/kde ,
KDE ( KDE KDE);
6. Linux
87
/locale ;
/opt , /opt.
( , /opt) ,
, /opt,
;
/ppp , pppd. , PPP- IPv4 IPv6,
;
/rc.d , ;
samba Samba. , :
lmhosts ;
smbpasswd Samba;
smbusers ,
, Samba;
smb.conf ;
/sgml SGML XML;
/skel .
, .
,
. , ,
, , - . , , ,
. -
.
, , , , .
:
.bashrc
.bash_logout
.less
.Xdefaults
.bash_profile
.inputrc
.xinitrc
, , ;
/sysconfig ;
/X11 X Window System.
/etc :
aliases ,
, .
root;
anacrontab anacron.
(, , ) , (
).
II. Linux
88
anacron ,
cron. anacron ,
(24 ).
;
at.allow , at;
at.deny , at;
bashrc , bash. , ;
cron.allow ,
cron;
cron.deny , cron;
crontab cron.
(, , , ) , (
).
cron .
, , -
, cron . anacron;
cron.allow cron . , cron, cron.allow;
cron.deny cron, c
cron
, cron.allow;
dir_colors , ls
. ;
exports NFS;
fstab ,
( ), ,
. fstab 6.1.
6.1
LABEL=/
ext3
defaults
1 1
LABEL=/boot
/boot
ext2
defaults
1 2
none
/dev/pts
devpts
gid=5,mode=620
0 0
none
/proc
proc
defaults
0 0
none
/dev/shm
tmpfs
defaults
0 0
/dev/hda8
swap
swap
defaults
0 0
/dev/cdrom
/mnt/cdrom
iso9660
noauto,owner,kudzu,ro 0 0
/dev/fd0
/mnt/floppy
auto
noauto,owner,kudzu
0 0
6. Linux
89
ftpusers FTP-, -
FTP ;
gateways (gateways)
routed;
gettydefs , getty;
group , .
:
;
;
GUID ;
, .
group 6.2.
6.2
root:x:0:root
bin:x:1:root,bin,daemon
daemon:x:2:root,bin,daemon
sys:x:3:root,bin,adm
adm:x:4:root,adm,daemon
wheel:x:10:root
mail:x:12:mail
news:x:13:news
nobody:x:99:
users:x:100:
slocate:x:21:
floppy:x:19:
utmp:x:22:
mysql:x:27:
alst:x:500:
gshadow ( 6.3) -
group.
6.3
root:::root
bin:::root,bin,daemon
daemon:::root,bin,daemon
sys:::root,bin,adm
adm:::root,adm,daemon
disk:::root
lp:::daemon,lp
mem:::
II. Linux
90
kmem:::
wheel:::root
utmp:x::
mailnull:x::
mysql:x::
alst:!::
host.conf ,
IP-. :
order hosts,bind
hostname .
hostname;
hosts "IP-
". ,
:
127.0.0.1 localhost.localdomain localhost
, , (
sendmail).
hosts.allow , ;
hosts.deny , ;
hosts.equiv rlogin, rsh, rcp;
hosts.lpd lpd;
inetd.conf inetd;
inittab init. ,
init ;
issue , "login:".
ld.so.conf ;
localtime , , / , . , /usr/share/zoneinfo/, /etc localtime.
, localtime,
zic;
man.config ,
man;
modules.conf ,
. TV- , ;
6. Linux
91
motd , ;
mtab ;
mtools.conf mtools;
networks ;
passwd ,
, . passwd 6.4.
6.4
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
news:x:9:13:news:/var/spool/news:
uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
games:x:12:100:games:/usr/games:/sbin/nologin
gopher:x:13:30:gopher:/var/gopher:/sbin/nologin
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
nobody:x:99:99:Nobody:/:/sbin/nologin
mailnull:x:47:47::/var/spool/mqueue:/dev/null
rpm:x:37:37::/var/lib/rpm:/bin/bash
xfs:x:43:43:X Font Server:/etc/X11/fs:/bin/false
ntp:x:38:38::/etc/ntp:/sbin/nologin
rpc:x:32:32:Portmapper RPC user:/:/bin/false
gdm:x:42:42::/var/gdm:/sbin/nologin
rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin
nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/sbin/nologin
nscd:x:28:28:NSCD Daemon:/:/bin/false
ident:x:98:98:pident user:/:/sbin/nologin
radvd:x:75:75:radvd user:/:/bin/false
apache:x:48:48:Apache:/var/www:/bin/false
squid:x:23:23::/var/spool/squid:/dev/null
pcap:x:77:77::/var/arpwatch:/bin/nologin
mysql:x:27:27:MySQL Server:/var/lib/mysql:/bin/bash
vasya:x:500:500::/home/vasya:/bin/bash
II. Linux
92
6.4 .
, .
:
;
; ( x). shadow;
UID ;
GID ;
(, . .). ;
;
, .
, root, passwd.
,
, /sbin/nologin
/dev/null. ( shadow);
printcap lpd;
profile sh. , ,
;
protocols IP-;
resolv.conf Resolver;
rpc RPC- ;
securetty (root);
sendmail.cf sendmail ;
services .
, :
;
/;
;
.
services:
tcpmux
1/tcp
tcpmux
1/udp
shadow , passwd. -
. . ,
*.
, *.
shadow 6.5.
6. Linux
93
6.5
root:$1$zA+N$ZL.87fvylY.:11689:0:99999:7:::
bin:*:11689:0:99999:7:::
daemon:*:11689:0:99999:7:::
adm:*:11689:0:99999:7:::
lp:*:11689:0:99999:7:::
shells ;
sysctl.conf . -
.
sysctl.conf 6.6.
6.6
# Disables packet forwarding
net.ipv4.ip_forward = 0
# Enables source route verification
net.ipv4.conf.default.rp_filter = 1
# Disables the magic-sysrq key
kernel.sysrq = 0
syslog.conf syslogd.
/etc/rc.d
,
Linux :
/init.d ;
/rc0.d ,
;
/rc1.d ,
;
/rc2.d ,
;
/rc3.d ,
;
/rc4.d ,
;
/rc5.d ,
;
/rc6.d ,
;
II. Linux
94
rc
;
rc.local , -
;
rc.sysinit , .
/etc/rc.d/init.d
,
( )
.
, :
anacron
ipchains
nfslock
sendmail
apmd
iptables
nscd
single
arpwatch
isdn
portmap
snmpd
atd
kdcrotate
pppoe
sshd
autofs
keytable
random
syslog
crond
killall
awdevices
tux
functions
kudzu
rhnsd
windows
gpm
lpd
rstatd
xfs
halt
netfs
rusersd
xinetd
httpd
network
rwalld
ypbind
identd
nfs
rwhod
ppasswdd
ypserv
/etc/rc.d/rc0.d rc6.d
,
. ,
/rc3.d :
K03rhnsd
K50tux
S13portmap
S56xinetd
K15httpd
K65identd
S14nfslock
S60lpd
K20nfs
K73ypbind
S17keytable
S80isdn
K20rstatd
K74nscd
S20random
S80pppoe
K20rusersd
K74ypserv
S25netfs
S80sendmail
K20rwalld
S05kudzu
S26apmd
S85gpm
K20rwhod
S08ipchains
S28autofs
S90crond
K34yppasswdd
S08iptables
S40atd
S90xfs
K45arpwatch
S10network
S55sshd
S95anacron
K50snmp
S12syslog
S56rawdevices
S99local
S99windows/etc/sysconfig
, .
6. Linux
95
:
/etc/sysconfig/apm-scripts , apmd,
.
, ;
/etc/sysconfig/cbq cbq ( -). ;
/etc/sysconfig/console .
/etc/sysconfig/console/default.kmap ;
/etc/sysconfig/network/ , , ;
/etc/sysconfig/clock
( , , / . .);
/etc/sysconfig/i18n/ , , .
/sysconfig :
apmd ;
arpwatch arpwatch;
clock .
:
ZONE="Europe/Kiev"
UTC=false
ARC=false
, , ( + 2 );
gpm gpm , ;
harddisks
. hdparm;
hwconf kudzu. 6.7.
6.7
class: OTHER
bus: PCI
detached: 0
driver: agpgart
desc: "Intel Corporation|82815 815 Chipset Host Bridge and Memory Controller Hub"
vendorId: 8086
deviceId: 1130
subVendorId: 8086
II. Linux
96
subDeviceId: 1130
pciType: 1
class: OTHER
bus: PCI
detached: 0
driver: unknown
6. Linux
vendorId: 8086
deviceId: 244b
subVendorId: 8086
subDeviceId: 244b
pciType: 1
class: OTHER
bus: PCI
detached: 0
driver: unknown
desc: "Intel Corporation|82820 820 (Camino 2) Chipset SMBus"
vendorId: 8086
deviceId: 2443
subVendorId: 8086
subDeviceId: 244b
pciType: 1
class: OTHER
bus: PCI
detached: 0
driver: btaudio
desc: "Brooktree Corporation|Bt878"
vendorId: 109e
deviceId: 0878
subVendorId: 0000
subDeviceId: 0000
pciType: 1
class: OTHER
bus: USB
detached: 0
driver: unknown
desc: "USB UHCI Root Hub"
usbclass: 9
usbsubclass: 0
usbprotocol: 0
usbbus: 1
usblevel: 0
usbport: 0
vendorId: 0000
deviceId: 0000
productrevision: unknown
97
II. Linux
98
class: OTHER
bus: USB
detached: 0
driver: unknown
desc: "USB UHCI Root Hub"
usbclass: 9
usbsubclass: 0
usbprotocol: 0
usbbus: 2
usblevel: 0
usbport: 0
vendorId: 0000
deviceId: 0000
productrevision: unknown
class: MOUSE
bus: PSAUX
detached: 0
device: psaux
driver: generic3ps/2
desc: "Generic 3 Button Mouse (PS/2)"
class: AUDIO
bus: PCI
detached: 0
driver: i810_audio
6. Linux
bus: PCI
detached: 0
driver: Card:NVIDIA GeForce 2 MX (generic)
desc: "nVidia Corporation|NV11"
vendorId: 10de
deviceId: 0110
subVendorId: 0000
subDeviceId: 0000
pciType: 1
class: FLOPPY
bus: MISC
detached: 0
device: fd0
driver: unknown
desc: "3.5" 1.44MB floppy drive"
class: HD
bus: IDE
detached: 0
device: hda
driver: ignore
desc: "FUJITSU MPG3409AT E"
physical: 79428/16/63
logical: 4983/255/63
class: CAPTURE
bus: PCI
detached: 0
driver: bttv
desc: "Brooktree Corporation|Bt878"
vendorId: 109e
deviceId: 036e
subVendorId: 0000
subDeviceId: 0000
pciType: 1
class: USB
bus: PCI
detached: 0
driver: usb-uhci
desc: "Intel Corporation|82820 820 (Camino 2) Chipset USB (Hub A)"
99
100
II. Linux
vendorId: 8086
deviceId: 2442
subVendorId: 8086
subDeviceId: 244b
pciType: 1
class: USB
bus: PCI
detached: 0
driver: usb-uhci
desc: "Intel Corporation|82820 820 (Camino 2) Chipset USB (Hub B)"
vendorId: 8086
deviceId: 2444
subVendorId: 8086
subDeviceId: 244b
pciType: 1
class: MODEM
bus: SERIAL
detached: 1
device: ttyS0
driver: ignore
desc: "IDC|5620 IDC 5614BXL VR PnP"
pnpmfr: IDC
pnpmodel: 5620
pnpcompat: *PNPC107
pnpdesc: IDC 5614BXL VR PnP
i18n , . -
internationalization ( i n ).
:
LANG="ru_RU.koi8r"
SUPPORTED="ru_RU.koi8r:ru_RU:ru"
SYSFONT="cyr-sun16"
SYSFONTACM="koi8-u"
, KOI8-R
cyr-sun16;
identd identd,
;
keyboard , /etc/sysconfig, .
6. Linux
101
( ) :
(
/usr/lib/kbd/keytables/ map);
keyboard ,
KEYTABLE="/usr/lib/kbd/keytables/zzz.map", zzz
;
: /etc/rc.d/rc.sysinit , Caldera,
/etc/rc.d/rc.boot: /sbin/kbdrate -s r 16 d 500 r 16 , d 500 .
keyboard:
KEYBOARDTYPE="pc"
KEYTABLE="ru"
kudzu kudzu
;
mouse ,
. 6.8 mouse.
6.8
MOUSETYPE="imps2"
XMOUSETYPE="IMPS/2"
FULLNAME="Microsoft IntelliMouse (PS/2)"
XEMU3=no
DEVICE=/dev/mouse
sendmail , sendmail
;
squid squid;
syslog syslog;
xinetd xinetd, Linux inetd.
102
II. Linux
/home
. ,
, (login) . , frozzy /home/frozzy. ,
, :
/cedit
/.gnome-desktop
/.netscape
.bash_profile
/Desktop
/.gnome_private
/nsmail
.bashrc
/.dia
/.gnp
/.sawfish
.ICEauthority
/.gimp-1.2
/kde
.bash_history
.screenrc
/.gnome
/.mc
.bash_logout
, , , , .
/lib
,
, . . , /bin /sbin. /lib:
libc.so.* () C;
ld* / (linker/loader) .
/lib:
/modules ;
/security PAM.
/lib64
, 64- ,
, PPC 64, AMD 64, IBM s390x sparc64. /lib64 /lib ( 32 ) . 64- .
/lost+found
, . ,
, , /, /home, /var,
, /home /var
/lost+found. . chkfsk (, , ) .
-
. /lost+found.
6. Linux
103
/media
CD-ROM
automount. :
floppy ;
cdrom CD-ROM;
cdrecorder ;
zip ZIP-.
/mnt
,
(, CD-ROM).
Linux /mnt , , , CD-ROM . . /mnt - , , , /mnt, ,
, /mnt.
/opt
. , /opt, /opt/<_>, <_> . <_>:
/bin;
/doc;
/lib;
/man . .
/bin,
, /doc.
/opt/<_>/man
, /usr/share/man.
/opt/<_>/lib . . , , /var/opt, -
/etc/opt.
/proc
procfs
Procfs , Linux,
,
( ). ,
.
104
II. Linux
/proc:
/1 , PID-;
/2;
/3;
/4;
/5;
/6;
/7;
/384;
/389;
/403;
/418;
/490;
/5196;
/bus , (PCI,
ISA);
/driver ;
/fs ;
/ide IDE-;
/irq ;
/net ;
/sys ;
/sysvipc SysVIPC- (msg, sem, shm);
/tty TTY-;
apm ;
cmdline ;
cpuinfo ;
devices ( );
dma DMA;
execdomains ;
fb Frame Buffer-;
filesystems ;
interrupts ;
iomem ;
ioports /;
isapnp ISA-;
kcore ;
kmsg ;
ksyms ;
loadavg 1, 5 15 ;
locks "" ;
mdstat , RAID- ;
meminfo ;
misc , ;
6. Linux
105
modules ;
mounts ;
mtrr ;
partitions , ;
pci PCI- (. /proc/bus/pci/);
rts ;
scsi SCSI-;
self , /proc;
slabinfo Slab;
stat ;
swaps ;
uptime ;
version ;
video BTTV- .
/proc/_PID-
PID-.
/proc. :
cmdline , ;
cpu (
);
/cwd ;
environ ;
exe ;
/fd , ;
maps ;
mem , ;
/root ;
stat ;
statm ;
status , .
/proc/ide IDE-,
IDE, .
/proc/net
, . IPv4, IPv6:
arp ARP- ;
dev ;
dev_stat ;
106
II. Linux
ip_fwchains Firewall;
ip_fwnames Firewall;
/ip_masq *;
ip_masquerade ;
netstat ;
raw ;
route ;
/rpc RPC-;
rt_cache ;
snmp SNMP;
sockstat ;
tcp TCP-;
tr_rif Token ring RIF;
udp UDP-;
unix UNIX-;
wireless (Wavelan . .);
igmp IP-, ;
psched ;
netlink PF_NETLINK-;
ip_mr_vifs ;
ip_mr_cache .
, IPv6:
udp6 UDP- (IPv6);
tcp6 TCP- (IPv6);
raw6 (IPv6);
igmp6 IP-, (IPv6);
if_inet6 IPv6- ;
ipv6_route IPv6;
rt6_stats IPv6- ;
sockstat6 (IPv6);
snmp6 SNMP- (IPv6).
/proc/parport
,
.
/proc/scsi SCSI-,
SCSI-, /proc/scsi, SCSI, .
IP- (),
IP- () , .
6. Linux
107
/proc/sys
, , ,
.
/proc/sys/dev ,
CD-ROM.
/proc/sys/fs
.
/proc/sys/kernel
, .
/proc/sys/net ""
. :
/802 E802;
/appletalk Appletalk-;
/ax25 AX25;
/bridge Bridging;
/core ;
/decnet DEC-net;
/ethernet Ethernet-;
/ipv4 IP 4;
/ipv6 IP 6;
/ipx IPX;
/netrom NET/ROM;
/rose X.25 PLP layer;
/token-ring IBM token ring;
/unix UNIX domain sockets;
x25 X.25.
/proc/sys/sunrpc
,
.
/proc/sys/vm
Linux.
/proc/tty
.
108
II. Linux
/root
root ()
/root .
/home, . ,
/root .
/sbin
,
( root), /sbin, /usr/sbin
/usr/local/sbin. /sbin , , , ,
/bin. , ,
/usr/sbin. , , /usr/local/sbin.
/sbin. ( ) , /bin. /sbin :
badblocks ;
ctrlaltdel ;
dumpe2fs ;
e2fsck ;
fastboot , ;
fasthalt , ;
fdisk , (, , . .);
fsck , ;
fsck.* ,
(, Ext2);
getty getty;
halt , ;
ifconfig ;
init Init-;
kbdrate ;
lilo ;
mke2fs ;
mkfs , ;
mkfs.* , ;
mkswap , -;
reboot , ;
route IP-;
6. Linux
109
swapon , ;
swapoff , ;
tune2fs ;
update , .
/sys
sysfs
/proc. Linux Unified Device Model Of Kernel (
). /proc Linux
, , .
sysfs, /proc.
:
device ;
device_driver ;
bus_type ;
device_attribute ;
driver_attribute ;
bus_attribute .
bus_type , ""
.
.
sysfs, /sys/bus/flash_bus.
device_driver . bus_type.
.
, /sys/bus/drivers/flash_driver, /sys/drivers/flash_driver.
device .
/sys/bus/devices/flash_device, /sys/devices/flash_device.
device_attribute, driver_attribute, bus_attribute .
sysfs. .
/tmp
, . , /tmp,
( , ).
110
II. Linux
/usr
/usr , ,
. :
/bin , ;
/include , C-;
/lib ;
/local ;
/sbin ;
/share - ;
/X11R6 X Window System, 11, 6;
/games ;
/src .
/usr/bin
, . ( ):
perl Perl;
python Python;
tclsh Tcl;
wish Tcl/Tk;
expect .
/usr/include include-
C/C++.
/usr/lib
, ,
.
/usr/lib, -
. , /perl5
Perl 5.
/usr/local
. . :
/bin ;
/games ;
/include C-;
/lib ;
/sbin ;
/share - ;
/src .
6. Linux
111
/usr/sbin
,
. , , /sbin.
/usr/share -
-
(). :
/dict ();
/doc ;
/games /usr/games;
/info GNU;
/locale ;
/man ;
/misc - ;
/terminfo terminfo;
/zoneinfo (Timezone).
, , , /usr/share ( /usr/local/share, ).
/usr/share/dict ()
, . , look
.
, .
/usr/share/man
. , /man1 /man8. :
/man1 , ;
/man2 , (
);
/man3 .
, .
;
112
II. Linux
/man4 ,
.
/dev;
/man5 ;
/man6 ;
/man7 . , ;
/man8 .
.
, /usr/share/man
:
, (locale, ),
/usr/share/man , ;
/man<>, , ;
/man<> ,
, - ,
(, ,
, ).
man - , . , , /usr/share/man/man<>.
.
/usr/share/man E POSIX 1003.1, -
<>[_<>][.< >][,<>]
;
<> (
ISO 3166);
< > .
, , ;
<> .
, , , ,
.
. 6.3.
6. Linux
113
6.3.
ASCII
/usr/share/man/en
ASCII
/usr/share/man/en_GB
ASCII
/usr/share/man/en_US
ISO 8859-1
/usr/share/man/fr_FR
ISO 8859-1
/usr/share/man/fr_CA
KOI8-R
/usr/share/man/ru_RU
- ,
. , /usr/share/man/<locale>/man8/i386/ctrlaltdel.8.
,
- ,
.
, /usr/local, /usr/local/man. , X11R6,
/usr/X11R6/man.
/usr/local/man /usr/X11R6/man.
/usr/share/misc -
- ,
/usr/share/. , :
ascii ASCII- ;
magic "" ;
termcap .
/usr/src
.
/usr/src/Linux-x.y.z Linux
, Linux, , .
Linux, .
114
II. Linux
/usr/src/Linux-x.y.z/Documentation
Linux
,
Linux . :
/arm
/networking
cachetlb.txt
floppy.txt
/cdrom
/parisc
cciss.txt
ftape.txt
/cris
/powerpc
Changes
hayes-esp.txt
/DocBook
/s390
CodingStyle
highuid.txt
/fb
/sound
computone.txt
ide.txt
/filesystems
/sparc/sysctl
Configure.help
initrd.txt
/i2c
/telephony
cpqarray.txt
ioctl-number.txt
/i386
/video4linux
devices.txt
IO-mapping.txt
/ia64
/vm
digiboard.txt
IRQ-affinity.txt
/isdn
/usb
digiepca.txt
isapnp.txt
/kbuild
00-INDEX
DMA-mapping.txt
java.txt
/m68k
binfmt_misc.txt
dnotify.txt
joystick-api.txt
/mips
BUG-HUNTING
exception.txt
joystick-parport.txt
joystick.txt
nbd.txt
serial-console.txt
kernel-doc-nano-HOWTO.txt
nfsroot.txt
sgi-visws.txt
kernel-docs.txt
nmi_watchdog.txt
smart-config.txt
kernel-parameters.txt
oops-tracing.txt
smp.tex
kmod.txt
paride.txt
smp.txt
locks.txt
parport-lowlevel.txt
specialix.txt
logo.gif
parport.txt
spinlocks.txt
logo.txt
pci.txt
stallion.txt
LVM-HOWTO
pcwd-watchdog.txt
SubmittingDrivers
magic-number.txt
pm.txt
SubmittingPatches
mandatory.txt
ramdisk.txt
svga.txt
mca.txt
README.DAC960
sx.txt
md.txt
README.moxa
sysrq.txt
memory.txt
README.nsp_cs.eng unicode.txt
mkdev.cciss
riscom8.txt
VGA-softcursor.txt
mkdev.ida
rtc.txt
watchdog.txt
modules.txt
SAK.txt
xterm-linux.xpm
moxa-smartio
scsi-generic.txt
zorro.txt
mtrr.txt
scsi.txt
/var
. spool- , , . ,
/var, /var/log, /var/lock /var/run,
. , /var/mail,
/var/cache/man, /var/cache/fonts /var/spool/news, .
6. Linux
115
/var .
, ,
. , .
/var. /var :
/cache ;
/db ;
/games ;
/lib ;
/local /usr/local;
/lock Lock- (-);
/log Log- ( );
/lost+found , ;
/mail ;
/named DNS-;
/opt /opt;
/run ;
/spool spool- ;
/state ;
/tmp , .
/var/cache
"" , . / ,
- . /var/cache .
, :
/fonts ;
/man . /usr/man
, ,
, ;
/www - proxy- WWW;
/<> .
/var/games
, ,
, , . .
/var/lib
. , - , .
, - /var/lib, -
116
II. Linux
, /var/lib<_>.
, :
/misc ;
/<> , ;
/rpm RPM. ;
/<> ;
/xdm X-.
/var/log (log-)
.
, .
, :
/httpd Web-;
/samba Samba;
/squid SQUID;
/uucp UUCP.
/var/log :
cron cron;
dmesg ;
lastlog ;
maillog , ;
messages syslogd;
secure , ;
statistics ;
usracct ;
wtmp logins logouts;
boot.log ;
htmlaccess.log Web-;
XFree86.0.log XFree86.
/var/mail
, UNIX mailbox.
6. Linux
117
/var/opt
/opt
, /opt.
/opt/<_>.
/var/run
, .
. ,
(, , FTP : ftp.pids-all, ftp.pids-local, ftp.pids-other,
).
, , - (PID, Process
identifie file), <_>.pid, , /var/run/named.pid.
Pid- , PID, .
/var/run , /var/run
, .
/var/spool spool-
/var/spool , - .
(, , )
. ,
:
/at spool- at;
/cron spool- cron;
/lpd spool- ;
/mail ;
/mqueue ;
/news spool- ;
/samba spool- Samba;
/squid spool- SQUID;
/uucp spool- UUCP.
/var/tmp ,
/var/tmp , ,
, . , /tmp,
.
118
II. Linux
.
http://www.kernel.org/pub/linux/docs/device-list/devices.txt
.
proc.txt procfs. Linux.
man-.
HOWTO:
Networking-HOWTO;
SMB-HOWTO;
DNS-HOWTO;
LILO-HOWTO.
Linux
,
, .
, , . , .
,
,
. BIOS (Basic Input/Output System
/), , , (, C:), .
(GRUB) Linux, vmlinuz-x.y.za ( x.y.z , , 2.6.19, a , - ) /boot ( Red
Hat- ) (
Slackware). , ( ). , ,
(root) . , .
Linux , .
(RAM-disk, ), . . -,
, , -,
, .
Linux ,
init , , , ( , ). ,
120
II. Linux
init , : ,
, . .
.
-
Linux,
, .
GRUB
GRand Unified Bootloader ( ) , .
LILO , .
LoadLin
Linux, , Linux DOS ( ).
LoadLin , LILO MBR (Master Boot Record) .
, , DOS .
, Linux,
.
7. Linux
121
- ,
, .
. :
ether=9,0x300,0xd0000,0xd4000,eth0
root=/dev/hda1
, , , /proc/cmdline.
rdev
Linux,
. , ,
, rdev.
rdev :
rdev , ;
swapdev , (swap);
ramsize RAM-;
vidmode ;
rootflags ("
" "/").
rdev .
Linux
:
[=_1][,_2]...[,_11],
, ,
, .
linux/init/main.c.
, root=, ro,
rw debug, ( bootsetups) .
foo=3,4,5,6,bar, , foo bootsetups.
, , foo
(foo_setup()), 3, 4, 5 6,
, bar.
, . -
122
II. Linux
TERM=vt100 BOOT_IMAGE=vmlinuz.bak . , .
,
, , init. init
single, init
. init
.
, , , , RAM-, . .
root
,
.
, . , /dev/hda2,
/dev/hda6. , root=/dev/hda2, ,
/dev/hda6. !
:
/dev/hdaN, /dev/hdbN, /dev/hdcN, /dev/hddN, N
IDE-;
/dev/sdaN, /dev/sdbN, /dev/sdcN, /dev/sddN, /dev/sdeN, N SCSI-;
/dev/fd0, /dev/fd1 - N;
/dev/nfs, , .
root , rdev.
ro rw
ro
" ". rw
"/".
init .
7. Linux
123
"/",
. :
"
";
"/
", " ".
, rdev.
RAM-
, RAM-,
.
ramdisk_start
-
RAM-, ramdisk_start=<>.
load_ramdisk
, RAM- .
RAM-. , . . RAM-.
load_ramdisk=1
prompt_ramdisk
- RAM-. RAM- , , .
prompt_ramdisk=0.
, prompt_ramdisk=1. .
ramdisk_size
RAM- , -
.
4096 .
noinitrd ( RAM-)
, 2.x,
RAM-. , (,
SCSI, RAM-, SCSI-).
noinitrd , initrd
.
124
II. Linux
Linux
.
mem
( ,
, Linux). BIOS
,
64 . .
mem=xx, , , ,
, , - .
,
. , 96
, mem=0x6000000 mem=96M.
swap
(Virtual Memory), . :
MAX_PAGE_AGE;
PAGE_ADVANCE;
PAGE_DECLINE;
PAGE_INITIAL_AGE;
AGE_CLUSTER_FRACT;
AGE_CLUSTER_MIN;
PAGEOUT_WEIGHT;
BUFFEROUT_WEIGHT.
/usr/src/Linux-x.y.z/Documentation/vm/ , .
buff
, swap, , . :
MAX_BUFF_AGE;
BUFF_ADVANCE;
BUFF_DECLINE;
BUFF_INITIAL_AGE;
BUFFEROUT_WEIGHT;
BUFFERMEM_GRACE.
7. Linux
125
NFS
Linux ,
.
NFS (Network File System, ). ,
, , . root=/dev/nfs. NFS
/usr/src/Linux-x.y.z/Documentation/nfsroot.txt.
nfsroot
, ,
NFS .
:
nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>]
nfsroot ,
/tftpboot/%s.
:
<server-ip> IP- NFS. , nfsaddrs;
<root-dir> , .
"%s", ASCII- IP ;
<nfs-options> NFS. .
, :
port = portmap-;
rsize = 1024;
wsize = 1024;
timeo = 7;
retrans = 3;
acregmin = 3;
acregmax = 60;
acdirmin = 30;
acdirmax = 60;
flags = hard, nointr, noposix, cto, ac.
nfsaddrs
nfsaddrs . , RARP /
BOOTP. :
nfsaddrs=<my-ip>:<serv-ip>:<gw-ip>:<netmask>:<name>:<dev>:<auto>
126
II. Linux
:
<my-ip> IP- . , -
RARP BOOTP. ,
, <auto>. ,
RARP, BOOTP ;
<serv-ip> IP- NFS. ,
, RARP BOOTP;
<gw-ip> IP- . , ;
<netmask> ;
<name> ;
<dev> . ,
RARP- , BOOTP
. NFS , RARP BOOTP;
<auto> . :
rarp RARP;
bootp BOOTP;
both ;
none .
.
debug
Linux ( /, . .).
console_loglevel. , .
debug .
init
Linux init, . Linux init /sbin, /bin/sh.
init , , init=/bin/sh, - .
7. Linux
127
kbd-reset
x86 Linux
, , BIOS. . Linux .
maxcpus
SMP.
0 nosmp.
md
(Multiple) ( , RAID- ), md.
/usr/src/Linux-x.y.z/Documentation/md.txt.
no-hlt
i486.
Intel hlt, , (, . .)
. i486 hlt,
. no-hlt
Linux .
no-scroll
.
.
noapic
Linux
. /usr/src/Linuxx.y.z/Documentation/IO-APIC.txt.
nosmp
Linux SMP-
. .
128
II. Linux
panic
"" ( , , kernel panic )
, . ,
. ( ),
. , panic=20 Linux 20
kernel panic.
.
-
/proc/sys/kernel/panic.
pirq
IRQ- PCI SMP.
/usr/src/Linux-x.y.z/Documentation/IO-APIC.txt.
profile
,
, . . ,
.
reboot
, Linux.
Linux "" (
, BIOS . .). "" , , .
reserve
/ (I/O probe).
:
reserve=iobase,extent[,iobase,extent]...
(auto-probing) . , , ,
.
7. Linux
129
reserve , /, .
.
.
,
PCI
pci PCI
. , , Plug and Play,
PCI-.
pci=bios pci=nobios
(probing) PCI PCI BIOS. bios.
pci=conf1 pci=conf2
1 2. PCI
BIOS probe (. . pci=nobios).
pci=io=
Unassigned IO space for.../
/ .
pci=nopeer
, BIOS.
pci=nosort
PCI- .
pci=off
PCI-. , PCI , , .
pci=reverse
PCI- PCI.
130
II. Linux
video= ,
. , (Intel, AMD,nVidia .)
() . :
video=name:option1,option2,...
name .
, , , .
, ,
/usr/src/Linux-x.y.z/Documentation/fb/.
video=map:...
.
video=scrollback:...
,
. k K ,
.
video=vc:...
.
SCSI-
SCSI- .
Mid-level
Mid , , CDROM SCSI-.
LUN (max_scsi_luns=)
SCSI- .
, SCSI CD-ROM, .
CD-ROM (Logical Unit Number,
7. Linux
131
SCSI (scsi_logging=)
SCSI-.
SCSI (st=)
Linux
SCSI,
st=buf_size[,write_threshold[,max_bufs]]
. buf_size
32 . write_threshold , ,
30 . , 2.
SCSI
, :
iobase /, SCSI. 0x200
0x3ff;
irq , .
, 5, 7, 9, 10, 11, 12 15;
dma DMA (Direct Memory Access ).
(bus-mastering);
scsi-id ,
SCSI-. .
7.
parity SCSI-
.
, .
, , SCSI-
, , . SCSI- Linux , -
, (, )
.
.
132
II. Linux
() IDE.
IDE
/CD-ROM
IDE ,
:
hdx= a h, HDD;
idex= 0 3, IDE1;
hdx=noprobe , ;
hdx=none , CMOS
;
hdx=nowerr WRERR_STAT ;
hdx=cdrom CD-ROM;
hdx=cyl,head,sect ;
hdx=autotune
PIO, .
;
idex=noprobe ;
idex=base , base 0x1f0
0x170, ctl base+0x206;
idex=base,ctl base, ctl;
idex=base,ctl,irq base, ctl IRQ;
idex=autotune
PIO . ;
idex=noautotune ;
idex=serialize overlap idex.
/usr/src/Linux-x.y.z/Documentation/ide.txt.
ISDN-
ISDN-
. ,
, -
, .
7. Linux
133
membaseN N- ; irqN
N- . IRQ=5 membase=0xD0000.
DigiBoard (digi)
DigiBoard
, . :
Enable/Disable / ;
PC/Xi(0), PC/Xe(1), PC/Xeve(2), PC/Xem(3);
Enable/Disable / ;
;
/, ;
.
:
digi=E,PC/Xi,D,16,200,D0000
/usr/src/Linux-2.4.3/
Documentation/digiboard.txt.
/
Baycom (baycom)
:
baycom=modem,io,irq,options[,modem,io,irq,options]
modem=1 , ser12; modem=2 par96. options=0 DCD, opton=1 DCD. io irq / .
,
.
II. Linux
134
Ethernet (ether)
, , / . :
ether=irq,iobase[,param_1[,param_2,]]],name
.
. , . ,
param_n
ether=0,0,eth1
, IRQ /
.
. Linux
. ether=
, .
, Ethernet-HOWTO.
(sound)
. ,
. .
. :
sound=device1[,device2[,device3...]] ,
deviceN 0xDTaaaId.
deviceN:
D DMA ( );
T ( 26
/usr/src/Linux-x.y.z/include/linux/soundcard.h, 27 999 /usr/src/
Linux-x.y.z/drivers/sound/dev_table.h.):
1=FM
2=SB
3=PAS
4=GUS
5=MPU401
6=SB16
7=SB16-MIDI
. .;
7. Linux
135
aaa / ;
I ;
d DMA.
sound=0 .
(lp)
,
, . .
/, , ,
lp=0x3bc,0,0x378,7
0x3bc
. 0x278 ( )
,
lp=. lp=0 .
0x378
init
Linux ,
( , ,
, , ),
.
.
, :
VFS: Mounted root (ext2 filesystem) readonly
init
.
init , ,
, . init ,
: ,
. .
(run level).
, , , " "
, , , .
, , . ,
, . .
. (
, ) , init, .
( , ), , ,
136
II. Linux
, , . , UNIX-
.
Linux (, Slackware ). (Red Hat Linux) . Red Hat,
.
Linux :
0 ;
1 . , ;
2 ;
3 ;
4 ;
5 X Window System;
6 ;
S s , ,
S , , .
, .
. UNIX, .
, , . .
, , , , .
init /etc/inittab
, init /etc/inittab. ,
. # (
) , . , :
id:runlevels:action:process
:
id . ,
.
,
BASIC
;
runlevels , .
( );
process , ;
7. Linux
137
action . , ,
init, ( ) ,
process:
wait . ,
, init . ,
( ),
();
once ;
respawn "". , ;
off . ;
boot ,
runlevels ( ) ;
bootwait , , init ;
initdefault init, ;
sysinit
boot bootwait;
powerwait init
. , (UPS) , ( " ", "
", " " . .), , init , ;
ctrlaltdel init , <Ctrl>+<Alt>+<Del> .
<Ctrl>++<Alt>+<Del>, .
.
inittab man- init, inittab.
( 7.1) inittab,
.
7.1
# inittab
#
, INIT
#
# Author:
II. Linux
138
#
#
# Default runlevel. The runlevels used by RHS are:
#
networking)
4 unused
5 X11
#
id:3:initdefault:
# System initialization.
si::sysinit:/etc/rc.d/rc.sysinit
l0:0:wait:/etc/rc.d/rc 0
l1:1:wait:/etc/rc.d/rc 1
l2:2:wait:/etc/rc.d/rc 2
l3:3:wait:/etc/rc.d/rc 3
l4:4:wait:/etc/rc.d/rc 4
l5:5:wait:/etc/rc.d/rc 5
l6:6:wait:/etc/rc.d/rc 6
# Things to run in every runlevel.
ud::once:/sbin/update
# Trap CTRL-ALT-DELETE
ca::ctrlaltdel:/sbin/shutdown -t3 -r now
# When our UPS tells us power has failed, assume we have a few
# minutes
# of power left.
# This does, of course, assume you have powerd installed and your
# UPS connected and working correctly.
pf::powerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down"
# If power was restored before the shutdown kicked in, cancel it.
pr:12345:powerokwait:/sbin/shutdown -c "Power Restored; Shutdown Cancelled"
7. Linux
139
1:2345:respawn:/sbin/mingetty tty1
2:2345:respawn:/sbin/mingetty tty2
3:2345:respawn:/sbin/mingetty tty3
4:2345:respawn:/sbin/mingetty tty4
5:2345:respawn:/sbin/mingetty tty5
6:2345:respawn:/sbin/mingetty tty6
# Run xdm in runlevel 5
# xdm is now a separate service
x:5:respawn:/etc/X11/prefdm -nodaemon
init
/etc/inittab . ,
.
id:3:initdefault, ,
, ( ). Fedora
Core .
init ,
:
ca::ctrlaltdel:/sbin/shutdown -t3 -r now
pf::powerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down"
pr:12345:powerokwait:/sbin/shutdown -c "Power Restored; Shutdown Cancelled"
init ,
, - . sysinit:
si::sysinit:/etc/rc.d/rc.sysinit
init ,
:
ud::once:/sbin/update
, , :
l3:3:wait:/etc/rc.d/rc 3
1:2345:respawn:/sbin/mingetty
2:2345:respawn:/sbin/mingetty
3:2345:respawn:/sbin/mingetty
4:2345:respawn:/sbin/mingetty
5:2345:respawn:/sbin/mingetty
6:2345:respawn:/sbin/mingetty
tty1
tty2
tty3
tty4
tty5
tty6
140
II. Linux
rc init (
mingetty , , gettty), ( ,
- ).
: <Alt> , . ,
, ,
.
init .
telinit, init,
init
.
( shutdown, halt, poweroff
reboot), init ,
.
, , init
:
rc.sysinit /etc/rc.d;
rc /etc/rc.d , ( );
getty.
6, /etc rc.d, . :
/init.d
/rc2.d
/rc5.d
rc.local
/rc0.d
/rc3.d
/rc6.d
rc.sysinit
/rc1.d
/rc4.d
rc
, ,
, - /init.d , rc rc.sysinit.
rc.local rc
, . rc , , - , , rc.local.
rc.sysinit
. rc.sysinit , . , rc.sysinit.
7. Linux
141
, ,
.
:
;
;
/etc/sysconfig/network;
;
/proc;
, /etc/sysctl.conf;
/etc/sysconfig/clock;
loadkeys
/etc/sysconfig/console/default.kmap /etc/sysconfig/keyboard;
/etc/sysconfig/i18n
pcf.gz gz /etc/sysconfig/console, /usr/lib/kbd/consolefonts
/lib/kbd/consolefonts;
;
USB-;
fsck , ;
PNP- /etc/isapnp.conf;
/;
/etc/mtab;
;
, ,
;
RAID-;
fsck ;
;
;
;
/var/lock /var/run;
/var/run/utmp /var/run/utmpx;
- /tmp;
;
, /etc/rc.d/rc.serial;
SCSI-;
/sbin/mkkerneldoth;
/boot/System.map;
, , /var/run/confirm.
fsck /fastboot, /forcefsck.
142
II. Linux
shutdown . .
Sysctl ( /etc/sysctl.conf)
. 7.2 /etc/sysctl.conf
.
7.2
# Disables packet forwarding
net.ipv4.ip_forward = 0
# Enables source route verification
net.ipv4.conf.all.rp_filter = 1
# Disables the magic-sysrq key
kernel.sysrq = 0
rc
rc, /rcX.d /init.d. /rcX.d Red Hat , UNIX-
.
, , .
/init.d , (sendmail, HTTP, Samba, FTP . .). , . /rcX.d , ,
/etc/rc.d/init.d. K, S,
. S
K start kill . , , S, , , K, . , S K , .
rc. , .
, <I> .
, , . ,
.
. Linux .
/var/lock/subsys/${subsys}
/var/lock/subsys/${subsys}.init, subsys .
7. Linux
143
, ( S-
), ( K- ).
linuxconf /var/run/runlevel.dir, .
linuxconf, ntsysv,
/usr/sbin/setup Control-panel.
.
-
(SXXlalala) /rcX.d, /rcX.d.
, ,
,
. ? , ,
, .
/etc/rc.d/init.d/, , anacron ( 7.3).
7.3
#!/bin/sh
# Startup script for anacron
# chkconfig: 2345 95 05
# description: Run cron jobs that were left out due to downtime
# Source function library.
. /etc/rc.d/init.d/functions
[ -f /usr/sbin/anacron ] || exit 0
prog="anacron"
start() {
echo -n $"Starting $prog: "
daemon anacron
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/anacron
echo
return $RETVAL
}
stop() {
if test "x"pidof anacron"" != x; then
echo -n $"Stopping $prog: "
killproc anacron
echo
fi
II. Linux
144
RETVAL=$?
:
#!/bin/sh
# Startup script for anacron
# chkconfig: 2345 95 05
# description: Run cron jobs that were left out due to downtime
, ,
:
# chkconfig: 2345 95 05
, , , , 95 05 (95) (05) .
7. Linux
145
100. , , . Description
, linuxconf
.
, , ,
start stop. restart, condrestart status. ,
daemon,
killproc, status. daemon, killproc, status
/etc/rc.d/init.d/functions ( /etc/sysconfig/init).
, ().
daemon . .
. ( , ) , .
killproc .
, , , . SIGKILL , ,
, SIGTERM, , SIGKILL. .
status . , . (/var/run/.pid /var/lock/subsys/),
. ,
.
rc.local
/etc/rc.d/rc.local rc. .
.
,
, ,
/etc:
/etc/fstab
;
/etc/skel ,
;
/etc/bashrc ;
146
II. Linux
/etc/initscript ,
/etc/inittab ( ).
:
/etc/issue , "login:";
/etc/motd , .
:
1. (login) "login:"
getty.
2. getty login, login
.
3. login
/etc/passwd (login) /etc/shadow ().
( MD5), , /etc/shadow.
4. , ( 3 , ) Password incorrect. login ,
getty "login:".
5. , login /etc/motd " ".
6. login (shell), , TERM.
7. shell ,
, , ( Bourneshell, .profile, C-shell .login .cshrc, Korn-shell
.profile .kshrc). , , - .
shell .
,
:
/etc/profile ,
;
/etc/passwd , , , ;
7. Linux
147
/etc/shadow passwd,
;
/etc/bashrc bash;
/ /.* .
, -
,
~/.profile .bash_profile.
, -
, ./etc/profile
:
if test $USER = petya; then
echo Hello Petya!
#
fi
petya.
, , init
, . , . -
inittab (, , sendmail , , 10 ).
. LILO (boot:)
single emergency. ( 1),
(root) , login. telinit, , ,
init. telinit,
, init inittab .
, . ,
fsck /usr. ,
, fsck
. , .
,
. -
II. Linux
148
CD-ROM.
( )
, , Windows MBR,
( Linux , ).
root.
. Press "I" to enter interactive startup. <I>, (
<F8> Windows step by step).
( ) , .
, , :
init , ;
telinit init;
runlevell ;
linuxconf Linux.
, ;
ntsysv ,
;
/usr/sbin/setup ;
control-panel .
www.osp.ru/os/2001/02/073.htm . . .
/usr/src/Linux-x.y.z/Documentation/ , -
, , . .
man init, inittab, telinit, initscript.
HOWTO:
Ethernet-HOWTO ;
The Linux BootPromt HOWTO , Linux ;
The Linux Bootdisk HOWTO .
Linux
, , Linux. , .
?
, ,
.
.
- , , - . , Web- .
: ", , ". , , :
. , , ,
, , .
, .
,
, . , .
. ,
.
150
II. Linux
, ,
, . ,
, ,
(
,
).
,
, . ,
, .
, , " " , , .
,
, .
, ,
. , :
", ".
- , , , .
:
;
.
( ).
:
;
.
:
;
.
, , . ,
. , -
8. Linux
151
, ( )
.
. , , .
. ,
, , .
. ,
.
.
, .
,
,
. .
. , , , .
,
, , ,
.
, , ,
, Rack Mount.
. , .
BIOS
BIOS , ,
99% BIOS.
BIOS
BIOS. ( BIOS ,
- ),
. ,
.
152
II. Linux
( , ,
.) ,
BIOS.
BIOS, , , DVD-ROM-, Zip, USB Flash- . .
. , BIOS, BIOS , .
BIOS , ( ) -, Zip-
DVD-ROM,
.
Linux .
.
xlock vlock
-
, xlock vlock.
, ( -
" "), :
xlock X Window. "" ;
vlock , "" .
, "" ,
( Reset
).
, . , . Linux , .
, , , . () . , .
8. Linux
153
, :
;
, -
;
, -
;
;
su , .
,
. , ,
uptime.
. , . .
, rm "" .
. , :
;
, ;
, ;
, .
root
(root). " ", ,
, .
root , , . ,
root:
. ,
, ;
154
II. Linux
(, ,
) , , . , Linux ;
root
.
su sudo;
r- rlogin, rsh, rexec
, telnet.
. . . SSH;
, , , , <Enter>.
- . ,
:
. , ,
/etc/fstab nosuid. nodev ( ), noexec (
) ro ( );
NFS. NFS ,
;
. 077;
.
;
SUID- SGID- . , ,
, ,
;
.rhosts;
, , , . ,
- ;
.
.
8. Linux
155
. , . rpm,
.
, , rpm.
, Tripwire
, . , . , .
Ext2(3,4)
Ext2
, . Linux
:
A Atime. access time ;
S Sync. ,
, , ;
a append. .
, ;
i immutable. . , , ,
;
d no dump. , , ;
c compress. ;
s secure deletion.
, , ;
u undelete. ,
, .
, , , .
A Atime
, . . access time , .
S Sync
.
156
II. Linux
Ext2
,
: chattr lsattr.
chattr :
chattr +Si test.txt sync immutable test.txt;
chattr -ai test.txt append-only immutable test.txt;
chattr =aiA test.txt
a, i A.
lsattr ls.
lsattr -a test*, , :
---i-------- test.conf
----a------- test.log
------------ test.txt
. , a i , root, root .
.
lcap , , Ext2 .
lcap, :
lcap CAP_LINUX_IMMUTABLE root a i;
lcap CAP_SYS_RAWIO , , .
.
:
8 ;
, ,
# $ @ / . , ;
- ;
.
Linux DES (Data Encryption Standard, ). /etc/shadow. DES /etc/shadow .
/etc/shadow
John the Ripper.
. PAM- (
MD5 ) .
8. Linux
157
:
SSL Secure Sockets Layer, , Netscape
. ,
. SSL . Web-;
S-HTTP -, ;
S/MIME Secure Multipurpose Internet Mail Extension, ,
.
SSH
SSH (Secure Shell) , . SSH rlogin, rsh rcp. ,
. SSH- Windows.
PAM
PAM (Pluggable Authentication Modules) . , , PAM.
" " , , .
PAM:
;
;
" " (shadow password);
/ .
CIPE
CIPE IP-,
. , .
CIPE (tunnelling)
(VPN, Virtual Private Networks). ,
, VPN, - .
158
II. Linux
Kerberos
Kerberos , Athena
(MIT). Kerberos
, , . , . , .
CFS TCFS
CFS . , . NFS-, .
TCFS
CFS, , ,
, .
, , . ,
.
/dev/random /dev/urandom
. PGP-
(Pretty Good Privacy ), SSH- .
/dev/random ,
- .
/dev/urandom , , ,
/dev/random.
, - Web-
. , . , , , ,
,
.
8. Linux
159
Packet Sniffers
(Packet Sniffer ,
, . ) . Ethernet- Password, Login su. ,
,
. ,
. , . .
.
SSH .
, ,
. , . ,
, /etc/hosts.allow. "" /etc/hosts.deny. /etc/rc.d/rcN.d
, .
, , , .
, /etc/services ,
.
DNS
DNS-
.
DNS-, .
identd
identd , TCP . , , ,
.
, . , -
160
II. Linux
.
, ,
- . .
" "
. " ,
".
,
. :
SYN flooding " ".
"" (loophole) TCP-. Linux SYN Flooding-;
Ping flooding " ". "" ICMP-. , , ,
- . , "smurfing", ICMP-
IP- ;
Ping of Death , , ICMP-
ECHO REQUEST ,
, . -
(65 510 ) ping- , ;
Teardrop/New Tear , ,
IP Linux- Windows-.
2.0.33.
SELinux/AppArmor
SELinux (Security-Enhanced Linux Linux )
, e . Linux. -
8. Linux
161
SELinux
(ps, ls .), , .
, , SELinux .
. SELinux . ,
SELinux , /.
. SELinux "" , .
SELinux .
"" , Fedora. 200 ,
. , "" , unconfined_t. SELinux , . ,
""
.
( Bell LaPadula).
"". " , ".
SELinux
.
AppArmor , (), , . AppArmor
, ,
, .
Linux.
Immunix. Novell GNU GPL
openSUSE Ubuntu.
NFS
NFS
NFS.
. NFS, , , .
.
162
II. Linux
Firewall
Firewall (, )
,
. , ,
,
.
. - , . , .
.
, " Linux".
Linux , , Windows,
.
Linux, . , Linux- Internet ,
Windows. Dr Web 1 861 304 .
, .
, :
" " - ;
( " ").
, Dr Web,
, , , ,
GPL. cvs.souceforge.net/viewcvs.py/
openantivirus/mini-faq/av-unix_e.txt ,
UNIX/Linux. , Clam AntiVirus
ClamAV.
?
GPL.
(UNIX/Linux, Windows).
" ".
.
(RAR, ZIP, GZIP).
- .
: 34 .
"" 23 .
.
8. Linux
163
, . ,
.
, .
.
.
IDE- 1 90 . , , , , .
,
, .
CD-RW .
CD-R 30 , CD-RW , DVD-.
DVD-RW
DVD 40 .
Zip , .
.
Jazz , .
. .
. .
USB Flash- , , 515 /. Flash- 16 30 . .
.
. . " " .
, ,
. :
;
, . . ;
.
164
II. Linux
,
(, ), ( , ).
,
. , .
RPM-
, RPM. ,
. , ,
RPM- , , .
RPM- ,
. RPM (/var/lib/rpm/*)
.
rpm Va
RPM.
,
, .
, , . . ,
/var/log.
.
. , , /etc/syslog.conf,
syslog, . ,
- , , .
.
syslog ,
. -
8. Linux
165
.
syslog.conf
(man-).
Linux -.
, . , Fedora 700 . ! .
: " !"
. - . . .
, ,
.
,
. .
. ,
.
, .
, . - ( ,
), .
, ,
.
. ?
, ,
. , Samba.
-
166
II. Linux
. ,
- .
, . .
.
. , . , , .
, .
Linux , kickstart,
, . . , .
, , "" .
, , ,
. , ,
- . ,
( internic). ,
. , , ,
, .
, .
, . : " ".
,
.
, UNIX Linux.
.
, Linux,
www.subscribe.ru.
:
www.rootshell.com , ;
www.netspace.org/lsv-archive/bugtraq.html/ ;
8. Linux
167
www.aoy.com/Linux/Security/ Linux.
, :
www.linuxdocs.org Network Administrators Guide ( );
linux.webclub.ru/books/linuxsos/index.html Linux.
Red Hat ;
dc.internic.net/rfc/rfc2196.txt , ;
www.consensus.com/security/ssl-talk-faq.html
SSL;
www.kernel.org/pub/linux/libs/pam/index.html PAM-;
linux.webclub.ru/adm/attr_ext2.html Michael Shaffer.
Ext2;
pw1.netcom.com/~spoon/lcap/ Linux Kernel Capabilities Bounding Set Editor;
cvs.souceforge.net/viewcvs.py/openantivirus/mini-faq/av-unix_e.txt , UNIX/Linux;
www.clamav.org ClamAV;
www.linuxdocs.org HOWTO:
security-HOWTO ,
;
hacker-HOWTO , ;
NFS-HOWTO NFS ;
Firewall-HOWTO , ;
IP-Masquerade mini-HOWTO .
RPM- DEB-
Microsoft Windows , Setup Install. ,
( - , , , ), (
) : " , , , ". .
, , : "
, DirectX 9 DirectX 7,
DLL Visual Basic". , , - , , , ,
. Linux Windows.
, . , Linux
, .
GNU, .
, Linux,
UNIX-, UNIX- - "tarballs" , tar ( tar) gzip ( tar.gz).
Linux- , FTP- ,
, . ,
Linux, , ,
, ( , , . .).
Linux ,
, , , ,
. .,
Linux. , -
9. RPM- DEB-
169
, , , " " .
, ""
*.tar.gz, , , make, make install.
RPM (Red Hat Linux ackage
management; Red Hat Linux) , ,
RPM, .
" " RPM RPM
. : ,
.
( ) , Linux Debian.
, - . Linux , . ,
Red Hat Linux Debian. ,
, RPM DEB.
RPM-, DEB- .
RPM
RPM, Linux, Red Hat Linux . RPM.
RPM :
,
;
;
( . .);
;
;
(, FTP).
RPM ,
. RPM
. , , ,
(supporting) .
Windows ,
Windows. , ,
. Windows -
170
II. Linux
, ( ) . Linux
.
, .
. .
,
RPM ( ,
. .).
, ,
() "_-." "src.rpm".
telnet-server-0.17-18.i386.rpm.
, telnet- 0.17, () 18 Red Hat Linux Intel 80386
, RPM. , (, i586) src, . , apache-1.3.3-1.src.rpm.
(1.3.3). Red Hat
FTP RPMS, , , SRPMS.
RPM . ,
, ,
, ,
, , .
RPM.
RPM
RPM:
;
FTP;
,
;
. -
;
(Upgrade) ,
, (Degrade);
: , , , , -
, . .;
9. RPM- DEB-
171
, , -
;
: , , . .;
. .
RPM
RPM :
,
;
RPM ;
.
,
RPM , . , :
Build Host , ;
Build Date ;
Change Log ;
Copyright ;
Description , 12 ;
Group / ,
, Development/Languages;
License , . , , GPL. LGPL;
Name , apache;
Version ;
Release ( );
RPM version RPM: Red Hat Linux 7. 4,
3;
Size ;
Source RPM , , gcc-2.96-85.src.rpm;
Summary , - , The
C Preprocessor;
URL Web- ;
Vendor , Red Hat, Inc.
II. Linux
172
, ,
( Group). . 9.1.
.
Amusements .
, (, , , , . .):
Games ;
Graphics ,
(Screensavers).
Applications . ( ) . , (, , ):
Archiving ;
Communications , , .
, , ISDN, ATM, ;
. 9.1.
9. RPM- DEB-
173
Databases ;
Editors . ,
;
Engineering : , , , ;
File ;
Internet , : Web, , ICQ , FTP;
Multimedia : CD, MP3-,
, . .;
Productivity , : , "", . .;
Publishing : , . .;
System .
, ;
Text : , . .
Development , (, , , ):
Debuggers -;
Languages , , , ;
Libraries ( , );
System ;
Tools , .
Documentation , .
System Environment , :
Base ;
Daemons (daemon, , - , );
Kernel , Linux
, ;
Libraries ;
Shells .
User Interface .
, X Window:
Desktops ;
X , X Window;
X Hardware Support , .
174
II. Linux
RPM
RPM man RPM. , , , , . ,
, X Window
(, X Window),
RPM , .
, .
, RPM, Red Hat.
:
;
;
;
;
;
;
;
;
tar-;
;
;
;
;
;
;
.
, :
-vv ;
-quiet ( ,
);
-help , , RPM;
-version ,
RPM;
-rcfile <_>
RPM
. <_> /usr/lib/rpm/rpmrc:/
etc/rpmrc:~/.rpmrc. ;
$HOME;
-root <> <> .
, , <> pre- post-
chroot() <>;
-dbpath <> RPM <>;
-justdb , ;
-ftpproxy <host> <host> FTP- (. . " FTP/HTTP");
-httpproxy <host> <host> HTTP- (. . " FTP/HTTP");
-ftpport <> <> FTP- proxy- (. . "
FTP/HTTP");
<_>
9. RPM- DEB-
175
FTP/HTTP");
-pipe <cmd> RPM <cmd>.
RPM:
rpm -i [-] <_>
RPM:
rpm -U [-] <_>
, rpm ,
,
. , , ,
, .
:
rpm -F [-] <_>
,
.
<_> FTP- HTTP- (,
http://www.freshmeat.net/Linux/ww-1.11-5.src.rpm).
c, . FTP/HTTP . . " FTP/HTTP" .
:
-force , -replacepkgs, -replace-ffiilleess
-oldpackage. , ,
;
-h, -hash 50 # .
-v . , (log);
-oldpackage ( ). , (roll-back)
: 1) (,
gcc 2.9 3.0),
("", . .); 2)
( , . .);
-percent . RPM ;
176
II. Linux
-replacefiles ,
, ;
-replacepkgs , -
;
-allfiles ,
missingok ( RPM
), ;
-nodeps ;
-noscripts pre- post- ;
-notriggers -,
;
-ignoresize ;
-excludepath <> ,
<>;
-excludedocs , ( man- texinfo);
-includedocs . ;
-test ,
;
-ignorearch ,
RPM ;
-ignoreos , RPM ;
-prefix <> <> ;
-relocate <_>=<_> <_> ,
<_>;
-badreloc -relocate. ,
;
-noorder .
.
()
:
rpm -e <_>
:
-allmatches , <_>.
<_> ,
;
-noscripts pre- post- ;
9. RPM- DEB-
177
-notriggers -,
;
-nodeps ;
-test , .
-vv.
RPM:
rpm -q [-]
, .
-queryformat . printf().
( escape C ,
) printf().
.
<_>:
-q <_>
:
-a, -all ;
-whatrequires <capability> , <capability>
;
-whatprovides <virtual> ,
<virtual>;
-f <>, -file <> , <>;
-g <>, -group <> <>;
-p <_> () <_>.
<_> FTP- HTTP-;
-specfile <spec_file> <spec_file> ,
. (, ) , RPM spec-;
-querybynumber <num> <num>. ;
-triggeredby <_> , , <_>.
:
-i , , .
-queryformat, ;
-R, -requires , ;
178
II. Linux
-provides ,
;
-changelog ;
-l, -list , ;
-s, -state ( -l).
: , ;
-d, -docfiles ( -l);
-c, -configfiles ( -l);
-scripts ,
/, ;
-triggers, -triggerscripts -,
, ;
-dump : path size mtime
md5sum mode owner group isconfig isdoc rdev symlink.
, , -l, -c -d;
-last ,
;
-filesbypkg ;
-triggerscripts - .
RPM:
rpm V [-]
rpm -y [-]
RPM.
, MD5, ,
, . . , .
, (, , -excludedocs), .
, . .
(, , ,
, , ).
, (, login).
9. RPM- DEB-
179
:
-nofiles ;
-nomd5 MD5;
-nopgp PGP.
. ,
RPM. , .
:
5 MD5;
S ;
L ();
T ;
D ;
U ;
G ;
M ( ).
RPM:
rpm -checksig <__>
PGP-
.
PGP . . . " PGP"
.
RPM:
rpm -bO [-] <spec_>
180
II. Linux
%install);
-bs ( %prep,
%build %install);
-ba (RPM)
%prep, %build %install).
(SRPM) (
:
-short-circuit ,
. -bc -bi;
-timecheck timecheck (0 ).
, _timecheck.
timecheck ( ), .
, , ;
-clean , , , ;
-rmsource spec- ( , rpm -rmsource foo.spec);
-test . spec;
-sign PGP-. . . . " PGP" ;
-builroot <> <>
;
-target <> <>
arch-vendor-os _target, _target_arch
_target_os.
RPM:
rpm -recompile <__>;
rpm -rebuild <__>.
RPM
%prep, %build %install. , -rebuild . , , ( -clean), spec-.
RPM
RPM :
rpm -resign <__>
resign .
.
9. RPM- DEB-
181
addsign .
.
PGP
, RPM PGP.
:
_signature . PGP;
_pgp_name "",
.
-sign.
, .
RPM:
rpm rebuilddb
:
rpm -initdb
: -dbpath -root.
FTP/HTTP
RPM FTP HTTP
, . , FTP- HTTP-:
ftp://<user>:<password>@hostname:<port>/path/to/packagee.rpm.
182
II. Linux
-httpport
, RPM:
/usr/lib/rpm/rpmrc;
/etc/rpmrc;
~/.rpmrc;
/var/state/rpm/packages;
/var/state/rpm/pathidx;
/var/state/rpm/nameidx;
/tmp/rpm*.
RPM
RPM. Windows . ,
, . , .
:
rpm -i <__>
:
rpm i cpp-2.96-85.i386.rpm
, .
( , ) ,
. , .
, , . . .
:
rpm -i <___1> <___2>
, , ,
, , . ,
rpm -U <__>
, , , .
.
rpm -F <__>
, ,
. FTP.
9. RPM- DEB-
183
RPM :
. , , h,
.
:
rpm ih cpp-2.96-85.i386.rpm
, RPM , - . , , ( ,
).
. ,
.
.
Red Hat 7.1, GNOME Sawfish. , : Sawfish
(, ) (
). ,
, .
,
/usr/src/redhat/RPMS/i386/
Sawfish,
rpm F Sawfish
: " , 0.36, ,
1.02". , - .
rpm U -force Sawfish-1.0-1.i386.rpm
, . force,
, , . .
.
. , , Linux 2.4.2 ,
Linux 2.4.3, ,
II. Linux
184
: " -, ". , , , . , ,
RPM, .
, :
rpm -e <_>
.
, RPM : " ".
, :
,
, . .
, ,
.
,
. , - ,
-nodeps force, .
, , :
rpm -q <_>
: cpp
Version
: 2.96
Release
: 85
: Development/Languages
Size
Packager
: 292618
URL
Summary
Build Host:
License: GPL
Description :
Cpp is the GNU C-Compatible Compiler Preprocessor. Cpp is a macro processor which is used automatically by the C compiler to transform your program before actual compilation. It is called a macro processor because it
allows you to define macros, abbreviations for longer constructs.
9. RPM- DEB-
185
( , ).
, rpm ql cpp-2.96-85 ,
9.2.
9.2
/lib/cpp
/usr/bin/cpp
/usr/lib/gcc-lib
/usr/lib/gcc-lib/i386-redhat-linux
/usr/lib/gcc-lib/i386-redhat-linux/2.96
/usr/lib/gcc-lib/i386-redhat-linux/2.96/cpp0
/usr/lib/gcc-lib/i386-redhat-linux/2.96/tradcpp0
/usr/share/info/cpp.info-1.gz
/usr/share/info/cpp.info-2.gz
/usr/share/info/cpp.info-3.gz
/usr/share/info/cpp.info.gz
/usr/share/man/man1/cpp.1.gz
, : ,
? :
rpm -qf /usr/bin/mc
: mc-4.5.51-32.
. , , , ?
PGP- :
rpm -checksig <_>
-, , :
rpm -V gimp
II. Linux
186
, , :
.M......
/usr/lib/gimp/1.2/modules/libcolorsel_gtk.a
.M......
/usr/lib/gimp/1.2/modules/libcolorsel_triangle.a
.M......
/usr/lib/gimp/1.2/modules/libcolorsel_water.a
, .
, , :
rpm Va
9.3.
9.3
S.5....T c /etc/printcap
.M......
/var/spool/at/.SEQ
/etc/rpm/macros.db1
.......T
/usr/share/pixmaps/netscape.png
SM5....T
/usr/X11R6/lib/X11/fonts/Speedo/encodings.dir
/var/cache/ssl_gcache_data.dir
.M....G.
/dev/jsfd
......G.
/dev/tty0
.....U..
/dev/vcs3
.....U..
/dev/vcsa3
S.5....T c /etc/X11/fs/config
/usr/share/ssl/certs/stunnel.pem
S.5....T c /etc/openldap/ldap.conf
, RPM,
( RPM).
,
RPM . , , - , .
RPM, ,
RPM. .
Yum
Yum RPM :
;
( -
);
.
9. RPM- DEB-
187
Yum . , Yum ,
, . Yum cron.
Yum
:
list .
, mc yum list mc;
search . ,
, KDE, yum search KDE;
provides , . ,
lib yum provides lib.
? * (
\ bash). , , lib, : yum list lib\*, , , /etc/httpd, yum provides
/etc/httpd\*.
Yum
install. , yum install
Midnight Commander.
Yum .
mc
update. yum
, yum update mc mc.
update
remove. , yum remove mc mc.
( ) info.
Yum
Yum "".
clean.
188
II. Linux
.
.
yum list updates , Yum
.
yum list updates after [date] ,
Yum , [date]. : --.
yum list updates last [days] , Yum , [days] .
yum list installed .
yum list extras ,
.
yum clean packages .
.
yum clean headers , Yum
.
, Yum
.
yum clean oldheaders , Yum .
yum clean [all] yum clean packages yum clean oldheaders,
.
Midnight Commander
,
, Midnight Commander
RPM DEB, . ,
,
.
. 9.2 RPM-,
<Enter> .
( ):
HEADER ,
rpm -qi <_>;
*INSTALL, *UPGRADE , Midnight Commander
;
/INFO . , .
9. RPM- DEB-
189
purp
purp , , , . , RPM. . 9.3 .
. 9.3. purp
190
II. Linux
. 9.4.
, ( ) X Window,
RPM - (
DOS/Windows, Norton
Commander). . 9.4.
RPM, .
Kpackage
Kpackage RPM, Debian, Slackware, BSD KISS. Kpackage K Desktop Environment - KDE
(KFM). , RPM, Kpackage. Kpackage . 9.5.
GnoRPM
, , GNOME. :
.
;
,
.
GnoRPM . 9.6.
9. RPM- DEB-
. 9.5. Kpackage
. 9.6. GnoRPM
191
192
II. Linux
Yumex
Yumex (Yum extender) Yum. , , .
Python. fedorahosted.org/yumex/.
. 9.7. Yumex
DEB-
RPM-, Red Hat Based , DEB-, Debian.
deb, . ,
:
debian-binary ;
control.tar.gz (, );
data.tar.gz .
, DEB- .
9. RPM- DEB-
193
DEB
DEB-:
;
FTP;
,
;
. ;
(Upgrade) ,
, (Degrade);
, ,
;
;
( , , . .);
. ;
DEB- , RPM-.
DEB
DEB :
, ;
DEB .
,
DEB , . :
;
;
;
;
.
DEB-
DEB- ,
APT (Advanced Package Tools). APT
: CD-ROM, FTP, HTTP- . Debian FTP- HTTP-.
194
II. Linux
APT
. APT
.
APT
APT , .
.
CD-ROM, HTTP-, FTP- .
APT /etc/apt/sources.list.
sources.list 9.4.
9.4
deb http://security.debian.org/ stable/updates main
deb http://http.us.debian.org/debian stable main contrib non-free
deb cdrom:[Debian GNU/Linux 3.0 r0 _Woody_ - Official i386 Binary-3 (20020718)]/
unstable contrib main non-US/contrib non-US/main
deb cdrom:[Debian GNU/Linux 3.0 r0 _Woody_ - Official i386 Binary-2 (20020718)]/
unstable contrib main non-US/contrib non-US/main
deb cdrom:[Debian GNU/Linux 3.0 r0 _Woody_ - Official i386 Binary-1 (20020718)]/
unstable contrib main non-US/contrib non-US/main
sources.list .
CD-ROM apt-cdrom:
apt-cdrom add
(package cache) , Debian. ,
. ,
, . , .
:
apt-get update
apt-cache , .
,
apt-cache search perl
, perl.
9. RPM- DEB-
195
apt-cache show:
apt-cache show packagename
, apache, :
prompt$ apt-cache show apache
, 9.5.
9.5
Package: apache
Priority: optional
Section: web
Installed-Size: 748
Maintainer: Matthew Wilcox <willy@debian.org>
Architecture: i386
Version: 1.3.26-0woody1
Replaces: apache-modules
Provides: httpd
Depends: libc6 (>= 2.2.4-4), libdb2 (>= 2:2.7.7.0-7), libexpat1
(>= 1.95.2-6), mime-support, apache-common (>= 1.3.26-0),
apache-common (<< 1.3.27-0), perl5 | perl, logrotate (>=
3.5.4-1), dpkg (>> 1.9.0)
Suggests: apache-doc
Conflicts: apache-modules, libapache-mod-perl (<= 1.17-1), jserv (<= 1.1-3)
Filename: pool/main/a/apache/apache_1.3.26-0woody1_i386.deb
Size: 352814
MD5Sum: 728257f5de8d71e0d00701bdca9d452d
Description: , HTTP-.
HTTP- , Apache
(runtime). , , : ; " "; ,
; HTML; ; CERN httpd-; (proxy) . , Apache (multiple virtual homing).
Apache PHP3, mod_perl, Java
Servlet, Apache-SSL .
http://www.apache.org/.
Task: web-server
196
II. Linux
apt-get:
apt-get install packagename
prompt$ apt-get remove packagename
. APT :
apt-get update
apt-get upgrade
, , .
Aptitude
Aptitude Advanced Packaging Tool,
.
, . Debian
.
Aptitude apt-get, .
aptitude search keyword,
, . ,
: - ( ), , . -:
i (installed) ;
p (purge) ;
c (clean) ;
v (virtual) .
- :
A (Auto)
;
h (hold) "", . .
upgrade dist-upgrade;
u (unpacked) , , ;
C (half-Configured) ;
9. RPM- DEB-
197
H (Half-installed) ;
B (Broken) "" ,
aptitude show -.
: , ( ), , ,
, ( ), , ,
( ), , .
aptitude install _
,
(/etc/apt/source.list), ,
, , , , , , , .
aptitude, apt-get, ,
"" , "" ( ).
"" suggest.
aptitude upgrade aptitude
. , h ( ), upgrade,
dist-upgrade. aptitude
hold _, aptitude keep _.
dist-upgrade.
- , aptitude reinstall _.
aptitude remove _
, .
aptitude purge _
198
II. Linux
purge .
(remove purge) , , ,
, ,
.
aptitude clean
aptitude autoclean. , Aptitude. Autoclean ,
.
,
.
www.linuxdocs.org Linux.
www.rpm.org/maximum-rpm.ps.gz RPM: "Maximum
RPM" PostScript.
www.redhat.com/support/docs/rpm/RPM-HOWTO/RPM-HOWTO.html
RPM-HOWTO RPM, ( ).
www.linux.org.ru ,
Linux, RPM-HOWTO .
www.rpm.org , RPM.
rpmfind.net RPM.
rufus.w3.org/linux/RPM RPM.
www.freshmeat.net , RPM-.
www.debian.org/doc/ Debian.
man- apt-get, apt-cache sources.list.
gazette.linux.ru.net/lg84/tougher.html Debian APT. 1: . : Rob Tougher. : .
III
Linux
10
Linux.
Linux ( ) , , .
.
( ), Linux
.
,
. , Linux
.
, ( . .).
:
- ( ), . Windows 9 ( ,
) . Windows
, /
.
Linux . -,
. , , ,
"". ,
2.2 2.4. , . : " ".
,
. -,
" " -, .
, , .
202
III. Linux
- . :
"" ( );
;
;
.
.
, . . . .
( ,
).
. . . . .
:
;
RAID-, ;
;
;
( );
SCSI- ( );
, ( -), ;
( );
( ).
, . ( ).
, . .
.
10.
203
, , :
IP-;
;
;
IP- DNS-;
;
.
, Linux. , . Linux.
.
, , Fedora ( ): 86
400 , 512 ( 1 )
10 .
. , . , (, . route
, , - , ) - ,
. , - .
.
, . ,
, . Swap- (-, ),
. ,
- .
,
-.
204
III. Linux
, - .
, - , .
, , ,
. ,
(, ,
. .), . Linux . ,
. , .
.
/
/ .
. / , .
Linux,
, .
, ,
.
(/bin, /dev, /etc, /mnt . .), , ,
.
/bin
/bin , . , , , /bin
, . , /bin . /bin
.
/boot
/boot , .
, ,
,
. , . ,
10.
205
, /boot .
/boot , ,
. ,
/boot .
/dev
/dev , . makedev
.
. /dev , , , , . /dev ,
. /dev
, .
/etc
, /etc. /etc ,
1520 . /etc . /etc ,
. , ,
. ,
/etc ,
.
/home
/home . , , /home . ,
/home . . /home
quota,
. /home (NFS). ,
,
.
/lib
. . ,
206
III. Linux
.
/lib. /lib .
/lib
, ( /lib /sbin) .
/lost+found
()
/lost+found. fsck ,
. , .
/mnt
. /floppy /CDROM,
-. , , NFS. /mnt , .
, , /etc,
, .
/opt
/opt , , ,
Interbase. /opt
. /opt .
, /opt, .
/proc
/proc . , /proc, .
/proc . /proc .
/root
root.
. , , .
10.
207
/sbin
/sbin /bin. /sbin ,
.
/tmp
, . , , ,
/tmp .
/tmp .
/tmp , , , .
/tmp .
/usr
/usr, . /usr
. /usr/local.
/var
/var ( ,
, , FTP . .). . , /var . /var
.
/var .
FTP, HTTP, /var/log /var/spool.
, .
, ,
. ,
, .
.
,
,
. -
208
III. Linux
DNS .
, .
/var
100 , DNS .
NIS
NIS ,
DNS, , , YP. ( /var/yp/maps.)
/var /var/log. /var/log
50 , /var
YP.
NIS , ,
/var /var/log .
, NFS,
. , -
10.
209
. NFS-
. , .
Samba
,
. ( , ,
. .)
.
/var/spool/news , , ,
.
. ,
. ,
34 ,
.
. , . ,
(raw, " "), .
, /var /var/log.
, .
.
, ,
/opt /usr/local. ,
, . ,
, .
.
RAID-.
210
III. Linux
. -, . -, .
,
.
.
-. RAM 2
80% . . ,
- -.
, ( 1 ),
- 2 . . 1 .
- free top. 50% ,
-.
:
() , , ;
, ();
.
( ,
), 23 :
/ ;
/boot ( );
/swap (-).
( ) .
, , .
: .
: , , (, ), ,
.
10.
211
:
/ 512 , /bin, /sbin . .;
/boot 256 , ;
/usr 256 ,
Linux ;
/home N +
+ . , 100 M
;
/var 512 , ,
(, log-, );
/tmp 256 , .
.
. , FTP
.
. , .
, ,
- .
FAQ, HOWTO, . , Linux.
.
. , . .
, nVIDIA AMD(ATI)
Linux.
.
Linux-.
. . Win . www.linmodems.org
. Win- Lucent.
. HOWTO,
.
RAID-. , HOWTO.
212
III. Linux
.
.
www.redhat.com/support/manuals .
The Official Red Hat Linux x86 Installation Guide
11
: , . , .
-, . , ,
, .
-, Red Hat kickstart, .
. , -,
( ). ,
, .
,
.
- , (
PCMCIA) Flash-.
(15 , 25 7 ), , ,
. . 11.1 .
11.1. Fedora Core
<Ctrl>+<Alt>+<F1>
<Ctrl>+<Alt>+<F2>
III. Linux
214
11.1 ()
<Ctrl>+<Alt>+<F3>
<Ctrl>+<Alt>+<F4>
<Ctrl>+<Alt>+<F5>
<Ctrl>+<Alt>+<F7>
X Window
,
(. 11.1).
,
, , .
( <Enter>). , (. 11.2), (. 11.3). , : , ,
(. 11.4).
(. 11.5). , , (. 11.6).
. 11.1.
11.
215
. 11.2.
. 11.3.
. 11.4.
III. Linux
216
. 11.5.
. 11.6.
, (. 11.7).
(. 11.8)
(. 11.9).
.
root (. 11.10).
.
11.
217
. 11.7.
. 11.8.
218
III. Linux
. 11.9.
. 11.10. root
11.
219
,
(. 11.11). ,
.
.
, ,
. , .
. 11.11.
, . "" , .
. , (. 11.12).
220
III. Linux
. 11.12.
. 11.13.
11.
221
, , (. 11.13).
:
.
,
(. 11.14).
, ,
. (. 11.15).
.
. 11.14.
III. Linux
222
. 11.15.
(. 11.16).
GPL (. 11.17).
( )
(. 11.18). ,
.
(. 11.19). .
(. 11.20). ,
(. 11.21).
( ) , .
11.
223
. 11.16.
. 11.17.
III. Linux
224
. 11.18.
. 11.19.
11.
225
. 11.20.
. 11.21.
226
III. Linux
-, . , ISO- .
NFS- HTTP- . , .
http://www.redhat.com/support/manuals .
http://docs.fedoraproject.org/en-
US/Fedora/14/html/Installation_Guide/index.html
Fedora.
12
, , . . , ,
. .
root . . .
. .
, , , , . ,
.
Linux .
. , , . X Window, ( , GNOME) -, RPM (, ,
-). , . , .
, : .
, - ,
, . , , .
228
III. Linux
,
.
, ,
.
, .
, ,
Linux- ,
. , .
,
"" , , Microsoft Office.
OpenOffice. , .
( ), . , . , finger, r- (rlogin,
rcopy . .), telnet ( ) ,
. ,
, SSH. ( ) ,
- .
, , . , , ,
. telnet ,
. .
.
, ,
NTP . .
.
, , . :
;
,
;
, .
12.
229
. DVD - , IP-. , .
. , . . .
( ).
. , , (
, ).
, , .
, , .
,
.
, ,
.
, .
,
,
, FTP-, HTTP- . . ,
( ) ( )
, , Web- , .
, - , - .
. (C/C++ , Perl Pyton . .),
. " ", .
230
III. Linux
, , .
, , .
.
, .
SCSI- ( ).
, ,
, . SCSI
. USB- (, , ), .
( ). /
. (, firewall) , .
.
.
,
Web-, , Web-. ,
,
finger, r- (rlogin, rcopy . .), telnet ( ), NFS
. . . ,
. . Web-, , X Window .
( ) , :
BOOTP (Boot Protocol) .
, ;
DHCP (Dynamic Host Configuration Protocol) ,
IP- (IP-, , . .).
DHCP-;
mt-st : mt ( magnetic tape devices) st ( SCSI
tape devices). ;
eject ( CD-ROM,
Iomega Jazz Zip), .
;
12.
231
apmd -
. ,
;
linuxconf .
. , , ;
isapnptools ISA Plug and Play (PnP)
, ISA Plug and Play.
ISA-, ;
setserial .
.
, .
(UPS). ;
kudzu .
,
. ,
, ;
raidtools , RAID-. RAID- , ;
redhat-logos ;
redhat-release ;
rmt .
r- ;
tyx HTTP-. HTTP. , Web-, . ,
Web- Apache.
.
, , ,
. ,
" " ,
.
.
.
1. . ,
, . .
2. , , , .
232
III. Linux
3. , root , .
4. root , . ,
.
5. root .
6. logrotate: log- 100
200 .
7. .
8. .
, .
9.
.
10. ,
, , .
.
11. .
"UNIX:
" " Linux".
HOWTO:
Security-HOWTO;
Hacker-HOWTO;
NFS-HOWTO;
Firewall-HOWTO.
IV
Linux
13
- . UNIX- , , , .
.
apropos
apropos () whatis
(. ) .
Man-
Linux
:
man _
. , man , . , ,
.
, , (, , ) , . ,
, .
man
. ,
.
whatis
whatis - . , .
236
IV. Linux
HOWTO
man , , . HOWTO " -". , :
, , Web-, . , ,
HOWTO , . HOWTO , www.rambler.ru.
-HOWTO
HOWTO, 50100 , -HOWTO . .
Fedora
http://docs.fedoraproject.org/ru-RU/index.html , ,
Linux.
, ,
, , . ,
.
Slackware
www.slackware.ru . www.slackware.org .
Alt Linux
Alt Linux
, .
www.altlinux.ru .
Debian
www.debian.org/doc/ ,
.
13.
237
www.linuxdocs.org Linux.
, , Linux,
.
www.redhat.com Red Hat, . ,
4. ( 1995 ) .
Red Hat ,
Windows. Red Hat - .
( ).
www.fedoraproject.org Fedora. , Red Hat Linux, Fedora, , Red Hat.
www.debian.org c Debian.
www.altlinux.ru c Alt Linux.
www.slackware.ru Slackware.
14
. ,
. X Window ,
. (,
) X Window. ,
( Windows NT Server, Windows 2000,
Windows 2003) . , ( X Window) , , Web-,
? .
, ( ) .
, ( , ).
, ( )
. Web-.
.
. ,
X Window, .
. , Linux () ( , ) X Window.
- .
Linux , . ,
- . - , , .
, Windows . Windows
" " (all in one). , .
.
14.
239
, Linux .
, . . Linux
() . ,
Windows .
, , ,
, .
/,
( , ). . . / .
<.
,
mysql <2.sql
mysql , 2.sql.
> >>.
? > ,
. ,
. >> ,
, .
:
command 2>&1
.
:
df > 1.txt
ls A >>1.txt
/ .
()
(, pipe) |. . .
:
ls | grep
IV. Linux
240
Linux UNIX,
. , , , , UNIX. , , , :
UNIX Linux 98% .
. , . man, HOWTO.
, . ,
( ) .
,
cal
cal ,
.
:
;
;
.
:
cal
3
10
17
24
2011
1
4 5 6 7 8
11 12 13 14 15
18 19 20 21 22
25 26 27 28 29
2
9
16
23
30
date
date , .
:
+ ;
-s ;
-u .
, . :
MMddhhmmyy
14.
241
;
;
;
;
.
:
MM
dd
hh
mm
yy
date
man date.
, .
, " "
.
chgrp
chmod , , .
:
[ugoa...][[+-=][rwxXstugo...]...][,...]
, . -
u, g, o a (, ) , , :
u ;
g ;
o , ;
a . a ugo ;
+ ;
- ;
= .
rwxXstugo ,
ugoa:
r ;
w ;
242
IV. Linux
x ;
X , -
- ;
S setuid setgid-;
t sticky-;
u , ,
;
g , ;
o ,
.
sticky- , .
Linux, setgid, ,
(mandatory), (advisory). /usr/src/linux/Documentation/mandatory.txt.
, 4, 2 1. :
setuid (4),
setgid (2) sticky- (1);
,
: (4), (2) (1);
, ;
, .
, root.
man chmod.
chown
chown / .
/ ,
. :
( )
,
;
(
) ;
, ,
;
,
.
, ,
root.
14.
243
chroot
chroot root,
chroot _
.
.
man chroot.
lockfile
lockfile .
mknod
mknod (FIFO),
( ).
:
. ,
. .
, .
.
, . .
, , , :
p FIFO;
b ;
c .
/usr/src/linux/Documentation/devices.tex ,
, , .
man mknod.
,
.
cat
, .
cd
cd bash .
:
cd /var/log
/var/log.
IV. Linux
244
cp
cp .
, cp .
, cp .
, , sticky, setuid setgid .
:
cp /home/user1/test /home/user2/1.txt
/home/user1/test /home/user2/1.txt.
man cp.
dir
. ls.
file
file ( )
. /usr/share/magic.
14.1 .
14.1
file file.c
file.c:
C program text
file -s /dev/hda{,1,2,3,4,5,6,7,8,9,10}
/dev/hda:
/dev/hda1:
/dev/hda2:
/dev/hda3:
/dev/hda4:
/dev/hda5:
/dev/hda6:
/dev/hda7:
/dev/hda8:
/dev/hda9:
empty
/dev/hda10: empty
man file.
find
find . , , .
man find.
14.
245
head
head 10 .
.
ln
ln . , s .
,
, . , , ln
,
. , ( )
( ).
ln
.
:
ln make test
test make.
man ln.
locate
locate .
ls
ls .
, , ,
, .
, .
(locale).
, .
l :
;
;
;
;
;
;
;
.
:
- ;
d ;
b ;
c ;
IV. Linux
246
l ;
p FIFO;
s .
14.2 .
14.2
ls l
124
-rw-rw-r--
1 alst
alst
665
6 16:09 cd
-rw-rw-r--
1 alst
alst
665
-rw-rw-r--
1 alst
alst
4005
6 16:08 chgrp
-rw-rw-r--
1 alst
alst
6909
6 16:08 chmod
-rw-rw-r--
1 alst
alst
3668
6 16:08 chown
-rw-rw-r--
1 alst
alst
1126
-rw-rw-r--
1 alst
alst
12508
drwxr-xr-x
2 alst
alst
-rw-rw-r--
1 alst
alst
16011
-rw-rw-r--
1 alst
alst
17248
-rw-rw-r--
1 alst
alst
8497
6 16:10 ln
-rw-rw-r--
1 alst
alst
2550
6 16:11 locate
-rw-rw-r--
1 alst
alst
7228
6 16:09 locfile
-rw-rw-r--
1 alst
alst
-rw-rw-r--
1 alst
alst
3917
6 16:09 mknod
drwx------
2 alst
alst
4096
8 16:03 nsmail
-rw-rw-r--
1 alst
alst
978
6 16:11 uptime
-rw-rw-r--
1 alst
alst
62
6 16:09 cdd
6 16:08 chroot
6 16:10 cp
6 16:11 lss
6 16:11 uptm
man ls.
mc
mc Midnight Commander,
. Midnight
Commander ,
<F1>.
mkdir
.
0777 , umask.
:
mkdir test
man mkdir.
14.
247
mkfifo
mkfifo (FIFO) .
FIFO ,
. FIFO- , ,
shell.
man mkfifo.
mv
mv .
, mv . ,
.
:
mv /tmp/test /home/user1
pwd .
:
pwd
/home/alst
rm
rm . ,
-r -R, .
:
rm *.tmp
TMP- .
man rm.
rmdir
rmdir . ,
.
rmdir r
size
size ,
.
:
size /sbin/agetty
text
10819
data
bss
dec
844
10336
21999
hex
filename
55ef
agetty
IV. Linux
248
slocate
slocate locate.
14.3 .
14.3
locate dir
/var/run/runlevel.dir
/var/www/icons/dir.gif
/var/www/icons/small/dir.gif
/var/www/icons/small/dir2.gif
/etc/X11/applnk/Games/xpuzzles/.directory
/etc/X11/xdm/authdir
...
/usr/src/linux-2.4.3/net/tux/redirect.c
/bin/mkdir
/bin/rmdir
/home/alst/.kde/Autostart/.directory
/home/alst/Desktop/.directory
/lib/security/pam_mkhomedir.so
/root/.kpackage/dir
man slocate.
split
split .
1000 .
stat
stat , .
14.4.
14.4
stat /sbin/agetty
File:
Size:
Access:
Device:
Access:
Modify:
Change:
"agetty"
13148
Blocks: 32
Regular File
(0755/-rwxr-xr-x)
Uid: ( 0/ root) Gid: ( 0/ root)
302
Inode: 350883
Links: 1
Sat Oct 6 20:10:19 2010
Fri Jul 13 01:22:17 2010
Fri Aug 31 07:44:08 2010
man stat.
14.
249
tac
tac ,
.
tail
tail 10 . .
vdir
. ls.
dig
DNS-.
, .
elm
elm , , mail.
finger
finger ,
.plan .project. , , . finger-.
ftp
ftp FTP.
, ,
.
FTP-. FTP-.
FTP-, (,
mc).
getty (mgetty)
. . man.
host
host IP- , DNS.
IP-, .
250
IV. Linux
hostname
hostname . .
ipchains
ipchains ,
IP- (firewall) Linux.
:
;
;
IP- (forwarding);
.
.
, iptables.
man ipchains
.
iptables
iptables , IP (firewall) Linux. ipchains.
man iptables
.
kppp
, KDE.
PPP- . .
lynx
lynx .
. Web- ( HTML), .
mail
mail .
, . .
mimencode
mimencode MIME
.
minicom
minicom , , . .
. .
14.
251
netcfg
netcfg linuxconf.
,
.
netstat
, , . . .
nslookup
DNS-.
.
pine
pine
Usenet. MIME- MIME. , .
ping
ping ICMP- ECHO_REQUEST (IP ) . ,
. 14.5.
14.5
ping
PING 127.0.0.1 (127.0.0.1) from 127.0.0.1 :
64 bytes from 127.0.0.1: icmp_seq=0 ttl=255
64 bytes from 127.0.0.1: icmp_seq=1 ttl=255
64 bytes from 127.0.0.1: icmp_seq=2 ttl=255
64 bytes from 127.0.0.1: icmp_seq=3 ttl=255
--- 127.0.0.1 ping statistics --4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max/mdev = 0.029/0.085/0.214/0.076 ms
man ping.
procmail
procmail .
.forward. , procmail .
252
IV. Linux
ssh
ssh (secure shall) telnet r-. , , .
telnet
telnet Telnet. ,
.
SSH OpenSSH.
traceroute
traceroute
. (
), , ,
,
. , , .
man traceroute.
uudecode
uudecode UU- , (
).
uuencode
uuencode UU- ,
(
).
wget
wget HTTP . FTP,
(date stamps), Web- .
, wget , , .
,
.
at
at
.
14.
253
. , ,
. .
man at. man crontab.
atq
atq , at.
atrm
atrm at.
batch
batch, at, , ,
, .
.
cksum
cksum (CRC) .
crond
.
crontab.
crontab
, crontab.
getkeycodes
getkeycodes - .
ifconfig
. .
14.6.
14.6
lo
Mask:255.0.0.0
UP LOOPBACK RUNNING
MTU:16436
Metric:1
IV. Linux
254
collisions:0 txqueuelen:0
ppp0
MTU:1500
Metric:1
insmod
insmod .
modprobe.
Isapnp
,
ISA PnP, Linux.
ISA ,
.
kill
kill .
. .
killall
killall .
lilo
lilo , , Linux. .
:
-v ;
-q . lilo /boot/map
, ;
-m - , ;
-C - lilo /etc/lilo.conf.
;
-d . lilo , <Shift>, , . .
;
-D . ,
, ;
14.
255
-r .
MBR;
-t .
. -v, ,
lilo;
-c . . ;
-f disk-tab , (
/etc/disktab);
-i _ , . ( /boot/boot.b.);
-l "//" lilo
;
-P {fix|ignore} (fix) (ignore)
;
-s _ lilo ,
/boot/boot.NNNN,
NNNN .
-u, , ;
-S _ lilo
. ;
-u _ lilo
;
-U _ , ;
-R _ , .
.
;
-I
BOOT_IMAGE. ,
, ;
-V .
man lilo.conf.
linuxconf
. ( ) . , . .
.
md5sum
md5sum MD5. ,
256
IV. Linux
, ( ).
man md5sum.
modprobe
modprobe .
.
man modprobe.
mount
root. .
.
:
mount /dev/fd0 /mnt/floppy
man mount.
nice
nice .
15 () 20 (). root.
nice
.
passwd
, . passwd , , .
root ,
() .
pnpdump
pnpdump isapnp
ISA PnP. ISA- .
ISA PnP.
renice
.
rpm
rpm , , , , , .
14.
257
:
;
;
;
;
TAR-;
;
;
;
;
;
;
;
;
;
;
.
rpm . 8.
rmmod
rmmod ,
.
man rmmod.
setserial
setserial .
:
setserial ttyS0
man setserial.
setterm
setterm . ,
.
man setterm.
skill
.
TERM.
snice
snice . +4.
+ .
258
IV. Linux
strace
strace .
. strace ,
. .
strace .
stty
.
, .
:
stty
speed 0 baud; line = 0;
-brkint -imaxbel
umount
umount . .
:
umount /mnt/floppy
man umount.
useradd
.
, .
xf86config
xf86config f86config, .
xvidtune
xvidtune -. xvidtune , , . xvidtune
, . ,
f86onfig.
zic
, . . -
14.
259
,
/usr/share/zoneinfo/ .
df
df
.
, .
1024 , ,
POSIXLY_CORRECT ( POSIX-).
:
df
Filesystem
1k-blocks
/dev/hda2
4134932
1607188
2317696
41% /
/dev/hda1
4008372
1085892
2922480
28% /mnt/floppy
du
du
. " " , .
, du
.
1024 ( ), ,
POSIXLY_CORRECT.
/root 14.7.
14.7
du
16
4
./.gnome/accels
./.gnome/apps
20
./.gnome/panel.d/default/launchers
52
./.gnome/panel.d/default
56
./.gnome/panel.d
./.gnome/nautilus-scripts
./.gnome/gnome-vfs
./.gnome/application-info
168
./.gnome
.........
IV. Linux
260
16
./.ee/minis/root
20 ./.ee/minis
32 ./.ee
612 .
dumpkey
dumpkey .
free
free .
14.8.
14.8
free
total
Mem:
255532
-/+ buffers/cache:
Swap:
257000
used
227600
86892
0
free
27932
168640
257000
shared
0
buffers
66140
cached
74568
ftpcount
ftpcount , FTP-, ftpaccess.
ftpwho
ftpwho , FTP .
kdb_mode
.
last
last
.
14.9.
14.9
last
alst
alst
alst
tty4
tty3
tty2
Sun Nov
Sun Nov
Sun Nov
4 12:54:36 2001
4 12:55
still logged in
4 12:55 12:56 (00:00)
4 12:54
still logged in
14.
261
ps
ps
( 14.10).
14.10
ps A
PID TTY
TIME CMD
1 ?
00:00:04 init
2 ?
00:00:00 keventd
3 ?
00:00:00 kapm-idled
4 ?
00:00:00 kswapd
5 ?
00:00:00 kreclaimd
6 ?
00:00:00 bdflush
7 ?
00:00:00 kupdated
8 ?
00:00:00 mdrecoveryd
. . . . . . . . . ..
741 tty1
00:00:00 login
742 tty1
00:00:00 bash
781 tty1
00:00:00 mc
782 ?
00:00:00 cons.saver
783 pts/0
00:00:00 bash
802 tty2
00:00:00 bash
837 tty2
00:00:00 mc
838 ?
00:00:00 cons.saver
839 pts/1
00:00:00 bash
1292 pts/1
00:00:00 ps
man ps.
quota
quota .
man quota.
tload
.
top
top ,
. .
14.11.
IV. Linux
262
14.11
top
buff
COMMAND
init
keventd
kapm-idled
kswapd
kreclaimd
bdflush
kupdated
khubd
syslogd
klogd
portmap
rpc.statd
apmd
automount
atd
sshd
xinetd
uptime
: ,
, ,
.
:
uptime
4:11pm
up 5 min,
2 users,
users
users ,
. /etc/utmp.
who
.
, , .
14.
263
:
who
alst
tty1
Oct
6 14:13
root
tty2
Oct
6 14:18
man who.
w
w : , , ,
. who, ps, -a uptime.
fdisk
, . .
fdformat
fdformat
FAT.
mkfs
mkfs . fdisk.
. man.
fsck
fsck
. .
gzip
, .
MS-DOS Windows, .
tar.
264
IV. Linux
tar
, /
. . .
joe
joe , .
sort
sort , .
.
uniq
uniq .
vi
vi ,
UNIX-. vi vim elvis.
vim
, vim, vi- . "", .
apropos
apropos whatis.
man
man , . man
.
man man.
whatis
whatis - . , .
14.
265
:
whatis du
du
(1)
banner
banner , *.
bash
Bourne Again Shell
( sh).
.
bc
bc , .
.
chvt
. , .
clear
clear .
cpp
cpp , - .
csh
C shell
Linux.
echo
echo ( ). :
Linux /bin/echo, echo-
C shell Bourne Again Shell.
env
env .
266
IV. Linux
Linux . , , , , EDITOR.
, , , . .
g77
g77 Fortran.
IBM .
, ""
( , ), .
gawk
gawk GNU-
AWK.
gcc
gcc ++, Linux. UNIX , (
, ).
id
id : , , ,
.
login
login , , UID- GID-,
. ,
root , /etc/securetty.
logname
,
. /etc/utmp.
make
make , .
make . Makefile.
14.
267
nohup
nohup
.
, .
openvt
, ( 64).
, . ,
.
perl
PERL Practical Extraction and Report Language, , , .
CGI- Web-.
printenv
. , ,
.
reset
.
resizecons
(
80 , 25 ) .
startx
startx X Window .
startx .xinitrc
. X Window,
, X- . ,
, .
strings
. , .
IV. Linux
268
strip
strip . , ,
, .
.
subst
subst . .
.
. , . , .
#. , #,
.
su
su
.
root. /etc/passwd . , su .
true
, , .
es
, .
, . , ,
.
man.
www.linuxdocs.org , HOWTO.
HOWTO:
iptables-HOWTO;
NAT-HOWTO.
V
Linux
15
, ,
. ( "")
.
, ,
. ,
.
, , ,
, , .
. Linux? , " ", Linux , . ,
- ,
( )
,
,
.
,
Linux.
Linux- ,
, , , .
, Linux
, , , . .
272
V. Linux
, :
( , );
X Window;
;
;
(, , . .).
, ( )
() .
,
.
( ) , , .
,
. ,
.
ASCII
( )
ASCII ( ).
ASCII, 7- ASCII, 128 .
, . 0 127.
7- ASCII 8- ASCII
( ASCII). 256 , 0 255. 0 127 ,
. , 8- ASCII .
(ISO) (
ISO 8859-x),
. :
8859-0 (Latin 0);
8859-1 , (Latin 1);
15.
273
8859-2 ;
8859-5 .
8859-1 (Latin 1) , , . , ,
.
ASCII IBM.
.
, . :
(128);
.
(CP866)
(CP866) IBM, , .
Microsoft CP1251
Microsoft CP1251 Microsoft
. Windows.
, , CP866 .
8
, 7-
ASCII. 8 ASCII , . , ,
8, () ,
, . ,
" "
: "Mama myla ramu".
8, KOI8-R
, KOI8-U .
RFC 1489 Registration of a Cyrillic Character Set,
, ,
KOI8-R .
274
V. Linux
Unicode
Unicode ISO 10646,
256 Latin-1 (ISO 8859-1).
( 8).
,
65 535 . , , , , ,
. Windows 98
. UNIX- Unicode .
, , ( , ,
).
"" . ,
.
console-tools, Cyrillic
console-tools ( console-tools ) kbd.
,
.
Linux (Application Charset Map, ACM) (Screen Font Map, SFM).
,
, A,
. , B Unicode
. B
. , B, .
.
15.
275
VGA
, 512 .
B .
fallback-. B B1, B2 . . , B " ", , , B1 "
", B2 <.
console-tools kbd :
. consolechars ( console-tools) setfont mapscrn ( kbd);
fallback-;
loadkeys.
/usr/share/consolefonts
/usr/lib/kbd/consolefonts, /usr/share/consoletrans,
/usr/share/keymap/i386/qwerty.
console-tools
console-tools,
:
loadkeys ru.map
consolechars -v -f Cyr_a8x16 -m $foo/koi2alt
<Ctrl> (
<Alt> <Caps Lock>).
koi8-r koi8-u.
kbd
kbd
:
loadkeys /usr/lib/kbd/keytables/ru.map
setfont /usr/lib/kbd/consolefonts/Cyr_a8x16
mapscrn /usr/lib/kbd/consoletrans/koi2alt
276
V. Linux
# ""
echo -ne "\033(K"
echo -ne "\033(K"
. :
for i in 1 2 3 4 5 6 7; do echo -ne "\033(K" > /dev/tty$i; done
"" , CP866.
, .
"", 7- .
bash
.inputrc, ,
:
set meta-flag on
set convert-meta off
set output-meta on
, 8- .
.inputrc GNU
readline, bash, , GNU readline.
csh/tcsh
csh/tcsh
.
.inputrc, , :
set meta-flag on
set convert-meta off
set output-meta on
.cshrc :
setenv LC_CTYPE iso_8859_5
stty pass8
zsh
.zshrc :
setenv LC_CTYPE iso_8859_5
stty pass8
15.
277
less
less ~/.lesskey :
LESSCHARSET=
LESSCHARSET=
. lesskey
~/.less.
nroff
nroff
Tlatin1.
man
man , less.
/usr/lib/man.conf :
NROFF
NROFF
ls
ls
. :
ls N;
ls --show-control-chars;
Samba
, /etc/smb.conf
:
[global]
character set = koi8-r
client code page = 866
preserve case = yes
short preserve case = yes
278
V. Linux
telnet
~/.telnetrc, :
DEFAULT set outbinary
, , . . ,
- .
: (Localization, l1on) (Internationalization, i18n).
,
. ,
//, .., ...
, , . . , .
,
.
, , .
(locale). ,
.
, , :
;
;
;
/.
LANG :
export LANG={}
, , : LANG="C" LANG="POSIX".
POSIX.2 :
language_TERRITORY.Codeset
15.
279
:
language , (ru, fr . .);
TERRITORY , (RU, UA . .);
Codeset .
LC_ALL
( )
LC_CTYPE
LC_NUMERIC
LC_TIME
LC_COLLATE
LC_MONETARY
LC_MESSAGES
LC_PAPER
LC_NAME
LC_ADDRESS
LC_TELEPHONE
. , .
LI18NUX 2000
Globalization Specification Version 1.0 with Amendment 4 Linux Internationalization
Initiative (Li18nux).
X Window
X Window " ".
.
280
V. Linux
,
.
UNIX ispell. , , , .
ispell
8- . .
. .
ftp://mch5.chem.msu.su/pub/russian/ispell/rus-ispell.tar.gz.
,
emacs.
www.ispras.ru/~knizhnik.
vim
vim
. : , . ,
( ) langmap. .vimrc :
set langmap=;;
set langmap=`,q,w,e,r,t,y,u,i,o,p,[,],a,s,d,f,g,h,j,k,
l,',z,x,c,v,b,n,m,\,,.,~,Q,W,E,R,T,HY,U,I,O,P,{,},A,
S,D,F,G,H,J,K,L,:,\",Z,X,C,V,B,N,M,<,>
joe
8- , joe -asis.
.joerc.
:
8- ;
, ;
, .
15.
281
elm
~/.elm/elmrc:
CHARSET=koi8-r
pine
pine.conf :
character-set=koi8-r
pine,
quoted-printable:
enable-8bit-nntp-posting
enable-8bit-esmtp-negotiation
mutt
.muttrc:
set charset=koi8-r
set allow_8bit
(
8, CP1251)
.muttrc:
set charset= koi8-r
set send_charset= windows-1251
set allow_8bit
tin
.tin/tinrc
:
post_mime_encoding=8bit
mail_mime_encoding=8bit
FAT32 Windows
.
-
V. Linux
282
, , , .
, FAT32, mount :
codepage=866, iocharset=koi8-r.
- , :
mount -t iso9660 -o iocharset=koi8-r
/dev/cdrom
/mnt/cdrom
Perl
, , Perl :
use locale;
use POSIX qw (locale_h);
setlocale(LC_CTYPE, 'ru_RU.KOI8-R');
recode:
recode CP1251..KOI8-R
winfile.txt
16
Linux.
.
Linux RPM, Fedora (Red Hat).
Linux
, Linux , . , , ,
.
2.6.x.
,
, , . , Linux.
,
. :
rpm -qa | grep kernel
- :
kernel-headers-2.6.21
kernel-2.6.21
kernel-source-2.6.21
kernel-doc-2.6.21
V. Linux
284
,
. , .
:
kernel-2.6.xx.;
kernel-headers2.6.xx, kernel-source-2.6.xx.
FTP-.
, , . :
rpm -Uvh kernel-2.6.XX.i386.rpm ;
rpm -ivh kernel-2.6.xx.i386.rpm .
, , "" (roll back, downgrade) .
Linux.
:
ls -l /boot
vmlinuz-2.6.xx.
(boot loader).
Yum.
,
,
.
,
( ).
, Linux . .
GRUB
GRUB,
/boot/grub/grub.conf.
GRUB 16.1.
16.
285
16.1
# NOTICE: You have a /boot partition. This means that
# all kernel paths are relative to /boot/
default=0
timeout=30
splashimage=(hd0,0)/grub/splash.xpm.gz
title Fedora Core Linux (2.6.21)
root (hd0,0)
kernel /vmlinuz-2.6.21 ro root=/dev/sda3
initrd /initrd-2.6.21.img
:
1. , . . 16.2 ( ).
16.2
# NOTICE: You have a /boot partition. This means that
# all kernel paths are relative to /boot/
default=0
timeout=30
splashimage=(hd0,0)/grub/splash.xpm.gz
title My new kernel (2.6.22)
root (hd0,0)
kernel /vmlinuz-2.6.22 ro root=/dev/hda3
initrd /initrd-2.6.22.img
title Fedora Core Linux (2.6.21)
root (hd0,0)
kernel /vmlinuz-2.6.21 ro root=/dev/sda3
initrd /initrd-2.6.21.img
.
2. , , .
286
V. Linux
Linux
Linux : .
, , . ,
,
- .
, , .
, .
, .
? "" ""?
""
"".
Linux. , .
, "" ,
.
Linux
(, , , , . .).
, "" (), .
. ""
(Alan Kox).
,
. , ,
, .
""
"" ( ), "".
,
: -
16.
287
, , , , .
( ) .
" ".
?
, , : ,
50100 .
Linux
- Linux, ? , ,
, - . :
xconfig , X Window;
menuconfig
(. 16.1). ,
;
. 16.1. menuconfig
V. Linux
288
. 16.2. config
config -
(. 16.2). , .
, ( )
. .
,
. root :
/sbin/mkbootdisk kernelversion
kernelversion , uname.
( ) kernel-headers kernel-source.
/usr/src/kernels/2.6.27.XXXXXX
.
()
Linux .
1. ,
-
. make mrproper,
16.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
289
"" , , /usr/src/linux-2.6/.config.
(/usr/src/linux-2.6/.config),
, , make mrproper
.
.
, . , ,
, :
make xconfig X Window;
make config ;
make menuconfig
Linux;
make oldconfig , .
/usr/src/kernels/2.6.27.XXXXX/.config
make dep.
make
clean.
/usr/src/kernels/2.6.27.XXXX/Makefile
, (
Kernel-HOWTO). /usr/src/kernels/
2.6.27.XXXXX/Makefile , EXTRAVERSION=,
, . . , EXTRAVERSION= -0.1.6-jul2009.
.
make bzImage.
make modules.
make modules_install.
/lib/modules/
KERNELVERSION/kernel/drivers, KERNELVERSION , Makefile. /lib/modules/2.6.27-jul2009/kernel/
drivers/.
SCSI-, SCSI-
, initrd (. ).
make install, .
. (. . " ").
290
V. Linux
initrd
initrd SCSI-
. /sbin/mkinitrd initrd
, :
loopback block device ;
/etc/modules.conf SCSI-.
initrd /sbin/mkinitrd
/sbin/mkinitrd /boot/initrd-2.6.27-jul2008.img 2.6.28-jul2009
/boot/initrd-2.6.28-jul2009.img initrd,
2.6.27-jul2008 , ( /lib/modules)
initrd.
. Linux:
1. make mrproper.
2. make menuconfig.
3. make dep.
4. make clean.
5. /usr/src/kernels/2.6.27.XXXX/Makefile.
6. make bzImage.
7. make modules.
8. make modules_install.
9. /sbin/mkinitrd /boot/initrd-2.6.xx.img 2.6.xx ( SCSI-).
10. make install.
11. .
:
, , . .
Yes No. No
kmod support module version (CONFIG_MODVERSIONS) support;
:
make modules;
make modules_install;
LILO lilo.conf append=nomodules.
. Linux:
1. make mrproper.
2. make menuconfig.
16.
3.
4.
5.
6.
7.
291
make dep.
make clean.
/usr/src/kernels/2.6.27.xxxx/Makefile.
make bzImage.
/sbin/mkinitrd /boot/initrd-2.6.xx.img 2.6.xx ( SCSI-).
8. make install.
9. (. . " ").
Linux. menuconfig
Linux, .
()
, ,
,
Linux. 90%
.
" ".
.
General setup :
. ,
PCI, EISA, MCA, PCMCIA-,
. .
Enable loadable module support ( ).
Infrastructure for tracing and debugging user processes
.
Enable block layer , .
Processor type and features , , ,
,
. ,
, ,
Pentium I7, AMD Cyrix.
Power management options . .
Bus options (PCI etc.) -.
292
V. Linux
.
Networking support -
Linux , , , .
: , , .
Device drivers .
Firmware drivers BIOS, . .
File systems (VFAT, Ext3, ISO 9660
. .), ,
, .
.
Kernel hacking "" , .
Security options .
Cryptographic API .
Virtualization .
.
Library routines .
.
www.gnu.org/software/grub/ GRUB.
www.redhat.com/support/docs/howto/kernel-upgrade/kernel-upgrade.html
, .
/usr/src/linux-2.6/Documentation ,
Linux .
Kernel-HOWTO (The Linux Kernel HOWTO)
17
DNS
DNS (Domain Name System). DNS
IP- IP-
. ?
www.lazzycat.com, 213.162.145.242, 4
, 5060 .
"IP-"
/etc/hosts. ,
, , DNS-.
DNS- ,
IP-.
DNS, DNS.
DNS . . () root (). (Top Level Domains, TLDs). : ORG, COM,
EDU, GOV, MIL, NET, RU, UA . .
, .
moshkin.bins.ru,
. ,
, ru. (.), ru. ,
ru. ( ), ,
bins.ru.
IP- moshkin.bins.ru.
, "IP-" DNS
.
IP-
DNS-. in-addr.arpa
, . ,
213.162.145.242 242.145.162.213.in-addr.arpa,
.
V. Linux
294
DNS-:
DNS "IP-
DNS- ,
. , " DNS-", .
, , , .
, , ,
, .
host.conf
, , IP-.
host.conf ,
/etc/hosts, DNS:
order hosts,bind
, , DNS (
), .
/etc/hosts
"IP-":
127.0.0.1
192.168.0.1
192.168.0.2
localhost localhost.localdomain
user
user2
:
127.0.0.1
localhost localhost.localdomain
/etc/resolv.conf
, :
search bins.ru
nameserver 213.166.195.22
17. DNS
295
, search, ,
. , user, user.bins.ru. search . DNS-,
.
" IP-"
DNS- .
, ,
. DNS- DNS- , DNS- .
.
/etc/named.conf
DNS-. 17.1 .
17.1
options {
directory "/var/named";
};
zone "." {
type hint;
file "root.hints";
};
zone "0.0.127.in-addr.arpa" {
type master;
file "127.0.0";
};
directory bind, . ,
, .
zone "0.0.127.in-addr.arpa" , bind 127.*.*.*, , 127.0.0.
zone "." . , DNS-, .
V. Linux
296
, /var/named/root.hints,
, 17.2.
17.2
.
.
.
.
.
.
.
.
.
.
.
.
.
6D
6D
6D
6D
6D
6D
6D
6D
6D
6D
6D
6D
6D
IN
IN
IN
IN
IN
IN
IN
IN
IN
IN
IN
IN
IN
NS
NS
NS
NS
NS
NS
NS
NS
NS
NS
NS
NS
NS
G.ROOT-SERVERS.NET.
J.ROOT-SERVERS.NET.
K.ROOT-SERVERS.NET.
L.ROOT-SERVERS.NET.
M.ROOT-SERVERS.NET.
A.ROOT-SERVERS.NET.
H.ROOT-SERVERS.NET.
B.ROOT-SERVERS.NET.
C.ROOT-SERVERS.NET.
D.ROOT-SERVERS.NET.
E.ROOT-SERVERS.NET.
I.ROOT-SERVERS.NET.
F.ROOT-SERVERS.NET.
5w6d16h
5w6d16h
5w6d16h
5w6d16h
5w6d16h
5w6d16h
5w6d16h
5w6d16h
5w6d16h
5w6d16h
5w6d16h
5w6d16h
5w6d16h
IN
IN
IN
IN
IN
IN
IN
IN
IN
IN
IN
IN
IN
G.ROOT-SERVERS.NET.
J.ROOT-SERVERS.NET.
K.ROOT-SERVERS.NET.
L.ROOT-SERVERS.NET.
M.ROOT-SERVERS.NET.
A.ROOT-SERVERS.NET.
H.ROOT-SERVERS.NET.
B.ROOT-SERVERS.NET.
C.ROOT-SERVERS.NET.
D.ROOT-SERVERS.NET.
E.ROOT-SERVERS.NET.
I.ROOT-SERVERS.NET.
F.ROOT-SERVERS.NET.
A
A
A
A
A
A
A
A
A
A
A
A
A
192.112.36.4
198.41.0.10
193.0.14.129
198.32.64.12
202.12.27.33
198.41.0.4
128.63.2.53
128.9.0.107
192.33.4.12
128.8.10.90
192.203.230.10
192.36.148.17
192.5.5.241
.
.
.
root.hints , , : FTP internic,
dig @rs.internic.net . ns >root.hints
/etc/127.0.0
127.0.0 , IP- .
17.3 , 127.0.0.
17. DNS
297
17.3
@
IN
SOA
ns.bins.ru. hostmaster.bins.ru. (
1
; Serial
8H
; Refresh
2H
; Retry
1W
; Expire
1D)
; Minimum TTL
IN
NS
ns.bins.ru.
PTR
localhost.
:
@ , ;
ns.bins.ru;
, hostmaster@bins.ru (-
@);
1 ( -
,
);
8 ;
2 ;
1 ;
1 ;
IN NS ns.bins.ru. ,
ns.bins.ru.,
ns.bins.ru;
1 PTR localhost. , 1 127.0.0.
localhost.
named
.
nds start <Enter>.
nslookup:
$ nslookup
Default Server: localhost
Address: 127.0.0.1
V. Linux
298
,
( 17.4).
user.bins.ru
17.4
> user7.bins.ru
Server:
Address:
Name:
Address:
localhost
127.0.0.1
user7.bins.ru
213.166.195.55
localhost
127.0.0.1
Non-authoritative answer:
Name:
Address:
user7.bins.ru
213.166.195.55
DNS-
DNS- , , , , .
.
ivan.petrov.
17. DNS
299
/etc/named.conf
17.6 DNS.
17.6
options {
directory "/var/named";
};
zone "." {
type hint;
file "root.hints";
};
zone "0.0.127.in-addr.arpa" {
type master;
file "127.0.0";
};
zone "ivan.petrov" {
notify no;
type master;
file "ivan.petrov";
};
zone "0.168.192.in-addr.arpa" {
notify no;
type master;
file "192.168.0";
};
,
zone "ivan.petrov" zone "0.168.192.in-addr.arpa".
zone "ivan.petrov" , DNS-
ivan.petrov (. . ivan.petrov),
ivan.petrov.
zone "0.168.192.in-addr.arpa" , DNS- 0.168.192.in-addr.arpa, , 192.168.0.
V. Linux
300
/etc/named/ivan.petrov
ivan.petrov 17.7.
17.7
@
IN
SOA
ns.ivan.petrov. hostmaster.ivan.petrov. (
199802151
8H
; refresh, seconds
2H
; retry, seconds
1W
; expire, seconds
1D )
; minimum, seconds
;
NS
ns
; -
MX
10 mail.ivan.petrov.
MX
20 mail2.ivan.petrov.
;
localhost
127.0.0.1
ns
192.168.0.1
192.168.0.40
A
A
A
127.0.0.1
192.168.0.1
192.168.0.40
mail ns ivan.petrov
IP-.
17. DNS
301
/etc/192.168.0
DNS- () , DNS IP- . (FTP, IRC,
WWW . .), .
17.8 /etc/192.168.0.
17.8
@
IN
SOA
; Refresh
2H
; Retry
1W
; Expire
1D)
; Minimum TTL
NS
ns.linux.bogus.
PTR
gw.ivan.petrov.
PTR
ns.ivan.petrov.
PTR
petya.ivan.petrov.
40
PTR
mail.ivan.petrov.
PTR
ftp.ivan.petrov.
, , , 2 192.68.0. gw.ivan.petrov, 40
mail.ivan.petrov.
, , . DNS-
.
, DNS- . -, DNS, -,
, DNS-.
.
V. Linux
302
(RR) DNS
( 17.9).
17.9
gw
192.168.0.2
HINFO
TXT
"The router"
192.168.0.1
MX
10 mail
HINFO
www
CNAME
ns
User
192.168.0.3
MX
10 mail
HINFO
"p4"
TXT
ns
"WindowsXP"
, HINFO, CNAME
TXT.
HINFO (Host INFOrmation); :
,
. . :
HINFO
, , 223344.
RP (Responsible Party, ). , RP . DNS . 17.1.
17. DNS
303
RFC
IP-
RFC1035
AAAA
IPv6
, Thomson
CNAME
RFC1035
GPOS
RFC1712
HINFO
( )
RFC1035
ISDN
ISDN
RFC1183
KEY
, Eastlake
LOC
, Vixie
MX
RFC1035
NSAP
SAP- ( A NSAP)
RFC1706
NSAP-PTR
PTR NSAP
RFC1706
NULL
RFC1035
NXT
, Eastlake
PTR
RFC1035
RP
RFC1183
SIG
, Eastlake
SRV
, Vixie
TXT
RFC1035
WKS
RFC1035
X25
X.25
RFC1183
() ! ,
FTP-
. .
DNS
, DNS.
DNS: , .
IP-:
.
304
V. Linux
,
in-addr.arpa. ,
,
. ,
. , , .
DNS-
, DNS
DNS. , .
, DNS-, , . , ,
.
, DNS , , , . , -
DNS-, "" .
HTML DNS
webdns.lcs.mit.edu/cgi-bin/webdns/. webmin.
DNS-HOWTO.
linux.webclub.ru/bind/pers_dns.html . DNS.
www.biblioteka.agava.ru/nastroyka_dns.htm . DNS.
www.4com.ru/support/DNSAdvanSetup.html . DNS.
www.webmin.com/webmin/ webmin.
18
DHCP
, IP-
TCP/IP. IP-
. , ""
4050 . " ",
Windows , "",
, DNS
IP- .
"" , IP- .
IP-
DHCP.
DHCP-
DHCP (Dynamic Host
Configuration Protocol) - ,
. RFC
2131, RFC 2132, RFC 1531 RFC 1541.
DHCP - . , IP-, ,
, . DHCP
(IP-, ),
IP-,
.
DHCP- UDP.
67- DHCP-, 68-. , , DHCP BOOTP.
DHCP- . 18.1.
V. Linux
306
18.1. DHCP-
op
(1 = BOOTREQUEST (),
2 = BOOTREPLY ())
htype
hlen
hops
xid
Secs
Flags
Ciaddr
IP-
Yiaddr
IP-,
Siaddr
IP- ,
Giaddr
IP-
Chaddr
16
MAC-
Sname
64
- ()
File
128
()
options
312576
IP-
, ,
. !
IP-, : , . :
DHCP- ,
IP-;
IP-,
;
DHCP- , .
, ,
.
.
IP- () . DHCP- , IP-
18. DHCP
307
. ,
( , -) IP-, .
( ) IP .
IP- .
1. ,
IP- .
DHCP- ,
BOOTP.
2. DHCP- , IP- (
yiaddr) , , .
yiaddr ,
ICMP , IP- .
3. .
, DHCP-,
,
DHCP-
.
IP-, .
4. -, , IP- . ,
IP-.
5. , DHCP-, ARP IP-
. IP- , 10 .
( options)
DHCP- IP- .
, DHCP-.
.
MTU ( ).
TTL ( ).
COOKIE-.
DNS-.
FINGER-.
IRC-.
LOG-.
LPR-.
308
V. Linux
WINS-.
NIS-.
NNTP-.
NTP-.
POP-.
SMTP-.
TFTP-.
WWW-.
, DHCP-.
DHCP
, ,
, UDP.
DHCP-,
: IP-, . .
,
DHCP DNS.
, ,
DHCP-,
IP- .
DHCP-
,
. DHCP .
DHCP Internet
Software Consortium http://www.isc.org.
. , dhcpd
.
dhcpd :
/etc/dhcpd.conf;
/var/lib/dhcp/dhcpd.leases.
dhcpd.conf
DHCP-. , .
ASCII dhcpd.conf
dhcpd. , #. -
18. DHCP
309
: , .
, , , .
,
.
, :
ddns-update-style none; DNS;
option domain-name "test.org"; , DHSP-. host ;
option domain-name-servers DNS-; DNS, DHCP ;
option netbios-name-servers IP-;
NetBIOS, WINS-;
option netbios-node-type ; netbios-name-servers:
1 WINS-;
2 WINS-;
3 , WINS-;
4 WINS-, ;
option nis-domain "test.org"; NIS,
;
max-lease-time ; IP-
( ). , , IP- ;
default-lease-time ; IP- ,
( ). , . ;
min-lease-time ; IP-
( ). , . .
,
DHCP- ( MAC-):
allow unknown-clients; IP- ;
deny unknown-clients; IP- ;
ignore unknown-clients; IP-.
V. Linux
310
, bootp-:
allow bootp; IP- bootp;
deny bootp; bootp;
ignore bootp; bootp.
{}, ,
( 18.1).
:
subnet;
group;
host.
18.1
subnet 204.254.239.64 netmask 255.255.255.224 {
...
range 204.254.239.74 204.254.239.94;
}
group {
...
host vasya.test.org {
...
}
host petya.test.org {
...
}
}
:
subnet IP- netmask -
, DHCP IP-.
subnet:
range IP- IP-
IP-,
. range , IP- ;
option domain-name "test.org"; , DHSP-. host
;
option nis-domain "test.org"; NIS, ;
option routers IP-; IP- ;
18. DHCP
311
option subnet-mask ; ;
option domain-name-servers DNS-; DNS-,
DHCP ;
range dynamic-bootp IP IP ; , bootp,
, IP-;
option broadcast-address IP-; ;
group ,
. ;
host , :
hardware ethernet xx:xx:xx:xx:xx:xx; MAC-, xx:xx:xx:xx:xx:xx
( Ethernet-), xx
;
fixed-address IP-; IP- ;
filename "filename"; ,
IP-. .
, .
, .
dhcpd.leases
dhcpd.leases ,
IP-. ( 18.2).
18.2
lease 192.168.10.27 {
starts 5 200806/20 09:14:54;
ends 5 2008/06/27 09:14:54;
hardware ethernet 00:60:67:75:40:37;
uid 01:00:60:67:75:40:37;
client-hostname "Oscar";
}
:
lease 192.168.10.27 , IP- ;
starts 5 2008/06/20 09:14:54; (
20 2008 9 14 54 );
V. Linux
312
). 7 ;
hardware ethernet 00:60:67:75:40:37; , ,
dhcpd.conf
, /usr/local/etc/dhcpd.conf,
( 18.3), :
192.168.1.0;
255.255.255.0;
test.org;
DHSP- 192.168.0.2;
DNS- 192.168.0.3;
192.168.0.1;
11 , , .
18.3
#global options
ddns-update-style none;
option domain-name "test.org";
option domain-name-servers 192.168.10.3;
# 7 X 24 hours lease time
default-lease-time 604800;
max-lease-time 604800;
# my subnet
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.10.5 192.168.10.20;
option routers 192.168.1.1;
}
host vasya {
hardware ethernet 00:70:58:bc:10:03;
fixed-address 192.168.1.17;
}
18. DHCP
313
DHCP-
DHCP- DHCP- . , http://www.isc.org.
.
:
etc/dhclient.conf;
/var/lib/dhcp/dhclient.leases.
dhclient.conf
dhclient.conf DHCP-.
:
timeout ; ( ), ( 60 );
retry ; , ;
reboot ; IP . DHCP- IP-, IP-;
initial-interval ; .
;
select-timeout ; ,
DHCP-.
DHCP-, ,
;
reject IP-; , DHCP- .
IP-.
DHCP-,
:
renew ; ,
, IP-;
rebind ; ,
IP- DHCP-;
expire ; IP-.
V. Linux
314
dhclient.conf, dhcpd.conf, .
, interface " ".
, .
DHCP- ( 18.4).
18.4
interface "eth0" {
send host-name "andare.fugue.com";
send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
send dhcp-lease-time 3600;
request subnet-mask, broadcast-address, routers,
domain-name, domain-name-servers;
}
, . , send. , .
, (MAC- ,
) IP- .
, request. , . , , , DNS-.
,
.
, DHCP-
dhclient.conf! .
dhclient.leases
dhclient.leases dhcpd.leases , DHCP-, DHCP-
( 18.5).
18.5
lease {
interface "eth0";
fixed-address 192.168.1.15;
option subnet-mask 255.255.240.0;
option routers 192.168.1.1;
option domain-name-servers 192.168.1.3;
18. DHCP
315
, eth0.
IP-, 192.168.1.15, 255.255.240.0,
, DHCP- DNS- 192.168.1.1,
192.168.1.2 192.168.1.3. vasya, test.org.
IP-.
DHCP.
ezine.daemonnews.org/200207/dhcp.html Pham Linh. HOWTO Setting Up
ISC-DHCP 3.x Under FreeBSD.
www.dhcp.org , DHCP.
mvd.h1.ru/tr/ DHCP mini-HOWTO, .
www.isc.org Internet Software Consortium ( DHCP).
www.nominum.com/resources/faqs/dhcp-faq.html Nominum's DHCP FAQ.
www.onlamp.com/pub/a/bsd/2003/04/17/ Lavigne Dru. Introducing DHCP.
www.onlamp.com/pub/a/bsd/2003/05/01/FreeBSD_Basics.html Lavigne Dru.
Configuring a DHCP Server.
www.onlamp.com/lpt/a/3689 Lavigne Dru. DHCP on a Multi-Segment Network.
man dhcpd.conf.
man dhcpd.leases.
man dhcp-options.
man dhclient.leases.
19
, , .
"" . , . ,
, , . , , ,
. . .
.
,
. ,
, , ,
.
: mail, Pine, Kmail,
Evolution, Sylpheed, Mutt . MTA, Mail Transport Agent . sendmail. Qmail, postfix, exim.
.
, , .
, ivan ogpu.odessa.ua
: ivan@ogpu.odessa.ua.
: ,
" at" "@", . UUCP (UNIX to UNIX Copy Program), :
odessa.ua!ogpu!ivan. , UUCP .
Simple
Mail Transfer Protocol (SMTP) ,
TCP.
19.
317
SMTP
Simple Mail Transfer Protocol . SMTP , TCP/IP.
SMTP , .
, .
, SMTP ASCII- .
19.1
SMTP.
19.1
: MAIL FROM: <ivan@ogpu.odessa.ua>
: 250 Ok
: RCPT TO: <vano@mail.ru>
: 250 Ok
: DATA
: 354 Start mail input; end with <CRLF>.<CRLF>
:
: 250
, , , , .
POP3
POP3 (Post Office Protocol)
-. , SMTP
, POP3 . ,
ASCII- .
IMAP
IMAP (Interactive Mail Access Protocol)
POP3, .
V. Linux
318
.
POP3 .
RFC-822. : , . , .
,
. .
":". , Date, From, Cc To, :
Date:
From:
To:
Date , From ,
C To . , , ( 19.2).
19.2
Date:
27 Aug 76 0932
From:
Motya <1@mail.ru>
Subject:
Re:
Sender:
K@Other-host
Reply-To:
Sam.Irving@R.org.ru
To:
Geo <J@chat.ru>
Cc:
Sm3@chat.ru
Comment:
In-Reply-To:
Message-ID:
<4331.629.XYzi-What@Other-Host
Subject , Reply-To ,
, Comment , In-Reply-To ,
" , , ...", Message-ID , .
.
RFC-1327 X.400.
19.
319
MIME
MIME (Multipurpose Internet Mail Extension), RFC-1341, . ,
RFC-822 .
RFC-822 , MIME
.
. :
MIME ,
;
;
;
.
MIME , , .
MIME.
MIME-Version
, , MIME.
:
MIME-Version: 1.0
Content-Type
, . ,
, . /
. MIME ,
. .
(text) , . text plain () . richtext, html.
320
V. Linux
(multipart) ,
. .
(message) -
, . :
partial
;
External-Body ;
rfc822 message. RFC-822.
(image).
(audio).
(video).
(application).
Content-Transfer-Encoding
.
, .
.
S/MIME
S/MIME (Secure/Multipurpose Internet Mail Extensions)
MIME, RFC2630, RFC2632, RFC2633, RFC2634. S/MIME
. ,
. .
, , . , () S/MIME- . S/MIME-,
.
,
( ) .
, . .
S/MIME-
.
S/MIME ( PGP GPG)
. .
19.
321
PGP, GPG
S/MIME, PGP (Pretty Good Privacy) GNU GPG
(GnuPG, GNU Privacy Guard)
. PGP ( , Windows) .
, "-". :
SMTP
;
;
POP3 IMAP.
sendmail
sendmail . Sendmail
. Sendmail ( UUCP SMTP).
Sendmail SMTP UUCP.
Sendmail :
-;
;
;
;
SMTP-;
BIND;
.
sendmail
sendmail , .
, : , :
,
, , -
322
V. Linux
. ;
,
. ;
. , , .
.
:
;
, ;
.
sendmail
sendmail
/etc/sendmail.cf, :
(local information)
. .;
sendmail, ;
, ;
;
sendmail, ;
;
, ;
;
;
;
.
sendmail , , , . ( Red Hat) .
sendmail , 100 ,
. sendmail "UNIX ",
, sendmail.
sendmail ( 19.3).
19.
323
19.3
##################
#
local info
##################
Cwlocalhost
CP.
# UUCP relay host
DYucbvax.Berkeley.EDU
CPUUCP
#
#DBmailhost.Berkeley.EDU
DBrelay.kiae.su
CPBITNET
# "Smart" relay host (may be null)
DSrelay.kiae.su
# who I send unqualified names to (null means deliver locally)
DR
# who gets all local email traffic ($R has precedence for unqualified names)
DH
# who I masquerade as (null for no masquerading)
DM
# class L: names that should be delivered locally, even if we have a relay
# class E: names that should be exposed as from this host, even if we masquerade
#CLroot
CEroot
# operators that cannot be in local usernames (i.e., network indicators)
CO @ % !
# a class with just dot (for identifying canonical names)
C..
# dequoting map Kdequote dequote
sendmail
sendmail -v ( verbose). .
sendmail.
SMTP
SMTP telnet, 25:
telnet ivan.petrov 25
V. Linux
324
. MAIL FROM:
.
RCPT TO: . DATA . "." .
sendmail, . 19.1,
SMTP, . 19.2, SMTP.
SMTP
SMTP.
<domain>
MAIL <SP>
FROM:<reverse-path>
<CRLF>
<reverse-path>. ,
RCPT <SP>
TO:<forward-path>
<CRLF>
<forward-path>.
, MAIL FROM, DATA
19.
325
19.1 ()
DATA <CRLF>
.
(.)
RSET <CRLF>
SEND <SP>
FROM:<reverse-path>
<CRLF>
, RCPT
SOML <SP>
FROM:<reverse-path>
<CRLF>
SEND OR MAIL.
SAML <SP>
FROM:<reverse-path>
<CRLF>
, <string>
NOOP <CRLF>
QUIT <CRLF>
TURN <CRLF>
19.2. SMTP
211
214
220
SMTP-
221
250
251
V. Linux
326
19.2 ()
354
421
450
451
452
500
501
502
503
504
550
551
552
553
554
Transaction failed
POP3
SMTP telnet POP3.
110 ( 19.5).
19.
327
19.5
telnet ivan.petrov 110
user user
+OK Password required for user.
pass 12345623432
+OK user has 3 messages (33276 octets).
list
+OK 3 messages (33276 octets)
1 11276
2 11000
3 11000
.
dele 3
+OK Message 3 has been deleted.
quit
+OK
Connection closed by foreign host.
POP3-
(. 19.3) telnet.
+, ERR .
19.3. POP3
PASS <>
QUIT
STAT
( +OK ERR)
+ <- >
<
>
V. Linux
328
19.3 ()
( +OK ERR)
UST [<
>]
.
,
+ < >
RETR <
>
+ <
>
-ERR < >
DELE <
>
.
QUIT
+ < >
-ERR < >
NOOP
RSET
,
<-
>
UIDL [<
>]
.
,
+ < >
,
. ,
+
.
,
+
.
< > <>
,
.
, +
. < >
< >
.
,
,
19.
329
19.3 ()
( +OK ERR)
MD5 ,
+ < >
Postfix
Postfix MTA-. Sendmail
Postfix . Postfix
postfix postdrop. postfix
postfix. postfix,
postdrop .
/etc/postfix.
main.cf.
, , .
Postfix. ,
.
myhostname=tech.test.ru . hostname.
mydomain=test.ru . , Postfix myhostname.
inet_interfaces=192.168.0.2, 195.80.10.26 , SMTP-. all
.
mydestination=$myhostname, $mydomain , .
mynetworks=192.168.0.0/24, 127.0.0.0/8 .
, ,
. , IP, Postfix.
alias_database=dbm:/etc/postfix/aliases .
. , ,
.
.
V. Linux
330
,
postfix check.
, , Web-.
, . :
;
;
SMTP-;
SMTP-;
POP3- IMAP-;
POP3- IMAP-.
, , , .
Mail
. ( ), ,
. Mail . 19.1.
. 19.1. Mail
19.
331
Pine
"" ,
(news). . Pine . 19.2.
. 19.2. Pine
Thunderbird mozilla
.
"Mozilla Web-", , .
Windows.
Sylpheed
. Windows (. 19.3).
Evolution
Microsoft Outlook
(. 19.4), (. 19.5), . "" .
332
V. Linux
. 19.3. Sylpheed
. 19.4. Evolution
19.
333
. 19.5. Evolution
. 19.6. Kmail
334
V. Linux
Kmail
(. 19.6). , . KDE.
www.citforum.ru/internet/servers/ . -
Internet. .
HOWTO:
Linux Mail-Queue mini-HOWTO;
Sendmail+UUCP HOWTO;
Sendmail address rewriting mini-HOWTO.
20
Web- Apache
HTTP- UNIX- Web Apache, GNU.
Web- Apache.
? -, : CGI-, , , "
", . -, . -, Apache Linux, UNIX Windows.
-, . . , , , . .
Web- Microsoft IIS,
Windows-.
Microsoft IIS ,
Apache. Microsoft IIS
. Windows.
Linux- Web-
TUX, Linux,
.
, :
;
;
Apache.
RPM-
rpm I <_>
, .
.
V. Linux
336
, Apache,
.
HUP USR1. Apache , kill USR1,
,
.
150
MinSpareThreads
25
MaxSpareThreads
75
ThreadsPerChild
25
MaxRequestsPerChild
</IfModule>
Listen 80
...
Include conf.d/*.conf
User apache
Group apache
### Section 2: 'Main' server configuration
...
ServerAdmin root@localhost
UseCanonicalName Off
DocumentRoot "/var/www/html"
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<IfModule mod_userdir.c>
UserDir disabled
</IfModule>
DirectoryIndex index.html index.html.var
AccessFileName .htaccess
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>
TypesConfig /etc/mime.types
337
V. Linux
338
DefaultType text/plain
<IfModule mod_mime_magic.c>
#
MIMEMagicFile /usr/share/magic.mime
MIMEMagicFile conf/magic
</IfModule>
HostnameLookups Off
#EnableSendfile off
ErrorLog logs/error_log
LogLevel warn
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog logs/access_log combined
ServerSignature On
Alias /icons/ "/var/www/icons/"
<Directory "/var/www/icons">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<IfModule mod_dav_fs.c>
# Location of the WebDAV lock database.
DAVLockDB /var/lib/dav/lockdb
</IfModule>
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
<Directory "/var/www/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
IndexOptions FancyIndexing VersionSort NameWidth=* HTMLTable Charset=UTF-8
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
...
AddIcon /icons/binary.gif .bin .exe
...
339
DefaultIcon /icons/unknown.gif
ReadmeName README.html
HeaderName HEADER.html
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
AddLanguage ca .ca
...
LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl
pt pt-BR ru sv zh-CN zh-TW
ForceLanguagePriority Prefer Fallback
AddDefaultCharset UTF-8
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl
.crl
V. Linux
340
# enable the proxy server:
...
# End of proxy directives.
### Section 3: Virtual Hosts
#<VirtualHost *:80>
#
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /www/docs/dummy-host.example.com
ServerName dummy-host.example.com
ErrorLog logs/dummy-host.example.com-error_log
#</VirtualHost>
. Apache
.
1. , "" Apache.
2. , ""
( , ).
3. . -
, .
On , Off ,
allow deny .
" "
Apache, ,
. .
ServerTokens OS , , . , .
ServerRoot "/etc/httpd" , , .
PidFile run/httpd.pid , ,
.
Timeout 120 ( ),
-.
KeepAlive Off, MaxKeepAliveRequests 100, KeepAliveTimeout 15 , - (15 ). .
341
. ,
.
.
LoadModule foo_module modules/mod_foo.so.
Apache ,
LoadModule ,
, . .
Include conf.d/*.conf , conf.d.
User apache, Group apache ,
.
" "
"" .
, , , "" ,
.
, .
ServerAdmin root@localhost ,
.
ServerName www.example.com:80 , . IP-.
DocumentRoot "/var/www/html" , , . , .
<Directory _></Directory> , , .htaccess . .
DirectoryIndex index.html index.html.var ,
.
AccessFileName .htaccess , .
ErrorLog logs/error_log .
LogLevel warn ,
. debug, info, notice, warn, error,
crit, alert, emerg.
CustomLog logs/access_log combined ( , . .), access_log.
AddDefaultCharset UTF-8 , .
V. Linux
342
" "
. Web- ( ).
Apache , IP-
Web- Web-.
<VirtualHost 192.168.33.4:80>
</VirtualHost>, 192.168.33.4 , www.gost.ru,
80 , .
,
( 20.2).
20.2
<VirtualHost www.gost.ru:80>
#
ServerAdmin webmaster@gost.ru
DocumentRoot /www/docs/gost.ru
ServerName www.gost.ru
ErrorLog logs/www.gost.ru-error_log
#</VirtualHost>
,
.
access.conf
access.conf ,
Web-. /www/<_>/,
.
access.conf Directory, Location Files, . ? *, , ~. Directory
, , Location , Files
( 20.3).
20.3
<Directory /www/lazzycat.com>
# , ,
/www/lazzycat.com
343
</Directory>
<Location /cgi-bin>
# , ,
http://<_>/cgi-bin/ <__>
</Location>
<Files /www/lazzycat.com/form.htm>
# , form.htm
/www/ lazzycat.com
</Files>
V. Linux
344
Apache.
_fastcgi mini-HOWTO Apache Web-
Apache+DSO+mod_ssl+mod_perl+php+mod_auth_nds+mod_auth_mysql+mod
mod_perl, mod_ssl php.
Linux Apache SSL PHP/FI frontpage mini-HOWTO Web-,
.
http://apache.lexa.ru Apache.
http://bog.pp.ru/work/apache.html Apache: HTTP-. , .
http://www.apache.org Apache.
http://www.cs.ifmo.ru/education/documentation/rapacheman/index.shtml
. Web- Russian Apache.
21
FTP
FTP , , . , , , FTP.
FTP
FTP (File Transfer Protocol, )
. , Web- HTTP, , , FTP, ,
.
FTP, , TCP-. ,
. 20 ,
21 . FTP
TCP-, UDP-.
. , FTP.
, . ( ) .
ASCII- NVT ASCII ( NVT). , NVT ASCII, . NVT ASCII- (CR), (LF). , .
DOS/Windows UNIX. DOS/Windows
346
V. Linux
/
(CR/LF), UNIX (LF).
EBCDIC- .
FTP-
.
, . . .
ASCII- EBCDIC-.
Nonprint .
Telnet format control
Telnet, .
Fortran carriage control Fortran-
.
.
. (
.)
.
.
.
.
-
.
, FTP . :
ASCII ;
nonprint;
;
.
FTP
NVT ASCII. / (CR/LF).
21. FTP
347
30 . . 21.1 . RFC.
21.1. FTP
ABOR
FTP
LIST -
PASS
PORT a, b, c, d, e, f
QUIT
RETR
STOR
SYST
TYPE
: A ASCII, I
USER
()
FTP-
FTP-
ASCII , .
.
. 21.2.
21.2.
1xx
. ,
2xx
3xx
. ,
4xx
. , ,
5xx
. ,
0x
x1x
V. Linux
348
21.2 ()
x2x
. ,
x3x
. ,
x4x
x5x
. . 21.3
.
FTP- .
, ,
, , .
21.3.
125
200
214
331
425
452
500
502
MODE
() :
;
;
.
. FTP-
,
, .
,
-, -
21. FTP
349
. ,
, .
.
. ,
. :
1. .
2.
.
3. PORT.
4. .
20 .
.
,
, ,
, .
PORT,
, .
FTP : .
: ,
, . Web- FTP-.
, FTP.
- wu-ftp (Washington University at Saint Louis FTP daemon).
wu-ftp
wu-ftp .
,
.
, FTP- ,
. . 21.4
wu-ftp.
, wu-ftp (. 21.5).
V. Linux
350
ABOR
APPE
CDUP/XCUP
CWD /XCWD
DELE
HELP
LIST
MKD /XMKD
MDTM
MODE
NLST
PASS
PASV
""
PORT
QUIT
REST
RETR
RMD/XRMD
RNFR
RNTO
SIZE
STAT
STOR
STOU
STRU
SYST
TYPE
USER
21. FTP
351
SITE EXEC
SITE GROUP
SITE GPASS
SITE IDLE
SITE MINFO
, .
, NEWER
SITE NEWER
SITE UMASK
umask ,
wu-ftp .
.
, rpm,
. .
, /etc.
wu-ftp :
ftpaccess;
ftpusers;
ftpgroups;
ftpservers;
ftphosts;
ftpconversion.
.
ftpaccess
.
, , .
.
:
autogroup <_> <> ... , , ,
;
class <> typelist <_> ... , IP- , :
typelist , anonymous, guest real ( /etc/passwd), ;
<_> :
( /,
);
352
<_> <___>
;
guestgroup <_> ...
, , .
, ,
, ;
guestuser <_> ... guestgroup,
;
realgroup <_> ... guestgroup guestuser;
realuser <_> ... guestgroup
guestuser;
defumask umask [ <> ] umask,
;
keepalive { yes | no } TCP SO_KEEPALIVE;
timeout accept <> (PASV);
timeout connect <> (PORT);
timeout data <>
;
timeout idle <> ;
timeout maxidle <>
idle , maxidle
;
timeout RFC931 <> ident;
file-limit [ raw ] { in | out | total } <> [ <> ] ;
byte-limit [ raw ] { in | out | total } <> [ <> ] ;
limit-time { * | anonymous | guest } <> . ;
guestserver [ <__> ]
. , ;
limit <> <> <_> <___> . .
limit, ;
noretrieve [ absolute | relative ] { class=<> } <_> ... . /,
, . ,
;
deny
V. Linux
21. FTP
353
noretrieve;
loginfails <>
, ;
:
greeting { full | brief | terse | text <> } ,
:
full ;
brief ;
terse , ;
text ;
banner <_> , /;
hostname <_> ( );
email <> ;
message <_> { LOGIN | CWD=<_> { <> } } ;
readme <_> { LOGIN | CWD=<_> { <> } }
/ .
:
log commands _ ,
_ real, guest anonymous;
log transfers _ _ , _ real, guest
anonymous; _ incoming
outbound;
log security _ , _ real, guest anonymous;
log syslog syslog
xferlog;
log syslog+xferlog syslog
xferlog.
:
daemonaddress <IP->
;
virtual <IP-> { root | banner | logfile } <_> , , , ;
virtual <IP-> { hostname | email } <>
( ) ;
virtual <IP-> private
;
354
V. Linux
;
virtual <IP-> mailfrom <email-> -
;
<_> ...
;
defaultserver private ;
defaultserver incmail <email-> ;
defaultserver mailfrom <email->
.
:
defaultserver { deny | allow }
/ . . <_>
: anonymous, guest, real class=<_>;
passwd-check { none | trivial | rfc822 } ( { enforce | warn } )
e-mail- :
none ;
trivial @;
rfc822 RFC-822;
warn , ;
enforce , ;
deny-email <email-> ;
>
, , , ;
<_> ...
.
;
throughput ;
anonymous-root <> [ <> ] ...
(chroot) ;
guest-root <> [ <-uid> ] ... <> chroot . uid ;
deny-uid <> ... ftpusers;
21. FTP
355
ftpusers;
allow-uid <> ...
ftpusers;
allow-gid <> ... ftpusers;
restricted-uid <> ... ;
restricted-gid <> ...
;
unrestricted-uid <> ...
;
unrestricted-gid <> ...
;
site-exec-max-lines <> [ <> ] ... ,
SITE EXEC;
dns refuse_mismatch <__> [ override ] , .
override, ;
dns refuse_no_reverse <__> [ override ] , . override,
.
:
alias <> <_>
cd <> ;
cdpath <_> cdpath, cd;
compress { yes | no } <_> ... / / , ;
tar { yes | no } <_> ... / tar , ;
shutdown <__>
;
passive address <_IP-> <CIDR_> PASS, , IP- CIDR-;
pasive ports <CIDR_> min max ,
;
pasv-allow <> <_>
,
;
port-allow <> <_>
PORT , ;
356
V. Linux
;
lsshort <> [ <> ]
;
lsplain <> [ <> ] , -
;
incmail <email-> , ;
mailserver <-> ;
mailfrom <email->
.
ftpservers
. :
IP- ;
, . : ftpaccess, ftpusers, ftpgroups, ftphosts, ftpconversions. - , .
ftpconversions
" " , :
;
;
;
;
;
: T_REG , T_ASCII ,
T_DIR ;
: O_COMPRESS, O_UNCOMPRESS, O_TAR ;
.
ftpgroups
SITE GROUP SITE GPASS. ftpgroups ,
, :
;
;
.
21. FTP
357
ftphosts
FTP- . :
allow <_> <_IP-> ... ;
deny <_> <_IP-> ... .
ftpusers
FTP-
. ,
root, news . .
,
ftpd , . FTP-, , . .
ftpd
FTP. ( ):
-d ;
-l ;
-t <_> , ( );
-T <_> , ;
-a ftpaccess;
-A ftpaccess;
-i xferlog;
-I IDENT;
-o xferlog;
-X syslog;
-u umask ;
-w wtmp;
-W wtmp;
-s INETD;
-S , INETD, ;
-p <> , FTP-
/etc/services, INETD ;
-P <> , ftp-data
/etc/services;
-q ;
-Q ;
;
358
V. Linux
-r rootdir chroot ( )
, ;
.
ftpwho
.
ftpcount
.
ftpshut
FTP-.
:
-l <> ,
;
-d <> ,
;
<_> .
:
now ;
+ ;
MM .
ftprestart
FTP-, stop.
ckconfig
FTP-. , .
xferlog
, FTP- . xferlog . , .
.
1. , Sat.
2. .
3. .
4. ::.
5. .
21. FTP
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
359
.
.
.
.
:
a ;
b .
:
C ;
U ;
T tar;
_ ( ) .
:
o ;
i .
:
a ;
g guest ();
r real ().
.
.
:
0 ;
1 ident (RFC931).
.
*.
:
c ;
i .
FTP- . FTP-
, .
, FTP
. - FTP, . ,
/etc/passw guest anonymous ,
, - /dev/null.
21.1 ,
FTP- ( ftpusers).
V. Linux
360
21.1
root
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody
FTP-.
ftp.wu-ftpd.org wu-ftp.
www.bog.pp.ru/work/ftpd.html wu-ftp.
www.westnet.com/providers/multi-wu-ftpd.txt -
FTP-.
22
NNTP. INN
, , Usenet (, , - FIDO).
Web- , Web-,
, . Usenet
. . .
. , . fido7.ru.linux, fido7 , , - FIDO, ru , linux
Linux. News (Usenet-), ( ) . NNTP
(Network News Transfer Protocol, ).
NNTP
NNTP RFC977,
USENET RFC1036.
NNTP , , TCP -. NNTP , RFC850. .
NNTP.
( , ). , NEWGROUPS.
NEWNEWS , . ,
. , , ,
.
NNTP TCP 119. , ,
.
.
V. Linux
362
.
, CR/LF. ,
".", CR/LF.
, .
, .
,
.
( ) : ,
, (. 22.1).
(. 22.2). .
.
22.1.
1xx
2xx
ok
3xx
4xx
, -
5xx
22.2.
x0x
, ,
x1x
x2x
x3x
x4x
x8x
x9x
( ).
. . . CR/LF.
, , , , .
363
x9x . ,
190199.
. 22.3 ,
NNTP-. -
- .
22.3.
100
190199
200
201
400
500
501
502
503
NNTP
NNTP.
, NNTP- .
512 .
ARTICLE
ARTICLE . ARTICLE ("<" ">"), ;
,
.
ARTICLE <message-id>
, . (message-id) . , ,
NEWNEWS. .
ARTICLE [nnn]
, . nnn
. ,
364
V. Linux
. ,
. ,
.
, ( ) .
, .
BODY
BODY ARTICLE .
HEAD
HEAD ARTICLE .
STAT
STAT ARTICLE ,
. STAT
- .
.
GROUP ggg
.
, .
.
. , .
ggg
HELP
, . .
IHAVE <message-id>
IHAVE , <message-id>. ,
, .
, ,
. , .
LAST
LAST
. ,
, .
365
LIST
.
:
<group> <last> <first> <p>
<group> , <last>
, <first> , <p>
'y' 'n', .
<first> <last> . <last>
<first>, .
NEXT
. ,
, .
366
V. Linux
. .
POST
.
QUIT
QUIT
.
NNTP-, .
SLAVE
, , (slave). .
INN
INN (InterNetNews) , .
NNTP. ,
.
INN
innd . NNTP , 119
, , , ,
, , .
innd nnrpd, nnrp.access
.
innd (, , , ,
) ctlinnd.
expire expireover, , innd.
.
,
Control:. , innd
.
control.
control._, .
367
INN
INN sendmail. ,
/etc/news.
/etc/news/actsync.cfg
. ;
/etc/news/actsync.ign
;
/etc/news/control.ctl , . .
, . , ( all), . .
. :
doit
doifarg
doit=_
doit=mail
doit= ( )
drop
log ( errlog)
log=_
mail
, control.ctl
all:*:*:drop ;
/etc/news/cycbuff.conf CNFS,
;
/etc/news/distrib.pats , , inews . .
;
/etc/news/expire.ctl , .
. , CNFS . , "" .
,
history
. , .
: /remember/:, , .
V. Linux
368
(
) . , , :
<____>:<>:min:default:max
, ;
, , :
A ;
M ;
U ;
X . , ,
, .
.
never;
.
never;
.
never;
/etc/news/incoming.conf ,
. : , , , . :
hostname IP ;
streaming true false; ,
;
max-connections
;
password ,
, ;
patterns , ;
noresendid true false; ,
431 RESENDID 436 Retry later , ;
/etc/news/inn.conf
, . , , innd
. :
<>: <>
:
fromhost From:,
. FROMHOST .
, ;
369
, . moderators;
organization Organization:, . ORGANIZATION, ;
pathhost Path:. ,
;
server NNTP-,
. , NNTPSERVER,
;
domain , ;
overviewmmap , expire, nnrpd makehistory
mmap overview;
storageapi :
false ( ;
);
true ( ,
);
cnfs ( ;
);
maxforks
innd;
maxartsize ;
nicekids , nnrpd;
nicenewnews nnrpd,
NEWNEWS;
mta ;
mailcmd ;
logcancelcomm , (syslog) cancel;
wanttrash ,
junk;
remembertrash ,
history;
linecountfuzz , Lines;
logartsize ;
logipaddr , IP-
Path;
logsitename ,
;
overviewname ; ; .overview;
extendeddbz overview DBZ-;
storageapi;
moderatormailer
V. Linux
370
syslog nnrpd;
storeonxref Xref: Newsgroup: ;
nnrpdcheckart nnrpd
overview, ;
storemsgid (Message-ID);
usecontrolchan ;
refusecybercancel ,
(Message-ID) cancel;
activedenable, activedupdate, activedport
nnrpd active;
pathnews, pathbin, pathfilter, pathcontrol, pathdb, pathetc, pathrun,
pathlog, pathhttp, pathtmp, pathspool, patharticles, pathoverview,
pathoutgoing, pathincoming, patharchive, pathuniover : ,
, . .;
backoff , nnrpd;
strippostcc nnrpd To:, Cc: Bcc:;
nnrpperlauth nnrpd perl;
pathalias , pathhost;
nnrpdposthost, nnrpdpostport nnrpd rnews
;
wireformat ,
CR LF ;
status
syslog;
timer syslog;
peertimeout ,
, innd ;
chaninacttime, chanretrytime ,
, innd ;
maxconnections NNTP-;
artcutoff (, , );
nntplinklog nntplink;
nntpactsync , ;
badiocount , / , ;
pauseretrytime ;
nnrpdoverstats
371
sourceaddress , ; any ;
port , ;
localmaxartsize , nnrpd;
mimeversion nnrpd MIME-;
mimecontenttype MIME-, Content-Type;
mimeencoding MIME-,
Content-Transfer-Encoding;
spoolfirst true, nnrpd ,
innd; false
;
articlemmap mmap ;
clienttimeout , nnrpd ;
innflags , innd ;
doinnwatch , innwatch;
innwatchsleeptime innwatch ;
controlfailnotice ,
;
logcycles , ;
innwatchpauseload , 100,
innwatch innd ;
innwatchhiload , 100,
innwatch innd throttle ( );
innwatchloload , 100,
innwatch innd ;
innwatchspoolspace ,
articles overview, inndf, innwatch innd throttle;
innwatchbatchspace ,
, inndf, innwatch
innd throttle;
innwatchlibspace , db-history, active, inndf, innwatch innd throttle;
docnfsstat , cnfsstat (
CNFS);
/etc/news/innfeed.conf innfeed.
;
/etc/news/innreport.conf innreport.
;
/etc/news/innwatch.ctl innwatch.
, ,
372
V. Linux
, .
: , , ,
@, ; ,
;
/etc/news/moderators , . nnrpd inews
, , , innd, .
. , .
.
;
/etc/news/news2mail.cf news2mail;
/etc/news/newsfeeds ,
NNTP-. ,
, .
,
, :
<_>/<___> ME. ,
:
<_> ;
Path:, ;
( overchan, archive . .) , ; ,
Path: ;
<_> ;
Path:.
:
cyberspam, spewcancel, bincancel;
<_____>/<___
_>
<_> ,
. .
. ! @,
, , ;
: Distribution: ,
. . , "";
373
<_>
<size , ;
>size , ;
Ac ;
AC ;
Ad Distribution:;
Ae Newsgroups: , -
;
Ap Path:
;
F<_> ;
G<> ,
;
H<> , Path:
;
I<> , ;
Nm ;
Nu ;
P<> 0 20,
;
O<> X-Trace,
;
S<> , innd
;
T<> : c , f , l
( ), p ;
W<> , , . . . * (b , f
, g , h hash-
Message-ID, m Message-ID, n ,
p , s , t , * , , D Distribution: ("?" ), H , N
Newsgroups:, P Path:, R );
<> . :
/var/log/news/news;
, <>, . , outgoing/_;
V. Linux
374
;
<> , innd. . , , UID
GID . , . ,
outgoing/_;
exploder ,
. . : newgroup <_>,
rmgroup <_>, flush, flush <_>;
funnel . <> ;
/etc/news/nnrp.access NNTP-.
, , :
<_>:<_>:<_>:<>:
<__>
, ;
<_> , , :
R ;
P ;
N NEWNEWS, ;
L ;
<__> , ,
, ;
<_> , ;
<> , ;
<__> , ;
/etc/news/nnrpd.track nnrpd .
:
<_>
<____>:<__>
/etc/news/nntpsend.ctl , nntpsend
, .
:
<>:fqdn:<>
<> , newsfeeds;
fqdn , ;
375
,
;
<> innxmit;
/etc/news/overview.ctl
overview ;
/etc/news/overview.fmt ,
overview;
/etc/news/passwd.nntp NNTP;
/etc/news/storage.conf
. .
active
, . , ,
active, .
:
<> <_> <_> <>
:
<> ;
<_> -
. ;
<_>
.
;
<> :
y ;
n ;
m ,
;
j ,
;
x ;
=news.group
news.group.
, , , , . active.
.
ctlinnd newgroup, rmgroup changegroup;
active
.
376
V. Linux
:
/var/lib/news/.news.daily;
/var/lib/news/active;
/var/lib/news/active.times;
/var/lib/news/distributions;
/var/lib/news/history;
/var/lib/news/newsgroups;
/var/lib/news/subscriptions.
:
/var/log/news;
/var/log/news/OLD;
/var/log/news/news.crit;
/var/log/news/news.err;
/var/log/news/news.notice.
:
/var/spool/news/archive;
/var/spool/news/articles;
/var/spool/news/incoming;
/var/spool/news/incoming/bad;
/var/spool/news/innfeed;
/var/spool/news/outgoing;
/var/spool/news/overview;
/var/spool/news/uniover.
, . :
getlist -h newsserver.our.pro > active.provider
active.provider ,
. ,
, active. , relcom.humor,
:
relcom.humor 0000000000 0000000001 y
( ) , , active active.provider,
( ):
#!/bin/sh
sed < active.provider > active \
-e 's/^\([^ ]*\) [0-9]* [0-9]* \([^ ]*\)$/\1 0000000000 0000000000 \2/'
377
active ( , ), (
, ).
,
NNTP.
. hosts.nntp:
newsserver.our.provider:
, ,
, .
NNTP-, , NNTP-.
, newsserver.our.badprovider relcom :
newsserver.our.badprovider::relcom.*
newsfeeds, NNTP-,
. .
.
newsserver.our.provider
NNTP:
ME:*, !junk, !control*, !local*/!local::
newsserver.our.provider:*, !junk, !control*, !local*:Tf,
Wnm:newsserver.our.provider
UUCP ( UUCP-
provider), sendbatch:
ME:*, !junk, !control*, !local*/!local::
provider/newsserver.our.provider:*, !junk, !control*, !local*:Tf, Wnb:
( , ) , ,
. inn.conf.
(, ). ,
- (192.168.1.0/255.255.255.0) (
our.domain), ,
. partner.domain (, ).
, , .
nnrp.access :
*:: -no- : -no- :!*
192.168.1.*:Read Post:::*
*.our.domain:Read Post:::*
*.partner.domain:Read Post:::*, !local*
,
. ,
V. Linux
378
expire, expire.ctl ( , , ).
:
history ( , );
.
,
history 14 ,
5 7 (
6), 3 5 ( 4 ).
/remember/:14
*:A:3:4:5
local*:A:5:6:7
, ( *) ,
,
.
. INN , . .
newsfeeds :
innd -s
, :
Found 1 errors --see syslog
, , syslog
news.err news.notice.
active :
expire -n -x -t
,
/var/news/etc/active: line 5 wrong number of fields
, 5- (
4). active. expire
( inncheck).
, inncheck Perl-,
. ,
. ,
( active), inncheck
:
/var/news/etc/active:5: ends with whitespace
, inncheck (
), .
-v ( verbose), inncheck , .
379
inncheck ,
inncheck <_>.
,
inncheck -perm. , ,
, ,
inncheck f
-perm
, log-.
news cron:
crontab -u news -e
( EDITOR)
/var/cron/tabs/news. 4
news.daily, , expire . , 1- 28-
nntpsend NNTP
:
0
4 * * *
1, 28 * * * *
INN
INN syslog. , , :
news.crit ,
;
news.err ;
news.notice NNTP-,
,
ctlinnd, innxmit, rnews.
INN log-, syslog,
log- errlog news (
/var/log/news):
errlog ,
innd;
news , innd .
, INN
(expire.log, send-uucp.log, nntpsend.log .).
380
V. Linux
INN
INN ,
, , .
/usr/bin/actived nnrpd, active;
/usr/bin/actmerge active;
/usr/bin/actsync ,
active;
/usr/bin/archive ;
/usr/bin/batcher , ;
/usr/bin/controlchan
innd ;
/usr/bin/convdate ;
/usr/bin/ctlinnd innd;
/usr/bin/cvtbatch Usenet- INN;
/usr/bin/expire , innd;
/usr/bin/expireindex ;
/usr/bin/expireover ;
/usr/bin/fastrm ;
/usr/bin/getlist NNTP-;
/usr/bin/grephistory ;
/usr/bin/inncheck ;
/usr/bin/innd , ;
/usr/bin/inndstart innd;
/usr/bin/innreport ;
/usr/bin/innstat ;
/usr/bin/innwatch INN;
/usr/bin/innxbatch Usenet NNTP-;
/usr/bin/innxmit NNTP-;
/usr/bin/mailpost news;
/usr/bin/makeactive active ;
/usr/bin/news.daily ;
/usr/bin/news2mail ;
/usr/bin/nnrpd , ;
/usr/bin/nntpsend innxmit;
/usr/bin/overchan ;
/usr/bin/parsecontrol ;
/usr/bin/pgpverify ;
/usr/bin/scanlogs ;
/usr/bin/send-nntp innxmit;
/usr/bin/sendxbatches innxbatch;
/usr/bin/writelog INN.
381
.
RFC1036 Standard for interchange of USENET -
USENET.
antonio.mccinet.ru/net/nntp.html (NNTP).
ief.tup.km.ua/docs/Linux/NAG/nag19.html NNTP.
malik.bishkek.su/doc/UNIX/innd/inn.htm .
InterNetNews (INN).
www.bog.pp.ru/work/inn.html INN.
www.isc.org/products/INN INN.
www.logic.ru/Russian/soft/ligs/node382.html
Usenet.
www.mibsoftware.com/userkt/inn/0346.htm INN.
www.switch.ch/switch/netnews/wg/newstools.html INN.
23
Proxy-
:
DNS, , proxy-.
proxy-? proxy-, ,
- ,
, ,
, ,
proxy-. proxy- ,
proxy- WWW-, , , .
proxy-, . , 60%.
proxy- proxy-,
,
.
Proxy- :
;
;
;
;
proxy-.
proxy-. , , .
proxy- , , , .
proxy-, GNU,
Squid.
23. Proxy-
383
Squid
Squid proxy-, FTP, gopher HTTP. Squid
, proxy-, DNS- ( ,
DNS-). , SSL, .
Squid
Internet Cache Protocol (ICP, -), proxy- Squid
.
Squid:
proxy HTTP, FTP;
proxy SSL;
;
ICP, HTCP, CARP, Cache digests;
proxy;
WCCP;
;
HTTP- ;
SNMP;
DNS-;
.
.
ICP
ICP Squid-. Squid ,
ICP- Squid-, proxy-.
ICP HIT () MISS (). , proxy- .
Cache digest
proxy-.
Proxy-
( ICP-).
MD5.
proxy-,
/ , ,
384
V. Linux
-, proxy-, . , , ,
proxy- , . , .
/ , Squid " " . proxy-
,
, .
Squid
:
1. ICP- .
2. , :
HIT (), ;
, MISS (
);
.
Squid
Squid /etc/Squid.conf.
, , ICP-
. Squid, . , ( ) .
proxy- .
http_port 3128 proxy-;
icp_port 3130 ICP-. ,
proxy- ;
htcp_port 4827 ICP TCP-;
mcast_groups 239.128.16.128 224.0.1.20 , multicast-
(- squid) ICP,
multicast;
passive_ftp on | off FTP ( ), Squid .
23. Proxy-
385
, Squid
squid-, .
:
cache_peer hostname type proxy-port icp-port options
type:
parent ;
sibling ;
options:
proxy-only , , ;
weight= , ,
;
ttl= ; multicast;
no-query ICP-;
default ;
round-robin , ;
multicast-responder multicast-;
no-digest cash digest;
login=user:password ,
proxy- ;
connect-timeout= ;
cache_peer_domain host domain [domain...]
;
icp_query_timeout milisec ;
mcast_icp_query_timeout milisec multicast;
dead_peer_timeout seconds ,
, ;
hierarchy_stoplist ( ), URL
; cgi-bin;
no_cache deny -ACL , .
, , . .
cache_mem 8 MB
;
cache_swap_high 95 ( ) ;
cache_swap_low 90 ,
( );
maximum_object_size 4096 KB ;
386
V. Linux
minimum_object_size 0 KB ; -
;
ipcache_size 1024 IP-;
ipcache_high 95 IP- -
;
ipcache_low 90 IP-
:
cache_dir Directory-Name Mbytes Level-1 Level2 ,
(
, );
cache_access_log /usr/local/squid/logs/access.log ;
cache_log /usr/local/squid/logs/cache.log ;
cache_store_log /usr/local/squid/logs/store.log ;
emulate_httpd_log on|off
HTTPD;
mime_table /usr/local/squid/etc/mime.conf MIME;
log_mime_hdrs off access HTTP;
useragent_log - User-agent
HTTP-;
debug_options , ; ALL ;
ALL,1;
log_fqdn off
.
, Squid
(,
).
ftp_user email-
FTP-; Squid@, , ;
cache_dns_program /usr/local/squid/bin/dnsserver , DNS-;
dns_children 5 , DNS lookup (
IP- );
23. Proxy-
387
/etc/resolv.conf;
redirect_program none
URL ;
redirect_children 5 , URL
;
redirect_rewrites_host_header on Host: ( Squid Host: );
redirector_access acl (
);
authenticate_program none , ; " "
OK ERR; ACL proxy_auth;
authenticate_children 5 , ;
authenticate_ttl 3600 ,
;
authenticate_ip_ttl 0, .
:
wais_relay_host localhost WAIS-;
wais_relay_port 8000 WAIS-;
request_header_max_size 10KB ;
request_body_max_size 1 MB ;
refresh_pattern [-i] regex MIN_AGE percent MAX_AGE[options]
, .
refresh_pattern , . / ; ,
-i. MIN_AGE MAX_AGE . :
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern. 0 20% 4320
Squid;
reference_age 1 month ;
quick_abort_min 16 KB , min KB, Squid ;
quick_abort_max 16 KB max KB, Squid ;
388
V. Linux
quick_abort_pct
, Squid ;
negative_ttl 5 minutes (
Squid:
connect_timeout 120 seconds ;
siteselect_timeout 4 seconds URL;
read_timeout 15 minutes -
;
request_timeout 30 seconds -
;
client_lifetime 1 day -
Squid; , ;
half_closed_clients on , , ;
shutdown_lifetime 30 seconds
SIGTERM SIGHUP.
23. Proxy-
389
dstdomain foo.com... ( -
none);
srcdom_regex [-i] ... IP- URL
;
dstdom_regex [-i] ... ,
;
url_regex [-i] URL;
urlpath_regex [-i] path- URL;
port ... ;
browser [-i] regexp User-Agent;
maxconn IP.
:
http_access allow|deny [!]aclname... proxy
HTTP;
icp_access allow|deny [!]aclname... proxy ICP;
miss_access allow|deny [!]aclname... MISS;
cache_peer_access cache-host allow|deny [!]aclname...
;
proxy_auth_realm Squid proxy-caching web server , -
/ .
:
cache_mgr email , ,
Squid ;
cache_effective_user nobody Squid root, -
UID ;
cache_effective_group nogroup Squid root, -
GID ;
visible_hostname -
;
unique_hostname -
visible_hostname,
hostname_aliases ... .
HTTP-
HTTP- :
httpd_accel_host hostname , transparent proxy ( ), virtual;
httpd_accel_port port HTTP-;
390
V. Linux
httpd_accel_with_proxy on|off ;
httpd_accel_uses_host_header on|off -
, .
Squid, :
dns_testnames netscape.com internic.net microsoft.com ,
DNS;
logfile_rotate 10 ( - , );
append_domain.vasya.ru ,
;
tcp_recv_bufsize 0 bytes 0 ,
;
err_html_text ;
deny_info err_page_name acl , http_access,
ACL,
page_name;
memory_pools on|off :
on ,
;
off ;
memory_pools_limit , Squid , 0 , ;
forwarded_for on|off , Squid IP-
HTTP-: X-Forwarded-For:
192.1.2.3; , X-Forwarded-For: unknown;
log_icp_queries on|off ICP-;
icp_hit_stale on|off ICP_HIT ;
cachemgr_passwd password action action...
Squid;
disable; none,
config shutdown; Squid;
store_avg_object_size 13 KB , ;
store_objects_per_bucket 20 -;
client_db on|off ;
netdb_low 900 ICMP;
netdb_high 1000 ICMP;
netdb_ping_period 5 minutes ping ;
query_icmp on|off ICP- ICMP-;
23. Proxy-
391
Squid
, Squid .
proxy- .
, ,
, .
Squid.conf :
http_port 3128 , Squid
;
392
V. Linux
proxy- ,
;
cache_mem 16 MB c Squid
. , . ;
maximum_object_size 16384 KB ,
. ;
cache_dir /usr/local/Squid/cache 2048 16 256 proxy-,
.
16 256 1- 2- ;
ftp_user anonymous@vasya.ru proxy-, FTP-;
negative_ttl 1 minutes ;
positive_dns_ttl 6 hours DNS-
IP-;
negative_dns_ttl 5 minutes DNS IP-.
.
, ACL (Access Control List, ). Squid.conf, acl. , :
acl users proxy_auth vasya tolik petya nina
proxy- ,
Squid ;
acl
us\.yimg\.com
. , . ;
http_access deny !users ,
users;
http_access deny BANNER URL, BANNER ( );
proxy_auth_realm Vasy Pupkina proxy-caching web server , /;
cache_mgr vasya@pupkin.ru ,
HTML- ,
vasya@pupkin.ru;
cache_effective_user nobody
proxy-;
cache_effective_group nogroup proxy;
client_db on .
23. Proxy-
393
, ,
, , .
proxy-
,
cache_host.
Squid.conf
pupkin.ru , :
cache_host petya.com parent 3128 3130
cache_host monya.ru sibling 3128 3130
cache_host gesha.ru sibling 3128 3130
cache_host_domain
, .
23.1 , kesha.ru .ru,
.au, .aq, .fj, .nz, gesha.ru .uk, .de, .fr, .no, .se, .it.
23.1
cache_host kesha.ru parent 3128 3130
cache_host gesha.ru parent 3128 3130
cache_host uc.cache.nlanr.net sibling 3128 3130
cache_host bo.cache.nlanr.net sibling 3128 3130
cache_host_domain kesha.ru.ru.au.aq.fj.nz
cache_host_domain gesha.ru.uk.de.fr.no.se.it
Transparent proxy
Transparent proxy proxy-, "" . ,
- .
, :
1. HTTP- , HTTP
proxy-.
2. proxy-.
3. proxy- .
.
proxy- ,
.
HTTP- HTTP proxy-, () , ,
80, proxy-. proxy- -
394
V. Linux
, . Squid.conf :
httpd_accel www.your.domain 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
Squid
, Squid
.
:
-a HTTP-;
-d stderr ( );
-f __ ( );
-h Squid;
-k Squid :
reconfigure HUP. ;
rotate ( USR1);
shutdown
( TERM);
interrupt ( INT);
kill "" (KILL);
debug / ( USR2);
check ( ZERO);
-u ICP-;
-v ;
-z (!);
-D DNS- ;
-F ( );
-N ;
-V ;
-X ;
-Y .
Squid z:
Squid -z
. , proxy-.
Squid k rotate () .
23. Proxy-
395
Squid
access.log
access.log proxy. , .
.
, 10 .
2 .
, . :
timestamp UNIX- ( 1 1970
);
elapsed ;
client IP address IP- , ;
type/HTTP , type:
TCP_HIT ;
TCP_MISS ;
TCP_EXPIRED , ;
TCP_CLIENT_REFRESH ;
TCP_REFRESH_HIT ,
" ";
TCP_REFRESH_MISS , ,
;
TCP_IMS_HIT , ;
TCP_IMS_MISS ;
TCP_REF_FAIL_HIT ,
;
TCP_SWAPFAIL , ;
TCP_DENIED ;
size , ;
method ; GET, HEAD, POST TCP-
ICP_QUERY UDP-;
URL ;
ident "-", ;
hierarchy data/Hostname /
:
PARENT_HIT UDP- (parent) ;
PARENT_UDP_HIT_OBJECT UDP-;
DIRECT ;
(MIME-/).
396
V. Linux
store.log
store.log proxy. , . :
Time UNIX- ( 1 1970 );
action :
RELEASE ;
SWAPOUT ;
SWAPIN , ;
HTTP reply code HTTP-;
HTTP Date ;
HTTP Last-Modified ;
HTTP Expires ;
HTTP Content-Type ;
HTTP Content-Length ;
. , , ;
HTTP metod (GET, HEAD, POST);
Access key ( URL).
useragent.log
,
(Web-) .
.
Web-.
Squid proxy. . .
Web-,
, ( )
-. , .
GPRS , .
Squid ,
. .
1
. ( ).
.
23. Proxy-
397
/usr/local/Squid/etc :
banners_path_regex ;
banners_regex ;
banners_exclusion , , .
Squid.conf 23.2.
23.2
acl banners_path_regex urlpath_regex
"/usr/local/Squid/etc/banners_path_regex"
acl banners_regex url_regex "/usr/local/Squid/etc/banners_regex"
acl banners_exclusion url_regex "/usr/local/Squid/etc/banners_exclusion"
http_access deny banners_path_regex !banners_exclusion
http_access deny banners_regex !banners_exclusion
,
proxy- .
.
"" mybanner.gif.
() Squid.conf redirect_program
/usr/local/Squid/bin/banner.pl.
Perl banner.pl ( 23.3).
23.3
#!/usr/bin/perl
$|=1;
while (<>)
{
s@-@http://www.myhost.org/mybanner.gif@;
print;
}
, ,
proxy- .
, , 1024 ,
. , 1
(, 512 ), 2
V. Linux
398
3 256 .
Squid.
:
"" ;
"" , ,
;
"" ,
.
:
"" ;
"" 255 ;
255 "" B ""
.
Squid 23.4.
23.4
delay_pools 3
# 3 pool
delay_class 1 1 # 1 pool 1
delay_class 2 1 # 2 pool 1
delay_class 3 3 # 3 pool 3
delay_access 1 allow staff
delay_access 1 deny all
delay_access 2 allow students
delay_access 2 deny all
delay_access 3 allow college
delay_access 3 deny all
delay_parameters 1 512000/512000
delay_parameters 2 512000/512000
delay_parameters 3 512000/512000 256000/512000 12800/256000
, , :
delay_parameters pool total_rest/total_max net_rest/net_max ind_rest/ind_max
, ;
;
net ;
ind ;
rest (/);
max "" ( ).
pool
total
23. Proxy-
399
Squid , Perl, Squid:
access-extract.pl access.log
;
access-summary.pl access-extract.pl .
MRTG
,
Squid. HTML-.
RRDtool
, Squid. HTML-.
400
V. Linux
http://www.Squid-cache.org Squid.
http://karjagin.narod.ru/solaris/Squid-faq-rus.html Squid-faq.
http://www.nlanr.net/Cache/ICP/ICP-id.txt Internet Cache Protocol.
http://Squid.org.ua : ,
Squid.
http://linux.webclub.ru/security/proxy/Squid.html .
Squid.
http://www.bog.pp.ru/work/Squid.html Bog BOS: Squid ( proxy
HTTP): , .
http://www.nitek.ru/~igor/Squid Squid.
24
,
,
"" .
/ .
" " ,
. ,
, , -
. , ,
.
(Network Time Protocol, NTP).
NTP
(, ). NTP
, ( )
. ,
.
.
, , , ,
, . .
UDP, 123. , ,
.
64-
, UTC.
32 , 32 .
232 . .
402
V. Linux
:
multicast , .
NTP- ,
, , .
NTP-;
procedure-call . NTP- , . ;
symmetric .
. .
, ,
, .
.
, .
:
;
,
, , .
.
,
DES.
NTP-
NTP :
LI (leap indicator) ;
VN ;
mode ;
stratum ;
precision ;
poll interval . , ;
24. ,
403
synchronization distance
;
;
;
reference timestamp ;
originate timestamp , NTP;
receive timestamp NTP-;
transmit timestamp ;
authenticator (96 ) .
synchronization dispersion
reference clock identifier
, ,
. .
NTP . 24.1.
24.1. NTP
RFC1128
RFC1129
RFC1165
Network Time Protocol (NTP) over the OSI Remote Operations Service (
OSI)
RFC1305
RFC1119, RFC1059, RFC958
RFC2030
NTP , ,
V. Linux
404
xntpd
UNIX-, Linux, ,
xntpd. RFC1305
,
.
Linux. . /etc/ntp.conf.
, ,
/etc/ntp.conf.
symmetric
symmetric.
peer <address> [key <key>] [version <version>] [prefer] [minpoll <minpoll>]
[maxpoll <maxpoll>]
<address> ;
<key> 32- ( );
prefer ;
<minpoll> (, 2 <minpoll>
procedure-call
procedure-call.
server address [key <key>] [version <version>] [prefer] [mode <mode>];
<address> ;
<key> 32- ( );
<mode> .
multicast
multicast. .
broadcast <address> [key <key>] [version <version>] [ttl <ttl>]
<address> ;
<key> 32- ( );
<version> ;
<ttl> ;
24. ,
405
;
broadcastdelay <> -
xntpd:
driftfile <driftfile> ,
;
enable/disable auth/monitor/pll/pps/stats /
:
auth ;
monitor ;
pll NTP;
stats ;
statistics loopstats
loopstats, :
;
(UTC);
;
;
;
statistics peerstats ,
peerstats, :
;
(UTC);
IP- ;
, ;
, ;
, ;
, ;
statistics clockstats , clockstats;
statsdir <---> ,
;
filegen [file <filename>] [type <typename>] [flag <flagval>] [link |
,
:
, ,
;
, ,
file;
<typename>;
none ;
nolink] [enable | disable]
V. Linux
406
xntpd (
);
day ( .yyyymmdd);
week (
.yyyywww);
month (
.yyyymm);
year ( .yyyy);
age 24 ( .a 8- xntpd);
link/nolink (
, );
enable/disable /
;
restrict numeric-address [ mask <numeric-mask> ] [flag] ...
: , , :
;
ignore ;
noquery NTP 6 7 ( );
nomodify NTP 6 7 ( );
notrap mode 6 trap- ( );
lowpriotrap , ,
;
noserve mode 6 7;
nopeer , ;
notrust ;
limited
;
ntpport/non-ntpport ( , / 123),
;
clientlimit limit limited ( 3);
clientperiod <> ;
pid
24. ,
407
, ;
setvar <variable> ;
logfile <-> <->
syslog;
logconfig <keyword> , -
. ( ), ( ), ();
(clock, peer, sys, sync) (info, event, statistics, status); all.
,
123 ,
denial of service ( ),
. .
,
. ,
Windows, .
ntpdate
NTP-.
:
-B , 128 ;
-b settimeofday;
-d ;
-p <> ( 1 8, 4);
-q ;
-s syslog stdout;
-t <timeout> ( 1 );
-u .
ntpq
NTP- (
NTP mode 6).
408
V. Linux
ntptrace
.
:
-r <> ( 5);
-t <> ( 2).
xntpd
. :
xntpd [-aAbdm ] [-c <config-file>] [-f <drift-file>] [-k <key-file>]
[-l <log-file>] [-p <pid-file>] [-r <broadcast-delay>] [-s <stats-dir]
[-t <key>] [-v <variable>] [-V <variable>]
:
-a ;
-A ;
-b ;
-c <config-file> ( /etc/ntp.conf);
-d ;
-f <drift-file> , ( /etc/ntp.drift);
-k <key-file> ( /etc/ntp.keys);
-l <log-file> ( syslog).
xntpdc
NTP- .
Xntpd-. NTP mode 7.
NTP-
. , . ().
, /. NTP. .
24. ,
409
UNIX/Linux
xntpd
. , . ,
. .
ntpdate.
.
100 .
ntpdate -B <ntp> <ntp2> <ntp3>
Apple
Apple NTP, macntp.
Mac Os X .
Windows
Windows
. AboutTime, AnalogX Atomic
TimeSync, http://www.listsoft.ru/programs/536/
www.analogx.com/contents/download/network/ats.htm.
Dimension 4 www.thinkman.com/~thinkman.
Windows. Windows XP,
.
25
NIS (NIS+)
. LDAP
NIS (NIS+) LDAP, "" (. . , ),
. , -, ,
.
NIS
NIS (Network Information Service, ) , , . , NIS:
// (/etc/passwd);
(/etc/group).
NIS Sun Microsystems, Inc.
Yellow Pages. - , Yellow Pages , British Telecom, .
NIS
NIS , (-),
( NIS). NIS-.
NIS
- , - . , , NIS- , NIS, ,
NIS- ( ).
- yppush . NIS ,
.
411
- ypserv
, ,
NIS,
all /var/yp/Makefile.
/var/yp/securenets /etc/ypserv.conf. ,
portmapper (portmap(8)) , ypserv.
rpcinfo -u localhost ypserv
program 100004 version 1 ready and waiting
program 100004 version 2 ready and waiting
version 1 ypserv
.
NIS (YP). -
ypinit -m
, ypwhich -m . ,
NIS
ypinit -s masterhost
NIS.
NIS make /var/yp
-. ,
.
NIS+
NIS+ (Network Information Service Plus, ) NIS .
, NIS, NIS+ Linux . Linux NIS+. NIS+ Linux LDAP.
NIS+
NIS+ Sun.
NIS NIS+ , NIS+
RPC.
NIS+ .
NIS+ : , , , , .
NIS+, NIS+, . NIS+: org_dir groups_dir.
org_dir , passwd (),
412
V. Linux
LDAP
LDAP (Lightweight Directory Access Protocol, ) - .
LDAP , LDAP, LDAP. LDAP LDAP-
. ,
( LDAP-).
, LDAP- ,
.
LDAPv3 RFC2251-2256, 2829-2831.
LDAP, OpenLDAP.
OpenLDAP:
LDAPv2 LDAPv3;
;
IPv4 IPv6;
Strong Authentication (SASL ) (RFC2829);
Start TLS (RFC2830);
Language Tags ( ) (RFC2596);
, DNS (RFC2247);
;
Named References/ManageDsaIT ( );
;
Threads pool, ;
;
;
LDIFv1 (RFC2849);
/.
LDAP-
LDAP- OpenLDAP .
OpenSSL TLS .
Kerberos OpenLDAP Kerberos. , OpenLDAP SASL/GSSAPI Heimdal MIT Kerberos V.
Sleepycat Software BerkeleyDB Free Software Foundation's GNU Database
Manager (GDBM)
413
, slapd
.
OpenLDAP
.
OpenLDAP slapd.
LDAP-
slapd.conf . /etc
/usr/local/etc/openldap. slapd.conf.
.
slapd.conf : , . , ,
, ,
.
/ .
.
( #) . ,
. slapd.conf 25.1.
25.1
#
< >
#
backend <typeA>
< >
#
database <typeA>
<, >
#
database <typeB>
<, >
#
414
V. Linux
database <typeA>
<, >
# ,
#
...
, .
, . (\),
.
, ,
,
. , , <>.
access to <> [ by <> < > <control> ]+ ( < >) /
( <>) ( <>).
attributetype <RFC2252 > .
defaultaccess { none | compare | search | read | write }
,
access.
(, read search compare,
write).
idletimeout < > , .
include < > slapd
.
slapd. , .
loglevel < > , syslog .
( ,
), OpenLDAP enable-debug
( ). . , , slapd
-?.
< > :
-1 ;
0 ;
1 ;
2 ;
4 ;
8 ;
16 ;
32 ;
64 ;
128 ;
256 //;
512 ;
1024 shell- ;
2048 .
objectclass <RFC2252 >
415
.
referral <URL> , slapd -
.
sizelimit < > ,
.
timelimit < > , slapd -
, . ,
, .
, . .
.
backend <> . <>
ldbm, shell, passwd
.
, . .
database <> . <>
ldbm, shell, passwd
.
readonly { on | off } " ".
" " "unwilling to perform".
replica host=< >[:<>] [bindmethod={ simple | kerberos |
sasl }] ["binddn=< >"] [mech=<>] [authcid=<identity>]
[authzid=<identity>] [credentials=<>] [srvtab=< >] . host=
LDAP. < >
, IP-. <> , LDAP . binddn=
416
V. Linux
. bindmethod
simple, kerberos sasl, slapd: , Kerberos- SASL-. binddn credentials. Kerberos binddn srvtab.
SASL mech. , /
, authcid credentials .
authcid .
replogfile < > , .
slapd slurpd.
rootdn < > ,
. , .
SASL.
:
rootdn "cn=Manager, dc=example, dc=com"
SASL:
rootdn "uid=root@EXAMPLE.COM"
rootpw <> ,
, , .
suffix < >
. .
.
updatedn < > slapd. , . ,
slurpd ,
, SASL.
updateref <URL> .
URL, , . , URL.
, LDBM-
LDBM.
database ldbm database.
cachesize < >
LDBM .
417
.
, .
,
, .
dbnolocking ,
. .
dbnosync . .
directory <> , ,
LDBM, .
index {< > | default} [pres, eq, approx, sub, none]
. < >, .
mode < >
.
Slapd ( LDBM):
ldbm Berkeley GNU DBM- ;
passwd /etc/passwd " ";
shell shell- ( );
sql SQL.
Slapd :
-f < > slapd;
-h <URL> . ldap:///, -
LDAP TCP , . -
. IPv4-, , . ;
-n < > , . slapd;
-l < syslog>
syslog;
-u <> -g <>
, .
, uid; , gid;
-r <> . , - slapd chroot;
418
V. Linux
?, , slapd , .
:
-1 ;
0 ;
1 ;
2 ;
4 ;
8 ;
16 ;
32 ;
64 ;
128 ;
256 //;
512 ;
1024 shell- ;
2048 .
, , .
LDAP
, LDAP . .
LDAP,
Slapd .
LDBM .
SHELL UNIX- shell-.
PASSWD .
LDAP LDBM- , .
LDBM .
. , (EID)
. .
, LDAP,
LDIF (LDAP Data Interchange Format, LDAP ). LDIF - . LDAP, , LDIF- LDBM-.
25.2 LDIF-.
419
25.2
dn: o=Home, c=UA
o: Home
objectclass: organization
dn: cn=Vasya Pupkin, o=Home, c=UA
cn: Vasya Pupkin
sn: Pupkin
mail: vasya@yahoo.com
objectclass: person
, dn, , .
LDAP .
LDAP , :
,
;
, ;
;
.
. , person,
inetOrgPerson, groupOfNames organization. ( ) .
"". .
, cn (commonName) .
, , person.
, , .
objectClass. , .
,
. , person cn sn. description, telephoneNumber, seeAlso userpassword
, .
. :
bin (binary) ;
ces (case exact string) (
);
420
V. Linux
);
tel ( cis, '' -
);
dn (distinguished name) .
. -,
, LDAP. , slapd LDAP- .
. -,
. , .
, .
, , :
suffix "o=Home, c=UA"
, ,
:
directory <>
:
directory /usr/local/home
, :
index {<attrlist> | default} [pres,eq,approx,sub,none]
slapd, LDAP- .
421
. slapd, , LDIF-.
LDBM. , :
suffix < >
, , .
, :
suffix "o=Home, c=UA"
, ,
:
directory <>
:
directory /usr/local/home
,
.
.
dbcachesize < >
,
50 :
dbcachesize 50000000
, .
index {<attrlist> | default} [pres,eq,approx,sub,none]
:
index cn,sn,uid pres,eq,approx
index default none
:
-l < > LDIF-, -
;
-f < slapd>
slapd, , , . .;
V. Linux
422
, slapd;
-n < > . ,
. 1, 2 . .
b;
-b <> , ,
.
, .
-n.
, LDAP.
Slapindex
(,
slapd.conf). slapindex.
Slapcat
slapcat LDIF-.
,
.
Ldapsearch
Ldapsearch shell ldap_search. LDAP- .
Ldapsearch LDAP, , .
LDAP, RFC1558.
ldapsearch , ,
.
Ldapdelete
Ldapdelete shell- ldap_delete.
LDAP- .
Ldapdelete LDAP-,
. dn,
.
RFC1779.
, .
423
Ldapmodify
Ldapmodify shell- ldap_modify
ldap_add. LDAP- .
Ldapadd
Ldapadd ldapmodify.
ldapadd -a ( )
ldapmodify.
Kldap
Kldap LDAP- KDE. .
GQ
GQ LDAP- GNOME .
LDAP
LDAP PAM (Pluggable Authentication Module ). PAM pam_ldap
. pam_ldap ldap.conf.
/etc/ldap.conf :
BASE dc=home,dc=ua
HOST 192.168.0.1
pam_password clear
:
BASE LDAP;
HOST IP- , LDAP-;
pam_password .
PAM pam.conf
/etc ,
. , pam_ldap.
424
V. Linux
., ., ., . . UNIX: -
. : . . .: ; .: BHV, 2002.
LDAP Linux HOWTO.
The Linux NIS(YP)/NYS/NIS+ HOWTO.
Man- lapd.conf.
RFC 1558: A String Representation of LDAP Search Filters.
RFC 1777: Lightweight Directory Access Protocol.
RFC 1778: The String Representation of Standard Attribute Syntaxes.
RFC 1779: A String Representation of Distinguished Names.
RFC 1781: Using the OSI Directory to Achieve User Friendly Naming.
RFC 1798: Connectionless LDAP.
RFC 1823: The LDAP Application Programming Interface.
RFC 1959: An LDAP URL Format.
RFC 1960: A String Representation of LDAP Search Filters.
RFC 2251: Lightweight Directory Access Protocol (v3).
RFC 2307: LDAP as a Network Information Service.
http://www.keldysh.ru/metacomputing/ism99.html . ., . .,
. . LDAP .
. . . .
http://www.openldap.org OpenLDAP.
http://www.opennet.ru/docs/RUS/ldap/index.html .
LDAP.
26
NFS
NFS (Network File System, ) ,
. NFS
: , . NFS 80- .
UNIX Windows.
NFS,
Linux-.
NFS-
, NFS - .
, , . .
NFS , .
.
( ), NFS RPC (Remote Procedure Called,
), Linux portmap.
, RPC, /etc/hosts.allow, /etc/hosts.deny.
, ()
, /etc/exports.
:
___
_____ (_)
:
/home/boss/documents
zam(ro)
V. Linux
426
26.1.
26.1
program vers proto
port
100000
tcp
111
portmapper
100000
udp
111
portmapper
100005
udp
745
mountd
100005
tcp
747
mountd
100003
udp
2049
nfs
100003
tcp
2049
nfs
, ,
hosts.allow hosts.deny.
exports nfsd
exports. , :
killall -HUP /usr/sbin/mountd
killall -HUP /usr/sbin/nfsd
NFS-
NFS- ,
. ,
NFS.
.
/home/boss/documents,
boss.
mount -o rsize=1024,wsize=1024 boss:/home/boss/documents /mnt/docs
mount
:
mount: boss:/home/boss/documents failed, reason given by server:
Permission denied
exports , .
,
umount /mnt
26. NFS
427
NFS /etc/fstab
boss:/home/bosss/documents
hard, intr 0 0
/mnt/docs
nfs
rsize=1024,
wsize=1024,
.
,
, ( ) . .
rsize
rsize ( ). 8192 .
wsize
wsize ( ). 8192 .
,
(, ).
soft
NFS- , , ,
NFS. , .
hard
hard , NFS ,
.
"" , intr.
timeo=n
n
- RPC. 0,7 .
- -,
60 , , retrans, -.
428
V. Linux
retrans=n
n - ,
-. . -,
, "server not responding".
NFS
NFS , , , . , NFS , . .
suid NFS.
nosuid.
noexec, , , .
,
root, root_squash
exports:
/home/boss/documents zam(rw,root_squash)
27
Samba
Windows
, , /. Linux. Windows,
. , "", - .
, Microsoft Windows , ,
, , , Active Directory "".
-
Windows. - (patch), - Windows .
Linux Windows UNIX
Samba, Microsoft Windows.
Linux-
- Microsoft Windows,
Linux
(Primary Domain Controller, PDC) Windows. Samba-
Linux, Linux-
, Microsoft Windows.
:
Linux Windows XP/Vista, ;
Windows
;
Linux-,
;
Samba
SSH, Web-, SWAT (Samba
Web-based Administrative Tool);
Samba 3 , Windows
Server.
V. Linux
430
Samba
Linux Samba. , rpm -i sambaXXX.rpm.
,
TGZ-, , .
1. , Samba.
:
tar zxvf samba-X.X.X.tar.gz,
X.X.X .
2. , .
Readme, , , Samba.
3.
configure --with-smbmount --prefix=/opt/samba --with-msdfs,
Makefile.
4. make <Enter>.
.
5. make ,
make install,
Samba ( , /opt/samba).
Samba.
smb.conf
, Samba
( ) .
Samba /etc/samba. :
lmhosts ;
smbpasswd Samba (
);
smbusers , , Samba;
smb.conf .
, , examples ( : examples Samba).
.
431
# It should not be necessary to spell out the print system type unless
# yours is non-standard. Currently supported print systems include:
# bsd, sysv, plp, lprng, aix, hpux, qnx
printing = lprng
# Uncomment this if you want a guest account, you must add this to /etc/passwd
V. Linux
432
# otherwise the user "nobody" is used
;
# this tells Samba to use a separate log file for each machine
# that connects
log file = /var/log/samba/%m.log
# Put a capping on the size of the log files (in Kb).
max log size = 0
# Security mode. Most people will want user level security. See
# security_level.txt for details.
security = user
# Use password server option only with security = server or
# security = domain
;
password level = 8
username level = 8
433
include = /etc/samba/smb.conf.%m
# Most people will find that this option gives better performance.
# See speed.txt and the manual pages for details
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
# Configure Samba to use multiple interfaces
# If you have multiple network interfaces then you must list them
# here. See the man page for details.
interfaces = 192.168.10.0/24
# Configure remote browse list synchronization here
#
local master = no
os level = 33
V. Linux
434
# per user logon script
Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
wins server = w.x.y.z
# DNS Proxy tells Samba whether or not to try to resolve NetBIOS names
# via DNS nslookups. The built-in default for versions 1.9.17 is yes,
# this has been changed in version 1.9.18 to no.
dns proxy = no
# Case Preservation can be handy system default is _no_
# NOTE: These can be set on a per share basis
;
preserve case = no
435
[homes]
comment = Home Directories
browseable = no
writable = yes
valid users = yura katya lena alst
[comm]
comment = Common place
path = /home/samba/comm
valid users = root yura katya lena alst
public = no
writable = yes
printable = no
create mask = 0775
directory mask= 0775
force group = office
[hp]
comment = HP LaserJet 1200 Series PCL6
path = /var/spool/samba
printer = lp
public = no
printable = yes
printer driver=HP LaserJet 1200 Series PCL6
printer driver location=\\%h\printer$
[printer$]
path=/home/samba/hplj1200
public=yes
browseable=yes
# This one is useful for people to share files
[tmp]
comment = Temporary file space
path = /tmp
read only = no
public = yes
, .
, [global], [homes] . .
INI-
Windows. # ; .
V. Linux
436
[global]
[global] , Samba
. [global].
workgroup = Kontora NT- ,
Samba.
netbios name = Serwer NetBIOS.
, .
server string = Kontora Samba Server ().
hosts allow = 192.168.10 IP- , , Samba.
printing = lprng ; bsd, sysv, plp,
lprng, aix, hpux, qnx.
guest account = pcguest , Samba-.
Linux- ( nobody
/etc/samba/smbusers) .
log file = /var/log/samba/%m.log log-
; , .
max log size = 0 log- ( ).
security = user ; user,
share, server domain.
password server = <NT-Server-Name>
security = server security = domain; .
password level username level
.
encrypt passwords = yes
; encrypt passwords = no, ,
.
smb passwd file = /etc/samba/smbpasswd ,
; Linux ,
Samba.
local master = yes Samba -
, .
preferred master = yes Samba .
NetBIOS , . .
, . NetBIOS
, (master), -
437
, ,
. .
DNS.
username map = /etc/samba/smbusers
[homes]
[homes]
Linux-. Linux-. [homes].
comment = Home Directories .
browseable = no .
writable = yes .
valid users = yura katya alst ,
; .
V. Linux
438
[comm]
[comm] , Samba.
FTP, . .
comment = Common place .
path = /home/samba/comm ,
.
valid users = root yura katya alst , .
public = no
.
writable = yes .
printable = no ,
.
create mask = 0775 .
directory mask = 0775 .
force group = office , , ,
office, , office,
.
[tmp]
[tmp] ,
. [comm] public:
comment = Temporary file space
path = /tmp
read only = no
public = yes
Samba .
encrypt password , .
encrypt password no,
Linux, /etc/passwd
/etc/shadow. , ,
. , Windows 95, Windows 98 Windows NT. , :
Windows 95
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\VNETSUP]
"EnablePlainTextPassword"=dword:00000001
439
Windows 98
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\VNETSUP]
"EnablePlainTextPassword"=dword:00000001
Windows NT
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Rdr\Parameters]
"EnablePlainTextPassword"=dword:00000001
Windows 2000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkStation\Par
ameters]
"EnablePlainTextPassword"=Data: 0x01
Samba
/etc/samba/smbpasswd /etc/samba/smbpasswd.
Linux-. , :
smbpasswd :
smbpasswd -a user_name;
: smbpasswd -e user_name.
. ,
"" passwd smbpasswd.
.
nobody, root,
news . .
smbclient smbmount , Samba.
man-, smbclient .
V. Linux
440
, Samba,
Samba- . ,
/etc/printcap, , smb.conf ( 27.2).
27.2
[printers]
path = /var/spool/lpd
writeable = no
guest ok = no
printable = yes
Samba
Samba Windows-
Linux-, , , Linux- SMB-.
, Windows- , Windows.
SMB Linux Samba
smbclient. FTP- . samba-client, SMB mount/umount smbmount/smbumount.
mount/umount t smbfs.
SMB-,
/usr/bin/smbclient -L host,
host , .
.
27.3 smbclient.
27.3
smbclient -L ziga
Server time is Sat Aug 17 19:58:27 2010
Timezone is UTC+2.0
Password:
Domain=[WORKGROUP] OS=[Windows NT 4.5] Server=[NT LAN Manager 4.5]
Server=[ZIGA] User=[] Workgroup=[WORKGROUP] Domain=[]
Sharename
Type
Comment
---Disk
Disk
Disk
Printer
441
------Remote Admin
Public
Default share
HP6L
Comment
------Samba 3.4.10p8
:
/usr/bin/smbclient service <password>,
service . ,
, public , ziga,
\\ziga\public.
( shell) , :
/usr/bin/smbclient \\\\ziga\\public <mypasswd>,
<mypasswd> .
smbclient:
smb: \>
h <Enter> ( 27.4).
27.4
smb: \> h
ls
get
more
md
translate
cancel
newer
setmode
smb: \>
dir
mget
mask
rmdir
lowercase
stat
archive
help
lcd
put
del
rd
print
quit
tar
?
cd
mput
rm
prompt
printmode
q
blocksize
!
pwd
rename
mkdir
recurse
queue
exit
tarmode
, FTP-.
smbclient , . Windows ,
Smbfs.
V. Linux
442
Samba
, .
Samba , Windows.
Samba
:
Samba PDC.
.
, :
;
domain logons [netlogon];
Windows
, (domain master
browser).
27.5 smb.conf, , Samba .
27.5
[global]
;
netbios name = domain_pdc
workgroup = test
; domain local master browser
os level = 64
preferred master = yes
domain master = yes
local master = yes
; -
password server = domain_pdc
;
allow trusted domains = yes
; NT
nt acl support = yes
443
;
security = user
; PDC
encrypt passwords = yes
; domain logons
domain logons = yes
; ,
logon path = \\%N\profiles\%u
;
;
logon drive = H:
logon home = \\homeserver\%u
;
; [netlogon]
logon script = logon.cmd
;
[netlogon]
path = /usr/local/samba/lib/netlogon
writeable = no
write list = ntadmin
;
[profiles]
path = /export/smb/ntprofile
writeable = yes
create mask = 0600
directory mask = 0700
, Samba
,
.
, Samba:
smbstatus Samba;
SWAT Samba Web-;
smbpasswd Samba;
444
V. Linux
testparm ;
testprns ;
smbtar SMB- ;
smbclient ;
Ksamba KDE-, ;
Smbedit Win32- Samba;
Webmin Web-,
Samba;
GSMB smbpasswd;
SambaSentinel smbstatus.
SWAT
SWAT (Samba Web Administration Tool)
Samba Web- (. 27.1). SWAT
localhost:901. ,
SWAT.
SWAT Samba, Web-.
. 27.1. SWAT
Webmin
Webmin Web-,
Web (. 27.2).
Samba.
445
Ksamba
Ksamba KDE-,
Samba.
SambaSentinel
smbstatus. ,
. .
boombox.campus.luth.se/sambasentinel.php sambasentinel.
www.culte.org/projets/developpement/gsmb/ GSMB.
www.linuxcenter.ru/lib/soft/samba_pdc.phtml Samba 2.2 -
).
www.samba.org Samba.
www.webmin.com Webmin.
28
(Virtual Private Network, VPN) , ,
() , . VPN
"" (, tunneling),
( , VPN)
.
, , PPP, SSH
- .
VPN, VPN , VPN
Windows.
, VPN:
SSH , ;
IPSec (Internet Protocol Security) FreeS/WAN.
. , ,
;
PPTP (Point-To-Point Tunneling Protocol)
. Microsoft, ;
CIPE
.
SSH ,
SSH , .
28.
447
IPSec
IPSec IP, , . IPv6
IPSec , . . IPSec IETF IPv6.
IPSec ,
: AH (Authentication Header, ), ESP
(Encapsulating Security Payload, ) IKE
(Internet Key Exchange, ). IPSec ,
.
AH ESP . AH IP, . AH
, MD5 (Message Digest, )
SHA (Secure Hash Algorithm, ). AH .
ESP , . AH, . IKE. IKE , , .
RSA-,
. IKE DiffieHellman (tokens).
, DES (Data
Encryption Standard, ). -,
MD5 SHA, .
.
IPSec IP. IPSec IP-. IPSec , .
IPSec RFC, . IPSec , , .
VPN- FreeS/WAN
, FreeS/WAN IPSec,
.
FreeS/WAN :
KLIPS (KerneL IP Security) Linux;
pluto IKE KLIPS,
.
448
V. Linux
Ipsec.conf
ipsec.conf, , /etc.
, . , #, . ipsec.conf
28.1.
28.1
#
coning setup
# ,
# VPN-
interfaces="IPSEC0=eth0"
#
# pluto
klipsdebug=none
plutodebug=none
#
# IPSec
plutoload=%search
plutostart=%search
#
#
conn Test
# 1-
# IP
28.
449
left=193.1.1.2
#
leftsubnet=192.168.1.0/24
# IP 1-
leftnexthop=194.17.2.5
# 2-
# IP
right=197.11.0.213
#
rightsubnet=192.168.1.0/24
# IP 2-
rightnexthop=202.22.8.24
#
# 0 -
keyingtries=0
# (AH ESP)
auth=ah
# IPSec
auto=start
, 29.1.
config setup config , setup .
config,
FreeS/WAN, conn, VPN-.
VPN- conn.
interfaces="IPSEC0=eth0" , VPN-.
klipsdebug=none / .
, %, , FreeS/WAN .
:
plutoload=%search;
plutostart=%search.
Pluto ipsec.conf , , VPN-. : plutoload="Test", Test ,
.
V. Linux
450
Ipsec.secrets
FreeS/WAN , pluto
256 .
.
ipsec ranbits 256 > /root/key
/root/key , /etc/ipsec.secrets , :
194.17.2.5 197.11.0.213
"0xaf4a2a4c_f58a444f_5a55d31e_55555ac4_555a58e2_b6ea25a3_0ee661d4_daf155"
IP- .
RSA-
ipsec.conf ipsec.secrets:
1. RSA
ipsec rsasigkey --verbose 1024 > /root/leftey
2. /etc/ipsec.conf
RSA- :
authby=rsasig
leftrsasigkey= ""
rightrsasigkey= ""
28.
451
, :
PPTP- Linux Windows-;
Linux- Windows NT VPN-.
Linux PPTP-
pptpd, . ntsysv, pptpd .
/etc/pptpd.conf 28.2.
28.2
speed 115200
option /etc/ppp/options.pptpd
debug
localip 192.168.0.1
remoteip 192.168.0.100-150
, ,
PPP PPTP, , VPN , VPN-.
/etc/ppp/options.pptpd 28.3.
28.3
lock
mtu 1490
mru 1490
ipcp-accept-local
ipcp-accept-remote
lcp-echo-failure 3
lcp-echo-interval 5
deflate 0
auth
+chap
-pap
proxyarp
ms-dns 192.168.0.1
+chapms
+chapms-v2
nobsdcomp
nodeflate
nodefaultroute
+mppe-128
+mppe-stateless
V. Linux
452
, -, . .
+mppe-128. 128- .
/etc/ppp/chap-secrets .
, .
Linux PPTP-
PPTP- PPTP, Linux VPN- MS Windows NT VPN-.
PPTP Client ( pptp-linux)
, MPPE (Microsoft Point-To-Point
Encryption) ppp-mppe.
ppp-mppe /etc/modules.conf
:
alias char-major-108 ppp_generic
alias ppp-compress-18 mppe
OpenVPN
. openvpn.net. UNIX- , MAC OS X Windows.
. OpenSSL,
LZO.
29
Linux.
,
.
, , ,
.
. - . ,
, root nobody.
, .
root , , . ,
(shell).
(Process Identification, PID). , .
(foreground) (background).
.
, . . , ,
( ) ( ).
, . .
, , .
V. Linux
454
. ,
.
.
. ,
,
.
, .
. .
(&),
, , . .
:
/home/vasya# yes > /dev/null &;
[1] 123
/home/vasya#
. ,
- .
[1] . , . 123 (PID) . .
, . ,
( )
[1]. ,
(PID)
. ,
? .
2693 1294, %1, %2. .
jobs:
/home/vasya# jobs
[1]+ Running
/home/vasya#
yes >/dev/null
&
,
, .
29.
455
,
. :
1. .
2. .
3. .
. <Ctrl>+<Z>.
:
/home/vasya# yes > /dev/null
ctrl+Z
[1]+ Stopped
/home/vasya#
yes >/dev/null
. ,
bg %1
, .
fg %1
, , , .
. ,
.
.
? <Ctrl>+<Z>
,
. , .
, ,
. , , . .
, ,
, .
, ( ), <Ctrl>+<C>. -
V. Linux
456
<Ctrl>+<Break>.
,
.
.
, "" "" , kill killall.
kill ,
(PID).
, :
/home/vasya# kill 123
:
/home/vasya# kill %1
, (PID)
% .
killall
, . , killall mc
mc, .
, .
. ,
. root .
,
, . (. 29.1).
29.1.
at
batch
cron
crontab
crontab
kill
nice
nohup
ps
renice
29.
457
nohup
,
, ,
&, .
nohup __ &
ps
ps
. , . man- .
ps ,
. :
PID TTY
TIME CMD
885 tty1
00:00:00 login
893 tty1
00:00:00 bash
955 tty1
00:00:00 ps
?
PID ( ). , , .
PID. , .
PID, .
TTY , . ps ,
.
TIME , . , Linux . , TIME, ,
.
CMD , .
, .
, ,
ps ax
29.1 .
V. Linux
458
29.1
PID TTY
STAT
TIME COMMAND
1 ?
0:04 init
2 ?
SW
0:00 [keventd]
3 ?
SW
0:00 [kapm-idled]
4 ?
SWN
0:00 [ksoftirqd_CPU0]
5 ?
SW
0:00 [kswapd]
6 ?
SW
0:00 [kreclaimd]
7 ?
SW
0:00 [bdflush]
8 ?
SW
0:00 [kupdated]
9 ?
SW<
0:00 [mdrecoveryd]
13 ?
SW
0:00 [kjournald]
437 ?
0:00 syslogd -m 0
442 ?
0:00 klogd -2
462 ?
0:00 portmap
490 ?
0:00 rpc.statd
647 ?
0:00 /usr/sbin/sshd
704 ?
732 ?
751 ?
769 ?
0:00 crond
835 ?
853 ?
0:00 anacron
871 ?
0:00 /usr/sbin/atd
885 tty1
886 tty2
887 tty3
888 tty4
889 tty5
890 tty6
893 tty1
0:00 -bash
1037 tty1
0:00 /usr/bin/mc -P
1038 ?
1039 pts/0
1067 pts/0
0:00 ps ax
, . ,
, ,
, .
29.
459
29.2 .
29.2
USER
RSS TTY
root
1.2
0.2
1412
VSZ
520 ?
root
0.0
0.0
0 ?
SW
root
0.0
0.0
0 ?
SW
root
0.0
0.0
0 ?
SWN
root
0.0
0.0
0 ?
SW
root
0.0
0.0
0 ?
SW
root
0.0
0.0
0 ?
SW
root
0.0
0.0
0 ?
SW
root
0.0
0.0
0 ?
SW<
root
13
0.0
0.0
0 ?
SW
root
437
0.0
0.2
1472
592 ?
root
442
0.0
0.4
1928 1040 ?
rpc
462
0.0
0.2
1552
588 ?
rpcuser 490
0.0
0.2
1596
756 ?
root
590
0.0
0.2
1396
524 ?
root
647
0.0
0.4
2676 1268 ?
root
680
0.0
0.3
2264
992 ?
lp
704
0.0
0.3
2600 1020 ?
root
732
0.0
0.7
5296 1984 ?
root
751
0.0
0.1
1440
492 ?
root
769
0.0
0.2
1584
660 ?
xfs
835
0.0
1.4
4988 3612 ?
root
853
0.0
0.2
1416
600 ?
V. Linux
460
daemon
871
0.0
0.2
1444
root
885
0.0
0.4
root
886
0.0
0.1
root
887
0.0
root
893
root
1037
root
568 ?
1384
448 tty2
0.1
1384
448 tty3
0.0
0.5
0.0
0.7
1038
0.0
0.1
1380
root
1039
0.0
0.5
root
1068
0.0
0.3
2780
348 ?
824 pts/0 R
. :
USER , -
;
%CPU, %MEM ,
;
TIME .
. 29.2 ps.
29.2. ps
""
txx
29.
461
ps ,
, .
top
, .
top. , ( 29.3).
29.3
2:55pm
up 3 min,
1 user,
1,1% user,
2,9% system,
Mem:
255532K av,
42856K used,
Swap:
257000K av,
0K used,
PID USER
PRI
NI
SIZE
1 root
2 root
3 root
4 root
5 root
212676K free,
0K shrd,
257000K free
8560K buff
19920K cached
TIME COMMAND
520
520
0,0
0,2
0:04 init
0 SW
0,0
0,0
0:00 keventd
0 SW
0,0
0,0
0:00 kapm-idled
19
19
0 SWN
0,0
0,0
0:00 ksoftirqd_CPU0
0 SW
0,0
0,0
0:00 kswapd
6 root
0 SW
0,0
0,0
0:00 kreclaimd
7 root
0 SW
0,0
0,0
0:00 bdflush
0 SW
0,0
0,0
0:00 kupdated
-1 -20
0 SW<
0,0
0,0
0:00 mdrecoveryd
0 SW
8 root
9 root
452 S
13 root
0,0
0,0
0:00 kjournald
437 root
592
592
496 S
0,0
0,2
0:00 syslogd
442 root
1040 1040
448 S
0,0
0,4
0:00 klogd
462 rpc
588
588
504 S
0,0
0,2
0:00 portmap
490 rpcuser
756
756
660 S
0,0
0,2
0:00 rpc.statd
590 root
524
524
464 S
0,0
0,2
0:00 apmd
647 root
1268 1268
1076 S
0,0
0,4
0:00 sshd
680 root
1008
992
816 S
0,0
0,3
0:00 xinetd
704 lp
1020 1020
872 S
0,0
0,3
0:00 lpd
: ,
,
, ,
. ,
462
V. Linux
, , .
, ps.
:
;
( );
;
;
;
;
,
;
.
top
, .
kill
kill ( )
. ,
, . , .
, PID
. , "" 123,
kill 123
, , . , root
.
kill . , ,
, .
kill 9 123
29.
463
29.4
1) SIGHUP
2) SIGINT
3) SIGQUIT
4) SIGILL
5) SIGTRAP
6) SIGABRT
7) SIGBUS
8) SIGFPE
9) SIGKILL
10) SIGUSR1
11) SIGSEGV
12) SIGUSR2
13) SIGPIPE
14) SIGALRM
15) SIGTERM
17) SIGCHLD
18) SIGCONT
19) SIGSTOP
20) SIGTSTP
21) SIGTTIN
22) SIGTTOU
23) SIGURG
24) SIGXCPU
25) SIGXFSZ
26) SIGVTALRM
27) SIGPROF
28) SIGWINCH
29) SIGIO
30) SIGPWR
31) SIGSYS
32) SIGRTMIN
33) SIGRTMIN+1
34) SIGRTMIN+2
35) SIGRTMIN+3
36) SIGRTMIN+4
37) SIGRTMIN+5
38) SIGRTMIN+6
39) SIGRTMIN+7
40) SIGRTMIN+8
41) SIGRTMIN+9
42) SIGRTMIN+10
43) SIGRTMIN+11
44) SIGRTMIN+12
45) SIGRTMIN+13
46) SIGRTMIN+14
47) SIGRTMIN+15
48) SIGRTMAX-15
49) SIGRTMAX-14
50) SIGRTMAX-13
51) SIGRTMAX-12
52) SIGRTMAX-11
53) SIGRTMAX-10
54) SIGRTMAX-9
55) SIGRTMAX-8
56) SIGRTMAX-7
57) SIGRTMAX-6
58) SIGRTMAX-5
59) SIGRTMAX-4
60) SIGRTMAX-3
61) SIGRTMAX-2
62) SIGRTMAX-1
63) SIGRTMAX
, . kill.
killall
kill. , , . ,
mc. ,
killall mc
, .
. man-.
Linux . . ,
.
, . . nice renice.
464
V. Linux
nice
nice
, . , . nice
- , .
root. nice :
nice -number command
top , 5.
root ,
number.
renice
renice, nice, . :
renice -number PID
. , , 24
( ) . , .
29.
465
at
at,
. at , , : .
01:01. , <Enter> <Ctrl>+<D>
:
at 1:01
ls
echo "Time is 1:01"
, at .
root
. at
/etc/at.allow /etc/at.deny. /etc/at.allow ,
at, /etc/at.deny ,
.
batch
batch at. , batch
at b. ? , .
, .
batch , ,
.
batch , ;
<Ctrl>+<D>.
batch.
cron
Cron , , ,
at, . , . , , , .
cron . cron
at crontab.
, cron .
V. Linux
466
cron crontab.
crontab-
, , .
crontab .
, .
, , :
_ _
. cron , (*).
, 10 01 01 * * , (*) ,
. . 29.3 cron.
29.3. cron
. 0 59
. 0 23, 0
, .
1 12, 1
0 7 (0 7 ) , Mon
, cron:
:
01 * * * * /usr/bin/script
8:20:
20 8 * * *
/usr/bin/script
6 :
00 6 * * 0 /usr/bin/script
7:40 :
40 7 1 * * /usr/bin/script
cron
crontab. .
29.
467
crontab:
- ( -
, EDITOR);
-r crontab- ;
-l .
cron. /etc/cron.allow /etc/cron.deny, /etc/at.allow /etc/at.deny.
www.tts.esoo.ru/~lesenka/linux/slack_book.html , -
, . Slackware Linux. .
30
, . , , , .
, , .
, , ,
.
, ,
, , ,
.
,
UNIX- . , ,
, , , . : ,
, ,
, .
.
Linux .
Linux
ACLs (Access Control Lists, ) POSIX ACLs
Linux. Linux ACLs
, ,
- , .
30.
469
getfacl setfacl .
getfacl
. 30.1 getfacl vasya.
30.1
getfacl
/home/vasya
file: home/vasya
owner: vasya
group: users
user::rwx
group::--other:---
470
V. Linux
, .
setfacl. :
setfacl - ACL_, ACL_,...,ACL_ _
_ ...
ACL- :
[d:][u:][] [:[+|^]_]
. , -;
[d:] g:[] [:[+|^]_] , , ;
[d:] m [:[+|^] _] ;
[d:] o [:[+|^] _] .
ACL:
-s ACL- ;
-m ();
-x ACL.
30.2 setfacl vasya.
30.2
setfacl -s u::rwx,g::---,o:---,u:us1:rwx,g:usrs2:rx,u:us2:--- /home/vasya
getfacl /home/dh
file: home/vasya
owner: vasya
group: users
user::rwx
user:us1:rwx
user:us2:--group::--group:usrs2:r-x
mask:rwx
other:---
, .
,
, , ,
. ,
30.
471
, .
.
, ,
. .
,
. . , .
, , , , ICQ, . .
.
SSL (Secure Sockets
Layer). HTTP (HTTPS),
SMTP, POP3,
IMAP .
, SSL Linux Windows, Stunnel.
, .
Stunnel
,
.
Stunnel . Stunnel , ,
V. Linux
472
. Stunnel ,
.
telnet- ( , SSH) ( ).
Stunnel :
stunnel -d 999 -r 23
c , , 1055, 999 .
telnet- . telnet
:
telnet localhost 1055
, .
.
Stunnel , SSL
,
SSL, SSL.
Stunnel , SSL.
, SSL.
30.3 SSL-.
30.3
https
443/tcp
smtps
465/tcp
nntps
563/tcp
imap4-ssl
585/tcp
sshell
614/tcp
# SSLshell
ldaps
636/tcp
ftps-data
989/tcp
ftps
990/tcp
telnets
992/tcp
imaps
993/tcp
ircs
994/tcp
pop3s
995/tcp
30.
473
Stunnel ,
( ) . -v. -v :
0 ;
1 , . , ;
2 .
, ;
3
.
, .
, , stunnel.pem.
, Stunnel.
,
.
, .
SATAN
. SATAN
. , , , .
root, Perl.
SATAN Web- ,
Web-.
" ",
, . Start the scan .
Reporting & Data Analysis,
, .
Portsentry
, . Portsentry:
;
, , , ;
474
V. Linux
syslogd
, .
Portsentry portsentry.conf.
portsentry.conf ,
:
= ""
:
TCP_PORTS TCP-,
Portsentry. Portsentry
, ,
. TCP-,
, ;
UDP_PORTS , TCP_PORTS, UDP-;
ADVANCED_PORTS_TCP TCP-, Portsentry Advanced Stealth Scan Detection Mode.
1, . . ADVANCED_PORTS_TCP,
2048, 1 2048;
ADVANCED_PORTS_UDP , ADVANCED_PORTS_TCP, UDP-;
ADVANCED_EXCLUDE_TCP TCP-,
, ADVANCED_PORTS_TCP. TCP-,
;
ADVANCED_EXCLUDE_UDP , ADVANCED_EXCLUDE_TCP, UDP-;
IGNORE_FILE IP- ,
, Portsentry;
HISTORY_FILE Portsentry.
, IP , ,
;
BLOCKED_FILE , , ;
BLOCK_TCP
Portsentry :
0 , ;
1 ;
2 .
KILL_RUN_CMD;
30.
475
. IP- $TARGET$.
$PORT$ , ;
KILL_HOSTS_DENY , /etc/hosts.deny
, inetd;
KILL_RUN_CMD ,
;
SCAN_TRIGGER Portsentry ,
Portsentry . 0 ;
PORT_BANNER ,
Portsentry .
portsentry.ignore IP- , .
Portsentry . Portsentry.
:
Classic Portsentry ,
TCP_PORTS UDP_PORTS, .
.
-tcp TCP- -udp
UDP-;
Enhanced Stealth Scan Detection TCP_PORTS UDP_PORTS
. Stealth-,
. Classic, , . -stcp TCP-
-sudp UDP-;
Advanced Stealth Scan Detection 1 ADVANCED_PORT_TCP ADVANCED_PORT_UDP. ,
ADVANCED_EXLUDE_TCP
ADVANCED_EXCLUDE_UDP, . , , . -atcp TCP- -audp
UDP-.
476
V. Linux
: , , /
. , log-,
log-,
.
NeTraMet
IP- : SMTP, ICMP, HTTP, FTP, UDP, TCP
. . .
:
NeTraMet - .
;
NeMaC - NeTraMet.
;
srl NeMaC;
fd_filter NeMaC;
fd_extract fd_filter.
NeTraMet
:
-i network_interface ,
NeTraMet;
-l , ;
-m 614 UDP-, NeTraMet c NeMaC;
-r password_for_read ;
-w password_for_write_and_read /;
-f 60000 NeTraMet.
, , .
NeMaC
:
-k 120 120 NeMaC ,
NeTraMet;
-F /var/ntm.log/$DATER.flows ;
-m 614 NeTraMet;
-c 900 NeTraMet 15 ;
-p .
, ;
-L /var/ntm.log/$DATER.nemac NeMaC;
-r /root/ntm.sh/short.3.rules c .
30.
477
. , log-?
log-
syslogd.
syslogd sysklogd, : syslogd klogd. Syslogd ,
klogd .
syslogd
syslogd
, .
syslogd /var/log/* .
log-, syslogd, : ,
, , .
. 30.1 syslogd.
30.1. syslogd
-d
-f file
-h
, .
-n
, syslogd init
-p socket
UNIX /dev/log
-r
-s socket
, syslog
-v
syslogd
/etc/syslog.conf. -f. 30.4
.
478
V. Linux
30.4
#
#kern.*
/dev/console
# info
# /var/log/messages
#
*.info;mail.none;authpriv.none;cron.none
/var/log/messages
# .
# /var/log/secure
authpriv.*
/var/log/secure
# log- /var/log/maillog.
mail.*
/var/log/maillog
# cron /var/log/cron
cron.*
/var/log/cron
# crit
# /var/log/spooler
uucp,news.crit
/var/log/spooler
# /var/log/boot.log
local7.*
/var/log/boot.log
: ,
, . :
debug ;
info ;
notice ;
warn ;
err ;
emerg .
. warn , err . , , . *,
.
30.
479
, ,
log- , .
UDP. /etc/service syslog 514/udp.
/etc/syslog.conf:
@hostname, hostname ,
.
/etc/hosts, syslogd
, DNS.
klogd
klogd
Linux. . 30.2
klogd.
30.2. klogd
-c n
-d
-f file
syslogd
-i
-I
-k file
-n
. ,
init
-o
,
. /
-s
klogd
-v
klogd
klogd ,
.
(kernel panic).
.
480
V. Linux
, ?
? ,
. ,
, .
, . ,
,
? .
. - , sendmail, ,
- , , " " , , ,
.
. ,
, , , -
, ,
- . , - .
, rootkit.
Rootkit
Rootkit ( ) ,
. Rootkit (,
,
, )
, log-, ,
, , ps, netstat, ifconfig,
killall, login.
rootkit ,
. telnetd
sshd. ,
, . rootkit
, .
30.
481
rootkit , , ,
ps, w, who, netstat, ls, find, login ,
.
rootkit, , ,
.
-.
, , RPM , MD5. RPM ,
RPM. ,
. .
RPM, ,
, RPM.
RPM , .
, Tripwire AIDE, .
, rootkit ,
.
rootkit, (Loadable Kernel Module, LKM), , .
rootkit
, ? , .
. rootkit . ,
, . top . , .
482
V. Linux
, ,
. ,
.
nmap,
1 65 535, . , , , , .
"" 1023, 10 000.
nmap, lsof.
.
lsof i
RPM
, rootkit RPM
, . RPM . , , .
RPM , , . RPM . 9.
rootkit
chkrootkit rootkit. Chkrootkit ,
rootkit .
rootkit, ,
rootkit.
chkrootkit :
chkrootkit rootkit;
ifpromisc ;
chklastlog, chkwtmp, check_wtmpx log-;
chkproc "" .
chkrootkit ,
.
30.
483
rootkit?
.
, , .
RPM-
.
rpm -U --force rpm_package_name.rpm
, .
, chkrootkit, .
"" top ps . , ,
.
LIDS
LIDS (Linux Intrusion Detection/Defense System) .
Linux, . LIDS , , , , . . root,
.
Linux, ,
LIDS,
, LIDS. LIDS. - LIDS, ,
.
LIDS ,
, ,
/ .
, ,
log- .
, LIDS
.
LIDS, Linux.
, .
484
V. Linux
, Linux LIDS.
Code maturity level options
Prompt for development and/or incomplete code/drivers.
General setup Sysctl support.
Linux Intrusion Detection System.
LIDS. LIDS :
[*] Linux Intrusion Detection System support (EXPERIMENTAL)
LIDS LIDS:
Maximum protected objects to manage ;
Maximum ACL subjects to manage LIDS;
Maximum ACL objects to manage
LIDS;
Maximum protected proceeds ;
Hang up console when raising securit alert ,
;
Security alert when execing unprotected programs before sealing LIDS ;
Do not execute unprotected programs before sealing LIDS
;
Try not to flood logs LIDS
log- ;
Authorized time between two identic logs (seconds)
, , log-;
Allow switching LIDS protections
LIDS .
;
Numbers of attempts to submit password
, LIDS
;
Time to wait after fail (seconds) ,
LIDS ;
Allow remote users to switch LIDS protections
LIDS. ;
30.
485
LIDS. ;
Allow reloading config. File LIDS ;
Port Scanner Detector in kernel ;
Send security alerts through network
.
;
Hide klids network threads LIDS;
Number of connection tries before giving up SMTP-;
Sleep time after a failed connection ;
Message queue size . ;
LIDS debug LIDS.
.
LIDS
LIDS /etc lids, :
lids.cap ;
lids.net LIDS;
lids.pw .
lidsadm;
lids.conf .
lidsadm.
(capabilities) - . LIDS
. LIDS
, ,
.
lids.cap :
[+|-] :
486
V. Linux
:
+ ;
- .
lids.cap .
,
, , lidsadm.
LIDS lids.cap
:
CAP_CHOWN
;
CAP_DAC_OVERRIDE , root,
.
root , ;
CAP_DAC_READ_SEARCH , ,
;
CAP_FOWNER ,
, ;
CAP_FSETID SUID- SGID- , root;
CAP_KILL root "" ;
CAP_SETGID root
, ;
CAP_SETUID root
, ;
CAP_SETPCAP ;
CAP_LINUX_IMMUTABLE S_IMMUTABLE
S_APPEND ;
CAP_NET_BIND_SERVICE ,
, 1024;
CAP_NET_BROADCAST ;
CAP_NET_ADMIN :
, , , Linux;
CAP_NET_RAW ;
CAP_IPC_LOCK root ;
CAP_IPC_OWNER root
, root;
CAP_SYS_MODULE ;
30.
487
CAP_SYS_RAWIO / ,
lidsadm I
/etc/rc.d/rc.local,
, .
LIDS lidsadm. Lidsadm
. /etc/lids/lids.conf.
lidsadm -L
30.5.
488
V. Linux
30.5
LIST
Subject ACCESS TYPE Object
----------------------------------------------------Any File READ /sbin
Any File READ /bin
Any File READ /boot
Any File READ /lib
Any File READ /usr
Any File DENY /etc/shadow
/bin/login READ /etc/shadow
/bin/su READ /etc/shadow
Any File APPEND /var/log
Any File WRITE /var/log/wtmp
/sbin/fsck.ext2 WRITE /etc/mtab
Any File WRITE /etc/mtab
Any File WRITE /etc
/usr/sbin/sendmail WRITE /var/log/sendmail.st
/bin/login WRITE /var/log/lastlog
/bin/cat READ /home/xhg
Any File DENY /home/httpd
/usr/sbin/httpd READ /home/httpd
Any File DENY /etc/httpd/conf
/usr/sbin/httpd READ /etc/httpd/conf
/usr/sbin/sendmail WRITE /var/log/sendmail.st
/usr/X11R6/bin/XF86_SVGA NO_INHERIT RAWIO
/usr/sbin/in.ftpd READ /etc/shadow
/usr/sbin/httpd NO_INHERIT HIDDEN
: , .
, LIDS. ,
.
, , , LIDS, .
, . :
READ ;
WRITE ;
DENY - ;
APPEND ;
IGNORE .
30.
489
LIDS, .
LIDS .
, LIDS , Linux
LIDS,
security=0. , LILO :
LILO boot: linux security=0
Portsentry
( ) . Portsentry:
UNIX-;
, ,
;
log- syslogd ;
, .
Portsentry , .
, RPM-.
LogSentry
LogSentry log
. .
Tripwire
tripwire ,
.
, .
tripwire, , , ,
( ) , ,
. .
, , .
.
tripwire Linux.
490
V. Linux
AIDE
AIDE ,
. AIDE ,
,
.
tripwire,
.
RSBAC
RSBAC Linux , Linux . , , , ,
RSBAC.
:
(, , );
;
;
;
.
RSBAC , , , ( ).
, RSBAC, ,
.
RSBAC ,
.
Security-Enhanced Linux
Security-Enhanced Linux RSBAC
, . Security Enhanced Linux (National Security
Agency, NSA). Security-Enhanced Linux ,
.
RSBAC Security-Enhanced Linux ,
.
.
.
30.
491
Lists).
bog.pp.ru/work/tripwire.html Bog BOS: Tripwire: ,
.
freshmeat.net/projects/netramet/ NeTraMet.
gazette.linux.ru.net/lg75/articles/rus-maiorano.html Ariel Maiorano. AIDE. . .
linuxrsp.ru/artic/portsentry.html . . Portsentry.
linuxrsp.ru/artic/posixacls.html . . .
linuxrsp.ru/artic/stunnel.html . . Stunnel: .
linuxsecurity.com ,
Linux.
rootshell.com , .
stunnel.mirt.net Stunnel.
www.chkrootkit.org chkrootkit.
www.cs.tut.fi/~rammer/aide.html AIDE.
www.false.com/security/linux/ Secure Linux patches by Solar Designer Linux, .
www.insecure.org nmap
.
www.lids.org LIDS.
www.linuxrsp.ru/artic/lids.html . . LIDS .
www.monkey.org/~dugsong/dsniff - Dsniff.
www.psionic.com Psionic Software, Portsentry.
www.softerra.ru/freeos/16901/ Oktay Altunergil. Rootkit.
.
www.softerra.ru/freeos/16999/ Oktay Altunergil. Rootkit. .
www.softerra.ru/freeos/17032/ . .
www.tripwire.org Tripwire.
. . Linux . 2001. 4.
linux.ru.net/~inger/RSBAC-DOC-ru.html RSBAC.
www.opennet.ru/docs/RUS/netramet/index.html . TCP/IP NeTraMet.
REFERENCE MANUAL NeTraMet & NeMaC. Nevil Brownlee.
31
UNIX- ,
X Window,
( )
. UNIX
, , , ,
.
: Telnet, SSH, r- .
.
Telnet
Telnet , :
Telnet-;
Telnet-;
Telnet-.
Telnet
Telnet RFC854. , Telnet , , , , . , "" () "" ( ).
Telnet ,
TCP. Telnet:
(Network Virtual Terminal, NVT);
;
" ".
31.
493
.
.
. . Telnet Telnet-
,
. .
Telnet " , ".
, ,
, . ,
7- ASCII,
8- .
. , .
, . ,
Telnet.
. UNIX- termcap. Telnet-
.
TERM. , .
.
Telnet
. 31.1 Telnet .
31.1. Telnet
EOF
236
SUSP
237
ABORT
238
EOR
239
SE
240
V. Linux
494
31.1 ()
NOP
241
Data Mark
242
Break
243
BRK
Interrupt Process
244
Abort Output
245
246
Erase Character
247
Erase Line
248
Go Ahead
249
( )
SB
250
WILL
251
( , )
WON'T
252
( )
DO
253
( )
DON'T
254
(
, )
IAC
255
Telnet TCP- ,
. Telnet
, , IAC
(Interpret as Command, ) 255.
255, .
, Telnet
. IAC. .
- telnet
telnet Telnet-,
UNIX- Windows.
:
telnet <_>
telnet . 31.2.
31.
495
31.2. telnet
Telnet- <host>
<port>.
IP-,
close
Telnet-
Quit
telnet
"" Telnet-
.
Exit
Mode <type>
<type> line,
, character
Send <argument>
Telnet,
- telnetd
telnetd , Telnet.
telnetd TCP- 23, .
telnetd
: , , , .
Telnet
Telnet
. ,
. , telnet (, SMTP POP3),
(,
).
Telnet . - ,
. Telnet SSH
OpenSSH.
496
V. Linux
r-
, Telnet, , , r- (remote-).
rlogin
rlogin (remote login) UNIX-
. RFC1282
Rlogin. rlogin TCP-
. .rhosts,
, . "",
.
rsh
rsh (remote shell) , .
rcp
rcp (remote copy) ,
.
, .
rsync
rsync rcp
. , rcp, ,
.
(links), (device), , .
rdist
, , . . , , .
r-
Telnet, r-
, r-
.
31.
497
SSH OpenSSH
SSH
, , . X Window TCP-.
, , SSH
OpenSSH.
SSH
SSH , , (Telnet, X11, RSH, FTP). (SSH1 RSA, SSH2
RSA/DSA), . .
TCP 22.
, , .
. , , , .
TCP .
.
: SSH1 SSH2. . SSH2 ,
.
SSH2.
, , .
OpenSSH
SSH . SSH1 SSH2. r-.
OpenSSH .
OpenSSH
OpenSSH . SSH1 , . r- , .
OpenSSH . sshd_config, ssh_config.
498
V. Linux
sshd_config
sshd_config SSH- .
:
AllowGroups <---->
, ;
AllowTcpForwarding yes/no TCP Forwarding;
AllowUsers <---> ;
AuthorizedKeysFile <----> , ;
Banner <--> ,
;
Ciphers SSH2: aes128cbc, 3des-cbc, blowfish-cbc, cast128-cbc, arcfour;
ClientAliveInterval <> , , ;
ClientAliveCountMax <>
;
DenyGroups <----> , ;
DenyUsers <---> , ;
GatewayPorts no/yes ;
HostbasedAuthentication no/yes
( SSH2);
HostKey <----> , ,
;
IgnoreRhosts yes/no .rhosts .shosts .
;
IgnoreUserKnownHosts no/yes
~/.ssh/known_hosts rhosts+RSA;
KeepAlive yes/no
;
KerberosAuthentication yes/no Kerberos
;
KerberosOrLocalPasswd yes/no ,
Kerberos ,
/etc/passwd;
KeyRegenerationInterval 3600 ;
31.
499
ListenAddress 0.0.0.0 , ;
Port;
LoginGraceTime <> , ,
;
LogLevel INFO . : QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG;
MACs <---> , : hmac-md5, hmac-sha1,
hmac-ripemd160, hmac-sha1-96, hmac-md5-96;
MaxStartups 10 , ;
PasswordAuthentication yes/no ;
PermitEmptyPasswords no/yes ;
PermitRootLogin yes/no/without-password/forced-commands-only -
root ;
PidFile <-> , PID ;
Port 22 , ;
PrintMotd yes/no /etc/motd
;
Protocol 2 , ;
PubkeyAuthentication yes/no
;
ReverseMappingCheck no/yes
,
;
RhostsAuthentication no/yes .rhosts /etc/hosts.equiv;
RhostsRSAAuthentication no/yes
.rhosts- RSA-;
RSAAuthentication yes/no SSH1;
ServerKeyBits 768 ;
StrictModes yes/no ;
SyslogFacility AUTH , syslog: DAEMON,
USER, AUTH, LOCAL0, LOCAL1, LOCAL2, LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7;
UseLogin no/yes login ;
X11DisplayOffset 10 X11.
500
V. Linux
, SSH
SSH :
/etc/nologin ,
root. ;
/etc/hosts.allow libwrap ;
/etc/hosts.deny libwrap ;
~/.rhosts " ", .
RhostsAuthentication RhostsRSAAuthentication.
r-;
~/.shosts .rhosts, r-;
/etc/hosts.equiv , ,
, .
.
r-;
/etc/shosts.equiv hosts.equiv,
r-;
~/.ssh/environment "",
.
:
/usr/local/etc/ssh_host_key ;
/usr/local/etc/ssh_host_rsa_key , -
RSA;
/usr/local/etc/ssh_host_dsa_key , -
DSA;
/usr/local/etc/ssh_host_key.pub ;
/usr/local/etc/ssh_host_rsa_key.pub , RSA;
/usr/local/etc/ssh_host_dsa_key.pub , DSA.
ssh_config
SSH- Host. , :
Host <> ,
; , * ?;
BatchMode no|yes / ;
CheckHostIP yes|no
known_hosts;
Cipher 3des|blowfish ;
31.
501
ClearAllForwardings no|yes ;
Compression no|yes ;
CompressionLevel <->
SSH1;
ConnectionAttempts
<-->
;
EscapeChar <>|<^>|none -
;
FallBackToRsh no|yes RSH ,
SSH-;
ForwardAgent no|yes , ;
GatewayPorts no|yes ;
GlobalKnownHostsFile <-> /usr/local/etc/ssh_known_
hosts ;
HostKeyAlgorithms ssh-rsa,ssh-dss (SSH2);
IdentityFile <-> , RSA- DSA ;
KeepAlive yes|no ;
KerberosAuthentication yes|no Kerberos-;
LogLevel INFO , . : QUIET, FATAL, ERROR,
INFO, VERBOSE, DEBUG;
MACs hmac-md5, hmac-sha1, hmac-ripemd160, hmac-sha1-96, hmac-md5-96 ;
NumberOfPasswordPrompts 3 ;
PasswordAuthentication yes/no ;
Port 22 , ;
PreferredAuthentications publickey, password, keyboard-interactive (SSH2);
Protocol <--> ;
ProxyCommand ;
PubkeyAuthentication yes|no
(SSH2);
RhostsAuthentication yes|no
.rhosts (SSH1);
StrictHostKeyChecking ask|no|yes
know_hosts;
502
V. Linux
UsePrivilegedPort yes|no -
;
User <-> ;
UserKnownHostsFile <-known_hosts>
known_hosts;
UseRsh no|yes RSH , SSH .
:
~/.ssh/identity RSA1- ;
~/.ssh/id_dsa DSA2- ;
~/.ssh/id_rsa RSA2- ;
~/.ssh/identity.pub RSA1- ;
~/.ssh/id_dsa.pub DSA2- ;
~/.ssh/id_rsa.pub RSA2- .
SSH
,
SSH . :
-D ;
-b <> (SSH1), 768;
-d , ;
-e stderr syslog (. . ,
);
-f <--> , ;
-g <-> ;
-h <--> ;
-k <> ;
-p <> , ;
-q syslog (. .
);
-t
;
-u <> , <>, utmp IP-: -u0 IP-;
-4 IPv4;
-6 IPv6.
31.
503
SSH
, :
-a ;
-A ;
-b <> ;
-c blowfish|3des (SSH1);
-c <----> ; : aes128-cbc, 3des-cbc,
blowfish-cbc, cast128-cbc, arcfour, aes192-cbc, aes256-cbc (SSH2);
-D <-> SOCKS4- ;
-e <> | <^> | none Escape- ;
none ;
-f ;
-F <-->
;
-g ;
-i <-> , RSA/DSA- ;
-k Kerberos;
-l <-> , ;
-m <----> ;
-n /dev/null stdin ;
-p <> ;
-P ,
;
-R <->:<>:<-> , ;
-s , sftp;
;
-t -tty;
-T -tty;
-x X11;
-X X11;
-1 SSH1-;
-2 SSH2-;
-4 IPv4;
-6 IPv6.
504
V. Linux
, OpenSSH
, OpenSSH , , , , r-.
ssh-keygen
ssh-keygen , . RSA-.
. . 1024.
.pub. .
:
:
ssh-keygen [-t rsa1|dsa|rsa] [-b <>] [-N <->]
[-C <>] [-f <-->] [-q]
:
ssh-keygen -c [-P <->] [-C <>]
[-f <-->]
OpenSSH
SECSH SSH:
ssh-keygen -e [-f <-->]
SSH2 SECSH -
OpenSSH:
ssh-keygen -i [-f <-->]
:
ssh-keygen -p [-P <-->] [-N <-->]
[-f <-->]
ssh-agent
ssh-agent RSA/DSA-. , SSH. ,
ssh-agent . ,
ssh-agent , stdout .
ssh-agent:
-c stdout csh;
-s stdout sh;
-k SSH_AGENT_PID.
31.
505
ssh-add
. , ssh-agent.
, DISPLAY,
, SSH_ASKPASS. , ,
ssh/scp/sftp.
ssh-add:
( ~/.ssh/identity);
-L , ssh-add;
-d ;
-D .
sftp
sftp (secure FTP) SFTP-, Subsystem sshd.
sftp , FTP-,
SSH. , FTP .
:
[<>@]<->[:<>/] FTP , , , ;
-b <->
;
-C ;
-F <---ssh> , ;
-o <> SSH.
sftp FTP-:
bye ;
cd <> ;
lcd <> ;
chgrp gid <-> ;
chmod mode <-> ;
chown uid <-> ;
exit ;
get [-P] <--> [<-->]
, -P ;
help ;
lls [<-ls> [<->]] ;
506
V. Linux
lpwd ;
mkdir <> ;
put [-P] <--> [<-->]
, -P , ;
pwd ;
quit ;
rename <-> <-> ;
rmdir <> ;
rm <-> ;
symlink <-> <-> .
scp
scp, rcp, ,
. SSH. SSH
. :
[[<>@]<>:]<>
-c <-> SSH;
-i <-> , SSH;
-o <> SSH;
-p , ;
-r ;
-B ;
-C ;
-F <-> -
-P <> ;
-S <>
-4 IPv4;
-6 IPv6.
SSH;
ssh-keyscan
ssh-keyscan , . .
:
-t <-> (RSA1, RSA, DSA);
-T <> -;
-f <-> ,
;
-4 IPv4;
-6 IPv6;
-p <-> .
31.
507
RFC854 Telnet.
lib.ru/LABIRINT/telnet.htm
.
www.bog.pp.ru/work/ssh.html Bog BOS: SSH OpenSSH: ,
.
www.mnet.uz/citforum/internet/services/index.shtml . . Internet. .
www.openssh.com SSH.
www.ssh.com SSH.
www.tigerlair.com/ssh/faq/ SSH FAQ.
32
Firewall
, . , Firewall (, ). "" ( ) .
( ) , , .
. ,
, , .
, .
.
, . , , , - .
,
. "", , ,
.
:
;
;
.
,
, .
(),
,
. .
32. Firewall
509
""
, ,
. :
;
;
proxy-.
, , .
IP-, , .
. ,
. ,
. , ,
, .
Proxy- , . proxy- , .
, proxy-. , proxy- ,
. , , .
, :
;
.
, .
. , ,
(HTTP, FTP . .), ,
.
, -,
" ", . ,
, :
, . , ,
.
510
V. Linux
"" ,
. Linux
, ICMP-, UDP- TCP-.
. ,
.
:
;
;
.
,
. ,
, , .
, .
, , IP- , TCP UDP, TCP- ICMP-.
. ,
,
. , , ,
(chains). "" ,
,
.
, .
.
,
.
. , , IP- ,
, . , , , .
32. Firewall
511
:
, , ;
, , .
, , , ,
.
, ( , ).
,
,
. ,
, , ,
. ,
, , - ,
, .
, , . , , .
. , , . ,
, .
, , .
(ACCEPT), (DENY)
, . . (REJECT).
, ?
(REJECT) , ICMP . (DENY) , .
,
. -, , -,
. ,
"" .
512
V. Linux
, , "" .
,
.
,
, , . , , "" , .
1. . ,
, , . , .
2. IP-, , . IP- IP- ,
IP-, . . , :
10.0.0.0 10.255.255.255;
172.16.0.0 172.31.255.255;
192.168.0.0 192.168.255.255.
3. IP- D, . D, , 224.0.0.0 239.255.255.255 .
4. IP- 240.0.0.0
247.255.255.255.
, .
5. IP- ,
. ,
127.0.0.1, 127.... , .
6. IP- . , . IP- 0.0.0.0.
32. Firewall
513
IP- .
, IP-
.
IP-, .
, IP- ,
, IP- . , ""
,
-, "" .
,
, ,
. ,
.
. , . , .
, ,
- , . , .
, . , ,
, .
TCP-
, TCP-, . .
, , SYN,
ACK . TCP-
514
V. Linux
. , , ACK, SYN .
. , , ACK, TCP- .
"" ,
.
, , . ,
.
, ,
, , .
,
IP- . .
, ,
.
, .
, , , , .
, .
, ,
, ,
.
.
, .
, .
32. Firewall
515
, ,
,
.
. , , ICQ.
, , ,
.
- , ,
.
,
. , .
ipchains
,
.
Linux,
. 2.02.2 ipchains. 2.4 ipchains,
iptables, 2.6 iptables.
, input, output forward
(, ),
Linux.
. ,
, , .
.
. ,
input ,
, , . , , ,
, output .
, : ACCEPT, REJECT DENY.
, , . ,
, .
V. Linux
516
ipchains .
:
ipchains
-|I [<>] [-i <>] [- <>] [ [!] -]
[-s <> [<> [: <>]]]
[-d <> [<> [: <>]]] j
<> [l]
, ,
. IP , IP-, .
ipchains IP-
0 32, . , , . , 32, ,
, .
, , 32. , 192.168.0.45
, 192.168.0.45/32.
ipchains
. 32.1 ipchains.
32.1. ipchains
- [<>]
.
input, output forward. ,
-I
[<>]
-i
<>
,
. ,
- <>
TCP/IP, . ,
.
tcp, udp, icmp all. , /etc/protocols
, TCP-,
SYN , ACK .
, SYN ACK
,
TCP-, ACK
. ! ,
ACK
32. Firewall
517
32.1 ()
-s <>
[<>]
. , , .
, ,
. ,
, .
, (, 1024:65535).
s ,
-d <>
[<>]
.
, , .
,
, . ,
,
.
, (,
1024:65535). d ,
-j
,
(ACCEPT, REJECT DENY). forward MASQ (masquerade )
<>
-1
, ( /var/log/messages)
, . . 32.2
, .
32.2. ,
EXTERNAL_INTERFACE = "eth0"
, ( )
LAN_1="192.168.1.0/24"
LAN_IPADDR_1="192.168.1.1"
LOOPBACK_INTERFACE = "lo"
IPADDR = "ipaddress"
V. Linux
518
32.2 ()
ANYWHERE ="any/0"
LOOPBACK="127.0.0.0/8"
CLASS_A ="10.0.0.0/8"
CLASS_B ="172.16.0.0/12"
CLASS_C ="192.168.0.0/16"
CLASS_D_MULTICAST
="224.0.0.0/4"
Class_E_Reserved_Net
="240.0.0.0/5"
E.
BROADCAST_SRC
="0.0.0.0"
BROADCAST_DEST
="255.255.255.255"
NAMESERVER = "mydns"
DNS-
SMTP_GATEWAY="isp.server"
POP_SERVER="isp.server"
POP-
NEWS_SERVER="isp.server"
NEWS-
IMAP_SERVER="isp.server"
IMAP-
PRIVPPORTS="0:1023"
UNPRIVPORTS="1024:65535"
SSH_PORTS="1000:1023"
SSH 24-
. , , .
.
, . ,
.
32. Firewall
519
, . , , , .
,
, . , , , ICMP- . , , ,
, ,
, .
, , , .
;
, , :
ipchains P input
DENY
ipchains P output REJECT
ipchains P forward REJECT
, ,
.
, , , . .
. . -
,
.
V. Linux
520
, ,
.
. :
ipchains A
ipchains A
input
output
-i $LOOPBACK_INTERFACE -j ACCEPT
-i $LOOPBACK_INTERFACE -j ACCEPT
, , ,
. , :
ipchains -A input
-i
$EXTERNAL_INTERFACE
-s
$IPADDR
-j
DENY
-1
,
. , ,
, . ,
, ,
. , - , , , ,
, , .
,
:
ipchains -A input
ipchains -A output
-i $EXTERNAL_INTERFACE
-i
$EXTERNAL_INTERFACE
-s
$LOOPBACK
-j DENY
-s
$LOOPBACK
-j DENY
-l
,
IP-, .
, .
, IP-,
,
, .
32.1
,
, , .
32. Firewall
521
32.1
# ,
# ,
# ,
# .
ipchains -A input
-i $EXTERNAL_INTERFACE -s $CLASS_A -j DENY
ipchains -A input
-i $EXTERNAL_INTERFACE -d $CLASS_A -j DENY
ipchains -A output -i $EXTERNAL_INTERFACE -s $CLASS_A -j DENY -l
ipchains -A output -i $EXTERNAL_INTERFACE -d $CLASS_A -j DENY -l
# ,
# ,
# B,
# .
ipchains -A input
-i $EXTERNAL_INTERFACE -s $CLASS_B -j DENY
ipchains -A input
-i $EXTERNAL_INTERFACE -d $CLASS_B -j DENY
ipchains -A output -i $EXTERNAL_INTERFACE -s $CLASS_B -j DENY -l
ipchains -A output -i $EXTERNAL_INTERFACE -d $CLASS_B -j DENY -l
# ,
# ,
# C,
# .
ipchains -A input
-i $EXTERNAL_INTERFACE -s $CLASS_C -j DENY
ipchains -A input
-i $EXTERNAL_INTERFACE -d $CLASS_C -j DENY
ipchains -A output -i $EXTERNAL_INTERFACE -s $CLASS_C -j DENY -l
ipchains -A output -i $EXTERNAL_INTERFACE -d $CLASS_C -j DENY -l
, , :
ipchains -A input
ipchains -A input
-i $EXTERNAL_INTERFACE -s
-i $EXTERNAL_INTERFACE -d
$BROADCAST_DEST -j DENY -l
$BROADCAST_SRC -j DENY -l
255.255.255.255. 0.0.0.0.
, .
. :
# , D.
ipchains -A input -i $EXTERNAL_INTERFACE -s $CLASS_D_MULTICAST -j DENY -l
ipchains -A output -i $EXTERNAL_INTERFACE -s $CLASS_D_MULTICAST j REJECT -l
V. Linux
522
UDP. ,
,
, .
, :
ipchains -A output -i $EXTERNAL_INTERFACE -d $CLASS_D_MULTICAST -j REJECT -l
ICMP-
ICMP ,
. ,
, ping traceroute. . 32.3 ICMP-, .
32.3. ICMP-
Echo Reply
ping
Destination
Unreachable
Source Quench
Redirect
,
,
Echo Request
ping
11
Time Exceeded
,
, ,
12
Parameter Problem
:
Source Quench ;
Parameter Problem ;
Destination Unreachable ( Fragmentation Needed)
( );
Destination Unreachable ( Fragmentation Needed)
( ).
32. Firewall
523
ICMP- .
Echo Request (-), Echo Reply (-), Destination Unreachable, Time Exceeded
( ). ,
.
, , . 32.3 Redirect ().
. .
, .
Source Quench
, ,
Source Quench, .
,
Source Quench.
Parameter Problem
Destination Unreachable
524
V. Linux
, .
, Destination Unreachable .
Fragmentation Needed Destination Unreachable
.
.
, traceroute, ,
Port Unreachable Destination Unreachable.
Time Exceeded
ping , :
ipchains A input -i $EXTERNAL_INTERFACE -p icmp -s $MY_ISP 8 d $IPADDR j ACCEPT
ipchains A output -i $EXTERNAL_INTERFACE -p icmp -s $IPADDR 0 d $MY_ISP j ACCEPT
,
ping, . ,
,
. ping .
32. Firewall
525
smurf-
smurf ping, Echo
Request, . IP-
IP- "" IP- ,
. , Echo
Request, "", ICMP. , , .
, 32.2,
smurf-. ICMP-
, .
, Echo Request,
. , ping.
32.2
# smurf-
ipchains A input -i $EXTERNAL_INTERFACE -p icmp -d $BROADCAST_DEST j DENY -l
ipchains A output -i $EXTERNAL_INTERFACE -p icmp -d $BROADCAST_DEST j REJECT -l
#
ipchains A input -i $EXTERNAL_INTERFACE -p icmp -d $NETMASK j DENY -l
ipchains A output -i $EXTERNAL_INTERFACE -p icmp -d $NETMASK j REJECT l
#
ipchains A input -i $EXTERNAL_INTERFACE
, , . .
() .
, FTP, HTTP . ., . , , ,
, .
DNS
V. Linux
526
:
ipchains A
$NAMESERVER
ipchains A
$NAMESERVER
, UDP-, TCP-.
DNS-.
:
ipchains A
$NAMESERVER
ipchains A
$NAMESERVER
DNS-, (, ),
DNS- . , 32.3.
32.3
# DNS-
ipchains A input -i $EXTERNAL_INTERFACE p udp -s <clients.addr> $UNPRIVPORTS
-d $IPADDR 53 j ACCEPT
ipchains A output -i $EXTERNAL_INTERFACE p udp -s <clients.addr>
$UNPRIVPORTS -d $IPADDR 53 j ACCEPT
# DNS-
ipchains A input -i $EXTERNAL_INTERFACE p udp -s <clients.addr> 53 -d
$IPADDR j ACCEPT
ipchains A output -i $EXTERNAL_INTERFACE p udp -s <clients.addr> 53 -d
$IPADDR j ACCEPT
TCP:
ipchains A input -i $EXTERNAL_INTERFACE p tcp -s <dns.sec> $UNIPRIVPORTS -d
$IPADDR 53 j ACCEPT
ipchains A output -i $EXTERNAL_INTERFACE p tcp ! y -s $IPADDR 53 -d
<dns.sec> $UNIPRIVPORTS j ACCEPT
:
SMTP 25 TCP;
POP3 110 TCP;
IMAP 143 TCP.
, SMTP-, , .
32. Firewall
527
SMTP- :
ipchains A input -i $EXTERNAL_INTERFACE p tcp -s $IPADDR $UNIPRIVPORTS -d
$SMTP_GATEWAY 25 j ACCEPT
ipchains A output -i $EXTERNAL_INTERFACE p tcp ! y -s $SMTP_GATEWAY 25 -d
$IPADDR $UNIPRIVPORTS j ACCEPT
,
SMTP-, :
ipchains A input -i $EXTERNAL_INTERFACE p tcp -s $IPADDR $UNIPRIVPORTS -d
$ANYWHERE 25 j ACCEPT
ipchains A output -i $EXTERNAL_INTERFACE p tcp ! y -s $ANYWHERE 25 -d
$IPADDR $UNIPRIVPORTS j ACCEPT
POP3 IMAP.
POP3- :
ipchains A input -i $EXTERNAL_INTERFACE p tcp -s $IPADDR $UNIPRIVPORTS -d
$POP_SERVER 110 j ACCEPT
ipchains A output -i $EXTERNAL_INTERFACE p tcp ! y -s $POP_SERVER 110 -d
$IPADDR $UNIPRIVPORTS j ACCEPT
POP3-:
ipchains A input -i $EXTERNAL_INTERFACE p tcp -s <pop.clients> $UNIPRIVPORTS
-d $IPADDR 110 j ACCEPT
ipchains A output -i $EXTERNAL_INTERFACE p tcp ! y -s $IPADDR 110 -d
<pop.clients> $UNIPRIVPORTS j ACCEPT
IMAP-, :
ipchains A input -i $EXTERNAL_INTERFACE p tcp -s $IPADDR $UNIPRIVPORTS -d
$IMAP_SERVER 143 j ACCEPT
ipchains A output -i $EXTERNAL_INTERFACE p tcp ! y -s $IMAP_SERVER 143 -d
$IPADDR $UNIPRIVPORTS j ACCEPT
, IMAP-:
ipchains A input -i $EXTERNAL_INTERFACE p tcp -s <pop.clients> $UNIPRIVPORTS
-d $IPADDR 143 j ACCEPT
ipchains A output -i $EXTERNAL_INTERFACE p tcp ! y -s $IPADDR 143 -d
<pop.clients> $UNIPRIVPORTS j ACCEPT
NNTP
119 TCP.
.
, :
ipchains A input -i $EXTERNAL_INTERFACE p tcp -s $IPADDR $UNIPRIVPORTS -d
$NEWS_SERVER 119 j ACCEPT
ipchains A output -i $EXTERNAL_INTERFACE p tcp ! y -s $NEWS_SERVER 119 -d
$IPADDR $UNIPRIVPORTS j ACCEPT
528
V. Linux
,
, :
ipchains A output -i $EXTERNAL_INTERFACE p tcp -s <ip.clients> $UNIPRIVPORTS
-d $NEWS_SERVER 119 j ACCEPT
ipchains A input -i $EXTERNAL_INTERFACE p tcp ! y -s $NEWS_SERVER 119 -d
<ip.clients> $UNIPRIVPORTS j ACCEPT
, :
ipchains A output -i $EXTERNAL_INTERFACE p tcp -s $IPADDR $UNIPRIVPORTS -d
$NEWS_SERVER 119 j ACCEPT
ipchains A input -i $EXTERNAL_INTERFACE p tcp ! y -s $NEWS_SERVER 119 -d
$IPADDR $UNIPRIVPORTS j ACCEPT
Telnet
, 32.5,
SSH-.
32.5
ipchains A input -i $EXTERNAL_INTERFACE p tcp -s $ANYWERE $UNIPRIVPORTS -d
$IPADDR 22 j ACCEPT
ipchains A output -i $EXTERNAL_INTERFACE p tcp ! y -s $IPADDR 22 -d
$ANYWHERE $UNIPRIVPORTS j ACCEPT
32. Firewall
529
FTP
32.6 ,
.
32.6
ipchains A input -i $EXTERNAL_INTERFACE p tcp ! y -s $ANYWHERE 20 -d
$IPADDR $UNPRIVPORTS j ACCEPT
ipchains A output -i $EXTERNAL_INTERFACE p tcp -s $IPADDR $UNPRIVPORTS -d
$ANYWERE 20 j ACCEPT
ipchains A output -i $EXTERNAL_INTERFACE p tcp -s $IPADDR $UNPRIVPORTS -d
$ANYWERE $UNPRIVPORTS j ACCEPT
ipchains A input -i $EXTERNAL_INTERFACE p tcp ! y -s $ANYWHERE $UNPRIVPORTS
-d $IPADDR $UNPRIVPORTS j ACCEPT
FTP- ,
, 32.7.
32.7
ipchains A input -i $EXTERNAL_INTERFACE p tcp -s $ ANYWERE $UNPRIVPORTS -d
$IPADDR 21 j ACCEPT
ipchains A output -i $EXTERNAL_INTERFACE p tcp ! y -s $IPADDR 21 -d
$ANYWERE $UNPRIVPORTS j ACCEPT
ipchains A output -i $EXTERNAL_INTERFACE p tcp -s $IPADDR 20 -d $ANYWERE
$UNPRIVPORTS j ACCEPT
ipchains A input -i $EXTERNAL_INTERFACE p tcp ! y -s $ANYWHERE $UNPRIVPORTS
-d $IPADDR 20 j ACCEPT
ipchains A input -i $EXTERNAL_INTERFACE p tcp -s $ANYWHERE $UNPRIVPORTS -d
$IPADDR $UNPRIVPORTS j ACCEPT
ipchains A output -i $EXTERNAL_INTERFACE p tcp ! y -s $IPADDR $UNPRIVPORTS
-d $ANYWHERE $UNPRIVPORTS j ACCEPT
V. Linux
530
HTTP
HTTP 80 TCP.
Web- ,
:
ipchains A output -i $EXTERNAL_INTERFACE p tcp -s $IPADDR $UNPRIVPORT -d
$ANYWHERE 80 j ACCEPT
ipchains A input -i $EXTERNAL_INTERFACE p tcp !-y -s $ANYWHERE 80 -d $IPADDR
$UNIPRIVPORTS j ACCEPT
Web-,
, :
ipchains A input -i $EXTERNAL_INTERFACE p tcp -s $ANYWHERE $UNIPRIVPORTS -d
$IPADDR 80 j ACCEPT
ipchains A output -i $EXTERNAL_INTERFACE p tcp ! y -s $IPADDR 80 -d
$ANYWHERE $UNIPRIVPORTS j ACCEPT
, ,
, , .
""
, , .
:
ipchains I input
-i $EXTERNAL_INTERFACE
-s </> j DENY
, .
, , . , .
-
, .
. :
ipchains A input i $INTERNAL_INTERFACE -s LAN j ACCEPT
ipchains A output i $Internal_INTERFACE -s LAN_1 j ACCEPT
32. Firewall
531
, .
, , , .
, .
, ,
:
, ;
, .
, , - . .
, , IP-,
, , ,
, proxy.
, , ,
proxy-, , . , , ,
,
proxy-. , , .
, , ,
. :
ipchains -A input -i $INTERNAL_INTERFACE -S LAN_1 -j ACCEPT ipchains -A output
-i $INTERNAL_INTERFACE -d LAN_1 -j ACCEPT
, .
, , - .
532
V. Linux
, , :
#
ipchains -A input -i $LAN_INTERFACE_1 -s LAN_1 -j ACCEPT ipchains -A output -i
$LAN_INTERFACE_1 -d LAN_1 -j ACCEPT
ipchains -A input -i $LAN_INTERFACE_2 -s LAN_2 -j ACCEPT ipchains -A output -i
$LAN_INTERFACE_2 -d LAN_2 -j ACCEPT
,
:
ipchains -A forward -i $LAN_INTERFACE_2 -s LAN_1 -d LAN_2 -j ACCEPT
ipchains -A forward -i $LAN_INTERFACE_1 -s LAN_2 -d LAN_1 -j ACCEPT
:
IP-
.
. .
Linux ,
. IP-
, , , .
, ,
. IP- ,
, ,
, . . IP-
.
.
IP-, ,
.
, , ipchains .
, ,
.
IP-
. proxy- .
, :
ipchains A forward I $EXTERNAL_INTERFACE s LAN_1 j MASQ
32. Firewall
533
,
IP- , , . .
. ,
. , .
proxy- ,
SOCKS. , . , , .
, ,
. . -
534
V. Linux
, , , . , , .
, ,
.
.
.
proxy-
, , . ,
, , . , (choke), .
,
. , . , .
.
. , . , .
, , .
, (choke). , -,
.
- , . , , . , - , ,
-.
, , , - .
, -, .
.
, , .
, , , , .
32. Firewall
535
,
.
, .
, ,
.
, , .
, , ,
, . ,
.
, .
,
, .
. . .
.
.
.
, ,
.
, : input output. , ,
, , , .
"", , , , , , DNS. - ,
DNS, IP-.
, DNS.
ipchains.
.
, . , v.
-v, ,
536
V. Linux
. -
.
- , , -l ipchains.
/var/log/messages.
, , , /etc/sysconfig/network, .
,
, ,
.
, /var/log/messages .
, , , -l. ,
. , /var/log/messages , .
, ,
, .
-L ipchains. -L , ipchains
, .
:
ipchains -L input
ipchains -L output
ipchains -L forward
ipchains
.
input, output forward .
ipchains ipchains-save,
,
. - ipchains-restore, .
Iptables
Iptables ipchains. , , , . iptables
32. Firewall
537
iptables. , , :
CONFIG_PACKET , , : tcpdump snort;
CONFIG_NETFILTER ,
;
CONFIG_IP_NF_CONNTRACK ( , (masquerading));
CONFIG_IP_NF_FTP FTP-;
CONFIG_IP_NF_IPTABLES , (NAT) ;
CONFIG_IP_NF_MATCH_LIMIT
. , -m limit --limit 3/
minute ,
. , " ";
CONFIG_IP_NF_MATCH_MAC ,
MAC-;
CONFIG_IP_NF_MATCH_MARK MARK,
, , , , ;
CONFIG_IP_NF_MATCH_MULTIPORT /
;
CONFIG_IP_NF_MATCH_TOS ,
TOS . TOS Type Of Service;
CONFIG_IP_NF_MATCH_TCPMSS MSS
TCP-;
CONFIG_IP_NF_MATCH_STATE ipchains. TCP, (state);
CONFIG_IP_NF_MATCH_UNCLEAN IP-, TCP-, UDP- ICMP- ;
CONFIG_IP_NF_MATCH_OWNER "" (socket).
, root ;
CONFIG_IP_NF_FILTER filter, . input, forward output;
CONFIG_IP_NF_TARGET_REJECT REJECT,
ICMP- ,
;
CONFIG_IP_NF_TARGET_MIRROR
;
V. Linux
538
CONFIG_IP_NF_NAT .
,
IP-;
CONFIG_IP_NF_TARGET_MASQUERADE . NAT, , IP- . , NAT, ,
IP-;
CONFIG_IP_NF_TARGET_REDIRECT .
, ;
CONFIG_IP_NF_TARGET_LOG (syslog);
CONFIG_IP_NF_TARGET_TCPMSS ,
, ICMP-
Fragmentation Needed;
CONFIG_IP_NF_COMPAT_IPCHAINS ipchains;
CONFIG_IP_NF_COMPAT_IPFWADM ipfwadm.
. 32.4 ,
.
32.4.
mangle
prerouting
nat
prerouting
.
.
, :
mangle
forward
forward mangle
,
filter
forward
forward ,
. . ,
32. Firewall
539
32.4 ()
mangle
postrouting
nat
postrouting
NAT
.
(. 32.5).
32.5.
mangle
prerouting
nat
prerouting
mangle
input
filter
input
(. 32.6).
32.6. ,
mangle
output
nat
output
(NAT) ,
V. Linux
540
32.6 ()
filter
output
mangle
postrouting
, , ,
. , ,
nat
postrouting
. , DROP
mangle
mangle, , :
TOS;
TTL;
MARK.
TOS Type of Service . .
TTL TTL (Time To Live) .
MARK ,
iptables .
"" ,
. .
nat
(Network Address Translation, NAT) :
DNAT (Destination Network Address Translation) ( );
SNAT (Source Network Address Translation) . , IP-
;
MASQUERADE () , SNAT,
, MASQUERADE .
, , , IP- ,
SNAT IP- . MASQUERADE IP-.
32. Firewall
541
filter
.
( ACCEPT DROP
) .
iptables
iptables. , ipchains.
, , , , ,
. :
iptables [-t table] command [match] [target/jump]
[-t table],
filter, ,
.
,
iptables. , .
[match] , ,
.
: IP- , IP- , ,
, . .
, , [target]
.
ipchains
. 32.7 .
:
.
32.7. iptables
-A, --append
-D, --delete
iptables -D INPUT
--dport 80 -j DROP,
iptables -D INPUT 1
.
,
-D,
.
,
,
,
,
.
1
V. Linux
542
32.7 ()
-R, --replace
iptables -R INPUT 1
-s 192.168.0.1 -j DROP
-I, --insert
iptables -I INPUT 1
--dport 80 -j ACCEPT
.
, ,
,
-L, --list
iptables -L INPUT
. ,
-F, --flush
iptables -F INPUT
. ,
,
-Z, --zero
iptables -Z INPUT
.
,
-N, --newchain
iptables -N allowed
-X, --deletechain
iptables -X allowed
-P, --policy
. ,
,
-E, --renamechain
iptables -E allowed
disallowed
.
.
TCP- TCP-.
UDP- UDP-.
ICMP- ICMP-.
: state, owner, limit .
32. Firewall
543
(. 32.8) ,
.
32.8.
-p, --protocol
iptables -A INPUT -p
tcp
-s, --src,
--source
iptables -A INPUT -s
192.168.1.1
IP- . ,
, IP-.
<address>/<mask>,
192.168.0.0/255.255.255.0, 192.168.0.0/24. !, ,
-d, --dst,
--destination
iptables -A INPUT -d
192.168.1.1
IP- .
IP-, . !
-i, --ininterface
iptables -A INPUT -i
eth0
, .
input,
forward prerouting.
.
! . +, ,
-o, --outinterface
iptables -A FORWARD
o eth0
.
output, forward postrouting. , -o +. !
.
+,
,
-f, --fragment
iptables -A INPUT -f
, , , /
, ICMP-
. !
, !
-f (. . ! f)
.
: TCP, UDP ICMP
ALL.
!
V. Linux
544
TCP-
TCP- (. 32.9).
--protocol tcp.
32.9. TCP-
--sport,
--source-port
iptables -A INPUT -p
tcp --sport 22
,
.
.
,
, --source-port 22:80.
!
--dport,
--destination
-port
iptables -A INPUT -p
tcp --dport 22
--tcp-flags
iptables -p tcp
--tcp-flags
SYN,FIN,ACK SYN
TCP-.
, .
SYN, ACK, FIN,
RST, URG, PSH,
ALL NONE. ! .
,
--syn
iptables -p tcp
--syn
--tcp-flags SYN,ACK,FIN SYN.
TCP. ,
,
--tcp-option
iptables -p tcp
--tcp-option 16
, TCP .
!
UDP-
UDP- (. 32.10).
-protocol udp.
32. Firewall
545
32.10. UDP-
--sport,
--source-port
iptables -A INPUT -p
udp --sport 53
,
.
.
.
!
--dport,
--destination
-port
iptables -A INPUT -p
udp --dport 53
, .
--source-port
ICMP-
ICMP- (. 32.11). --protocol icmp.
32.11. ICMP-
--icmp-type
iptables -A INPUT -p
icmp --icmp-type 8
ICMP
,
-m --match. state, -m state (. 32.12).
32.12.
--limit
iptables -A INPUT -m
limit --limit 3/hour
" " .
.
: /second, /minute, /hour, /day
--limit-burst
iptables -A INPUT -m
limit --limit-burst 5
burst limit
limit. , , ,
( --limit)
. ,
burst limit ,
--limit-burst. , --limit
V. Linux
546
32.12 ()
--mac-source
iptables -A INPUT -m
mac --mac-source
00:00:00:00:00:01
--mark
iptables -t mangle
-A INPUT -m mark
--mark 1
, "". MARK
--source-port
iptables -A INPUT -p
tcp -m multiport
--source-port
22,53,80,110
.
15 .
,
--destinationport
iptables -A INPUT -p
tcp -m multiport
--destination-port
22,53,80,110
--port
iptables -A INPUT -p
tcp -m multiport
--port 22,53,80,110
--uid-owner
iptables -A OUTPUT
-m owner --uid-owner
500
--gid-owner
iptables -A OUTPUT
-m owner --gid-owner 0
"" Group ID
(GID)
--pid-owner
iptables -A OUTPUT
-m owner --pid-owner 78
"" Process
ID (PID)
--sid-owner
iptables -A OUTPUT
-m owner --sid-owner 100
Session ID
--state
iptables -A INPUT -m
state --state
RELATED,ESTABLISHED
(state). : INVALID
, ,
; ESTABLISHED ,
; NEW ; RELATED
,
--tos
iptables -A INPUT -p
tcp -m tos --tos
0x16
TOS.
--ttl
iptables -A OUTPUT
-m ttl --ttl 60
TTL
MAC- ,
. MAC-
XX:XX:XX:XX:XX:XX. prerouting, forward input
32. Firewall
547
, , .
, ,
, .
, , . .
-j , .
: , ,
, , .
, , ,
.
iptables ,
. ,
,
, . ACCEPT, .
ACCEPT
ACCEPT,
.
.
-j ACCEPT.
DNAT
DNAT (Destination Network Address Translation) IP- . , DNAT, .
DNAT prerouting output
nat .
DROP
. ,
ACCEPT.
LOG
LOG- .
IP- . dmesg
syslogd.
548
V. Linux
MARK
. mangle.
, , ,
.
MASQUERADE
IP- , . MASQUERADE
"" .
MASQUERADE postrouting nat.
MIRROR
MIRROR source destination destination source.
input, forward prerouting,
, .
QUEUE
QUEUE .
.
REDIRECT
REDIRECT .
REDIRECT ""
(transparent proxying), proxy.
REJECT
, DROP, ,
, .
REJECT
RETURN
, ,
(, input), .
RETURN
SNAT
, . . IP- IP- . SNAT nat, postrouting.
32. Firewall
549
,
.
TOS
TOS Type of Service IP- .
TTL
Time To Live IP- . TTL
mangle .
ULOG
ULOG . LOG,
. , ( , MySQL . .)
.
iptables
iptables.
Iptables-save
iptables-save
, iptables-restore. :
iptables-save [-c] [-t table]
-c ( --counters) iptables-save .
-t ( --table) . -t , .
Iptables-restore
iptables-restore , iptables-save. Iptables-restore . :
iptables-restore [-c] [-n]
-c ( --counters) .
V. Linux
550
-n ( --noflush) iptables-restore ,
. iptables-restore
.
Ipchains-HOWTO.
bog.pp.ru/work/ipchains.html Bog BOS: ipchains: Linux:
, .
gazette.linux.ru.net/rus/articles/iptables-tutorial.html Andreasson O. Iptables
Tutorial 1.1.19. . .
. Linux: . ; . . .: -
"", 2000.
33
. , .
xDSL - , Ethernet ,
.
, , .
,
, , , Web- . .
, ,
, ,
.
, Linux ,
.
,
():
Networking support ( );
TCP/IP networking ( TCP/IP);
IP forwarding/gatewaying ( IP-);
IP multicasting ( IP-);
IP firewalling ( );
IP accounting ( IP);
Network device support ( ).
,
, , PPP
(Point-to-Point Protocol).
, , IP- . .
552
V. Linux
. , , , , .
Linux pppd, chat , , .
:
PPP ( SLIP, ). ( ). ,
.
,
dial on demand ( ). diald, ,
, diald . diald .
, .
,
:
,
;
pppd, chat diald;
ipchains iptables;
( );
proxy-;
.
, , .
, , ,
- . , .
33.
553
, , ,
, . -.
. :
1. PPP-.
2. (diald).
,
Linux . " PPP- Linux".
PPP? PPP
SLIP:
IP- PPP pppd,
IP-;
, , , ,
, , SLIP.
, . 33.1.
33.1.
(login)
Myname
(password)
Vasya
IP- ( )
192.168.0.100
IP- DNS
192.168.10.1
:
;
;
PPP-.
Linux ,
- . ,
,
PPP-.
. Red Hat :
/etc/ppp /etc/sysconfig/network-scripts. -
554
V. Linux
.
, :
/etc/ppp/chap-secrets chap. . :
myname * vasya;
/etc/ppp/pap-secrets pap. .
:
myname * vasya;
/etc/ppp/ip-up .
:
/usr/sbin/pppd
;
/etc/ppp/ip-down ;
/etc/ppp/options , , . ,
, pppd .
/etc/ppp/options ,
/etc/ppp/options.ttSX,
ttSX , .
ttS0 (COM1).
33.1 /etc/ppp/options.ttSX.
33.1
#
/dev/ttyS0
#
115200
mru 1500
# :
192.168.0.100:192.168.0.101
#
netmask 255.255.255.0
bsdcomp 0
chap-interval 15
debug
crtscts
defaultroute
33.
555
,
, , .
192.168.0.100:192.168.0.101,
IP- .
, IP. ,
. IP- .
, route ,
. , (
, ),
defaultroute, , .
pppd
pppd (. 33.2).
33.2. pppd
asyncmap 0
auth
bsdcomp 0
. ,
chap-interval
, pppd
chap-restart
chap (
challenges)
chap-max-challenge
chap challenge
connect <>
Crtscts
Debug
.
, pppd .
log- syslog.
/etc/syslog.conf
V. Linux
556
33.2 ()
disconnect <>
,
pppd
domain _
ipcp-max-configure
IPCP configurerequest
ipcp-max-terminate
IPCP terminaterequest
ipcp-max-failure
ipcp-restart
IPCP
local
lock
, pppd lock
UUCP
login
modem
mru
mtu
name _
( )
noauth
noipdefalut
, IP-, IP- .
IP- IPCP- (
options)
pap-restart
PAP
pap-max-authreq
33.
557
33.2 ()
passive
silent
user
, PAP.
name
xonxoff
+chap
chap-
+pap
pap-
-all
LCP IPCP
-am
asyncmap
-chap
chap-
-d
. , pppd .
log- syslog. /etc/syslog.conf
-detach
-ip
IP-
-mru
mru
-pap
pap-
-pc
,
.
diald
diald ,
rpm .
diald
.
, ,
diald. .
V. Linux
558
, . , diald ,
, ,
-. , -
. -,
diald .
,
. , .
. - , . ,
- . -
, , diald .
.
:
/etc/diald/connect;
/etc/diald.conf;
- /etc/diald/standard.filter.
: /etc/diald/connect
, : , PPP-. ,
, . , diald.
33.2 /etc/diald/connect.
33.2
#!/bin/sh
NIT="ATZ"
PHONE="223322"
ACCOUNT="myname"
PASSWORD="vasya"
#
#
# FIFO- diald
function message ()
{
[ $FIFO ] && echo "message $*" >$FIFO
logger -p local2.info -t connect "$*"
}
33.
559
#
#
message "*** Initializing Modem ***"
chat "" $INIT OK ""
if [ $? != 0 ]
then
message "!!! Failed to initialize modem !!!"
exit 1
fi
#
message "*** Dialing system
***"
chat \
ABORT "NO CARRIER" \
ABORT BUSY \
ABORT "NO DIALTONE" \
ABORT ERROR \
"" ATDT$PHONE \
CONNECT ""
case $? in
0) message "*** Connected ***";;
1) message "!!! Chat Error !!!"; exit 1;;
2) message "!!! Chat Script Error !!!"; exit 1;;
3) message "!!! Chat Timeout !!!"; exit 1;;
4) message "!!! No Carrier !!!"; exit 1;;
5) message "!!! Busy !!!"; exit 1;;
6) message "!!! No DialTone !!!"; exit 1;;
7) message "!!! Modem Error !!!"; exit 1;;
*) esac
#
message "*** Send login and password ***"
chat \
login: $ACCOUNT \
password: $PASSWORD
TIMEOUT 5 ""
if [ $? != 0 ] then
message "!!! Failed to send !!!"
exit 1
fi
# !
message "*** Protocol started *** "
, 33.2,
, .
560
V. Linux
: /etc/diald.conf
/etc/diald.conf diald, . diald ,
, diald.
33.3 diald.conf.
33.3
#
mode ppp
# diald.log
accounting-log /var/log/diald.log
#
# FIFO diald.ctl.
fifo /etc/diald/diald.ctl
# /etc/diald/connect
connect /etc/diald/connect
# , .
# /etc/ppp/options,
#
# /etc/ppp/options
# device /dev/modem
# speed 115200
# modem
# lock
# crtscts
#
# . IP-
# ,
# ,
# TCP/IP-.
# PPP diald
local 192.168.0.100
remote 192.168.0.101
# IP
dynamic
#
#
defaultroute
#
dial-fail-limit 10
33.
561
#
redial-timeout 5
# connect
connect-timeout 120
# -
include /etc/diald/standard.filter
-: /etc/diald/standard.filter
, -.
diald, . . IP-. diald ,
standard.filter . , ,
.
, . ( , , ). diald " ".
lynx ( , , http://www.bhv.ru), ping.
, . . lynx ,
! . , PPP- IP-
. , .
, .
,
. Web-, . diald .
, , . (/var/log/messages).
.
, . diald . -
, TCP/IP , , -.
562
V. Linux
, .
Web- , , ,
Linux. .
. .
,
pppd. pppd , options ( 33.4) .
33.4
#
/dev/ttyS0
#
115200
mru 1500
noauth
# :
192.168.0.100:192.168.0.101
#
netmask 255.255.255.0
bsdcomp 0
chap-interval 15
debug
crtscts
-detach
defaultroute
,
, .
192.168.0.100:192.168.0.101
IP- .
, IP. IP- .
,
defaultroute,
, .
33.
563
, pppd
. , , ?
inittab, pppd . :
7 : 2345 : respawn: /usr/sbin/pppd file /etc/ppp/options.ttyS0 >
/var/log/pppS0.log
,
. -
, inittab,
( , , ).
, , ping:
ping lazzycat.com
, .
, , .
(/var/log/messages).
-. . - , TCP/IP , ,
-.
, . . ,
, ( ),
(, ), ( ).
, , .
. . ,
.
proxy-
, , . proxy. proxy-? , -
564
V. Linux
proxy-, - , , - , , , ,
, proxy-. proxy-
, proxy- Web-,
, , . proxy-, .
proxy Squid proxy-, FTP, Gopher HTTP. Squid , proxy-, DNS- (
, DNS-),
SSL, .
Squid , .
Transparent proxy
Transparent proxy proxy-, , . , .
, proxy-
, proxy-.
, proxy-.
, proxy.
transparent proxy
(), , 80,
proxy-.
Web-,
, .
Squid , .
:
proxy- : , ;
transparent proxy;
proxy .
( )
, , , 1024 ,
.
33.
565
,
(, 512 ), 256 .
Squid. Squid
23.
Squid, , traffic shaper.
. traffic shaper,
, .
. , , .
traffic shaper .
. , , "" , traffic shaper,
, . , .
traffic shaper CBQ.
tc, iproute2.
- , log- .
, , , , Web-. MRTG (Multi Router Traffic Grapher) RRDtool
(Round Robin Database).
MRTG
MRTG HTML- , , . Perl, SNMP, , C, HTML- GIF/PNG.
MRTG
(cpuinfo, df, squid . .)
.
MRTG , .
. 33.1.
V. Linux
566
. 33.1. MRTG
MRTG
MRTG mrtg.cfg, . , , , .
:
;
, ;
;
#.
, mrtg.cfg :
Include: _ ;
WorkDir: _ , , HtmlDir, ImageDir LogDir;
HtmlDir: _ ;
33.
567
ImageDir: _ ; -
HtmlDir ;
LogDir: _ ;
Refresh: ;
RunAsDaemon: no | yes MRTG ;
Interval: MRTG;
IconDir: , ;
Forks: , ;
WriteExpire: no | yes .meta apache;
NoMib2: no | yes sysUptime, sysName;
Language: _ (
);
LogFormat: rrdtool rrdtool
;
LibAdd: --rrdtool RRDs.pm rrdtool;
PathAdd: -rrdtool rrdtool.
( target) , . MRTG
target (target.log target.old),
(target-day.gif, target-week.gif, target-month.gif, target-year.gif) HTML-
(target.html).
Target[target]: :community@
[:port[:timeout[:retries[:backoff[:2]]]]]
:
;
community ;
IP-;
port SNMP;
timeout ;
retries ;
backoff timeout ;
2 64- ;
Target[target]: ------
:
;
;
, ;
, ;
RouterUptime[target]: community@ target;
MaxBytes[target]: , ,
;
568
V. Linux
Title[target]: HTML-;
PageTop[target]: , HTML-;
PageFoot[target]: , HTML-;
AddHead[target]: HTML-, TITLE HEAD;
MaxAbs[target]:
MaxByte;
Unscaled[target]: [d][w][m][y]
(d , w , m , y );
WithPeak[target]: [w][m][y] ,
, (w , m ,
y );
Supress[target]: [d][w][m][y] (d
, w , m , y );
Directory[target]: - ,
target;
XSize[target]: ;
YSize[target]: ;
YTics[target]: ;
Step[target]: ;
Options[target]: ---:
growright ;
bits 8 ( );
perminute 60 ( );
perhour 3600 ( );
transparent ;
gauge .
, , ;
unknaszero 0, ;
kilo[target]: kilo. 1000, 1024;
kMG[target]: --
kilo, mega . . : "K, M, G, T, P";
Colours[target]:
Colouri#RRGGBB,Colouri#RRGGBB,Colouri#RRGGBB,Colouri#RRGGBB
, Colour , , i = 1, 2, 3, 4 , RRGGBB , RGB-;
Background[target]: #RRGGBB ;
YLegend[target]: - : "Bits per second";
ShortLegend[target]: - : "b/s".
MRTG, RRDtool.
33.
569
,
. ,
, .
, 5%.
:
, SNMP (OutOctets );
Cisco;
/proc/tty/driver/serial;
radacct (radius-accounting/ OutOctets);
ipchains;
nacctd.
ipchains.
IP-, :
ipchains -A output -d AA.BB.CC.DD -j ACCEPT
( 33.5).
33.5
ipchains -L -v
Chain input (policy ACCEPT: 4195746 packets, 1765818402 bytes):
Chain forward (policy ACCEPT: 142999 packets, 29941516 bytes):
Chain output (policy ACCEPT: 4182597 packets, 1309541595 bytes):
pkts bytes target prot opt tosa tosx ifname mark outsize source destination
ports
4 308 ACCEPT all -- 0xFF 0x00 any
anywhere AA.BB.CC.DD n/a
, 308 . bytes
. -
570
V. Linux
. Perl, linux.uatel.net.ua/ipcount.perl.
, IP- SNMP. " IP-
SNMP". .
,
, IpTraf, useripacct, netacct, ipacct.
www.linux.org.ru/books/gateway/ . . Linux
Internet.
lin-omts.airport.sakhalin.ru/departs/ccito/guide1.htm ,
Web- UNIX, , .
people.ee.ethz.ch/~oetiker/webtools/mrtg/mrtg.html MRTG.
www.mrtg.org MRTG.
rrdtool.eu.org rrdtool.
www.geocities.com/SiliconValley/Pines/7895/PPP.DOC . . PPP- Linux.
http://linux.perm.ru/doc/net/mrtg.html . .
( ) MRTG.
www.bog.pp.ru/work/rrdtool.html . . RRDtool .
linux.uatel.net.ua/ipcount.phtml IP- .
ftp://ftp.kiev.farlep.net/pub/os/linux/soft/trafficcounter-snmp
IP- SNMP.
http://www.tux.in.ua/articles/1098 RRDtool: .
HOWTO:
ISP-Hookup-HOWTO;
FIREWALLING_AND_PROXY_SERVER_HOWTO;
THE_LINUX_KERNEL_HOWTO.
34
. ,
.
. 3G-
. .
PPP
PPP - .
. , PPP - IP- .
Point-to-Point Protocol (PPP, "-") "point-to-point IP". PPP
IP-, , (Network Protocol Multiplexing), , , . PPP
Link Control Protocol (LCP, ) Network Control Protocols (NCPs, ), . PPP
IP, , IPX DECNet.
PPP
. 34.1 PPP.
,
, - , , PPP,
V. Linux
572
, .
34.1. , PPP
Demand on dial
( )
PPP-
. PPP
Redial
PPP-,
Campling
. Redial
Scripting
PPP- ,
UUCP
Parallel
PPP-
( )
Filtering
, p ,
, IP- TCP TOS (Type of Service). ,
ICMP-
Header Compression
( )
TCP- RFC1144
Server
PPP-,
Tunneling
Extra escaping
- , , ,
, ,
, , ,
.
PPP
PPP
point-to-point- :
PPP HDLC (High-Level Data Link Control, )
PPP ;
34.
573
LCP , -
;
NCP -
, PPP
.
PPP
PPP- PPP- LCP .
LCP,
PPP- NCP-
. . ,
LCP- NCP-
- , ,
.
PPP DTE/DCE, RS-232, RS-422, RS-423, CITT V.35.
, .
PPP
, PPP ISO, HDLC:
ISO 3309-1984/PDAD1 "Addendum 1: Start/stop transmission" ( 1 / );
ISO 3309-1979 HDLC ;
ISO 3309:1984/PDAD1 ISO 33091979 .
. 34.1 PPP.
2 4
. 34.1. PPP
PPP:
, . 01111110;
574
V. Linux
, 11111111, -
. PPP ;
, 00000011,
;
,
PPP. RFC;
, p , .
.
1500 . pppd ;
16 . pppd
32- .
PPP- (LCP)
PPP- (LCP) , , PPP-. LCP:
. - ( , IP) LCP
. ,
.
. LCP (
) . . ,
-
.
. LCP , NCP,
.
. LCP
. - , , .
LCP-:
;
;
.
34.
575
,
PPP
. 34.2 ,
PPP. ,
.
34.2. , PPP
ack
Acknowledgement
AO
CHAP
DES
DNA
IETF
FCS
LCP
LQR
MD4
MD5
MRU
MTU
NAK
Negative Acknowledgement
NCP
PAP
PDU
PO
Passive open
PPP
RCA
Receive Configure-Ack
RCJ
Receive Code-Reject
RCN
V. Linux
576
34.2 ()
RCR+
RER
Receive Echo-Request -
RTA
RUC
SCA
SCJ
SCN
ST-II
Stream Protocol
TO+
TO
VJ
XNS
, PPP
. 34.3 (RFC) PPP.
34.3. PPP
RFC
1144
1220
1332
1333
1334
1547
1552
1570
1598
34.
577
34.3 ()
RFC
1618
1619
1638
1661
1662
1663
1717
(dial-in)
. , . , ,
.
. PPP- , , " "
. mgetty
,
, voice mail .
mgetty
mgetty, ppp, . , , mgetty
-DAUTO_PPP, , .
mgetty .
/etc/mgetty+sendfax/login.config :
/AutoPPP/ a_ppp /usr/sbin/pppd auth refuse-chap require-pap login
- /bin/login @
mgetty :
pppd;
;
CHAP
PAP.
mgetty , ,
, PAP,
pppd, PAP.
V. Linux
578
/etc/mgetty+sendfax/mgetty.config
, 34.1.
34.1
port ttyS1
speed 115200
data-only y
debug 3
init-chat "" ATZ OK
answer-chat "" ATA CONNECT \c \r
, ,
115 200, ATZ.
mgetty inittab.
:
S4:2345:respawn:/sbin/mgetty /dev/ttyS1
, : , . , " ".
pppd
pppd 33. , .
options.tty , 34.2.
34.2
#
lock
login
auth
modem
crtscts
-chap
+pap
# :
192.168.10.100:192.168.10.101
#
netmask 255.255.255.0
# DNS Windows
ms-dns 192.168.10.100
34.
579
/etc/ppp/pap-secrets :
user1
user2
.
.
""
""
*
*
:
user1 , ,
;
user2 , ;
. ,
;
"" ,
/etc/shadow;
* IP-.
, Windows , IP- DNS- , , .
callback-
, dial-in-, - - . , , , .
dial-in- , , . callback-. .
callback-. ( dial-in-
).
. callback.
, .
,
. PPP-. .
callback-
dial-in- ,
callback. :
1. back.
2. callback.conf /etc/mgetty/.
3. /etc/mgetty/login.config
back /usr/sbin/callback -S 1234567
-S , .
V. Linux
580
, , callback. Linux.
Linux-
Linux :
1. /etc/ppp/options ( 34.3).
34.3
lock
defaultroute
noipdefault
modem
115200
crtscts
debug
passive
2. ppp-callback /etc/ppp/peers/, :
ttyS1 33600 crtscts
connect '/usr/sbin/chat -v -f /etc/ppp/chat-callback'
noauth
3. /etc/ppp/chat-callback ( 34.4).
34.4
ABORT BUSY
ABORT VOICE
ABORT "NO DIALTONE"
ABORT "NO ANSWER"
"" ATZ
OK ATDP7654321
CONNECT \d\d
ogin: \q\dback
TIMEOUT 90
RING AT&C0S0=1
ogin: \q\dvasya
assword: \q\dpasswordforvasya
chat-callback callback-, .
34.
581
4. /usr/bin/pppcall, :
#!/bin/bash
/usr/sbin/pppd -detach call ppp-callback &
.
, ,
pppcall.
MS Windows
Windows -. . , . ,
:
&c0s0=1
.
.
back.
, .
callback- .
. .
. .
.
, (, ).
(, ).
Win- ( , USB-, PCI).
, , .
Win- . ,
. Win- ,
Windows. , Win , , . ATC Win- , 44 000 / , 28 80033 600 /. , , Win-
Lucent ,
Conexant Pctel.
V. Linux
582
, Win-
Linux. , Linux , .
Linux : , .
, ( ) Linux. , , www.linmodems.org, . , .
, :
1. /etc/ppp/options ( 34.5).
34.5
lock
defaultroute
noipdefault
modem
115200
crtscts
debug
2. ppp-call /etc/ppp/peers/, :
ttyS1 115200 crtscts
connect '/usr/sbin/chat -v -f /etc/ppp/chat-call'
noauth
3. /etc/ppp/chat-call ( 34.6).
34.6
ABORT BUSY
ABORT VOICE
ABORT "NO DIALTONE"
ABORT "NO ANSWER"
"" ATZ
OK ATDP7654321
CONNECT \d\d
ogin: \q\dvasya
assword: \q\dpasswordforvasya
chat-call , .
34.
583
4. /usr/bin/pppcall, :
#!/bin/bash
/usr/sbin/pppd -detach call ppp-call &
.
, ,
pppcall.
X Window
. GNOME . . ,
, ,
. . 3G-.
3G- X Window
3G- ,
USB-. ,
3G-.
. 3G- , . ,
(. 34.2).
. 34.2.
(. 34.3), . ,
. .
(. 34.4). .
(. 34.5). .
(. 34.6). ,
. , .
(. 34.7).
. .
, (. 34.8).
584
V. Linux
. 34.3.
. 34.4.
34.
. 34.5.
. 34.6.
585
586
V. Linux
. 34.7.
. 34.8.
34.
. 34.9.
. 34.10. PPP
587
V. Linux
588
,
. , ,
(. 34.9).
PPP IP (. 34.10).
. .
3G-, , Flasch- . ,
/ . ,
usb-modeswitch usb-modeswitch-data.
, Flasch- .
PPP. .
www.linmodems.org Win-
Lucent, Connexant (Rockwell), Pctel.
www.o2.net/~gromitkc/winmodem.html Win-
Lucent, Connexant (Rockwell), Pctel.
www.idir.net/~gromitkc/winmodem.html Win Lucent, Connexant
(Rockwell), Pctel.
www.olitec.com/pci56kv2.html Win-
Connexant (Rockwell).
www.heby.de/ltmodem/ Win-
Lucent.
www.sfu.ca/~cth/ltmodem/ Win-
Lucent.
linux.uatel.net.ua/ppp-dialin.phtml PPP dial-in- (PAP).
www.softerra.ru/freeos/12279/ .
dial-in-.
www.linuxgazette.com Sunil Thomas Thonikuzhiyil. callback Linux. .
www.bdcol.ee/linux/callback.shtml Linux-callback.
www.leo.org/~doering/mgetty/ Mgetty+Sendfax.
http://koi.citforum.tula.ru/operating_systems/articles/ppp.shtml . . PPP- Linux.
pppd.
linux.yaroslavl.ru/Howto/Howto-mini/call-back-mini-HOWTO.html Callback miniHOWTO (c ).
PPP-HOWTO.
35
. ,
. , .
, . ,
. ,
.
, tar, cpio, gzip
.
:
, ;
(snapshots) . ;
.
. , .
. , ,
, ,
. .
590
V. Linux
, ,
.
( ),
.
, , , .
, , .
, ,
,
. , , , .
,
, ,
.
, . , .
cron, . ,
. ,
.
, .
,
. , (,
). , .
, ,
. , .
,
. ,
, .
35.
591
,
. .
.
.
,
(,
Windows). tar gzip,
.
.
" ", .
.
, tar cpio, .
, , .
. ,
. ,
tar, cpio dump.
,
. API
, , .
, .
, , , ,
.
, ,
. . , ,
.
.
. .
592
V. Linux
, , . , :
/proc ,
, ;
/sys /proc;
/mnt (CDROM, . .);
/tmp ;
/lost+found "" ,
;
NFS, Samba
;
, .
, ,
,
.
.
, - . , .
, , . : , RAID-
( " " ""
) .
, "" -
( ) .
. ,
, .
35.
593
FireWire USB 2.0 ( 100 .) . , . ,
.
CD-RW
CD-RW . , 20 CD-R
30 . , (
) . (700 ).
CD- .
DVD-RW
DVD-RW CD-RW
8,5 .
Blue Ray-
( 25 ) , .
.
USB Flash-
Flash- 32 60 . , .
640
4,7 , . (),
. , . ,
.
594
V. Linux
, . . ,
. ,
, ( ).
,
.
NAS
Network Attached Storage . , , .
RAID-,
. , NAS . 200 .
. . ,
.
, -,
, -,
.
, ,
.
root, GNU tar ( ) ,
(--preserve-permission).
tar UMASK.
tar ,
!
, , /etc/passwd /etc/group.
, Linux
,
.
35.
595
,
. , .
, , .
, tar, cpio dump/restore.
, .
.
tar
tar , . tar :
tar /
. , ,
,
. -, . , /r, CD-ROM, NFS Samba, .
. ,
GNU tar sparse- (, ,
, ) .
:
tar cSlzf $(backdirs) | buffer - /dev/st0
V. Linux
596
cpio
cpio
. tar
.
cpio
, tar. tar
, .
.
cpio ( , , UNIX,
. .). stdin cpio find.
, ,
:
find / -print0 I cpio 0 > /dev/st0
find /r .
find, :
find /* -fstype ext2 print0 I cpio 0 > /dev/st0
Ext2. .
.
, :
find /* -fstype ext2 print0 |
,
buffer.
35.
597
tar cpio . tar .
cpio .
, ,
(
root). cpio ,
-d.
, , :
ssh $OTHERHOST 'buffer -i /devst0', I 'find /* -fstype ext2 print0 |
cpio -id'
, cpio .
cpio tar,
. tar
. tar .
tar
, . grep,
tar . , restorelist,
, ,
ssh $OTHERHOST 'buffer -i /dev/st0' I 'tar xTf /tmp/restorelist -'
dump
dump tar
.
. ,
. restore , dump, .
dump 0 9,
0 ,
. 0
598
V. Linux
, dump
. , ,
. .
dump
dump :
dump -0u -f /dev/st0 /home
, /home. :
dump -3u -f /dev/st0 /home
, dump
, dump, restore, . restore ,
,
, .
, . , . .
restore , .
restore -i -f /dev/st0
restore >
, ls:
restore > ls
admin/ lost+found/ named/ quota.group quota.user wahib/
restore >
, add:
restore > add Personal/ restore >
delete.
extract.
restore
quit.
35.
599
AMANDA
.
AMANDA (Advanced Maryland Automatic Network Disk Archiver)
. . AMANDA .
,
. ,
.
,
.
AMANDA
dump tar. . ,
amrecover AMANDA.
mt mtx
mt mtx . mt ,
/
, , "
" .
mtx
.
buffer
buffer
, .
, . .
,
. tar cpio ,
600
V. Linux
. ,
. , , -.
36
Window
Linux
X Window (X Org), , ,
. ,
X Window,
. X Window
, , .
X Window X Org,
.
X Window (X Org)
:
X-;
Window Manager;
;
.
( ),
( ). X-, root, , , .
X-
X Window X-,
. X- /etc/X11/xorg.conf.
, : , , , , .
:
Section "-"
...
EndSection
V. Linux
602
SubSection/EndSubsection.
. 36.1 xorg.conf.
36.1. xorg.conf
Files
InputDevice
Device
Screen
ServerLayout
Module
36.1 xorg.conf
.
36.1
# Xorg configuration created by pyxf86config
Section "ServerLayout"
Identifier
Screen
"Default Layout"
0
"Screen0" 0 0
InputDevice
"Keyboard0" "CoreKeyboard"
InputDevice
"Synaptics" "CorePointer"
EndSection
Section "InputDevice"
Identifier "Keyboard0"
Driver
"kbd"
Option
"XkbModel" "pc105"
Option
"XkbLayout" "us,ru"
Option
"XkbOptions" "grp:shifts_toggle,grp_led:scroll"
EndSection
Section "InputDevice"
Identifier "Synaptics"
Driver
"synaptics"
Option
"Device" "/dev/input/mice"
Option
"Protocol" "auto-dev"
36. Window
Option
EndSection
Section "Device"
Identifier
Driver
EndSection
603
"Emulate3Buttons" "yes"
"Videocard0"
"intel"
Section "Screen"
Identifier "Screen0"
Device
"Videocard0"
DefaultDepth
24
SubSection "Display"
Viewport
0 0
Depth
24
EndSubSection
EndSection
Section "InputDevice"
Identifier
"Mouse0"
# Modified by mouseconfig
Driver
"mouse"
Option
"Device"
Option
"Protocol"
Option
"Emulate3Buttons"
Option
"ZAxisMapping"
"/dev/mouse"
"IMPS/2"
"no"
"4 5"
EndSection
Files
, X- .
, ,
. ,
koi8-r ,
.
Keyboard
,
.
Pointer
: , ,
. .
V. Linux
604
Device
. X , .
- , man X-.
Screen
,
, .
, , , X Window. , , ,
,
org configure, xorg.conf. . xorgcfg, org configure, X-
. xorgconfig , , .
- , "" ,
.
:
Modeline
"mode_name"
H1 H2 H3 H4
V1 V2 V3 V4
Flags
:
Modeline , ;
"mode_name" . , -
"__
__", "1024 768". "mode_name"
Section "Screen", Subsection "Display", Modes
"mode_name". ;
D ;
H1, H2, H3, H4 , ;
V1, V2, V3, V4 , ;
Flags .
. , .
. :
A ( ,
);
36. Window
605
B -
;
C , ;
D .
, :
H1
H2
H3
H4
=
=
=
=
A
A+B
A+B+C
A+B+C+D
. :
V1 , ;
V2 ;
V3 ;
V4 .
, , , .
X Window
X Window, .
56 :
1. startx.
2. startx xinit.
3. X Window /etc/X11/xinit/xinitrc ~/.xinitrc.
4. /etc/X11/xinit/Xclients ~/.Xclients.
5. .
6. Window Manager.
, .
Window Manager
(Window Manager)
/etc/X11/ , . ,
.
,
.
606
V. Linux
KDE GNOME.
( ), , , . ,
, .
KDE GNOME. , ( , GNOME).
. , . ,
, , , twm.
GNOME
GNOME (GNU Network Object Model Environment, GNU, ) GTK+
, Linux, BSD Solaris.
, , .
GNOME
CORBA (Common Object Request Broker Architecture), , , , .
GNOME ( ) .
. 36.1 .
, . , .
, ,
( ), root, .
36. Window
607
. 36.1. GNOME
608
V. Linux
K
Desktop
Environment. .
sky.inp.nsk.su/~bolkhov/teach/inpunix/xsetup_simple.ru.html . X Window.
gazette.linux.ru.net/lg67/articles/rus-adam.html Thomas Adam. The
Weekend Mechanic: X Window. .
gazette.linux.ru.net/lg64/articles/rus-sipos.html
XFree86.
linux.net.kg/articles/x.html X Window.
www.gnome.org GNOME.
www.kde.org KDE.
37
, , X Window ,
, ,
, . . .
.
, , ,
. : , USB Ethernet.
,
Win-, .
.
"" ,
UNIX- . ,
.
. , ,
, ,
.
. :
cat mytext.txt > /dev/lp
DOS:
copy mytext.txt > prn
, . -, -
, root . -, "" .
, ,
610
V. Linux
. , ,
, .
. , .
.
CUPS
CUPS (Common UNIX Printing System, UNIX) . ,
HTTP, LPD.
Adobe PostScript, PDF, HP-GL/2, TIFF, JPEG, PNG,
PBM, PGM, PPM, GIF, SGI, RGB, Sun Raster, Kodak Photo CDTM.
:
;
;
;
log-.
LPD
LPD (Line Printer Daemon, ) , UNIX. UNIX: - -,
.
. :
lpd ;
lpr . lpr lpd. lpr :
lpr [ ] [ _ ... ]
_ , lpr .
;
lpq . , ,
;
lpc lpd. , ,
. . lpc
, .
lpc ,
. :
disable ;
down ;
enable ;
37.
611
lprm . lprm
, , . ,
lpq, lprm.
. lpd. /etc/printcap ,
. ( - ) lpr lpd /dev/printer lpd-
, . lpd .
LPD
: HewlettPackard HP DeskJet 400. , LPD ,
.
lpd
/etc/printcap /var/spool/lpd. 37.1 /etc/printcap.
37.1
# deskjet400
lp|dj|deskjet:\
:sd=/var/spool/lpd/dj:\
:mx#0:\
:lp=/dev/lp0:\
:sh:
lp, dj deskjet,
/var/spool/lpd/dj. . /dev/lp0 , ,
. . , -, UNIX Windows , UNIX
, Windows . Windows,
V. Linux
612
. ,
:
" ", . , , ,
.
/etc/printcap ( 37.2).
37.2
# deskjet400
lp|dj|deskjet:\
:sd=/var/spool/lpd/dj:\
:mx#0:\
:lp=/dev/lp0:\
:if=/var/spool/lpd/dj/filter:\
:sh:
printcap if
of . , , /var/spool/lpd/dj/ filter.
, Perl:
#!/usr/bin/perl
while(<STDIN>){chop $_; print "$_\r\n";};
print "\f";
,
, . . PostScript .
, .
UNIX: .
printcap . ,
,
, .
(magic-filter). , -
37.
613
. :
APSFILTER lpd;
lprMagic . , Samba.
, ,
. LPD . af=
printcap, , , . , ,
- .
LPRng
LPD, ,
Linux. LPRng
LPD
( ). , . . PGP Kerberos.
netcat
Netcat .
, ,
, , .
PDQ
PDQ (Print Don't Queue, ). . , .
:
Xpdq X Window, .
Driver Options; , , . .;
Pdq . lpr . lpr, , .
PDQ :
pdq xpdq , ;
;
, ,
. .;
614
V. Linux
, , -
, PDQ, , ;
/dev/lp0, LPD, - ( , ,
. -
);
PDQ , , .
PDQ
PDQ , . PDQ /etc/printrc, .printrc.
PDQ ,
. PDQ
PDQ.
PDQ , .
:
local-port , PDQ. ;
bsd-lpd bsd-lpd LPD LPD . PDQ ,
LPD.
PDQ , ,
. , PostScript,
ASCII PostScript; PostScript , GhostScript.
PDQ, xpdq Printer | Add printer.
.
, , PDQ.
, PDQ, ,
, .
PPR
PPR , PostScript. , Appletalk, SMB LPD.
PPR, , Ghostscript
, PostScript.
37.
615
PDQ LPD
, , - .
,
LPD,
/etc/hosts.lpd. , .
/etc/printcap , 37.3.
37.3
# deskjet400
lp|dj|deskjet:\
:sd=/var/spool/lpd/dj:\
:rm=machine.out.there.com:\
:rp=printername:\
:lp=/dev/null:\
:sh:
, ,
lpd. ,
. ,
(machine.out.there.com),
(printername) , (lp=/dev/null).
-
Ethernet-
-. -,
50 .
- UNIX - Surecom.
- :
Novell NetWare IPX/SPX NDS;
TCP/IP;
DHCP IP-;
BOOTP IP-;
RARP IP-.
V. Linux
616
/var/spool/lpd/pserverd
daemon /var/spool/lpd/pserverd
daemon /var/spool/lpd/pserverd
775 /var/spool/lpd/pserverd
/etc/printcap , 37.5.
37.5
printer-name:\
:lp=:\
:rm=203.66.191.186:\
:rp=lpt1:\
:lf=/var/spool/lpd/pserverd.log:\
:sd=/var/spool/lpd/pserverd:\
:mx#0:
rm IP- -, sd , rp
-.
lpr P<printer-name> <file> ...
37.
617
Ethernet-
,
, , LPD. , ,
, , . ,
printcap Hewlett-Packard:
lj-6|remote-hplj:\
:lp=/dev/null:sh:\
:sd=/var/spool/lpd/lj-6:\
:rm=printer.name.com:rp=raw:
- X Window.
Linux , printconfgui. HP DeskJet 400.
. 37.1 , .
. 37.1.
618
V. Linux
(. 37.2)
.
. . . 37.2,
. . , .
, , . 37.3.
( ). . (. 37.4).
. 37.2. printconf-gui
. 37.3.
37.
619
. 37.4.
. 37.5.
620
V. Linux
. 37.6.
. 37.7.
. 37.8.
37.
621
. , , (. 37.5), .
, .
"" - PostScript-.
HP (. 37.6).
, .
(. 37.7) ,
, . ,
(. 37.8).
hpinkjet.sourceforge.net Hewlett-Packard
- ( 60 ).
61.251.162.120:8080 Samsung -.
ML.
- Surecom.
http://www.linuxrsp.ru/artic/print_server.html . Linux
.
linuxcenter.ru/lib/hardware/usbprinter.phtml . USB Linux.
linux.yaroslavl.ru/Docum/Rus/print.html . .
.
www.astart.com/lprng/LPRng.html LPRng.
www.freebsd.org/~andreas/#apsfilter APSFILTER:
.
metalab.unc.edu/pub/Linux/system/printing/ lprMagic: .
feynman.tam.uiuc.edu/pdq/ PDQ.
ftp://ppr-dist.trincoll.edu/pub/ppr/ PPR , PostScript.
www.Linux-USB.org , USB- Linux.
http://www.linuxdoc.org/ ,
Linux .
www.citycat.ru/linux/docs/index.html , Linux .
www.l0pht.com/~weld/netcat/ netcat- .
www.penguincomputing.com/prtools/npadmin.html npadmin . SNMP.
Linux Printing HOWTO Mark Komarinski. Linux. Alex Ott.
VI
38
, Linux ,
Linux. , , Linux .
, , . :
, ;
;
;
;
.
, ,
. .
.
Gimp Photoshop, ; , .
.
Linux .
, ,
Linux, .
,
, , "" ( ) , , .
, . . , - , ,
. ,
. Linux
, ,
VI.
626
SANE. , ,
. ,
, .
, ( ) :
SCSI;
( );
USB;
IEEE-1394.
, , , , , , , .
, ( - ) Linux- .
Linux , SCSI-,
SCSI-
SCSI-.
, USB-, - ,
- ,
Linux .
. , Windows,
, ,
Linux SANE . , . Linux
, .
. 38.1 ,
Linux, , .
38.1. , Linux
-
Acer/Benq
Prisa 620U
USB
Prisa 640U
Prisa 640BU
AcerScan 1240
AcerScan 3300
AcerScan 4300
AcerScan 5300
38.
627
38.1 ()
-
Agfa
Snapscan 1212U
USB
Snapscan 1236U
Snapscan e20
Snapscan e25
Snapscan e26
Snapscan e40
Snapscan e42
Snapscan e50
Snapscan e52
Canon
CanoScan FB630U
USB
CanoScan FB636U
CanoScan N650U
CanoScan N656U
CanoScan N670U
CanoScan N676U
Epson
GT-7000
USB
Perfection 610U
Perfection 636U
Perfection 640U
Perfection 1200U/Photo
Perfection 1240U/Photo
Perfection 1640SU
Perfection 1650/Photo
Perfection 1660
Perfection 2400
Perfection 2450
Perfection 3200
Actionscanner II
GT-5000
GT-6500
ES-300C
ES-600C
ES-1200C
VI.
628
38.1 ()
-
Epson
GT-5500
SCSI
Perfection 636S
ES-8500
GT-8000
GT-7000
Expression 1600
Expression 1680
Hewlett-Packard
ScanJet 4100C
USB
ScanJet 5200C
ScanJet 5300C
ScanJet 6200C
ScanJet 6250C
Hewlett-Packard
ScanJet 6300C
USB
ScanJet 6350C
ScanJet 6390C
ScanJet 7400c
ScanJet 7450c
ScanJet 7490c
Microtek
Scanmaker X6
USB
Scanmaker 3600
Scanmaker V6 USB
Scanmaker X12 USB
Minolta
Scan Dual II
USB
Plug-a-Scan 600CU
Plug-a-Scan 1200UB
Plug-a-Scan 1200CU
Plug-a-Scan 1200CU Plus
Mustek
Umax
Paragon 600 II N
AstraSlim SE
USB
38.
629
38.1 ()
-
Mustek
Paragon MFS-6000CX
SCSI
Umax
Paragon MFS-12000CX
Paragon MFC-600S
Paragon 600 II CD
ScanMagic 600 II SP
Paragon MFC-800S
Paragon 800 II SP
Paragon MFS-6000SP
Paragon MFS-8000SP
Paragon MFS-1200SP
Paragon MFS-12000SP
ScanExpress 6000SP
ScanExpress 12000SP
ScanExpress 12000SP Plus
Mustek
Vista S6
Umax
Vista S6E
UMAX S-6E
UMAX S-6EG
Vista-S8
Supervista S-12
UMAX S-12
UMAX S-12G
Astra 600S
Astra 610S
Astra 1200S
Astra 1220S
Astra 2200 (SU)
Astra 2400S
Astra MX3
Mirage D-16L
Mirage II
Mirage Iise
PowerLook
SCSI
VI.
630
38.1 ()
-
Mustek
PowerLook II
SCSI
Umax
PowerLook III
PowerLook 270
PowerLook 270plus
PowerLook 2000
Astra 6400
IEEE-1394
Astra 6450
PowerLook 1100
Linux
Linux USB- , , , .
. /etc/modules.conf
options scanner vendor=0x04b0 product=0x100 read_timeout=8000
USB-, ,
.
- .
read_timeout, .
USB- log-
:
hub.c: USB new device connect on bus1/1, assigned device number 5
usb.c: USB device 5 (vend/prod 0x4b0/0x100) is not claimed by any active driver.
/etc/hotplug/usb.agent: ... no drivers for USB product 4b8/110/110
,
. , /etc/hotplug/usb.distmap
:
scanner 0x0003 0x04b0 0x0107 0x000 0x000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
38.
631
,
, .
. .
SANE
Linux
, .
,
. SANE.
SANE , ,
. USB- SCSI-, , , FireWire (IEE1394), .
,
(frontends), .
SANE,
,
. /etc/sane.d/dll.conf "".
/etc/sane.d/scanner.conf:
usb /dev/usb/scanner0
:
scanimage -L -v
. , :
scanimage --help -v --device scanner:/dev/usb/scanner0
, 38.2.
632
VI.
38.2
--mode Binary|Gray|Color
--depth 8|16
--halftoning
--dropout None|Red|Green|Blue
--brightness -4..3
--sharpness -2..2
--gamma-correction
--color-correction --resolution
50|60|72|75|80|90|100|120|133|144|150|160|175|180|200|216|240|266|300|320|350|
360|400|480|600|720|800|900|1200|1600|1800|2400|
--threshold 0..255
--mirror[=(yes|no)]
--speed[=(yes|no)]
--auto-area-segmentation[=(yes|no)]
--zoom 50..250
--preview[=(yes|no)]
--preview-speed[=(yes|no)]
--source Flatbed|Transparency Unit
--film-type Positive Film|Negative Film
--focus-position Focus on glass|Focus 2.5mm above glass
(frontend) SANE
SANE SANE. .
Xsane
X Window. :
JPEG, PNG, PNM, PS, RAW,
TIFF;
;
;
-;
plug-in GIMP;
:
UNIX (Linux);
OS/2 X11;
Windows 9x/NT/2000/XP.
38.
633
xscanimage
X Window. Xsane
:
PNM;
plug-in GIMP.
QuiteInsane
X Window
. Qt.
FlScan
X Window
. FLTK.
scanimage
. , .
TkScan
SANE, TkScan
, Mustek, scanimage, SANE.
saned
.
scanadf
, .
scanlite
, Java.
.
xcam
. ,
SANE.
VI.
634
NSane
SANE NeXTStep.
VueScan
VueScan SANE.
. . Shareware,
. : , ,
, , . : , .
Linux.
www.digitalware.ru/static/dwscanners/ ,
.
www.hamrick.com/vsm.html VueScan
, .
www.scaner.ru , .
www.scaners.ru , .
www.buzzard.me.uk/jonathan/scanners-usb.html USB-, SANE.
www.mostang.com/sane SANE.
panda.mostang.com/sane/sane-backends.html .
www.qbik.ch/usb/devices/devices.php USB-, Linux, .
www.epsondevelopers.com/lscan.jsp Epson
Linux.
www.xsane.org Xsane.
www.hamrick.com/vsm.html VueScan.
sunsite.unc.edu/pub/Linux/apps/graphics/capture/ TkScan.
www.bible-mda.ru/soft/scanning/scanner-linux.html
GNU/Linux Epson Perfection 1270 Debian 4
OpenSUSE 10.2
39
""
,
Linux. , (, )
, Flash-. , "", , ,
.
? ,
Windows,
. Linux
.
Linux
, ,
, Nokia. ,
, , ,
?
, SIM-? ? , , , . ...
? , , , ,
. .
, (Siemens, Sony Ericsson, Motorola)
Bluetooth. Nokia.
Gammu (Gammu+) "" Gnokii.
. , Bluetooth-
USB-. .
, GSM-
Vi.
636
, SMS.
http://www.mwiacek.com/www/?q=gammu.
Kandy, KDE.
Linux
, , , (). :
Palm OS ();
Symbian (Epoc OS, );
Windows CE.
Linux .
Linux Palm
Palm OS
Palm, Sony Handspring, .
Palm OS
Linux, : , ( . cradle,
)
( )
.
Palm OS ,
Pilot-Link, .
,
, X Window.
Pilot-Link , .
/etc/profile:
export PILOTRATE=115200
export PILOTPORT=/dev/ttyS1
:
PILOTRATE . -
, 115 200 /. ,
, ,
,
39. ""
637
. , , : ,
;
PILOTPORT , .
pilot-xfer
. :
-b [] ;
-u [] ;
-s [] ;
-r [] ;
-i ;
-m , ;
-f ;
-d .
X Window
,
. www.freshmeat.net.
pilot , , . .
gnome-pilot
, GNOME,
, ,
. .
J-Pilot
, , J-Pilot. . 39.1.
KPilot
,
KDE. . 39.2.
Linux PocketPC
PocketPC ,
WindowsCE. , .
SynCE, synce.sourceforge.net,
WindowsCE.
, USB-.
Vi.
638
. 39.1. J-Pilot
. 39.2. KPilot
39. ""
639
, .
synce-serial-config ttySX,
ttySX , .
synce-serial-config irdaX,
irdaX , .
USB-
synce-serial-config ttyUSBX,
ttyUSBX USB-, .
,
,
dccm
, qwerty,
dccm -p qwerty
synce-serial-start ,
:
pcp ;
pls ;
pmkdir ;
pmv / ;
prm ;
prmdir ;
prun ;
pstatus ;
synce-install-cab .cab-.
SyncCE SyncCE-KDE SyncCE-GNOME.
Multisync (http://multisync.sourceforge.net).
Linux TV-
, ,
. (TV-), .
( ) . .
640
Vi.
video4linux video4linux2
Linux.
, TV- :
Bt848;
Bt849/Bt878;
Bt848a;
Bt879.
TV- .
1. , TV-
.
2. Linux
:
bttv;
I2C-;
I2C bit-banging-;
Multimedia Devices Video For Linux BT8XX Video For Linux .
3. /dev/video* , ,
:
cd /dev;
./MAKEDEV video.
4. Linux
:
/sbin/insmod bttv
5. , bttv , .
TV-.
TV-, - ,
video4linux. ,
xawtv, , libXaw
.
TV-
, .
, , ,
, TV-. - bttv TV-,
TV-. , .
xawtv.
.xawtv.
SECAM D/K, .xawtv
SECAM. , bttv
tuner type. TV- SECAM -
39. ""
641
, ,
jpeg-, .
bttv TV-, .
:
1. , I2C:
modprobe i2c
2. ,
SECAM:
modprobe tuner type=3
3. bttv
TV-, 1:
modprobe bttv card=1
4. xawtv:
xawtv &
5. , - , - .
.
- , ,
q xawtv :
bttv:
rmmod bttv
TV-:
modprobe bttv card=2
6. . 45 , .
Vi.
642
, xawtv
TV-. , X Window.
wmtv
, .
, , -
. ,
, xawtv.
kWinTV
,
KDE (. 39.3).
. 39.3. kWinTV
39. ""
643
LIRC
LIRC (Linux Infrared Remote Control,
). , . , ,
bttv. LIRC .
, ,
kWinTV.
, TV-,
Real Player 8 /tmp testing.rm.
, , Real Video. Real Producer
Basic, , .
Real Server . , Real Server , .
ffmpeg
audio/video /, (, ).
SANE
SANE, , video4linux, TV-.
TV-out
, . nVidia. ,
Vi.
644
, ,
, . ,
nVidia. , nVidia.
TV-out :
1. nVidia .
2. /etc/X11/XF86Config-4 , 39.3.
39.3
Section "Module"
Load
"dbe"
Load
"glx"
Load
"extmod"
Load
"type1"
Load
"freetype"
EndSection
Section "Device"
Identifier
VendorName
"nvidia"
BoardName
"ABIT"
Driver
"nvidia"
VideoRam
32768
Option
"DPMS"
# 'lspci' BusID
BusID
"PCI:1:0:0"
# X Window
# X',
# 3 1.
Option "NvAGP" 3
Option "ConnectedMonitor" "TV"
# SVIDEO COMPOSITE ,
# TV , svideo-
# "" (COMPOSITE)
Option
"TVOutFormat" "COMPOSITE"
# .
39. ""
Option
"SecondMonitorHorizSync" "30-50"
Option
"SecondMonitorVertRefresh" "60"
645
#
# , PAL-I, NTSC-J
Option
"TVStandard" "PAL-I"
# TwinView
Option
"TwinView"
# Clone TV
# "RightOf" "LeftOf" "Above" "Below",
Option
"TwinViewOrientation" "Clone"
# .
Option "MetaModes" "1024x768,640x480; 1024x769,640x480; 800x600,
640x480; 640x480,640x480"
# , TV, .
Option "ConnectedMonitor"
"crt,tv"
EndSection
3. X Window.
, , , AVI MPEG4
.
, . xcam,
SANE. , USB- Mass Storage.
.
USB Flash-,
USB
Flash- 1 32 . BIOS .
Linux, . USB- Linux SCSI-, , ? , CD-ROM. , SCSI- -
646
Vi.
,
.
, USB- . , . , log- , . hwbrowser.
Flash- () sda1, FAT16.
? ( ), /mnt/flash,
mount . FAT, :
Mount t vfat /dev/sda1 /mnt/flash o iocharset=koi8-r,codepage=866
USB .
, , SkyStar1(2).
, , . , ?
, .
www.gs.ru .
, , SkyStar1.
UPS ( )
, "",
(
) - Windows. ? :
On Battery , UPS ;
Low Battery , 12 UPS
;
Kill power UPS .
, , , .
: apcupsd, smartups, smartupstools, smupsd, upsd, NUT.
APC Back UPS 500 apcupsd. .
/etc/apcupsd/apcupsd.conf.
39. ""
647
39.4 .
39.4
UPSNAME APC Back 500
UPSCABLE 940-0020C
UPSTYPE dumb
DEVICE /dev/ttyS1
TIMEOUT 900
NETSERVER off
EVENTSFILE /var/log/apcupsd.events
UPSCLASS standalone
UPSMODE disable
STATTIME 1
STATFILE /var/log/apcupsd.status
,
, ;
Low Battery .
NUT (Network UPS Tools), ,
.
fero.koli.kando.hu/rivatv/ TV-out -
nVidia.
ftp://ftp.cs.unm.edu/mirrors/kde/unstable/apps/utils/ kpsion
Psion.
ftp://ftp.to.com/pub/psion/ plptools Psion.
ftp://ryeham.ee.ryerson.ca/pub/PalmOS/ PilotLink.
gazette.linux.ru.net/lg62/articles/rus-silva.html Anderson Silva. - Linux. .
huizen.dds.nl/~frodol/psiconv/ Psiconv.
jpilot.org J-Pilot.
linuxtv.org , Linux.
palm.opennet.ru/base/X/tv_out.txt.html nVidia
TV-out (linux tv video).
www.cadsoft.de/people/kls/vdr/index.htm Video Disk Recorder
, SkyStar1 Linux.
www.mwiacek.com/www/?q=gammu Gammu.
Vi.
648
www.gnome.org/projects/gnome-pilot/ gnome-
pilot.
www.in-berlin.de/User/kraxel/xawtv.html
xawtv.
www.linuxphone.ru , -
Linux.
www.linux.opennet.ru/base/X/video_out.txt.html TwinView nVidia-
, (linux tv video).
www.linuxdvb.tv ,
.
www.lirc.org LIRC (Linux Infrared Remote Control).
www.mainconcept.com
.
www.mathematik.uni-kl.de/~wenk/kwintv kWinTV.
www.medsyn.fr/perso/g.delafond/psilin/psiolinu.htm PsiLin
Psion.
synce.sourceforge.net The SynCE Project
PocketPC.
www.nvidia.com nVidia.
www.real.com Real Producer Basic.
www.slac.com/pilone/kpilot_home/ KPilot.
www.strusel007.de/Linux/bttv/ BT8XX.
www.stud.uni-hamburg.de/users/lennart/projects/atitvout/
TV-out ATI.
www.student.uwa.edu.au/~wliang wmtv.
www.thp.uni-koeln.de/~rjkm/linux/bttv.html bttv.
http://linux.webclub.ru/adm/palm_pilot.html .
PalmPilot.
HOWTO:
bttv mini-HOWTO , ;
Linux and Psion HOWTO.
40
, Linux . ,
MS Windows DOS.
. "-" .
,
Windows.
, ,
, .
-.
. .
1. .
,
.
2. . Linux
FAT, VFAT, NTFS . . Microsoft
, Microsoft.
3. , .
:
"" , . ,
, , .
,
. , ;
650
VI.
" ". ,
.
4. ,
. ,
.
, .
, , .
,
Linux , . , .
DOSEmu
, MSDOS. , Windows MS-DOS ,
. , MS-DOS,
. , ,
. . .
, MS-DOS, , WarCraft II, Doom Dune II.
- MS-DOS, .
DOSEmu ,
. DOS.
DOSEmu
DOSEmu
dosemu.conf /etc. ,
.dosrc,
DOSEmu .
, .
dosemu.conf , /var/lib/dosemu/global.conf :
$_xxx = (n)
$_zzz = "s"
40.
651
DOSEmu
$_debug = "-a"
, '-a'.
, '-o
file' '-O' ( stderr).
$_timint = (on|off) INT08.
$_mathco = (on|off) DOS
.
$_cpu = (80386) , . -
.
: 80386, 80486 80586.
$_rdtsc = (on) DOSEmu
Pentium .
'rdtsc' DOSEmu
. ,
:
$_cpuspeed = (166.666).
= (on) DOSEmu PCI.
, 40.1, , DOS.
$_pci
40.1
$_xms = (1024)
$_ems = (1024)
$_ems_frame = (0xe000)
$_dpmi = (off)
$_dosmem = (640)
, 40.2, DOSEmu
, DOSEmu.
40.2
$_hogthreshold = (1) # 0
DOSEMU
# 1
Linux
# >1 ,
DOSEMU
VI.
652
, Linux-, DOS-,
IRQ DOS:
$_irqpassing = ""
$_speaker = ""
# or "native" or "emulated"
, .
,
:
$_ports = ""
DOSEmu, xterm.
$_term_char_set = "" .
$_term_color = (on) .
$_term_updfreq = (4)
1/20 .
DOSEmu X Window
. , .
$_layout = "name" .
$_X_keycode = (on) X Window, (US) .
$_rawkeyboard = (1)
DOS-. .
$_keybint = (on) .
$_escchar = (30) ESC.
X Window
DOSEmu X Window .
$_X_updfreq = (5) 1/20 .
$_X_title = "DOS in a BOX" .
$_X_icon_name = "xdos" .
$_X_keycode = (off) DOSEmu.
$_X_blinkrate = (8) .
$_X_font = "" DOS-.
$_X_mitshm = (on) .
$_X_sharecmap = (off) .
$_X_fixed_aspect = (on) .
40.
653
.
VGA
.
$_X_lfb = (on) - VESA-.
DOSEmu .
$_video = "vga" .
$_console = (0) .
$_graphics = (0) BIOS .
$_videoportaccess = (1) .
$_vbios_seg = (0xc000) -BIOS.
$_vbios_size = (0x10000) -BIOS.
$_vmemsize = (1024) .
$_chipset = "" .
.
$_vbootfloppy = "" , .
$_floppy_a ="threeinch" A.
$_floppy_b = "" B.
$_hdimage = "hdimage.first" , /var/lib/dosemu.
DOSEmu /var/lib/dosemu/hdimage.first
. ,
DOS FAT.
'dd if=/dev/fd0 of=floppy_image'
DOS,
$_vbootfloppy = "floppy_image"
.
COM-
COM-
.
$_com1 = "/dev/mouse" , Linux
COM1.
654
VI.
COM2.
$_mouse = "microsoft" .
$_mouse_dev = "/dev/mouse" .
$_mouse_flags = "" -
.
$_mouse_baud = (0) , 0 .
Linux. DOSEmu, .
$_printer = "lp" Linux-, LPT1.
$_printer_timeout = (20) .
IPX/SPX
IPX/SPX,
IPX.
$_ipxsupport = (on) IPX/SPX.
$_vnet = (on) dosnet.
DOSEmu
Linux .
$_sound = (off) .
$_sb_base = (0x220) / .
$_sb_irq = (5) .
$_sb_dma = (1) DMA .
$_sb_dsp = "/dev/dsp" .
$_sb_mixer = "/dev/mixer" .
$_mpu_base = "0x330" MPU-401.
DEXE
40.
655
mkdexe:
;
DOS, ;
Config.sys Autoexec.bat.
.
root
mkdexe myapp.zip -x myapp.exe -o confirm
, myapp.exe,
dos -L myapp.exe [ dosemu-options ]
Wine
Wine (Wine Is Not an Emulator) Windows . Windows- X Window.
1.2.2,
Windows-. , Wine . .
Windows Xterm Wine . Wine
.
, Windows, :
wine _.exe
, Windows ,
:
wine winver win98 _.exe
- , , :
wine winver win95 dll a.dll b.dll c.dll _.exe
Cedega
Cedega (WineX) , Wine. " " Wine, ,
Windows. ,
. Wine.
656
VI.
CrossOwer Office
CrossOwer Office , Wine. "" Microsoft Office, Photoshop
. . , WINE.
WINE@Etersoft
WINE@Etersoft , Wine. . "" :
1:, , , .
, , (),
( 1033/1066 IBM 360/370). , Linux
, .
VMWare
VMWare , .
.
40.
657
. ( ), .
CD-ROM
.
: , VMWare.
Configuration Editor .
, VMWare ,
, ,
.
Win4Lin
, , VMWare,
Windows Linux. Linux.
, VMWare. , Win4Lin DOS-. DirectX.
Windows - X Window .
Linux.
Win4Lin .
Members, ,
. . , ,
Linux Win4Lin.
Win4Lin
30 . ,
Win4Lin. Windows .
/var/win4lin/publicbin installwindows, , Windows. winsetup Windows.
, , Windows .
VirtualBox
VirtualBox VMWare.
.
Qemu. : , . Sun Microsystems. VmWare, .
658
VI.
XEN
XEN (). .
, .
. .
. Linux NetBSD.
, Windows. XEN , Virtual Iron, XenSource Server, Oracle VM.
KVM
KVM (Kernel-based Virtual Machine) . XEN , Linux. Linux Windows,
.
.
www.winehq.org Wine.
www.vmware.org VMWare.
dhls.agava.ru/vmware.html . . VMWare.
www.softerra.ru/freeos/16294/print.html . VMWare
Workstation .
www.netraverse.com Win4Lin.
www.linux.hitech.by X-Stranger Win4Lin Windows - Linux.
t37.nevod.perm.su/linux/tune/dosemu.html . .
DOSEmu.
www.mgul.ac.ru/~t-alex/Linux/howto.mine/howto.mine.2.htm . MINI-NOWTO.
www.etersoft.ru WINE@Etersoft.
itc.ua/node/27014/ Linux hypervisor.
kvm.sourceforge.net KVM.
41
,
Linux, , . .
.
,
.
.
. , , ,
. -, , ,
. -, www.alsa-project.org. .
, .
, ,
. ,
.
, aumix (. 41.1).
, , alsamixer, xmix.
. , ,
Audio-CD. .
CD-ROM . , - ,
cdplay. , , - .
, cdp.
VI.
660
: , , -.
-
MP3.
. 41.1. aumix
, / MP3
,
/ MP3.
.
MP3
mpg123. mpg123
. , *,
, , .
(play-list) . MP3
blaster splay.
MP3
. wavplay
WAV, playmidi MIDI, tracker MOD. ,
,
Sox.
, , .
-, MP3.
cdparanoia. - cdparanoia, ,
WAV.
cdparanoia ,
. -B,
-.
41.
661
cdparanoia wav-.
MP3. wav- MP3 ,
lame. , ,
. wav- MP3.
- MP3 ,
cdparanoia 1 | lame my_music.mp3
. 41.2. - MP3
, - -.
mp3c
, , , MP3.
X Window
, , X Window.
. KDE GNOME.
VI.
662
. ,
GNOME.
. . 41.3 ,
Windows. .
: , , .
. . 41.4
-.
. 41.3.
. 41.4. -
41.
663
. 41.5. xmms
. 41.6. KMid
VI.
664
. 41.7. Kmidi
. 41.8. CD-
. 41.9.
- KDE (. 41.8).
, ,
(. 41.9).
41.
665
, .
festival. ,
,
. , ,
.
IBM ViaVoice.
Linux
Linux
. , .
.
,
MPEG. smpeg
, , . smpeg
:
Enjoympeg MPEG-;
Dumpmpeg mpeg-;
XMPS MPEG- play-list
;
ZZPlayer MPEG- KDE;
Xtheater Video CD.
.
, ,
MPEG4 (DivX). , ,
. , .
, Windows, . DivX (www.divx.com). , avifile
(avifile.sourceforge.net), Windows AVI-
(Indeo, Video, DivX) Linux.
XMPS
XMPS MPEG- play-list (. 41.10).
VI.
666
. 41.10. XMPS
avifile-player
avifile-player . 41.11. Win32-, DivX, AVI-,
Windows-.
. 41.11. avifile-player
41.
667
xmms
,
MP3-. plug-ins
. xmms-avi avifile- AVI- Win32.
, .
. 43.11. XMMP
MPlayer
MPlayer Movie Player for Linux (. 41.13).
Linux.
, ,
.
VI.
668
(. 41.14). 1520%. , , . , ,
.
,
- .
. 41.13. MPlayer
. 41.14. MPlayer
XINE
(. 41.15).
:
MPEG1;
MPEG2;
. 41.15. XINE
41.
669
MPEG4;
DivX;
motion JPEG;
AVI ( Win32-: Indeo 3.1-5.0, cinepak, Window Media 7/8).
, XINE :
MPEG audio layer 1;
MPEG audio layer 2;
MPEG audio layer 3;
a/52 (ac3, dolby digital);
dts;
vorbis;
pcm;
DivX audio.
,
, .
CD-R/CD-RW-
CD-R/RW- .
, .
, ? -,
. , .
.
IDE,
SCSI.
Linux SCSI,
ATAPI-. ,
. , .
cdrtools, cdda2wav, cdrecord, isoinfo, mkisoft, readcd.
.
. Linux,
( cdrtools) . front-end ( ,
). ,
.
VI.
670
Linux - :
(, , ) -
;
CD-R cdrecord.
CD-RW .
CD-ROM
,
.
CD-R , ,
,
CD-R-. mkisofs. :
mkisofs
-r
-o cd_image
game/
-r -
Rock Ridge. mkisofs
8.3, DOS .
, mkisofs
- :
mkisofs -;
.
CD
Linux . , , .
cd_image /cdrom,
mount -t iso9660 -o ro,loop=/dev/loop0 cd_image /cdrom
/cdrom ,
-. CD-
:
umount /cdrom
CD
, :
cdrecord -scanbus
, .
,
cdrecord -v speed=32 dev=0,6,0
-data
cd_image
41.
671
Audio-CD
audio-CD .
, Audio-CD ,
. (16
PCM- 44 100 ).
sox. :
sox
myMusic.wav
track1.cdr
cdrecord , -audio:
cdrecord -v speed=4 dev=0,6,0
-audio
track1.cdr track2.cdr...
MP3- :
mpg123 -s track1.mp3>track.cdr
. , CD-ROM.
cdrecord -v dev=0,6,0 speed=32 -isosize /dev/hdc
CD-ROM,
/dev/hdc, CD-R.
, CD
, .
CD-RW- , blank=fast cdrecord.
, .
front-end .
cdrecord.
K3b
K3b .
. 41.16.
K3b KDE.
cdrecord .
Audio-CD
Ogg Vorbis, MP3, WAV FLAC .
.
CD, DVD ISO-.
VI.
672
. 41.16. K3b
. 41.17. Eroaster
41.
673
, K3b - .
Eroaster
Eroaster .
, .
, Recorder/Reader (. 41.17).
D Bake Oven
Nero.
, , ,
CD-RW. Drag'n'Drop, ,
, ,
ISO-, , , ,
. . ,
.
,
. , .
, , .
674
VI.
www.softerra.ru/freeos/14906/ . -.
xine.sourceforge.net XINE.
xmms.org XMMS ( ).
xmps.sourceforge.net XMPS.
xtheater.sourceforge.net Video-CD
Xtheater.
http://gazette.linux.ru.net/lg63/articles/rus-andreiana.html Marius Andreiana. : . .
http://soft.mail.ru/article_page.php?id=147 . .
CD-R/RW Linux.
http://k3b.sourceforge.net K3b.
http://cdbakeoven.sourceforge.net CD Bake
Oven.
http://eclipt.uni-klu.ac.at Eroaster.
" " 236 . .
CD-Writing-HOWTO.
42
,
, , : , -, PDF .
, "" , . ,
(, HD-), 10 .
,
(HTTP, FTP, Torrent, Edonkey) , ,
. . Windows ""
, Linux?
, , , Web-, Mozilla Opera, Torrent- Edonkey/Emule p2p-
"".
Wget MLdonkey. , ,
; ,
,
, Web-. , , , .
Wget
, 10 . .
Wget HTTP, HTTPS, FTP
HTTP-proxy. .
Wget
VI.
676
,
. ,
"" Wget WWW-, , Mozilla Internet
Explorer.
Wget :
, .
HTML- , .
FTP . . 42.1 Wget.
. 42.1. Wget
Wget
, . .
wget
http://www.sample.org/graphics/sample.png
.
wget -P /path/for/save ftp://ftp.example.org/some_file
.
wget -b ftp://ftp.example.org/some_file .
wget - ftp://ftp.example.org/some_file.iso -
( , ).
42. ,
677
wget -i _ ; _ ,
.
wget -r -l5 http://sample.org/ -o log -
5 log-.
-k.
.
wget -r -l 0 -k http://example.org .
wget -m -np http://example.org .
.wgetrc
Wget , .wgetrc.
_ = .
.
accept/reject = STRING , STRING.
add_hostdir = on/off /
.
continue = on/off / .
background = on/off / .
base = STRING URL.
cache = on/off off .
convert links = on/off .
cut_dirs = N N .
debug = on/off / .
delete_after = on/off .
dir_prefix = STRING .
dirstruct = on/off .
dot_bytes = N , "" , ( 1024). k m .
.
dots_in_line = N ,
( 50).
dot_spacing = N ( 10).
678
VI.
exclude_directories = STRING ,
.
exclude_domains = STRING .
follow_ftp = on/off FTP- HTML-.
force_html = on/off on
HTML.
ftp_proxy = STRING STRING FTP proxy- , .
header = STRING HTTP-.
http_passwd = STRING HTTP-.
http_proxy = STRING STRING HTTP proxy-
, .
http_user = STRING HTTP .
ignore_length = on/off on "Content-Length".
include_directories = STRING , .
input = STRING URL.
kill_longer = on/off , , "Content-Length", (
). ,
, "Content-Length" .
logfile = STRING .
login = STRING FTP
. "anonymous".
mirror = on/off .
netrc = on/off / netrc.
no_parent = on/off
.
no_proxy = STRING STRING , -, , .
output_document = STRING .
passive_ftp = on/off FTP.
passwd = STRING FTP-. .
proxy_user = STRING proxy-.
proxy_passwd = STRING proxy-.
quota = QUOTA .
( ), ( k) ( m). , quota = 5m 5 . wgetrc. , Wget ,
.
.
42. ,
reclevel = N .
recursive = on/off .
relative_only = on/off .
remove_listing = on/off on Wget
679
FTP-.
retr_symlinks = on/off on Wget
.
robots = on/off ( ) "/robots.txt".
server_response = on/off HTTP- FTP- .
timeout = N -.
timestamping = on/off .
tries = N URL.
use_proxy = on/off proxy-.
verbose = on/off / .
wait = N N .
Wget
Wget:
Gwget (. 42.2).
GGet (. 42.3).
Kiwi.
Web.GET.
KWebGet (. 42.4).
KMAGO.
. 42.2. Gwget
VI.
680
. 42.3. GGet
. 42.4. KWebGet
42. ,
681
MLdonkey
MLdonkey , , -,
Web. : ED2K
( Kademlia, Overnet), BitTorrent, DC++, FastTrack, SoulSeek, Gnutella G2. .
, , .
mlnet.
daemon. http://localhost:4080/ Web-,
MLdonkey (. 42.5).
. 42.5, Options, . , IP-, , , . .
Transfers, ,
. , .
MLdonkey.
VI.
682
MLdonkey
MLdonkey.
:
Sancho , Java (. 42.6).
KMLdonkey KDE-, C++.
MLdonkeyGtkUi "" GTK.
CocoDonkey, xDonkey, mlMac Mac OS X, Cocoa.
MLdonkeyWatch MS Windows.
Alemula, phpEselGui, saman, Zuul , PHP.
Platero KDE.
JMoule , Java.
Web-GMUI Web-, Web-.
. 42.6. Sancho
, MLdonkey, Hydranode, , , .
Transmission
Torrent- (. 42.7). Unix ,
Mac OS X. , Debian, Fedora Ubuntu.
42. ,
683
. 42.7. Transmission
Vuze
Torrent-, Java (. 42.8). .
.
. 42.8. Vuze
43
, .
. , , , ,
"" .
" Linux".
root
, .
, - /etc/passwd
, . ,
.
,
.
root ( root, -,
), root
passwd. passwd shadow
, root , -
passwd.
.
<Ctrl>+<Alt>+<Delete>. .
43.
685
, root, .
Magic SysRq,
sync unmount.
:
<Alt>+<SysRq>+<s> sync
;
<Alt>+<SysRq>+<u> unmount remount
" ";
<Alt>+<SysRq>+<b> .
, ,
.
,
, . ,
fsck. .
. ,
single.
LILO
LILO: linux single
.
, root.
. , Linux:
LILO: linux init=/bin/sh
, .
,
LILO, linux. , , , , , LILO . <ab>.
, , (LILO ) , /etc/lilo.conf. .
686
VI.
rescue- .
rescue- LiveCD-.
root
mount
( CD-ROM)
" /" (
single init=/bin/sh).
" /"
mount - remount,rw /
,
fdisk -l .
, , /etc.
root
/etc/passwd /etc/shadow. , , .
, , .
/mnt ( ), chroot
, passwd , passwd.
" /", chroot
.
passwd.
,
.
/etc/passwd ,
, , .
. ,
, 8, .
, .
1. ,
,
,
.
43.
687
2. " " ,
. , ,
. :
log- ,
;
( errata, support,
updates . .) (bugtraq,
www.securityfocus.org)
(
) . "", ,
-.
, , ,
log- ( )
, "" log-
. - , log- , ,
log- .
3. .
, , ,
"" , .
,
, ,
,
. , , , .
4. ,
.
, , . .
688
VI.
LILO
, LILO
lilo.conf, ,
lilo.
, LILO
.
LILO.
/etc/lilo.conf,
(MBR) , -. ,
.
, LILO.
LILO 01010101010
,
BIOS.
LILO , L
LILO . , ,
lilo. , BIOS
LILO - .
, BIOS LBA ( ) linear lba32 ( BIOS )
/etc/lilo.conf, lilo .
, , BIOS.
i486, Pentium Pentium II.
LILO , LI
LILO ,
. .
boot.b ,
lilo .
LILO , LIL?
LILO
. , .
43.
689
LILO , LIL
LILO .
lilo .
LILO , LIL . ,
/boot/map .
LILO
LILO
. .
LILO
First boot sector doesn't have a valid LILO signature
,
/boot/boot. /etc/lilo.conf install
, LILO
.
Chain loader doesn't have a valid LILO signature
, /boot/chain.
/etc/lilo.conf loader= ,
LILO .
Linux boot.b, ,
. lilo.conf image= .
chain MS-DOS . , lilo.conf other=. ,
, LILO loader=.
BIOS
:
Warning: BIOS drive 082 may not be accessible
, lilo.conf
,
, , . , lilo.conf , .
LILO .
.
690
VI.
(MBR)
, . ,
, .
.
:
dd if=/dev/hda of= hda-mbr.bin bs=512 count=l
:
/dev/hda IDE;
hda-mbr.bin ,
;
512 ;
count 1,
.
(/dev/hda /dev/sda). , .
.
dd of=/dev/hda if=$BACKUP_FILE bs=512 count=l
dd , , ,
fdisk -l. . , .
, , .
, ,
.
dd ,
.
( ), ,
.
fdisk -1
mount
43.
691
.
LILO, /sbin/lilo
/etc/lilo.conf.
, , LILO.
, LILO . .
Loading Kernel..., , ,
. reserve= exclude=, LILO.
.
-
- .
, -.
- .
,
.
,
,
.
Linux ,
. ,
, rdev.
, . rdev, .
, , .
root=.
692
VI.
rdev /
/etc/lilo.conf, , append="root=hda2".
, ,
, , ,
, .
,
, , .
, . , /dev
.
gpm ,
. startx . Window.
, Window ,
.
, Window , .
, .
, .
, ,
.
Linux
,
. Linux
.
File Hierarchy Standard (
43.
693
) , /lib ,
.
, , ,
Magic SysRq, .
,
.
SIG11
, SIG11
, , .
- ,
, .
.
.
Linux Internal compiler error SIG11, , , .
Fedora
memtest86
. 45 ,
.
,
.
, ", , "
.
, , .
694
VI.
, , . , .
, /proc/sys/kernel/file-max // sys/kernel/inode-max.
:
inode-max = 32768 file-max .=5.120
.
.
,
.
, ,
root . , .
tune2fs.
.
root , root, , .
root ,
, .
43.
695
-
.
, .
,
.
4 , , .
( -i mke2fs).
, , .
, ,
. ,
, .
Ext2 e2fsck -.
mount
"",
,
. , SCSI-, .
, telnet
. . ps, "" D.
kill -9 ,
, .
, , mount
696
VI.
"" .
,
( "" ), .
,
.
, .
Linux "Undelete HOWTO"
. ext2ed debugfs ,
.
mc (Midnight Commander). mc cd /#undel:/hda. , ,
inode. , , .
fsck .
lost+found, Ext2(3,4).
,
lost+found .
,
, .
TCP, /etc/hosts.allow
/etc/hosts.deny. ,
, .
,
.
ping .
43.
697
/
, . (, emacs),
.
,
.
. .
reset, , . , .
,
, , , ,
. ,
loadkeys -d , . .
xmodmap .
Window.
loadkeys.
Window
Window , .
"", ,
, Window, .
kill -9
. ,
, . - init " " . , ""
.
VI.
698
- . .
,
: , , CD-RW, ZIP Drive .
,
, ,
lsmod , , .
, ,
.
mem=xxxM,
.
( Pentium
Pentium II) .
mem=xxxM, . , , .
.
HOWTO:
.
, , . , .
, . ,
, .
., ., ., . . UNIX: . : . . 3- ., . .
.: ; : BHV, 2007.
. , , , Linux.
.
., ., . Linux: .
; . . .: "", 2000.
.
, .
IT.
. Linux: . ; . . .:
"", 2000.
.
.
. Linux : . . : , 2000.
. 2.4 ,
Linux.
. . UNIX. .: , 2002.
.
, , TCP/IP .
. Linux. . . .: ,
2001.
CVS-
( ).
702
. Linux: . ; .
. .: "", 2001.
. .
. Linux (+ CD) .: , 2004.
.
., . . Linux. (VPN).
-, 2004.
VPN-
Linux. VPN,
.
.
.
. . Linux . .: , 2003.
" LINUX -" (http://ruslinux.net).
. Linux. . .: "",
2003.
, .
Red Hat.
., ., . Linux. 2- .; . .
.: "", 2003.
,
Linux- . Linux, ,
Linux. .
., ., . Linux; . .
.: "", 2007.
, . Linux: Red Hat, SuSE Debian. , , , Linux.
., . Linux. 5- .; . ., , 2008.
, .
. Linux: . 3- . .: , 2002.
! 199697 . ,
Web-,
Linux. ,
. Web-
,
. - .
www.altlinux.ru AltLinux. -
.
www.asplinux.ru ASPLinux. -
.
www.debian.org Debian. -
Linux. .
. Web- .
iso.linuxquestions.org , ISO- .
www.redhat.com Red Hat, . ,
4. ( 1995 ) .
Red Hat , Windows.
Red Hat - . : (
), Professional Advanced Server.
( ).
fedoraproject.org/ru/ Fedora Core Red Hat-.
704
www.slackware.com Slackware. -
. , .
,
.
www.novell.com/linux/ SuSE. , .
www.ubuntu.com Ubuntu.
.
.
dc.internic.net/rfc/rfc2196.txt ,
.
www.bog.pp.ru .
.
www.citforum.ru
, Linux. : , , , .
dc.internic.net/rfc RFC.
www.lib.ru .
www.linuxfocus.org "LinuxFocus", .
www.linux.org.ru ,
Linux. , Linux . Linux.
www.linuxrsp.ru .
linuxtv.org , Linux.
www.Linux-USB.org , USB- Linux.
www.opennet.ru ,
.
www.pathname.com/fhs/ Filesystem Hierarchy Standard .
www.redhat.com "" .
www.rfc-editor.org , RFC.
www.rpm.org , RPM.
www.tldp.org Linux Documentation project. ,
Linux.
2.
705
706
. "" .
www.psionic.com Psionic Software Portsentry.
rpmfind.net RPM.
rrdtool.eu.org rrdtool.
rufus.w3.org/linux/RPM RPM.
www.samba.org Samba.
www.slug.org.au/etherboot/ Etherboot,
.
www.squid-cache.org Squid.
stunnel.mirt.net Stunnel.
www.tripwire.org Tripwire.
www.vmware.org VMWare.
www.webmin.com Webmin.
www.winehq.org Wine.
xmms.org XMMS .
www.xsane.org Xsane.
linuxsecurity.com ,
Linux.
www.security.nnov.ru , .
www.rootshell.com , -
/
/ 83
/bin 83, 84
/boot 83, 85
/dev 83, 86
/etc 83, 86
/etc/bashrc 145, 147
/etc/fstab 145
/etc/initscript 146
/etc/inittab 136
/etc/issue 146
/etc/motd 146
/etc/profile 146
/etc/rc.d 93
/etc/rc.d/init.d 94
/etc/skel 145
/etc/sysconfig 94
/home 83, 102
/init.d 93
/lib 83, 102
/lib64 102
/lost+found 83, 102
/media 83, 103
/mnt 83, 103
/opt 83, 103
/proc 83, 103
/root 83, 108
/sbin 83, 108
/sys 83, 109
/tmp 83, 109
/usr 83, 110
/usr/bin 110
/usr/local 110
/usr/share/man 111
/usr/src 113
/usr/src/Linux-x.y.z 113
/var 83, 114
/var/cache 115
/var/lock 116
/var/log 116
/var/mail 116
/var/run 117
/var/spool 117
/var/tmp 117
A
AboutTime 409
ACL (Access Control List) 388, 468
ACM 274
Active Directory 429
AIDE 490
AltLinux 37
Apropos 235, 264
APT 193
ASCII 272
ASP Linux 37
at 252, 465
atq 253
atrm 253
B
background 453
badblocks 73
banner 265
bash 265
batch 253, 465
bc 265
BestLinux 38
BGP (Border Gateway Protocol) 53
Bonzai 37
BOOTP 230
C
cal 240
callback- 579
Canonical NAME 302
cat 243
708
cd 243
Cedega 655
chat 552
chattr 156
chgrp 241
chkrootkit 482
chmod 241
chown 242
chroot 243
chvt 265
CIPE 157
Ckconfig 358
cksum 253
Clam AntiVirus (ClamAV) 162
clear 265
CNAME 302
control-panel 143, 148
Cool Linux 40
cp 244
CP1251 273
CP866 273
cpp 265
cron 465
crond 253
crontab 253
CrossOwer Office 656
csh 265
ctlinnd 366
CUPS (Common UNIX Printing
System,
UNIX) 610
D
date 240
DEB 188
DEB- 192
Debian 36, 41
debugfs 77
dhclient.conf 313
dhclient.leases 314
DHCP (Dynamic Host Configuration
Protocol) 230, 305
dhcpd.conf 308
dhcpd.leases 311
DHCP- 313
DHCP- 308
dial on demand 552
diald 552, 557
dial-in- 579
dig 249
dir 244
DivX 665
DNS (Domain Name System,
) 293
Domain Name Service 45
DOSEmu 650
du 259
dumpkey 260
E
e2fsck 77
Eagle Linux 40
echo 265
EGP (Exterior Gateway Protocol) 53
eject 230
elm 249
Embedded Linux 10, 12
Embedded Windows 9
env 265
Ext 69
Ext2 69
ext2ed 77
Ext3 69
Extended Attributes 469
F
fdformat 263
fdisk 263
file 244
Filesystem Hierarchy Standard 82
find 244
finger 249
Firewall 162, 508
FlScan 633
foreground 453
free 260
FreeBSD 11
FreeS/WAN 446
fsck 72, 263
fstab 71
FTP (File Transfer Protocol) 45, 345
ftp 249
Ftpaccess 351
Ftpconversions 356
ftpcount 260
Ftpcount 358
Ftpd 357
Ftpgroups 356
Ftphosts 357
Ftprestart 358
Ftpservers 356
Ftpshut 358
Ftpusers 357
ftpwho 260
Ftpwho 358
709
IP (Internet Protocol) 45
ipchains 250
Ipchains 515
IPSec (Internet Protocol Security) 446
iptables 250, 515
IPv4 50
IPv6 51
Isapnp 254
isapnptools 231
ISO 8859-x 272
G
g77 266
gawk 266
gcc 266
Gentoo 39
getkeycodes 253
getty 146, 249
Gnokii 635
GNOME 606
gnome-pilot 637
GnoRPM 190, 192
GPG (GNU Privacy Guard) 321
GQ 423
Group Descriptors 76
GRUB 120
gzip 263
H
head 245
HINFO (Host INFOrmation) 302
host 249
hostname 250
HOWTO 236
J
joe 264
J-Pilot 637
K
kdb_mode 260
KDE 607
Kerberos 158
kill 254, 456, 462
killall 254, 456, 463
killproc 145
Kldap 423
klogd 479
Knoppix 37, 39
KOI8-R 273
KOI8-U 273
Kpackage 190
Kpilot 637
kppp 250
Ksamba 444
kudzu 231
KVM 658
kWinTV 642
I
ICMP (Internet Control Message
Protocol) 56
id 266
ifconfig 253
IGRP (Interior Gateway Routing
Protocol) 53
init 135
INN 366
innd 366
innwatch 371
insmod 254
Internet Cache Protocol 383
L
last 260
Latin 0 272
Latin 1 272
LCP (Link Control Protocol,
) 571
LDAP (Lightweight Directory Access
Protocol) 412
LDAP Data Interchange Format 418
Ldapadd 423
Ldapdelete 422
Ldapmodify 423
710
Ldapsearch 422
LIDS (Linux Intrusion Detection/Defense
System) 483
lilo 254
LILO 120
Linux 11
linuxconf 143, 231, 255
LIRC (Linux Infrared Remote
Control) 643
ln 245
LNX-BBC 40
LoadLin 120
locate 245
lockfile 243
login 146, 266
logname 266
logrotate 232
LPD (Line Printer Daemon,
) 610
LPRng 613
ls 245
lsattr 156
Lycoris 38
lynx 250
M
Mac OS X 10
macntp 409
mail 250
make 266
man 235, 264
Mandrake 38
mc 246
md5sum 255
mgetty 249, 577
Midnight Commander 188
mimencode 250
minicom 250
minix 69
mkdir 246
mke2fs 77
mkfifo 247
mkfs 263
mknod 243
modprobe 256
mount 71, 256
MoviX 40
MPPE (Microsoft Point-To-Point
Encryption) 452
711
1489 273
2030 403
2131 305
2132 305
RIP (Routing Information Protocol) 46, 53
Rlogin 496
rm 247
rmdir 247
rmmod 257
Rootkit 480
rpm 174, 256
RPM 169
RPMS 170
RRDtool (Round Robin Database) 565
RSBAC 490
Rsh 496
Rsync 496
run level 135
runlevel 148
S
Q
QNX 12
QuiteInsane 633
quota 261
R
r- (remote-) 496
raidtools 231
rc 142
rc.local 145
rc.sysinit 140
Rcp 496
rdev 121
Rdist 496
Red Hat 37
ReiserFS 69
renice 256, 464
reset 267
resizecons 267
Resource Records 300
Responsible Party 302
RFC (Request For Comments) 46
1128 403
1129 403
1165 403
1305 403
712
smbpasswd 443
smbstatus 443
smbtar 444
SMTP (Simple Mail Transfer Protocol) 46
snice 257
Sniffer 159, 480
SNMP (Simple Network Management
Protocol) 46
sort 264
split 248
Squid 383
Squid.conf 384
SRPMS 170
ssh 252
SSH 157, 497
ssh_config 500
Ssh-add 505
Ssh-agent 504
sshd_config 497
Ssh-keygen 504
Ssh-keyscan 506
Start Of Authority 300
startx 267
stat 248
sticky bit 68
StormLinux 37
strace 258
strings 267
strip 268
stty 258
Stunnel 471
su 268
subst 268
SUID 68
SuSE Linux 38
SWAT 444
Symbian 13
syslogd 477
T
tac 249
tail 249
tar 264
Tarballs 168
tc 565
TCP (Transmission Control Protocol) 46
telinit 140, 147
telnet 252
who 262
Win4Lin 657
Window Manager 605
Windows CE 10
Windows NT 9
Wine (Wine Is Not an Emulator) 655
WINE@Etersoft 656
wmtv 642
Wu-ftp 349
X
X Window 601
xawtv 640
xcam 633
XEN 658
xf86config 258
508
510
. . VPN
66
45
534
306
35
. . DNS
293
78
459
. . PID
76
713
Xferlog 358
xia 69
xlock 152
xntpd 404, 408
xntpdc 408
xorg.conf 601
Xpdq 613
Xsane 632
xscanimage 633
xvidtune 258
Y
es 268
Z
zic 258
65
:
8859-2 273
8859-5 273
Latin 0 272
Latin 1 272
8 273
239
361
194
(magic-filter) 612
659
67
70
454
NTP. . NTP
453
239
66
ICP 383
714
PPP 571
. . DHCP
. . FTP
453
469
306
401
. . NFS
. . NTP
SIGKILL 145
. . NIS
159
66
. . ACL
459
65
306
75, 76
446
135
65
65
68
453
52
- 361