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

Copyright & A K-C

-
-
2011

Copyright & A K-C

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

:

.
.

02429 24.07.00. 10.06.11.


70 1001/16. . . . . 95,46.
1500 .
"-", 190005, -, ., 29.
-
77.99.60.953..005770.05.09 26.05.2009 .
.

" ""
199034, -, 9 , 12.

ISBN 978-5-9775-0712-7

. ., 2011
, "-", 2011

Copyright & A K-C

............................................................................................................................ 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

Copyright & A K-C

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

Copyright & A K-C

......................................................................................................... 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

Copyright & A K-C

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

Copyright & A K-C

VII

/sbin .................................................. 108


/sys sysfs ............................. 109
/tmp .......................................................................... 109
/usr ........................................................................................... 110
usr/bin .............................................................. 110
usr/include include- .................................... 110
usr/lib ................................... 110
usr/local ........................................................................... 110
usr/sbin
.............................................................................................................. 111
usr/share - ................................................. 111
usr/src .................................................................. 113
/var ................................................................................................................ 114
var/cache .................................................................................... 115
var/games ........................................................ 115
var/lib ............................................................................................. 115
var/lock lock- (-) ............................................................ 116
var/log (log-).......................................... 116
var/mail .................................................. 116
var/opt /opt ................................................ 117
var/run .......................................... 117
var/spool spool- ................................................................ 117
var/tmp , ................ 117
var/yp Network Information Service (NIS)
() ........................................................................................................ 118
........................................................................................................................... 118
7. Linux.............................................................................. 119
-................................................................................................. 120
LILO LInux LOader ............................................................................................... 120
GRUB .......................................................................................................................... 120
LoadLin ....................................................................................................................... 120
............................................................................................................. 121
.......................................................................... 121
rdev............................................................................................................... 121
Linux ............................................................................... 121
................................................................. 122
........................................................................ 122
root ......................................................................................................... 122
ro rw ................................................................................................. 122
RAM- ............................................................................. 123
ramdisk_start ......................................................................................... 123
load_ramdisk .......................................................................................... 123
prompt_ramdisk ..................................................................................... 123

Copyright & A K-C

VIII

ramdisk_size ........................................................................................... 123


noinitrd ( RAM-) ......................................................... 123
....................................................... 124
mem ........................................................................................................ 124
swap........................................................................................................ 124
buff.......................................................................................................... 124
NFS .................................................. 125
nfsroot .................................................................................................... 125
nfsaddrs .................................................................................................. 125
........................................................................ 126
debug .......................................................................................................... 126
init .............................................................................................................. 126
kbd-reset..................................................................................................... 127
maxcpus ..................................................................................................... 127
md............................................................................................................... 127
no-hlt .......................................................................................................... 127
no-scroll ..................................................................................................... 127
noapic......................................................................................................... 127
nosmp ......................................................................................................... 127
panic........................................................................................................... 128
pirq ............................................................................................................. 128
profile ......................................................................................................... 128
reboot ......................................................................................................... 128
reserve ........................................................................................................ 128
, PCI ............................... 129
pci=bios pci=nobios ............................................................................ 129
pci=conf1 pci=conf2 ........................................................................... 129
pci=io=............................................................................................... 129
pci=nopeer................................................................................................. 129
pci=nosort ................................................................................................. 129
pci=off ....................................................................................................... 129
pci=reverse ................................................................................................ 129
..................................... 130
video=map:... ............................................................................................. 130
video=scrollback:... ................................................................................... 130
video=vc:... ................................................................................................ 130
SCSI- ................................................................. 130
Mid-level........................................................................ 130
LUN (max_scsi_luns=) ................................................................ 130
SCSI (scsi_logging=) ........................................................................ 131
SCSI (st=) ............................................ 131
SCSI ......................................................................... 131
............................................................................................................... 132
IDE /CD-ROM ................................................ 132

Copyright & A K-C

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

Copyright & A K-C

............................................................................................... 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

Copyright & A K-C

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

Copyright & A K-C

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

Copyright & A K-C

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

Copyright & A K-C

XIV

ftp ............................................................................................................................. 249


getty (mgetty) ........................................................................................................... 249
host........................................................................................................................... 249
hostname .................................................................................................................. 250
ipchains .................................................................................................................... 250
iptables..................................................................................................................... 250
kppp ......................................................................................................................... 250
lynx........................................................................................................................... 250
mail .......................................................................................................................... 250
mimencode ............................................................................................................... 250
minicom ................................................................................................................... 250
netcfg ....................................................................................................................... 251
netstat....................................................................................................................... 251
nslookup ................................................................................................................... 251
pine .......................................................................................................................... 251
ping .......................................................................................................................... 251
procmail ................................................................................................................... 251
ssh ............................................................................................................................ 252
telnet ........................................................................................................................ 252
traceroute................................................................................................................. 252
uudecode .................................................................................................................. 252
uuencode .................................................................................................................. 252
wget .......................................................................................................................... 252
.................................................................................................. 252
at .............................................................................................................................. 252
atq ............................................................................................................................ 253
atrm .......................................................................................................................... 253
batch ........................................................................................................................ 253
cksum ....................................................................................................................... 253
crond ........................................................................................................................ 253
crontab ..................................................................................................................... 253
getkeycodes .............................................................................................................. 253
ifconfig ..................................................................................................................... 253
insmod ...................................................................................................................... 254
Isapnp ...................................................................................................................... 254
kill ............................................................................................................................ 254
killall ........................................................................................................................ 254
lilo ............................................................................................................................ 254
linuxconf .................................................................................................................. 255
md5sum .................................................................................................................... 255
modprobe ................................................................................................................. 256
mount ....................................................................................................................... 256
nice........................................................................................................................... 256
passwd ..................................................................................................................... 256
pnpdump .................................................................................................................. 256

Copyright & A K-C

XV

renice ....................................................................................................................... 256


rpm ........................................................................................................................... 256
rmmod ...................................................................................................................... 257
setserial.................................................................................................................... 257
setterm ..................................................................................................................... 257
skill........................................................................................................................... 257
snice ......................................................................................................................... 257
strace ....................................................................................................................... 258
stty ............................................................................................................................ 258
umount ..................................................................................................................... 258
useradd .................................................................................................................... 258
xf86config ................................................................................................................ 258
xvidtune .................................................................................................................... 258
zic ............................................................................................................................. 258
................................................................................................... 259
df .............................................................................................................................. 259
du ............................................................................................................................. 259
dumpkey ................................................................................................................... 260
free ........................................................................................................................... 260
ftpcount .................................................................................................................... 260
ftpwho ...................................................................................................................... 260
kdb_mode ................................................................................................................. 260
last ........................................................................................................................... 260
ps .............................................................................................................................. 261
quota ........................................................................................................................ 261
tload ......................................................................................................................... 261
top ............................................................................................................................ 261
uptime ...................................................................................................................... 262
users ......................................................................................................................... 262
who........................................................................................................................... 262
w............................................................................................................................... 263
.................................................................................... 263
fdisk .......................................................................................................................... 263
fdformat ................................................................................................................... 263
mkfs .......................................................................................................................... 263
.............................................................................. 263
fsck ........................................................................................................................... 263
.................................................................................................................. 263
gzip........................................................................................................................... 263
tar............................................................................................................................. 264
................................................................................. 264
joe ............................................................................................................................ 264
sort ........................................................................................................................... 264
uniq .......................................................................................................................... 264
vi .............................................................................................................................. 264
vim ........................................................................................................................... 264

Copyright & A K-C

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

Copyright & A K-C

XVII

(CP866) ........................................................................ 273


Microsoft CP1251 .................................................................................... 273
8 .......................................................................................................... 273
Unicode ....................................................................................................................... 274
....................................................................................................... 274
................................................................................................. 274
................................................................................................. 274
.............................................. 274
console-tools ............................................................................................................ 275
Cyrillic console tools ............................................................................................... 275
kbd ........................................................................................................................... 275
....................................................................... 276
bash .......................................................................................................................... 276
csh/tcsh .................................................................................................................... 276
zsh ............................................................................................................................ 276
less ........................................................................................................................... 277
mc (The Midnight Commander) .............................................................................. 277
nroff ......................................................................................................................... 277
man .......................................................................................................................... 277
ls............................................................................................................................... 277
Samba ...................................................................................................................... 277
telnet ........................................................................................................................ 278
......................................................................... 278
......................................................................................................................... 278
...................................................................................................... 278
............................................................................................... 279
X Window ............................................................................................. 279
............................................................................................................ 280
............................................................................................ 280
............................................................................. 280
......................................................................... 280
vim............................................................................................................... 280
joe................................................................................................................ 280
........................... 280
elm ............................................................................................................................... 281
pine .............................................................................................................................. 281
mutt .............................................................................................................................. 281
tin ................................................................................................................................. 281
..................................................................................... 281
Perl ....................................................................................... 282
......................................................................................................... 282
........................................................................................................................... 282

Copyright & A K-C

XVIII

16. ............................................................ 283


Linux ........................................................ 283
....................................... 283
............................................................... 284
................................................................................. 284
GRUB ...................................................................................................................... 284
Linux ....................................................... 286
"" ...................................................... 286
"" .............................................. 286
Linux ........................ 287
........................................................................................ 288
() ................................... 288
................................................................................................... 290
.......................................................................................... 291
() ............................................................ 291
........................................................................................................................... 292
17. DNS............................................................................................................... 293
................................................................................... 294
host.conf ............................................................................................................ 294
/etc/hosts ............................................................................................................ 294
/etc/resolv.conf .................................................................................................. 294
............................................................................... 295
/etc/named.conf ................................................................................................. 295
/etc/127.0.0 ........................................................................................................ 296
named .............................................................................................................. 297
DNS-...................................................... 298
/etc/named.conf ................................................................................................. 299
/etc/named/ivan.petrov ...................................................................................... 300
/etc/192.168.0 .................................................................................................... 301
..................................................................................................... 301
(RR) DNS......................................................................... 302
........................................................................................................... 303
DNS........................................................................................................ 303
....................................................................................... 304
DNS- .......................................................................................... 304
......................................................................... 304
.............................................................................................................. 304
........................................................................................................................... 304
18. DHCP ........................................................................................................... 305
DHCP- ............................................................................................................. 305
.......................................................................... 305

Copyright & A K-C

XIX

IP- ...................................................................................... 306


( options) ................................................................ 307
DHCP...................................................................................................... 308
DHCP- ................................................................................................................. 308
dhcpd.conf ......................................................................................................... 308
dhcpd.leases ...................................................................................................... 311
dhcpd.conf ......................................................................................... 312
DHCP- ................................................................................................................. 313
dhclient.conf ...................................................................................................... 313
dhclient.leases ................................................................................................... 314
........................................................................................................................... 315
19. ........................................................................................................... 316
SMTP............................................................................................................. 317
POP3 .............................................................................................................. 317
IMAP ............................................................................................................. 317
..................................................................................... 318
MIME ................................................................................................... 319
MIME-Version ............................................................................................................ 319
Content-Type ............................................................................................................... 319
Content-Transfer-Encoding ......................................................................................... 320
S/MIME ................................................................................................ 320
PGP, GPG ....................................................................................................................... 321
........................................................................................... 321
sendmail .................................................................................................. 321
sendmail ................................................................. 321
sendmail ........................................................................... 322
sendmail .............................................................. 323
SMTP ............................................. 323
POP3 .............................................. 326
Postfix ......................................................................................................... 329
....................................................................................... 329
........................................................................................................ 330
Mail ............................................................................................................................. 330
Pine .............................................................................................................................. 331
Thunderbird mozilla .................................................................................................... 331
Sylpheed ...................................................................................................................... 331
Evolution ..................................................................................................................... 331
Kmail ........................................................................................................................... 334
........................................................................................................................... 334
20. Web- Apache ................................................................................... 335
................................................................................................................ 335
" " ........................................................................... 340

Copyright & A K-C

XX

" " ........................................................ 341


" " ................................................................................ 342
access.conf ........................................................................................................ 342
........................................................................................................................... 344
21. FTP ............................................................................................................... 345
FTP ................................................................................................................ 345
............................................................................................. 345
............................................................................................................... 345
........................................................................................... 346
............................................................................................................... 346
..................................................................................................... 346
FTP .................................................................................... 346
FTP- .................................................................. 347
......................................................................................... 348
........................................................................................... 349
wu-ftp ............................................................................................................... 349
................................................................................................................. 349
...................................................................................... 351
ftpaccess ........................................................................................................ 351
ftpservers ....................................................................................................... 356
ftpconversions................................................................................................ 356
ftpgroups ........................................................................................................ 356
ftphosts .......................................................................................................... 357
ftpusers .......................................................................................................... 357
, .................................................. 357
ftpd ....................................................................................................... 357
ftpwho .................................................................................................. 358
ftpcount ................................................................................................ 358
ftpshut .................................................................................................. 358
ftprestart............................................................................................... 358
ckconfig ............................................................................................... 358
xferlog ................................................................................ 358
.............................................................................................................. 359
........................................................................................................................... 360
22. NNTP. INN ................................................................... 361
NNTP............................................................................................................. 361
NNTP...................................................................... 363
ARTICLE.................................................................................................................. 363
BODY ....................................................................................................................... 364
HEAD....................................................................................................................... 364
STAT ........................................................................................................................ 364

Copyright & A K-C

XXI

GROUP ggg ............................................................................................................. 364


HELP ....................................................................................................................... 364
IHAVE <message-id> ............................................................................................. 364
LAST ........................................................................................................................ 364
LIST ......................................................................................................................... 365
NEWGROUPS date time [GMT] [<distributions>] ............................................... 365
NEWNEWS newsgroups date time [GMT] [<distribution>] ................................. 365
NEXT........................................................................................................................ 365
POST ........................................................................................................................ 366
QUIT ........................................................................................................................ 366
SLAVE ...................................................................................................................... 366
INN .................................................................................................... 366
INN ..................................................................................................... 366
......................................................................................... 366
INN ........................................................................................... 367
active ................................................................................................................. 375
............................................................................... 376
..................................................... 376
INN.................................................................................... 379
INN ............................................................................................. 380
........................................................................................................................... 381
23. Proxy- ............................................................................................... 382
Squid ............................................................................................................................... 383
ICP ............................................................................................................. 383
Cache digest ................................................................................................................ 383
......................................................................................................... 383
Squid ................................ 384
Squid ............................................................................. 384
................................................................................................ 384
..................................................................................................................... 385
............................................................................................................ 385
...................................................................................... 386
............................................................................ 386
......................................................................................... 387
..................................................................................................... 388
ACL Access Control List ................................................................................... 388
......................................................................................................... 389
........................................................................... 389
HTTP-............................ 389
...................................................................................................................... 390
Squid .................................................................................... 391
proxy-...................................................................... 393

Copyright & A K-C

XXII

Transparent proxy .................................................................................................... 393


Squid ................................................................................................. 394
Squid ............................................................................................. 395
access.log ....................................................................................................... 395
store.log ......................................................................................................... 396
useragent.log .................................................................................................. 396
................................................................................. 396
............................................................................................... 396
................................................................................ 397
.................................................................................................. 399
Squid Cache and Web Utilities (SARG) ................................................. 399
MRTG ..................................................................................................... 399
RRDtool .................................................................................................. 399
........................................................................................................................... 400
24. ,
...................................................................... 401
........................................................................................... 401
............................................................................................... 402
....................................................................... 402
NTP- ................................................................................................... 402
................................................................................. 403
.................................................................................................................. 403
xntpd .................................................................................................................. 404
.............................................................................................. 404
symmetric ...................................................................................................... 404
procedure-call .............................................................................................. 404
multicast........................................................................................................ 404
.................................................................................................. 405
......................................................................... 407
, ............................ 407
ntpdate ......................................................................................................................... 407
ntpq .............................................................................................................................. 407
ntptrace ........................................................................................................................ 408
xntpd ............................................................................................................................ 408
xntpdc .......................................................................................................................... 408
NTP- ............................................................................................. 408
............................................... 408
UNIX/Linux ................................................................................................................ 409
Apple ........................................................................................................................... 409
Windows...................................................................................................................... 409
........................................................................................................................... 409

Copyright & A K-C

XXIII

25. NIS (NIS+)


. LDAP ............................................................... 410
NIS .................................................................................................................................. 410
NIS ....................................................................................................... 410
- ypserv .......................................................................................... 411
NIS+ ................................................................................................................................ 411
NIS+ ..................................................................................................... 411
LDAP .............................................................................................................................. 412
LDAP- ......................................................................................... 412
LDAP- ......................................................................................... 413
..................................................................... 413
......................................................................................... 417
LDAP .................................................................................................... 418
LDAP, ......................................... 418
................................................................ 420
...................................................................................................................... 422
Slapindex ................................................................................................................. 422
Slapcat ..................................................................................................................... 422
Ldapsearch ............................................................................................................... 422
Ldapdelete ............................................................................................................... 422
Ldapmodify.............................................................................................................. 423
Ldapadd ................................................................................................................... 423
Kldap ....................................................................................................................... 423
GQ............................................................................................................................ 423
LDAP ............................................................................. 423
........................................................................................................................... 424
26. NFS ......................................................... 425
NFS- ........................................................................... 425
NFS- .......................................................................... 426
................................................................................................ 427
rsize .......................................................................................................................... 427
wsize......................................................................................................................... 427
soft ........................................................................................................................... 427
hard .......................................................................................................................... 427
timeo=n .................................................................................................................... 427
retrans=n ................................................................................................................. 428
NFS ......................................................................................................... 428
................................................................................................ 428
................................................................................................ 428
........................................................................................................................... 428

Copyright & A K-C

XXIV

27. Samba Windows .................................................. 429


smb.conf ...................................................................................... 430
[global] .......................................................................................................... 436
[homes] .......................................................................................................... 437
[comm] ........................................................................................................... 438
[tmp] .............................................................................................................. 438
.................................................................................................. 438
Samba ............................................................................... 439
....................................................................................................................... 440
Samba ................................................................................... 440
Samba ................. 442
......................................................................................................................... 443
SWAT .......................................................................................................................... 444
Webmin ....................................................................................................................... 444
Ksamba ........................................................................................................................ 445
SambaSentinel ............................................................................................................. 445
........................................................................................................................... 445
28. ..................................................................... 446
IPSec .............................................................................................................. 447
VPN- FreeS/WAN ........................................................................................... 447
Ipsec.conf ................................................................................................................. 448
Ipsec.secrets ............................................................................................................. 450
MS Windows NT VPN (PPTP) ...................................................................................... 450
Linux PPTP- ..................................................................................................... 451
Linux PPTP- .................................................................................................... 452
OpenVPN ........................................................................................................................ 452
........................................................................................................................... 452
29. .......................................................................... 453
.............................. 453
......................................................................... 455
....................................................................................... 455
.................................................................... 456
nohup ........................................................................................................................... 457
ps ................................................................................................................................. 457
top ................................................................................................................................ 461
kill................................................................................................................................ 462
killall............................................................................................................................ 463
......................................................... 463
nice .............................................................................................................................. 464
renice ........................................................................................................................... 464

Copyright & A K-C

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

Copyright & A K-C

XXVI

Portsentry ........................................................................................................................ 489


LogSentry ........................................................................................................................ 489
Tripwire .......................................................................................................................... 489
AIDE ............................................................................................................................... 490
RSBAC............................................................................................................................ 490
Security-Enhanced Linux................................................................................................ 490
........................................................................................................................... 491
31. ....................................................... 492
Telnet .............................................................................................................................. 492
Telnet ......................................................................................................... 492
Telnet ...................................................................................................... 493
- telnet ........................................................................................... 494
- telnetd ......................................................................................... 495
Telnet .......................................................................... 495
r- ...................................................................................................... 496
rlogin ........................................................................................................................... 496
rsh ................................................................................................................................ 496
rcp................................................................................................................................ 496
rsync ............................................................................................................................ 496
rdist.............................................................................................................................. 496
r- ..................................................................... 496
SSH OpenSSH ............................................................................................................. 497
SSH ................................................................................................ 497
OpenSSH ..................................................................................................................... 497
OpenSSH ............................................................................... 497
SSH ..................................................................................... 502
SSH .................................................................................... 503
, OpenSSH ................................................................ 504
ssh-keygen ........................................................................................... 504
ssh-agent .............................................................................................. 504
ssh-add ................................................................................................. 505
sftp ....................................................................................................... 505
scp ........................................................................................................ 506
ssh-keyscan .......................................................................................... 506
........................................................................................................................... 507
32. Firewall ........................................................................................................ 508
...................................................................................................... 508
............................................................................ 510
........................................................................... 511
................................................................................... 512
............................................................................ 512

Copyright & A K-C

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

Copyright & A K-C

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

Copyright & A K-C

XXIX

MRTG ..................................................................................................... 565


MRTG .................................................................................... 566
RRDtool (Round Robin Database).......................................................... 569
........................................................................................................... 569
........................................................................................................................... 570
34. ......................................................... 571
PPP ................................................................................................................ 571
................................................................................................... 571
PPP ........................................................................................... 571
PPP .................................................................................................... 572
PPP ......................................................................... 573
............................................................................... 573
PPP ............................................................................. 573
PPP- (LCP) ...................................................... 574
, PPP .......................................... 575
, PPP................................................................ 576
(dial-in) .......................................................... 577
mgetty ....................................................................................................... 577
pppd .......................................................................................................... 578
callback- .......................................................................................... 579
callback- ............................................................................... 579
........................................................................................... 580
Linux- ....................................................................... 580
MS Windows ........................................................... 581
................................................ 581
.................................................................. 582
X Window ................................................................................ 583
3G- X Window.......................................................................... 583
........................................................................................................................... 588
35. ........................................ 589
..................................................................... 589
............................................................................... 592
.......................................................................................................... 592
............................................................................................................. 592
............................................................................................. 593
CD-RW ........................................................................................................................ 593
DVD-RW..................................................................................................................... 593
Blue Ray-......................................................................................................... 593
USB Flash- .............................................................................................. 593
....................................................................................... 593
................................................................................................................... 594
NAS ............................................................................................................................. 594

Copyright & A K-C

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

Copyright & A K-C

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

Copyright & A K-C

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

Copyright & A K-C

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

Copyright & A K-C

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

Copyright & A K-C

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


. ,
, ,
, . , . ""
"...
Cisco ". , , .
- 45
"" .
, , . ,
Linux .


- , . ? , , ( ,

Copyright & A K-C

Windows),
Linux (
). " " " 21 "
, , , , , , . ,
"" Linux , , , "".
.


. ,
.
I Linux.
, , ,
Linux .
:
, , . ,
.
,
.
II , "" Linux, , , .
, ;
, Linux ; Linux, , , ,
. , ,
, . .
III ,
, , " ". , , " ",
Fedora Core.
IV . () . , -

Copyright & A K-C

, , !

, "" , Linux/UNIX
, .

V. , . . ,
, ,
. , . ,
, ,
, . Linux,
: , FTP, HTTP, DNS, NFS, Proxy,
. .
VI , .
, , TV , . .
,
, ,
Linux .


,
, , , alexey_stahnov@ukr.net.
.

Copyright & A K-C

I
Linux

Copyright & A K-C

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.
, , .

Copyright & A K-C

I. Linux

, ,
. , , , , .
,
:
(-);
( ) ;
( ,
PC-) ( , PC-, Macintosh, Sun, PowerPC);
;
;
, ;
, ;
;
. .
. . , "
" " , ?"
,
( ). . .

1980 /usr/group UNIX.


1984 ANSI C.
1985 Portable Operating System Interface for Computing Environment,
POSIX ( ). ( ) POSIX.

FreeDOS
, MS-DOS.
GNU.
BIOS ,
.

Copyright & A K-C

1. Linux

Windows NT (Windows 2000, Windows XP,


Windows 2003 Server, Windows 2008 Server,
Windows Vista, Windows 7)
"DOS Windows 3.1x", Microsoft
Windows NT (New Technology), POSIX NTFS (New Technology
File System). Windows NT (
Windows 7 , Windows 2008). : Windows 7 (Windows
XP) Windows 2008 Server. ,
. , , -,
. , , (PC)
. .
Windows :
. ,
,
. , .
32-, 64- .
. ( ). , . NTFS,
FAT. Windows XP:
Celeron 800 , 128 ,
500 . Windows 7
1,6 , 1 , 3 . Windows 2008 Server: 1,6 , 1 , 1500 .
Windows XP Windows 7.

Embedded Windows
"" Windows. : Embedded Windows Windows CE. Embedded Windows Windows 2000, Windows XP
, "" , , "". .
, .

Copyright & A K-C

I. Linux

10

Windows CE (Windows mobile)


, , .
Microsoft . Windows CE 4.x ARM.
:
PocketPC 2000, PocketPC 2002, Pocket Mobile 2003, Windows CE .NET.
Microsoft .
API "" , ,
.
, ( ), "" . , .

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 -

Copyright & A K-C

1. Linux

11

, , .
, , .
, ,
, .
,
UNIX. , UNIX, , ,
. UNIX-
(, BSD,
Linux). POSIX
UNIX
. UNIX ,
. , UNIX , .
,

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

FreeBSD, OpenBSD, NetBSD


POSIX- UNIX
. :
FreeBSD , (
). Intel;
NetBSD ;
OpenBSD FreeBSD NetBSD .
, .
-
FreeBSD. , SCO, BSD/OS, Net/Free/OpenBSD, 386BSD Linux.

Linux
POSIX- UNIX- . . UNIX . -

Copyright & A K-C

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% (" ").
,

Copyright & A K-C

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 ,
).

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

: , - . .

Copyright & A K-C

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-,
. ( , , . .) .
, , , ,
,
. ,
. .

Copyright & A K-C

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.

Copyright & A K-C

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
.

Copyright & A K-C

1. Linux

17

, .
Linux ,
. , , (,
, ) ,
(
: , ),
.

(, , ), . , Linux (
, )
, CD-ROM, , Flash- , .
Linux
. WIN-, , ,
. . . . LiveCD USB Flash- ,
Linux , .
, , . Linux . , Windows
.
" ", "". UNIX . , ,
UNIX- . Linux
, . , ,
, -,
Linux. , , .
. Microsoft
. ( ) , . ,
" ".
( , 3040 % )
. Windows ,
, . , , ,

Copyright & A K-C

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,
-, , -
. . , , ,
, , .

Copyright & A K-C

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- .
, .
,
, , .

Copyright & A K-C

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.

Copyright & A K-C

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


Linux "" TCP/IP, . , ,
, .
, , Linux

Copyright & A K-C

I. Linux

22

IPX/SPX Novell Netware, NetBIOS ( "NetBIOS


TCP/IP"; Microsoft Windows 3.1x, Windows 9x/ME, Windows NT/2000/XP) AppleTalk (Apple Mac OS). , ,
, ,
95% .
Linux
, : Ethernet, Radio Ethernet, Wi-Fi, ArcNet, , ISDN, ATM, . , , .
,
Linux. , Linux
, netconf.

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. , ,

Copyright & A K-C

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.

. 2.1. Midnight Commander

Copyright & A K-C

I. Linux

24

, , , . . RPM, FTP, HTML, . XNC. ,


X Window, Nautilus, Kcommander Kruiser.



, . , 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 (

Copyright & A K-C

2. Linux

25

486- ), , " Windows, " KDE GNOME.


: ( )
, . , , Linux (
) X Window .
,
.



, CorelDRAW Photoshop.
, . , Gimp
, , , Windows, StarDRAW , StarImage
, KimageShop .

Web-
Web- , HTML-.
Linux, , HTML- . , , HTML-, OpenOffice, Amaya,
GINF, WebMaker ( , ) Quanta Plus (
, ).


,
Linux . ,
, Linux
, "" . ,
, ,
. - : Microsoft Office, , ,
, .
, :
();
;
( );
;

Copyright & A K-C

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.

Copyright & A K-C

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 ;

Copyright & A K-C

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

Copyright & A K-C

2. Linux

29

, Web- Borland. , . -, Kylix


Windows Wine. , Borland Delphi Linux, Wine
Windows- , Kylix
. , -, Kylix . ,
(Kylix 3
). Free Pascal
Lazarus.

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

Copyright & A K-C

I. Linux

30

Glade

GTK+ (. 2.3).

. 2.3. Glade

Rhide
DOS Turbo Vision. C, C++, Assembler, Pascal Fortran. gdb , Turbo Debugger.
, , .

Eclipse

. ,
. Java, .

Copyright & A K-C

2. Linux

31

. 2.4. Eclipse

. 2.5. Lazarus

Copyright & A K-C

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,

Copyright & A K-C

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 ,

Copyright & A K-C

I. Linux

34

( Quake, Unreal). Id Software


Linux- . , , , , Linux- Windows. FreeCiv FreeCraft.
, , , Linux
. , Windows .

, 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.

Copyright & A K-C

. ? ?
?
, ,
,
. , , , , , , .
,
, -
( , ).
. , ""
.
. , , . , , , .
.
, .
, . () , , , ,
. .
,
. ,
:
;
, ;
"" ( ,
, . patch , );

Copyright & A K-C

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") .
, , -

Copyright & A K-C

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. , ,
. ,

Copyright & A K-C

I. Linux

38

, . , Sisyphus. Web-: www.altlinux.ru.


CentOS , Red
Hat Enterprise Linux .
Mandriva Mandriva Linux. , , KDE . Web-:
www.linuxmandriva.com/ru.
BestLinux SOT Finish Software Engineering.
.
Web-: www.bestlinux.net/ru, www.bestlinux.net.
TurboLinux TurboLinux Inc. ,
. Web-: www.turbolinux.com.
Lycoris Joseph Cheek. , Windows Linux , . Web-: www.lycoris.com.
OpenWall Linux
.

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,

. , -

Copyright & A K-C

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.

Copyright & A K-C

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.

Copyright & A K-C

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-, .

Copyright & A K-C

II

Linux

Copyright & A K-C

.

, . , " ". .


, ,
.
, :
(OSI);
TCP/IP.

, (. 4.1).
4.1.

DNS (Domain Name Service,


)

,
TCP/IP

FTP (File Transfer Protocol,


)

IP (Internet Protocol,
)

TCP/IP. IP

NFS (Network File System,


)

Copyright & A K-C

II. Linux

46

4.1 ()

NIC (Network Information


Center, )

(Node, Host)

. ,

OSI (Open System


Interconnection, )

RFC (Request For Comments,


)

RIP (Routing Information Protocol, )

SMTP (Simple Mail Transfer


Protocol,
)

SNMP (Simple Network Management Protocol,


)

TCP (Transmission Control


Protocol, )

Telnet

, ,

UDP (User Datagram Protocol, )

(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).

Copyright & A K-C

4. .

47

,
.
OSI , , , . , "" ,
, :
. . 4.2 OSI.
(. 4.3).
4.2. OSI


. , , , . .


( )
( )

4.3.

()

5, 6, 7

, OSI
GOSIP (Government Open Systems
Interconnection Profile, ),

Copyright & A K-C

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

()

, TCP/IP OSI, TCP/IP OSI.


*

"" , ,
. .

Copyright & A K-C

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

Ethernet, FDDI, ATM

SMTP

NFS

SNMP

ICMP

, , . .

()
()
TCP/IP TCP/IP, ARP/RARP ICMP.

IP
IP 1970- , . IP (

Copyright & A K-C

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.
,

Copyright & A K-C

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-

. ,
;
, (, ), ,
. .

Copyright & A K-C

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

Copyright & A K-C

4. .

53

IPv4. , , IPv4 , IPv6, .


, . .
. .
,
. , .


. , , ,
. ,
. . ,
.


(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,
;

Copyright & A K-C

II. Linux

54

DVMRP (Vector Multicast Routing Protocol) -

;
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

Copyright & A K-C

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, ,

Copyright & A K-C

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

Copyright & A K-C

4. .

57

4.7 ()


,
DF (
)


.
0,
1, 4 5.
2 3

.
,


.
,
, .

, , .



,
. , 0

- .
- .
-
. ,
,

, -.
, 0

Copyright & A K-C

II. Linux

58

4.7 ()

0,
1

.
, ,
, ,
.
.
, . 0
,

13

.

,
.
32 , ,
(UT). , .
,
.
,
, .
,
0

14

15

.
, IP- .
IP- .
,
, .
,
0

16

11

12

Copyright & A K-C

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:

.
;
.
;

Copyright & A K-C

II. Linux

60

""
, ,
. , "" .

;
.

, TCP, . , .

UDP
UDP . , ,
UDP, , .
. , , . UDP , TCP.
, UDP:
DNS;
, NTP;
, BOOTP.
, ( , . .)
.
TCP.


, . ,
, ,
. "" , RFC.
( TCP),
(
UDP). (, SMTP, HTTP),
.

Copyright & A K-C

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),
;

Copyright & A K-C

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

RFC827, RFC904, RFC911

EGP

RFC854

Telnet

RFC950

RFC959

FTP

RFC1058

RIP

RFC1094

NFS

RFC1157

SNMP

RFC1178

RFC1180

TCP/IP

RFC1208

RFC1219

Copyright & A K-C

4. .

63

4.9 ()

RFC1234

IPX- IP

RFC1245, RFC1246,
RFC1247, RFC1583

OSPF

RFC1267

BGP

RFC1597

IP-

RFC1700

www.rfc-editor.org , RFC.

Copyright & A K-C


, ,
. , . ""
(, 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 , , . .

Copyright & A K-C

5.

65


(
, , . .), . Linux :
;
;
;
(FIFO, PIPE);
(soft link);
(Socket).

.
. .

.
. , ,
, .
. . " Ext2".


Linux . . : .
( ),
. , .

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

Copyright & A K-C

II. Linux

66

, ,
"" :
ls l , .
.
, .
, ,
. , .


TCP/IP.


Linux , : , . ,
, . Linux.
( ) (
/ ) , .
, .

( ) .
( root).
chmod.


(- ,
) :
, ,
. .
( ) , . ,
. , , 644, , , .
, ,
.

Copyright & A K-C

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

10:15 [ -> test

2010 4odb_metadig

, , ,
, .
test ( l , , ). t
( d , (directory), ). . .
(, , . .). : rwx (, , ).
, .


, . :
Sticky bit (Save Text Attribute) "" ;
SUID (Set User ID) ;
SGID .

Copyright & A K-C

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);
;
( );
;
.

Copyright & A K-C

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.

Copyright & A K-C

II. Linux

70

sysv System V ( x86).


hpfs " " HPFS.
nfs ,


.
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. .

Copyright & A K-C

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.

Copyright & A K-C

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 , , .

Copyright & A K-C

5.

73

fsck (
,
read-only), . . ,
-
, .
badblocks.
, fsck .

(VFS)
VFS ,
.


Linux -, .

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

VFS
,
(, , ,
). , : , .
,
. . ,
/.

Copyright & A K-C

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,

Copyright & A K-C

5.

75

Not Clean ( "").


read-only,
Clean (""). .
. Erroneous ("").
, Ext2 . , ,
read/write. (
), ( ), Clean.
. .
Ext2 . , tune2fs .
:
;
read-only;
.
, :
;
;
, root.

Ext2
, Ext2 .
(primary, Fdisk Microsoft)
,
.
(1, 2 4 ).
( ).
.
, , .
. (. 5.1).
, . ,
, 1024
1024 . .

Copyright & A K-C

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) ,
.
.

Copyright & A K-C

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 .
, .

Copyright & A K-C

78

II. Linux

e2fsck , , 1B 1D ,
.

. ,
.
"." ( ) ".." ( ), "." .
. e2fsck
. ".." . ,
, /lost+found.
e2fsck
. /lost+found.
e2fsck
. ,
, , , .


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

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

Copyright & A K-C

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. ,

Copyright & A K-C

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", , .

Copyright & A K-C

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.

Copyright & A K-C

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.1, /usr , /var/lock .


, .
UNIX-.

Copyright & A K-C

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

Copyright & A K-C

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);

Copyright & A K-C

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. , ,

Copyright & A K-C

II. Linux

86

( Slackware), /boot ( Red Hat).


/boot,
1024 . BIOS .
, , /grub, . , /boot Linux Red
Hat :
boot.0300
boot.b
chain.b
kernel.h@

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", , /etc ,


.

/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);

Copyright & A K-C

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.
(, , ) , (
).

Copyright & A K-C

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

Copyright & A K-C

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:::

Copyright & A K-C

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- , ;

Copyright & A K-C

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

Copyright & A K-C

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

# TCP port service multiplexer

tcpmux

1/udp

# TCP port service multiplexer

shadow , passwd. -

. . ,
*.
, *.
shadow 6.5.

Copyright & A K-C

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 ,
;

Copyright & A K-C

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

, .

Copyright & A K-C

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

Copyright & A K-C

II. Linux

96
subDeviceId: 1130
pciType: 1
class: OTHER
bus: PCI
detached: 0
driver: unknown

desc: "Intel Corporation|unknown device 8086:1131"


vendorId: 8086
deviceId: 1131
subVendorId: 0000
subDeviceId: 0000
pciType: 1
class: OTHER
bus: PCI
detached: 0
driver: unknown
desc: "Intel Corporation|82820 820 (Camino 2) Chipset PCI"
vendorId: 8086
deviceId: 244e
subVendorId: 0000
subDeviceId: 0000
pciType: 1
class: OTHER
bus: PCI
detached: 0
driver: i810-tco
desc: "Intel Corporation|82820 820 (Camino 2) Chipset ISA Bridge
(ICH2)"
vendorId: 8086
deviceId: 2440
subVendorId: 0000
subDeviceId: 0000
pciType: 1
class: OTHER
bus: PCI
detached: 0
driver: unknown
desc: "Intel Corporation|82820 820 (Camino 2) Chipset IDE U100"

Copyright & A K-C

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

Copyright & A K-C

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

desc: "Intel Corporation|82801BA/BAM (ICH2) AC'97 Audio Controller"


vendorId: 8086
deviceId: 2445
subVendorId: 11d4
subDeviceId: 5360
pciType: 1
class: CDROM
bus: IDE
detached: 0
device: hdc
driver: ignore
desc: "SONY CD-ROM CDU4821"
class: VIDEO

Copyright & A K-C

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

Copyright & A K-C

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, .

Copyright & A K-C

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.

/etc/X11 X Window System


X11,
. , :
Xconfig XFree86;
XF86Config XFree86 3 4;
Xmodmap X11.

/etc/sgml SGML XML


SGML XML. *.conf
. *.cat DTD- , .

Copyright & A K-C

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.

Copyright & A K-C

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,
,
( ). ,
.

Copyright & A K-C

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 , ;

Copyright & A K-C

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 ;

Copyright & A K-C

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- () , .

Copyright & A K-C

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
.

Copyright & A K-C

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-;

Copyright & A K-C

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,
( , ).

Copyright & A K-C

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 .

Copyright & A K-C

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 .
, .

;

Copyright & A K-C

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 639. -

;
<> (
ISO 3166);
< > .
, , ;
<> .
, , , ,
.
. 6.3.

Copyright & A K-C

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, .

Copyright & A K-C

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, .

Copyright & A K-C

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, -

Copyright & A K-C

116

II. Linux

, /var/lib<_>.
, :
/misc ;
/<> , ;
/rpm RPM. ;
/<> ;
/xdm X-.

/var/lock lock- (-)


Lock- (-) , "" -
, . ,
. /var/lock
, , :
/console , ;
/samba , Samba.

/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.

Copyright & A K-C

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,
.

Copyright & A K-C

118

II. Linux

/var/yp Network Information Service (NIS)


()
(Network Information Service, NIS), , " " (Sun Yellow Pages, YP),
.

http://www.pathname.com/fhs/ Filesystem Hierarchy Standard

.
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.

Copyright & A K-C

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 , , , ( , ). ,

Copyright & A K-C

120

II. Linux

init , : ,
, . .
.

-
Linux,
, .

LILO LInux LOader


-,
. LILO (LInux Loader Linux) DOS, OS/2, Linux, FreeBSD, Windows
.
LILO
,
. LILO
( )
, . LILO
linux dos ( Windows 9 Linux).
LILO /etc/lilo.conf, .

GRUB
GRand Unified Bootloader ( ) , .
LILO , .

LoadLin
Linux, , Linux DOS ( ).
LoadLin , LILO MBR (Master Boot Record) .
, , DOS .
, Linux,
.

Copyright & A K-C

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.
, . -

Copyright & A K-C

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 .

Copyright & A K-C

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
.

Copyright & A K-C

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.

Copyright & A K-C

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>

Copyright & A K-C

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, - .

Copyright & A K-C

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-
. .

Copyright & A K-C

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) . , , ,
.

Copyright & A K-C

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.

Copyright & A K-C

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,

Copyright & A K-C

7. Linux

131

LUN). SCSI- , LUN.


SCSI- LUN,
. .
, LUN.
LUN
max_scsi_luns=n, n 1 8.

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 , -
, (, )
.
.

Copyright & A K-C

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-
. ,
, -
, .

Copyright & A K-C

7. Linux

133

PCBIT ISDN (pcbit)


:
pcbit=membase1,irq1[,membase2,irq2],

membaseN N- ; irqN
N- . IRQ=5 membase=0xD0000.

Teles ISDN (teles)


ISDN- :
teles=iobase,irq,membase,protocol,teles_id,
iobase / ; membase ; irq , ; teles_id .

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 / .


,
.

Copyright & A K-C

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

. .;

Copyright & A K-C

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, .
( , ), , ,

Copyright & A K-C

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 , ;

Copyright & A K-C

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:

Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>

Copyright & A K-C

II. Linux

138
#

Modified for RHS Linux by Marc Ewing and Donnie Barnes

#
# Default runlevel. The runlevels used by RHS are:
#

0 halt (Do NOT set initdefault to this)

1 Single user mode

2 Multiuser, without NFS (The same as 3, if you do not have

networking)

3 Full multiuser mode

4 unused

5 X11

6 reboot (Do NOT set initdefault to this)

#
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.

Schedule a shutdown for 2 minutes from now.

# 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"

# Run gettys in standard runlevels

Copyright & A K-C

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

, , rc, , . , rc.sysinit rc, . " " .

Copyright & A K-C

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.

Copyright & A K-C

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.

Copyright & A K-C

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 .

Copyright & A K-C

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

Copyright & A K-C

II. Linux

144
RETVAL=$?

[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/anacron


return $RETVAL
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status anacron
;;
restart)
stop
start
;;
condrestart)
if test "x"pidof anacron"" != x; then
stop
start
fi
;;
*)
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
exit 1
esac
exit 0
###################################################################

:
#!/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) .

Copyright & A K-C

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 ;

Copyright & A K-C

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 , , , ;

Copyright & A K-C

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
. , .
,
. -

Copyright & A K-C

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 .

Copyright & A K-C

Linux
, , Linux. , .


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


: ", , ". , , :
. , , ,
, , .

, .
,
, . , .
. ,
.

Copyright & A K-C

150

II. Linux


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


, , " " , , .
,
, .
, ,
. , :
", ".

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


, , . ,
. , -

Copyright & A K-C

8. Linux

151

, ( )
.

. , , .
. ,
, , .


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


,
, , ,
.
, , ,
, Rack Mount.
. , .

BIOS
BIOS , ,
99% BIOS.
BIOS
BIOS. ( BIOS ,
- ),
. ,
.

Copyright & A K-C

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 , .
, , , . () . , .

Copyright & A K-C

8. Linux

153

, :
;
, -

;
, -

;
;

su , .
,
. , ,
uptime.


. , . .
, rm "" .



. , :
;
, ;
, ;
, .

root

(root). " ", ,
, .
root , , . ,
root:

. ,
, ;

Copyright & A K-C

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;
, , , . ,
- ;
.
.

Copyright & A K-C

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
.

Copyright & A K-C

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 ) .

Copyright & A K-C

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, - .

Copyright & A K-C

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-
. , . , , , ,
,
.

Copyright & A K-C

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 . , , ,
.


, . , -

Copyright & A K-C

160

II. Linux

. , , SATAN ISS. SATAN ( ) Web. ,


. ISS ( ) . , SATAN, .


.
, ,
- . .

" "
. " ,
".
,
. :
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. -

Copyright & A K-C

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, , , .
.

Copyright & A K-C

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 .
.

Copyright & A K-C

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 . .

.
. . " " .


, ,
. :
;
, . . ;
.

Copyright & A K-C

164

II. Linux

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

RPM-
, RPM. ,
. , ,
RPM- , , .
RPM- ,
. RPM (/var/lib/rpm/*)
.

rpm Va


RPM.


,
, .
, , . . ,
/var/log.
.

. , , /etc/syslog.conf,
syslog, . ,
- , , .
.
syslog ,
. -

Copyright & A K-C

8. Linux

165

.
syslog.conf
(man-).


Linux -.
, . , Fedora 700 . ! .
: " !"
. - . . .
, ,
.


,
. .



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


. ?


, ,
. , Samba.
-

Copyright & A K-C

166

II. Linux

. ,
- .
, . .
.


. , . , , .
, .
Linux , kickstart,
, . . , .
, , "" .


, , ,
. , ,
- . ,
( internic). ,

. , , ,
, .
, .
, . : " ".
,
.

, UNIX Linux.
.
, Linux,
www.subscribe.ru.
:
www.rootshell.com , ;
www.netspace.org/lsv-archive/bugtraq.html/ ;

Copyright & A K-C

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 .

Copyright & A K-C

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. , -

Copyright & A K-C

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 -

Copyright & A K-C

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);
: , , , , -

, . .;

Copyright & A K-C

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.

Copyright & A K-C

II. Linux

172


, ,
( Group). . 9.1.
.
Amusements .
, (, , , , . .):
Games ;
Graphics ,
(Screensavers).
Applications . ( ) . , (, , ):
Archiving ;
Communications , , .
, , ISDN, ATM, ;

. 9.1.

Copyright & A K-C

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 , .

Copyright & A K-C

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");
<_>

Copyright & A K-C

9. RPM- DEB-

175

-httpport <> <> HTTP- proxy- (. . "

FTP/HTTP");
-pipe <cmd> RPM <cmd>.


RPM:
rpm -i [-] <_>

RPM:
rpm -U [-] <_>


, rpm ,
,
. , , ,
, .
:
rpm -F [-] <_>

rpm --freshen [-] <_>

,
.
<_> 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 ;

Copyright & A K-C

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- ;

Copyright & A K-C

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 , ;

Copyright & A K-C

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 -verify [-]

RPM.
, MD5, ,
, . . , .
, (, , -excludedocs), .
, . .
(, , ,
, , ).
, (, login).

Copyright & A K-C

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_>

rpm -tO [-] <arc_>

-b , spec. rpm gzip, -t. O, ,


:
-bp %prep spec-. ( . patch ,
, );
-bl . %files spec- ;
-bc %build spec- (
%prep). make;
-bi %install spec- ( %prep %build).
make install;

Copyright & A K-C

180

II. Linux

-bb ( %prep, %build

%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 .
.

Copyright & A K-C

9. RPM- DEB-

181

rpm -addsign <__>

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.

<password> , ( user/hostname). <user>, <password> ,


anonymous ftp. (PASV) FTP.
RPM FTP:
-ftpproxy <hostname> <hostname> proxy , FTP-
firewall, proxy .
_ftpproxy;
-ftpport <port> TCP-, FTP-
. _ftpport.
RPM HTTP:
-httpproxy <hostname> <hostname> proxy , HTTP-
firewall, proxy .
_httpproxy;

Copyright & A K-C

182

II. Linux

<port> TCP-, HTTP . _httpport.

-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 <__> <__> <__>

:
rpm i cpp-2.96-85.i386.rpm

, .
( , ) ,
. , .
, , . . .
:
rpm -i <___1> <___2>

, , ,
, , . ,
rpm -U <__>

, , , .
.
rpm -F <__>

, ,
. FTP.

Copyright & A K-C

9. RPM- DEB-

183

, FTP- bluewater. FTP- Red Hat RPM


FTP- . ,
( C++):
rpm -F ftp://bluewater/pub/linux/updates/redhat-7.1/cpp-2.96-85.i386.rpm

RPM :
. , , h,
.
:
rpm ih cpp-2.96-85.i386.rpm

rpm ivh cpp-2.96-85.i386.rpm

, RPM , - . , , ( ,
).
. ,
.
.
Red Hat 7.1, GNOME Sawfish. , : Sawfish
(, ) (
). ,
, .
,

rpm -rebuild Sawfish-1.0-1.src.rpm

/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, ,

Copyright & A K-C

II. Linux

184

: " -, ". , , , . , ,
RPM, .
, :
rpm -e <_>

.
, RPM : " ".
, :
,
, . .
, ,
.
,
. , - ,
-nodeps force, .
, , :
rpm -q <_>

, rpm -q cpp : cpp-2.96-85.



:
rpm -qi <__>

rpm -qi cpp-2.96-85 9.1.


9.1
Name

: cpp

Version

: 2.96

Release

: 85

Relocations: (not relocateable)


Vendor: Red Hat, Inc.
Build Date: 09 2001 21:04:50

Install date: 31 2001 07:38:10


porky.devel.redhat.com
Group

: Development/Languages

Size
Packager

: 292618

URL
Summary

Build Host:

Source RPM: gcc-2.96-85.src.rpm

License: GPL

: Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>


: http://gcc.gnu.org
: The C Preprocessor.

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.

Copyright & A K-C

9. RPM- DEB-

185

The C preprocessor provides four separate functionalities: the inclusion


of header files (files of declarations that can be substituted into your
program); macro expansion (you can define macros, and the C preprocessor
will replace the macros with their definitions throughout the program);
conditional compilation (using special preprocessing directives, you can
include or exclude parts of the program according to various conditions);
and line control (if you use a program to combine or rearrange source
files into an intermediate file which is then compiled, you can use line
control to inform the compiler about where each source line originated).
You should install this package if you are a C programmer and you use macros.

rpm -ql <__>

( , ).
, 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

Copyright & A K-C

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 :
;
( -

);
.

Copyright & A K-C

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.

Copyright & A K-C

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 . , .

Copyright & A K-C

9. RPM- DEB-

189

. 9.2. Midnight Commander, RPM

purp
purp , , , . , RPM. . 9.3 .

. 9.3. purp

Copyright & A K-C

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.

Copyright & A K-C

9. RPM- DEB-

. 9.5. Kpackage

. 9.6. GnoRPM

191

Copyright & A K-C

192

II. Linux

Yumex
Yumex (Yum extender) Yum. , , .
Python. fedorahosted.org/yumex/.

. 9.7. Yumex

glint, grpm, gtkrpm . Kpackage GnoRPM KDE GNOME.

DEB-
RPM-, Red Hat Based , DEB-, Debian.
deb, . ,
:
debian-binary ;
control.tar.gz (, );
data.tar.gz .
, DEB- .

Copyright & A K-C

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-.

Copyright & A K-C

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.

Copyright & A K-C

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

Copyright & A K-C

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) ;

Copyright & A K-C

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 _

Copyright & A K-C

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. : .

Copyright & A K-C

III
Linux

Copyright & A K-C

10


Linux.
Linux ( ) , , .
.
( ), Linux
.
,
. , Linux
.
, ( . .).
:
- ( ), . Windows 9 ( ,
) . Windows
, /
.
Linux . -,
. , , ,
"". ,
2.2 2.4. , . : " ".
,
. -,
" " -, .
, , .

Copyright & A K-C

202

III. Linux


- . :
"" ( );
;
;
.

.


, . . . .
( ,
).



. . . . .
:
;
RAID-, ;
;
;
( );
SCSI- ( );
, ( -), ;
( );
( ).
, . ( ).
, . .
.

Copyright & A K-C

10.

203


, , :
IP-;
;
;
IP- DNS-;
;
.


, Linux. , . Linux.
.
, , Fedora ( ): 86
400 , 512 ( 1 )
10 .

. , . , (, . route
, , - , ) - ,
. , - .
.

, . ,
, . Swap- (-, ),
. ,
- .
,
-.

Copyright & A K-C

204

III. Linux

, - .
, - , .


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

/
/ .
. / , .
Linux,
, .
, ,
.
(/bin, /dev, /etc, /mnt . .), , ,
.

/bin
/bin , . , , , /bin
, . , /bin . /bin
.

/boot
/boot , .
, ,
,
. , . ,

Copyright & A K-C

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
. . ,

Copyright & A K-C

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.
. , , .

Copyright & A K-C

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.


, .
, ,
. ,
, .
.


,
,
. -

Copyright & A K-C

208

III. Linux

/, /boot, /tmp, /usr, /var. .


DNS

DNS .
, .
/var
100 , DNS .
NIS

NIS ,
DNS, , , YP. ( /var/yp/maps.)
/var /var/log. /var/log
50 , /var
YP.
NIS , ,
/var /var/log .

/var /var/spool . /var/log


100 .
. /var/spool
, , . ,
.
FTP HTTP

FTP- HTTP- /var /var/log


100 ,
.
.
, , FTP- HTTP-, . (,
" "). FTP HTTP
, .
.
NFS

, NFS,
. , -

Copyright & A K-C

10.

209

. NFS-
. , .
Samba

NFS, Samba . NFS.


,
. ( , ,
. .)
.
/var/spool/news , , ,
.
. ,
. ,
34 ,
.

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

, /var /var/log.

, .
.
, ,
/opt /usr/local. ,
, . ,
, .
.
RAID-.

Copyright & A K-C

210

III. Linux


. -, . -, .

,
.



.
-. RAM 2
80% . . ,
- -.
, ( 1 ),
- 2 . . 1 .

- free top. 50% ,
-.
:
() , , ;
, ();
.
( ,
), 23 :
/ ;
/boot ( );
/swap (-).
( ) .
, , .
: .
: , , (, ), ,
.

Copyright & A K-C

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.

Copyright & A K-C

212

III. Linux

SCSI-. FAQ HOWTO.


"".

.
.

www.redhat.com/support/manuals .
The Official Red Hat Linux x86 Installation Guide

Red Hat Linux x86.


linuxiso.org , ISO-.
www.linuxlinks.com .
http://rus-linux.net Linux.
www.debian.org Debian.
www.redhat.com Red Hat.
www.asplinux.ru ASP Linux.
www.mandriva.ru Madriva.
www.bestlinux.net Best Linux.
www.turbolinux.com Turbo Linux.
www.slackware.com Slackware.
www.novell.com/linux/ SuSE.

Copyright & A K-C

11


: , . , .
-, . , ,
, .
-, Red Hat kickstart, .
. , -,
( ). ,
, .
,
.
- , (
PCMCIA) Flash-.


(15 , 25 7 ), , ,
. . 11.1 .
11.1. Fedora Core

<Ctrl>+<Alt>+<F1>

<Ctrl>+<Alt>+<F2>

Copyright & A K-C

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.

Copyright & A K-C

11.

215

. 11.2.

. 11.3.

. 11.4.

Copyright & A K-C

III. Linux

216

. 11.5.

. 11.6.


, (. 11.7).
(. 11.8)
(. 11.9).
.
root (. 11.10).
.

Copyright & A K-C

11.

217

. 11.7.

. 11.8.

Copyright & A K-C

218

III. Linux

. 11.9.

. 11.10. root

Copyright & A K-C

11.

219


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

. 11.11.


, . "" , .

. , (. 11.12).

Copyright & A K-C

220

III. Linux

. 11.12.

. 11.13.

Copyright & A K-C

11.

221

, , (. 11.13).
:






.


,
(. 11.14).
, ,
. (. 11.15).
.

. 11.14.

Copyright & A K-C

III. Linux

222

. 11.15.


(. 11.16).
GPL (. 11.17).
( )
(. 11.18). ,
.

(. 11.19). .
(. 11.20). ,
(. 11.21).


( ) , .

Copyright & A K-C

11.

223

. 11.16.

. 11.17.

Copyright & A K-C

III. Linux

224

. 11.18.

. 11.19.

Copyright & A K-C

11.

225

. 11.20.

. 11.21.

Copyright & A K-C

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.

Copyright & A K-C

12


, , . . , ,
. .
root . . .

. .
, , , , . ,
.

Linux .



. , , . X Window, ( , GNOME) -, RPM (, ,
-). , . , .
, : .
, - ,
, . , , .

Copyright & A K-C

228

III. Linux

,
.


, ,
.
, .
, ,
Linux- ,
. , .
,
"" , , Microsoft Office.
OpenOffice. , .
( ), . , . , finger, r- (rlogin,
rcopy . .), telnet ( ) ,
. ,
, SSH. ( ) ,
- .
, , . , , ,
. telnet ,
. .
.
, ,
NTP . .
.
, , . :
;
,
;
, .

Copyright & A K-C

12.

229

. DVD - , IP-. , .
. , . . .
( ).
. , , (
, ).
, , .
, , .

,
.
, ,
.
, .
,
,
, FTP-, HTTP- . . ,
( ) ( )
, , Web- , .
, - , - .
. (C/C++ , Perl Pyton . .),
. " ", .

Copyright & A K-C

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), .
;

Copyright & A K-C

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. , , , .

Copyright & A K-C

232

III. Linux

3. , root , .
4. root , . ,
.
5. root .
6. logrotate: log- 100
200 .
7. .
8. .
, .
9.
.
10. ,
, , .
.
11. .
"UNIX:
" " Linux".

www.linuxdocs.org Network Administrator's Guide.


www.linuxdocs.org

HOWTO:
Security-HOWTO;
Hacker-HOWTO;
NFS-HOWTO;
Firewall-HOWTO.

Copyright & A K-C

IV

Linux

Copyright & A K-C

13

- . UNIX- , , , .
.

apropos
apropos () whatis
(. ) .

Man-
Linux
:
man _

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

whatis
whatis - . , .

Copyright & A K-C

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/ ,
.

Copyright & A K-C

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.

Copyright & A K-C

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). , .
.

Copyright & A K-C

14.

239

, Linux .
, . . Linux
() . ,
Windows .
, , ,
, .

/,
( , ). . . / .
<.
,
mysql <2.sql

mysql , 2.sql.
> >>.
? > ,
. ,
. >> ,
, .
:
command 2>&1

.
:
df > 1.txt
ls A >>1.txt

/ .

()
(, pipe) |. . .
:
ls | grep

Copyright & A K-C

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

Copyright & A K-C

14.

241

;
;
;
;
.
:
MM
dd
hh
mm
yy

date

9 19:57:30 EEST 2011

man date.


, .


, " "
.
chgrp

chgrp , , (GID). man chgrp.


chmod

chmod , , .
:
[ugoa...][[+-=][rwxXstugo...]...][,...]

, . -
u, g, o a (, ) , , :
u ;
g ;
o , ;
a . a ugo ;
+ ;
- ;
= .
rwxXstugo ,
ugoa:
r ;
w ;

Copyright & A K-C

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.

Copyright & A K-C

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.

Copyright & A K-C

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:

x86 boot sector

/dev/hda1:

Linux/i386 ext3 filesystem

/dev/hda2:

x86 boot sector

/dev/hda3:

x86 boot sector, extended partition table

/dev/hda4:

Linux/i386 ext3 filesystem

/dev/hda5:

Linux/i386 swap file

/dev/hda6:

Linux/i386 swap file

/dev/hda7:

Linux/i386 swap file

/dev/hda8:

Linux/i386 swap file

/dev/hda9:

empty

/dev/hda10: empty

man file.
find

find . , , .
man find.

Copyright & A K-C

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 ;

Copyright & A K-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

4096 31 10:29 Desktop


6 16:10 file
6 16:10 find

6 16:11 lss

6 16:11 uptm

man ls.
mc

mc Midnight Commander,
. Midnight
Commander ,
<F1>.
mkdir

.
0777 , umask.
:
mkdir test

man mkdir.

Copyright & A K-C

14.

247

mkfifo

mkfifo (FIFO) .
FIFO ,
. FIFO- , ,

shell.
man mkfifo.
mv

mv .
, mv . ,
.
:
mv /tmp/test /home/user1

test /tmp /home/user1.


man mv.
pwd

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

Copyright & A K-C

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.

Copyright & A K-C

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-, .

Copyright & A K-C

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 , , . .
. .

Copyright & A K-C

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

56(84) bytes of data.


time=214 usec
time=69 usec
time=29 usec
time=30 usec

--- 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 .

Copyright & A K-C

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
.

Copyright & A K-C

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

Link encap:Local Loopback


inet addr:127.0.0.1

Mask:255.0.0.0

UP LOOPBACK RUNNING

MTU:16436

Metric:1

RX packets:14 errors:0 dropped:0 overruns:0 frame:0


TX packets:14 errors:0 dropped:0 overruns:0 carrier:0

Copyright & A K-C

IV. Linux

254
collisions:0 txqueuelen:0
ppp0

Link encap:Point-to-Point Protocol


inet addr:195.114.131.239 P-t-P:195.114.128.4 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST

MTU:1500

Metric:1

RX packets:174301 errors:31 dropped:0 overruns:0 frame:0


TX packets:98860 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3

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 . ,
, ;

Copyright & A K-C

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. ,

Copyright & A K-C

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 , , , , , .

Copyright & A K-C

14.

257

:
;
;
;
;
TAR-;
;
;
;
;
;
;
;
;
;
;
.
rpm . 8.

rmmod
rmmod ,
.
man rmmod.

setserial
setserial .
:
setserial ttyS0

man setserial.

setterm
setterm . ,
.
man setterm.

skill
.
TERM.

snice
snice . +4.
+ .

Copyright & A K-C

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
, . . -

Copyright & A K-C

14.

259

,
/usr/share/zoneinfo/ .


df
df
.
, .
1024 , ,
POSIXLY_CORRECT ( POSIX-).
:
df
Filesystem

1k-blocks

Used Available Use% Mounted on

/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

.........

Copyright & A K-C

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

wtmp begins Sun Nov

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

Copyright & A K-C

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.

Copyright & A K-C

IV. Linux

262
14.11
top

4:19pm up 13 min, 2 users, load average: 0,01, 0,02, 0,00


37 processes: 36 sleeping, 1 running, 0 zombie, 0 stopped
CPU states: 1,0% user, 1,0% system, 0,0% nice, 97,8% idle
Mem:319968K av, 50468K used, 269500K free, 0K shrd, 4164K
Swap: 216868K av, 0K used, 216868K free, 29524K cached
PID USER
PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME
1 root
8
0
544 544
472 S
0,0 0,1
0:04
2 root
8
0
0
0
0 SW
0,0 0,0
0:00
3 root
9
0
0
0
0 SW
0,0 0,0
0:00
4 root
9
0
0
0
0 SW
0,0 0,0
0:00
5 root
9
0
0
0
0 SW
0,0 0,0
0:00
6 root
9
0
0
0
0 SW
0,0 0,0
0:00
7 root
9
0
0
0
0 SW
0,0 0,0
0:00
61 root
9
0
0
0
0 SW
0,0 0,0
0:00
364 root
9
0
600 600
500 S
0,0 0,1
0:00
369 root
9
0 1060 1060
460 S
0,0 0,3
0:00
383 rpc
9
0
596 596
504 S
0,0 0,1
0:00
398 rpcuser 9
0
772 772
668 S
0,0 0,2
0:00
470 root
8
0
532 532
464 S
0,0 0,1
0:00
519 root
9
0
648 648
544 S
0,0 0,2
0:00
531 daemon
9
0
584 584
508 S
0,0 0,1
0:00
546 root
9
0 1136 1136
948 S
0,0 0,3
0:00
566 root
9
0
992 992
788 S
0,0 0,3
0:00

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,

load average: 0.04, 0.04, 0.01

users
users ,
. /etc/utmp.

who
.
, , .

Copyright & A K-C

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.

Copyright & A K-C

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 - . , .

Copyright & A K-C

14.

265

:
whatis du
du

(1)

estimate file space usage

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 .

Copyright & A K-C

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.

Copyright & A K-C

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
. , .

Copyright & A K-C

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.

Copyright & A K-C

V

Linux

Copyright & A K-C

15


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

, , ,
, , .


. Linux? , " ", Linux , . ,
- ,
( )
,
,
.
,
Linux.
Linux- ,
, , , .
, Linux
, , , . .

Copyright & A K-C

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);

Copyright & A K-C

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 .

Copyright & A K-C

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, .
.

Copyright & A K-C

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>).

Cyrillic console tools


(CP866).
, VGA
.
Unicode.
Unicode
, , , .
:
consolechars -f UniCyr_8x16.psf -m koi8-r.acm
loadkeys console_russian.map

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

Copyright & A K-C

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

Copyright & A K-C

15.

277

less
less ~/.lesskey :
LESSCHARSET=

LESSCHARSET=
. lesskey
~/.less.

mc (The Midnight Commander)


mc, <F9>
, Options | Display full 8 bits.

nroff
nroff
Tlatin1.

man
man , less.
/usr/lib/man.conf :
NROFF

/usr/bin/groff -S -Tascii -mandoc

NROFF

/usr/bin/groff -S -Tlatin1 -mandoc

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

(character set = koi8-r)


(client code page = 866).
,
.

Copyright & A K-C

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

Copyright & A K-C

15.

279

:
language , (ru, fr . .);
TERRITORY , (RU, UA . .);
Codeset .

ISO 639 , ISO 3166 .


LANG , ,
LANG="ru_RU.KOI8-R" LANG="ru_RU.ISO_8859-5".
,
.
: "C" "POSIX".
, . locale ( ). . 15.1
.
15.1.

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 " ".
.

Copyright & A K-C

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- ;
, ;
, .

Copyright & A K-C

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

win koi pine, .pinerc :


display-filters=_CHARSET(iso8859-5)_ /usr/local/bin/icat,
_CHARSET(utf-8)_ /usr/local/bin/ucat,
_CHARSET(windows-1251)_ /usr/local/bin/wcat

icat, wcat ucat ,


iconv.

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
.
-

Copyright & A K-C

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');

iconv recode. iconv , . ,


CP866 8-R:
iconv -f866 -tKOI8-R -o<outfile> infile

recode:
recode CP1251..KOI8-R

winfile.txt

RFC 1489 , KOI8-R.


RFC 2319 , KOI8-U.
www.unicode.org , Unicode.
charts.unicode.org Unicode.
www.sensi.org/~alec/ , .
www.tsu.ru/~pascal/x_locale/ : X Window.
www.inp.nsk.su/~baldin . The Linux Cyrillic HOWTO (rus).
Cyrillic HOWTO (old rus), .

Copyright & A K-C

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

Copyright & A K-C

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.

Copyright & A K-C

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. , , .

Copyright & A K-C

286

V. Linux

Linux
Linux : .
, , . ,
,
- .
, , .
, .
, .
? "" ""?

""

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

, "" (), .
. ""
(Alan Kox).
,
. , ,
, .

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

Copyright & A K-C

16.

287

, , , , .

( ) .
" ".
?
, , : ,
50100 .


Linux
- Linux, ? , ,
, - . :
xconfig , X Window;
menuconfig
(. 16.1). ,
;

. 16.1. menuconfig

Copyright & A K-C

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,

Copyright & A K-C

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, .
. (. . " ").

Copyright & A K-C

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.

Copyright & A K-C

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.) -.

Copyright & A K-C

292

V. Linux

Executable file formats / emulations -

.
Networking support -

Linux , , , .
: , , .
Device drivers .
Firmware drivers BIOS, . .
File systems (VFAT, Ext3, ISO 9660
. .), ,
, .
.
Kernel hacking "" , .
Security options .
Cryptographic API .
Virtualization .
.
Library routines .

The Linux Kernel on Red Hat Linux Systems

.
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)

Copyright & A K-C

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,
.

Copyright & A K-C

V. Linux

294

DNS-:
DNS "IP-

" , Web- DNS-.


DNS-;
DNS , , DNS- DNS-.


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

" IP-" DNS-. , DNS-.

/etc/resolv.conf
, :
search bins.ru
nameserver 213.166.195.22

Copyright & A K-C

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-, .

Copyright & A K-C

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.

Copyright & A K-C

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

>_ . , named.conf, named,


nds restart.

Copyright & A K-C

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

nslookup DNS . user7.bins.ru,


, 17.5.
17.5
> user7.bins.ru
Server:
Address:

localhost
127.0.0.1

Non-authoritative answer:
Name:
Address:

user7.bins.ru
213.166.195.55

"Non-authoritative answer". , DNS


,
. ,
DNS- . ,
nslookup, exit.


DNS-
DNS- , , , , .
.
ivan.petrov.

Copyright & A K-C

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.

Copyright & A K-C

V. Linux

300

/etc/named/ivan.petrov
ivan.petrov 17.7.
17.7
@

IN

SOA

ns.ivan.petrov. hostmaster.ivan.petrov. (
199802151

; serial, todays date + todays serial #

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

mail

192.168.0.40

(Resource Records, RR):


SOA RR SOA (Start Of Authority, ) , . , (, ns.ivan.petrov),
(hostmaster@ivan.petrov),
(serial: 1) ,
DNS;
NS RR RR (Name Server, NS);
MX RR MX (Mail eXchanger, ) , , ivan.petrov,
mail.ivan.petrov mail2.ivan.petrov. MX RR.
(10) ,
. ,
. . , , - ;
A RR A (Address, ) IP-:
localhost
ns
mail

A
A
A

127.0.0.1
192.168.0.1
192.168.0.40

mail ns ivan.petrov
IP-.

Copyright & A K-C

17. DNS

301

/etc/192.168.0
DNS- () , DNS IP- . (FTP, IRC,
WWW . .), .
17.8 /etc/192.168.0.
17.8
@

IN

SOA

ns.ivan.petrov. hostmaster. ivan.petrov. (


199802151 ; Serial, todays date + todays serial
8H

; 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-.
.

Copyright & A K-C

V. Linux

302

(RR) DNS
( 17.9).
17.9
gw

192.168.0.2

HINFO

"i586" "RH 6.2"

TXT

"The router"

192.168.0.1

MX

10 mail

HINFO

"Pentium4" "Fedora 9"

www

CNAME

ns

User

192.168.0.3

MX

10 mail

HINFO

"p4"

TXT

"Developer computer home tel 223344"

ns

"WindowsXP"

, HINFO, CNAME
TXT.
HINFO (Host INFOrmation); :
,
. . :
HINFO

"Pentium4" "Fedora 9"

, DNS- Pentium IV Linux Fedora 9;


CNAME (Canonical NAME)
. CNAME , MX, CNAME SOA , CNAME;
TXT .
. :
TXT

"Developer computer home tel 223344"

, , 223344.
RP (Responsible Party, ). , RP . DNS . 17.1.

Copyright & A K-C

17. DNS

303

17.1. (RR) DNS

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-:
.

Copyright & A K-C

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.

Copyright & A K-C

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.

Copyright & A K-C

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-

Copyright & A K-C

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-.

Copyright & A K-C

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. , #. -

Copyright & A K-C

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-.

Copyright & A K-C

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- ;

Copyright & A K-C

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 );

Copyright & A K-C

V. Linux

312

ends 5 2008/06/27 09:14:54; (

). 7 ;
hardware ethernet 00:60:67:75:40:37; , ,

IP-, Ethernet- MAC- 00:60:67:75:40:37;


uid 01:00:60:67:75:40:37; . , ARP Ethernet-
MAC-, ;
client-hostname "Oscar"; .
, dhcpd.

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;
}

Copyright & A K-C

18. DHCP

313

18.3? , . DNS. DNS-. IP-


. , IP- . , IP- vasya.

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-.

Copyright & A K-C

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;

Copyright & A K-C

18. DHCP

315

option broadcast-address 255.255.255.255;


option dhcp-server-identifier 192.168.1.2
option host-name "vasya";
option domain-name "test.org";
renew 3 2008/4/2 00:22:38;
rebind 6 2008/4/5 02:50:06;
expire 6 2008/4/5 23:50:06;
}

, 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-.

"" 1999 . 10. . DHCP: IP-.


www.asmodeus.com.ua/library/net/dhcp_linux.htm .

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.

Copyright & A K-C

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.

Copyright & A K-C

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, .

Copyright & A K-C

V. Linux

318


.
POP3 .


RFC-822. : , . , .
,
. .
":". , Date, From, Cc To, :
Date:
From:
To:

26 Aug 76 1429 EDT


1@mail.ru
Sm2@chat.ru

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:

Sam is away on bisiness

In-Reply-To:

<some.string@DBM.Group>, George's message

Message-ID:

<4331.629.XYzi-What@Other-Host

Subject , Reply-To ,
, Comment , In-Reply-To ,
" , , ...", Message-ID , .
.
RFC-1327 X.400.

Copyright & A K-C

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.

Copyright & A K-C

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)
. .

Copyright & A K-C

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 , .
, : , :
,
, , -

Copyright & A K-C

322

V. Linux

. ;
,
. ;
. , , .
.
:

;
, ;
.

sendmail
sendmail
/etc/sendmail.cf, :
(local information)
. .;
sendmail, ;
, ;
;
sendmail, ;
;
, ;
;
;
;
.
sendmail , , , . ( Red Hat) .
sendmail , 100 ,
. sendmail "UNIX ",
, sendmail.

sendmail ( 19.3).

Copyright & A K-C

19.

323

19.3
##################
#

local info

##################
Cwlocalhost
CP.
# UUCP relay host
DYucbvax.Berkeley.EDU
CPUUCP
#

BITNET relay host

#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

Copyright & A K-C

V. Linux

324

SMTP-, SMTP, SMTP ( 19.4).


19.4
MAIL FROM: user
250 user... Sender ok
RCPT TO: user
250 user... Recipient ok
DATA
354 Enter mail, end with "." on a line by itself
This is a test message!!!
...
250 JAA24856 Message accepted for delivery
quit
221 ivan.petrov closing connection
Connection closed by foreign host.
You have new mail.
#

. MAIL FROM:
.
RCPT TO: . DATA . "." .
sendmail, . 19.1,
SMTP, . 19.2, SMTP.
SMTP

SMTP- SMTP (. 19.1) (. 19.2) telnet.


19.1. SMTP

HELO <SP> <domain>


<CRLF>

SMTP.
<domain>

MAIL <SP>
FROM:<reverse-path>
<CRLF>

<reverse-path>. ,

RCPT <SP>
TO:<forward-path>
<CRLF>

<forward-path>.
, MAIL FROM, DATA

Copyright & A K-C

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>

SEND AND MAIL.

VRFY <SP> <string>


<CRLF>

, <string>

EXPN <SP> <string>


<CRLF>

HELP [<SP> <string>]


<CRLF>

NOOP <CRLF>

QUIT <CRLF>

TURN <CRLF>

19.2. SMTP

211

System status, or system help


reply

214

Help message. [Information on


how to use the receiver or the
meaning of a particular nonstandard command; this reply
is useful only to the human
user]

220

<domain> Service ready

SMTP-

221

<domain> Service closing


transmission channel

250

Requested mail action okay,


completed

251

User not local; will forward


to <forward-path>

Copyright & A K-C

V. Linux

326

19.2 ()

354

Start mail input; end with


<CRLF>.<CRLF>

421

<domain> Service not available, closing transmission


channel [This may be a reply
to any command if the service
knows it must shut down]

450

Requested mail action not taken: mailbox unavailable [E.g.,


mailbox busy]

451

Requested action aborted: local error in processing

452

Requested action not taken:


insufficient system storage

500

Syntax error, command unrecognized [This may include errors


such as command line too long]

501

Syntax error in parameters or


arguments

502

Command not implemented

503

Bad sequence of commands

504

Command parameter not implemented

550

Requested action not taken:


mailbox unavailable [E.g.,
mailbox not found, no access]

551

User not local; please try


<forward-path>

552

Requested mail action aborted:


exceeded storage allocation

553

Requested action not taken:


mailbox name not allowed [E.g.,
mailbox syntax incorrect]

554

Transaction failed

POP3
SMTP telnet POP3.
110 ( 19.5).

Copyright & A K-C

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.

SMTP. 110. "" user pass. list


. dele
, . quit
. .

POP3-
(. 19.3) telnet.
+, ERR .
19.3. POP3

USER < >

PASS <>

QUIT

STAT


( +OK ERR)

+ <- >
<
>

Copyright & A K-C

V. Linux

328

19.3 ()


( +OK ERR)

UST [<
>]

.
,

+ < >

RETR <
>

+ <
>

-ERR < >

DELE <
>


.
QUIT

+ < >

-ERR < >

NOOP

RSET

< > < >


,
<-
>

UIDL [<
>]


.
,

+ < >
,
. ,
+

.
,
+
.
< > <>

,
.
, +
. < >
< >

.
,
,

Copyright & A K-C

19.

329

19.3 ()


( +OK ERR)

APOP < > <>


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 .
. , ,
.
.

Copyright & A K-C

V. Linux

330

,
postfix check.

Postfix postfix reload.


, , Web-.
, . :
;
;
SMTP-;
SMTP-;
POP3- IMAP-;
POP3- IMAP-.
, , , .

Mail
. ( ), ,
. Mail . 19.1.

. 19.1. Mail

Copyright & A K-C

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), . "" .

Copyright & A K-C

332

V. Linux

. 19.3. Sylpheed

. 19.4. Evolution

Copyright & A K-C

19.

333

. 19.5. Evolution

. 19.6. Kmail

Copyright & A K-C

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.

Copyright & A K-C

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 <_>

, .
.

Copyright & A K-C

V. Linux

336

, Apache,
.
HUP USR1. Apache , kill USR1,
,
.

httpd.conf, srm.conf, access.conf .htaccess.


httpd.conf , srm.conf
, access.conf .

. -
httpd.conf.
(, mod_charset , ).
/etc/httpd/conf
/etc/httpd/conf.d.
20.1 httpd.conf ( ).
20.1
...
### Section 1: Global Environment
...
ServerTokens OS
ServerRoot "/etc/httpd"
PidFile run/httpd.pid
Timeout 120
KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 15
<IfModule prefork.c>
StartServers
8
MinSpareServers
5
MaxSpareServers
20
ServerLimit
256
MaxClients
256
MaxRequestsPerChild 4000
</IfModule>
<IfModule worker.c>
StartServers

Copyright & A K-C

20. Web- Apache


MaxClients

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

Copyright & A K-C

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
...

Copyright & A K-C

20. Web- Apache

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

AddHandler type-map var


AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
Alias /error/ "/var/www/error/"
<IfModule mod_negotiation.c>
<IfModule mod_include.c>
<Directory "/var/www/error">
AllowOverride None
Options IncludesNoExec
AddOutputFilter Includes html
AddHandler type-map var
Order allow,deny
Allow from all
LanguagePriority en es de fr
ForceLanguagePriority Prefer Fallback
</Directory>
</IfModule>
</IfModule>
BrowserMatch "Mozilla/2" nokeepalive
...

Copyright & A K-C

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

CustomLog logs/dummy-host.example.com-access_log common

#</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 ). .

Copyright & A K-C

20. Web- Apache

341

Listen 12.34.56.78:80 . , IP-

. ,

.
.
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 , .

Copyright & A K-C

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

CustomLog logs/www.gost.ru-access_log common

#</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

Copyright & A K-C

20. Web- Apache

343

</Directory>
<Location /cgi-bin>
# , ,
http://<_>/cgi-bin/ <__>
</Location>
<Files /www/lazzycat.com/form.htm>
# , form.htm
/www/ lazzycat.com
</Files>

Directory Location , , (URL),


Web-. ,
order, allow deny, URL
.
Options
All <Directory /www>,
.
20.4 access.conf.
20.4
## access.conf Apache HTTP server configuration file
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /www>
Options All
AllowOverride All
order allow, deny
allow from all
</Directory>

Copyright & A K-C

V. Linux

344

Apache-Overview-HOWTO Web- Apache.


Building a Secure Red Hat Apache Server HOWTO

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.

Copyright & A K-C

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

Copyright & A K-C

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).

Copyright & A K-C

21. FTP

347

30 . . 21.1 . RFC.
21.1. FTP

ABOR

FTP

LIST -

PASS

PORT a, b, c, d, e, f

IP- (a.b.c.d) (e 256 + f)

QUIT

RETR

STOR

SYST

TYPE

: A ASCII, I

USER

()

FTP-
FTP-
ASCII , .
.
. 21.2.
21.2.

1xx

. ,

2xx

3xx

. ,

4xx

. , ,

5xx

. ,

0x

x1x

Copyright & A K-C

V. Linux

348

21.2 ()

x2x

. ,

x3x

. ,

x4x

x5x

. . 21.3
.
FTP- .
, ,
, , .
21.3.

125

200

214

331

425

452

500

502

MODE


() :
;
;
.
. FTP-

,
, .
,
-, -

Copyright & A K-C

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).

Copyright & A K-C

V. Linux

350

21.4. FTP- wu-ftp

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

Copyright & A K-C

21. FTP

351

21.5. FTP- wu-ftp

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), ;
<_> :
( /,
);

Copyright & A K-C

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

Copyright & A K-C

21. FTP

353

allowretrieve [ absolute | relative ] { class=<> } <_>


...

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
;

Copyright & A K-C

354

V. Linux

virtual <IP-> incmail <email-> -

;
virtual <IP-> mailfrom <email-> -

;
<_> ...
;
defaultserver private ;
defaultserver incmail <email-> ;
defaultserver mailfrom <email->
.
:
defaultserver { deny | allow }

{ chmod | delete | overwrite | rename | umask } { yes | no } <_

/ . . <_>
: anonymous, guest, real class=<_>;
passwd-check { none | trivial | rfc822 } ( { enforce | warn } )
e-mail- :
none ;
trivial @;
rfc822 RFC-822;
warn , ;
enforce , ;
deny-email <email-> ;
>

path-filter <-> <__> <__>

, , , ;
<_> ...

upload [ absolute | relative ] [ class=<-> ]... [ ] <


_> { yes | no } owner group mode [ dirs | nodirs ] [ dir_
mode ] , /

.
;
throughput ;
anonymous-root <> [ <> ] ...
(chroot) ;
guest-root <> [ <-uid> ] ... <> chroot . uid ;
deny-uid <> ... ftpusers;

Copyright & A K-C

21. FTP

355

deny-gid <> ... -

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 , ;

Copyright & A K-C

356

V. Linux

lslong <> [ <> ]

;
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 ,
, :
;
;
.

Copyright & A K-C

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 ;
;

Copyright & A K-C

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. .

Copyright & A K-C

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).

Copyright & A K-C

V. Linux

360
21.1
root
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody

FTP- (upload) . ( ). ftpaccess upload no , .


c FTP- . ftpaccess noretrieve
, .

RFC959 RFC, FTP-.


ftp.fni.com/pub/wu-ftpd/guest-howto HOWTO

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-.

Copyright & A K-C

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. , ,
.
.

Copyright & A K-C

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.
, , , , .

Copyright & A K-C

22. NNTP. INN

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
. ,

Copyright & A K-C

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
. ,
, .

Copyright & A K-C

22. NNTP. INN

365

LIST
.
:
<group> <last> <first> <p>

<group> , <last>
, <first> , <p>
'y' 'n', .
<first> <last> . <last>
<first>, .

NEWGROUPS date time [GMT] [<distributions>]


, <date> <time>,
, LIST.
,
, MM ( , ),
.
, 86 1986, 30 2030, 99 1999,
00 2000 .
MM,
24- , MM 0059,
0059. , "GMT" ( ).
distributions . ,
, .

NEWNEWS newsgroups date time [GMT] [<distribution>]


, .
. , CR/LF. ,
NEWGROUPS.

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

NEXT
. ,
, .

Copyright & A K-C

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._, .

Copyright & A K-C

22. NNTP. INN

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/:, , .

Copyright & A K-C

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 .
, ;

Copyright & A K-C

22. NNTP. INN

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

Copyright & A K-C

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

Copyright & A K-C

22. NNTP. INN

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.
, ,

Copyright & A K-C

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: ,
. . , "";

Copyright & A K-C

22. NNTP. INN

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/_;

Copyright & A K-C

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 , ;

Copyright & A K-C

22. NNTP. INN

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
.

Copyright & A K-C

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/'

Copyright & A K-C

22. NNTP. INN

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*

,
. ,

Copyright & A K-C

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 , .

Copyright & A K-C

22. NNTP. INN

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 * * * *

/usr/news/bin/news.daily > /dev/null 2>&1 &


/usr/news/bin/nntpsend > /dev/null 2>&1 &

, UUCP UUCP provider, 37- cron sendbatch:


37

/usr/news/bin/sendbatch -c provider > /dev/null 2>&1 &

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 .).

Copyright & A K-C

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.

Copyright & A K-C

22. NNTP. INN

381

RFC977 Network News Transfer Protocol -

.
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.

Copyright & A K-C

23

Proxy-
:
DNS, , proxy-.
proxy-? proxy-, ,
- ,
, ,
, ,
proxy-. proxy- ,
proxy- WWW-, , , .
proxy-, . , 60%.
proxy- proxy-,
,
.
Proxy- :
;
;

;
;
proxy-.
proxy-. , , .
proxy- , , , .
proxy-, GNU,
Squid.

Copyright & A K-C

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-,
/ , ,

Copyright & A K-C

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 .

Copyright & A K-C

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 ;

Copyright & A K-C

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- );

Copyright & A K-C

23. Proxy-

387

dns_nameservers -IP- DNS-, -

/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 ;

Copyright & A K-C

388

V. Linux

quick_abort_pct

, Squid ;
negative_ttl 5 minutes (

"connection refused ", "404 not found") ;


positive_dns_ttl 6 hours DNS-
;
negative_dns_ttl 5 minutes DNS-
;
range_offset_limit 0 KB , :
1 Squid , ;
0 , Squid , ;
, 1 Squid
.


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.

ACL Access Control List


. ACL (Access Control List, )
.
acl <> <> <>

<> , <> , <> ( ), .


:
src ip-address/netmask... IP- ;
src addr1-addr2/netmask... ;
srcdomain foo.com... IP- URL;

Copyright & A K-C

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-;

Copyright & A K-C

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-;

Copyright & A K-C

23. Proxy-

391

test_reachability on|off ICP_MISS

ICP_MISS_NOFETCH, ICMP RTT ;


buffered_logs on|off ;
always_direct allow|deny [!]aclname... ,
ACL, , ;
never_direct allow|deny [!]aclname... ,
ACL, ;
anonymize_headers allow|deny header_name... ,
;
fake_user_agent none User-Agent
, ;
minimum_retry_timeout 5 seconds IP-,
- ;
maximum_single_addr_tries 3 ,
IP-; IP-,
;
snmp_port 3401 , Squid SNMP-;
snmp_access allow|deny [!]aclname... ,
SNMP-;
offline_mode on|off , Squid
;
uri_whitespace strip , URI;
:
strip ;
deny Invalid Request ( );
allow ;
encode RFC1738, ;
chop ;
mcast_miss_addr multicast-
"" ;
mcast_miss_port ;
strip_query_terms on ;
ignore_unknown_nameservers on DNS-,
Squid .

Squid
, Squid .
proxy- .
, ,
, .
Squid.conf :
http_port 3128 , Squid
;

Copyright & A K-C

392

V. Linux

hierarchy_stoplist cgi-bin, chat c URL,

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

BANNER url_regex banner reklama linkexch banpics


[\./]ad[s]?[\./] ,

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 .

Copyright & A K-C

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- -

Copyright & A K-C

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 () .

Copyright & A K-C

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-/).

Copyright & A K-C

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

. ( ).
.

Copyright & A K-C

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

Copyright & A K-C

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

Copyright & A K-C

23. Proxy-

399


Squid , Perl, Squid:
access-extract.pl access.log
;
access-summary.pl access-extract.pl .

Squid Cache and Web Utilities (SARG)


Squid .
:
;
;
;
;
Web-, ;
.
: Top sites Useragents.
, log- Squid.
, Squid,
.
Squid, SARG
. HTML-,
, .

.

MRTG
,
Squid. HTML-.

RRDtool
, Squid. HTML-.

Copyright & A K-C

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.

Copyright & A K-C

24

,

,
"" .
/ .
" " ,
. ,
, , -
. , ,
.
(Network Time Protocol, NTP).


NTP
(, ). NTP
, ( )
. ,

.
.
, , , ,
, . .
UDP, 123. , ,
.
64-
, UTC.
32 , 32 .
232 . .

Copyright & A K-C

402

V. Linux


:
multicast , .
NTP- ,
, , .
NTP-;
procedure-call . NTP- , . ;
symmetric .
. .

, ,
, .


.

, .
:
;
,
, , .
.
,
DES.

NTP-

NTP :
LI (leap indicator) ;
VN ;
mode ;
stratum ;
precision ;
poll interval . , ;

Copyright & A K-C

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

Measured performance of the Network Time


Protocol in the Internet system (

)

RFC1129

Internet time synchronization: The Network Protocol ( : )

RFC1165

Network Time Protocol (NTP) over the OSI Remote Operations Service (
OSI)

RFC1305

Network Time Protocol (v3) (


, )


RFC1119, RFC1059, RFC958

RFC2030

Simple Network Time Protocol (SNTP)


Version 4 for IPv4, IPv6 and OSI ( ,
IPv4, IPv6 OSI)


NTP , ,

Copyright & A K-C

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>

4 (16 ) 14 (16 384 ), 6 (64 ));


<maxpoll> (, 2 <mapoll>,
10 (1024 )).

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> ;

Copyright & A K-C

24. ,

405

broadcastclient [<address>] <address> , -

;
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]

Copyright & A K-C

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

Copyright & A K-C

24. ,

407

trap host-address [port <port-number>] [interface <interface-address>]

, ;
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).

Copyright & A K-C

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. .

Copyright & A K-C

24. ,

409

UNIX/Linux
xntpd
. , . ,
. .
ntpdate.
.
100 .
ntpdate -B <ntp> <ntp2> <ntp3>

<ntp>, <ntp2>, <ntp3> . crontab, .

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,
.

www.bog.pp.ru/work/ntp.html . Bog BOS: Network Time Protocol.


www.bog.pp.ru/work/xntpd.html . Bog BOS: xntpd (UNIX-

NTP Network Time Protocol).


www.ntp.org , xntp.
cisco.opennet.ru/docs/RUS/lasg/time.html : NTP.
www.psn.ru/net/servis/ntp.shtml " NTP?".
www.tomsknet.ru/ftp/docs/rfc/rfc1305.txt Network Time Protocol (Version 3)
Specification, Implementation and Analysis (RFC1305).

Copyright & A K-C

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 ,
.

Copyright & A K-C

25. NIS (NIS+) . LDAP

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 (),

Copyright & A K-C

412

V. Linux

hosts () mail_aliases ( ). groups_dir


NIS+, . org_dir, groups_dir NIS+.

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)

Copyright & A K-C

25. NIS (NIS+) . LDAP

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>
<, >
#

Copyright & A K-C

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 ;

Copyright & A K-C

25. NIS (NIS+) . LDAP

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=

Copyright & A K-C

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 .

Copyright & A K-C

25. NIS (NIS+) . LDAP

417

dbcachesize < > ( ),

.
, .
,
, .
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;

Copyright & A K-C

418

V. Linux

-d <> | ? slapd <>.

?, , 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-.

Copyright & A K-C

25. NIS (NIS+) . LDAP

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) (
);

Copyright & A K-C

420

V. Linux

cis (case ignore string) (

);
tel ( cis, '' -

);
dn (distinguished name) .


. -,
, LDAP. , slapd LDAP- .
. -,
. , .

OpenLDAP ldapadd, LDAP-.


, ldapadd.
ldapadd
. sldap ,
sldap.conf .
suffix < >

, .
, , :
suffix "o=Home, c=UA"

, ,
:
directory <>

:
directory /usr/local/home

, :
index {<attrlist> | default} [pres,eq,approx,sub,none]

, cn, sn, uid objectclass :


index cn,sn,uid
index objectclass pres,eq
index default none

slapd, LDAP- .

Copyright & A K-C

25. NIS (NIS+) . 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

presence, equality approximate cn, sn


uid, .
, ,
slapadd:
slapadd -l < > -f < slapd> [-d < >] [-n < >|-b <>]

:
-l < > LDIF-, -

;
-f < slapd>

slapd, , , . .;

Copyright & A K-C

V. Linux

422

-d < > < >.

, 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.
, .

Copyright & A K-C

25. NIS (NIS+) . LDAP

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.

, SQUID, LDAP PAM.

Copyright & A K-C

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.

Copyright & A K-C

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)

zam (ro) /home/boss/documents,


, (rw).
NIS LDAP.

Copyright & A K-C

V. Linux

426

, , NFS. NFS : portmapper, mountd nfsd. :


rpcinfo -p.

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

Copyright & A K-C

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, -.

Copyright & A K-C

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)

, UID 0 , UID nobody


. ,
, .
.
,
.
NFS.
hosts.allow hosts.deny
, .
, , nfs, mountd portmap firewall
. Nfsd 2049 UDP TCP.
Portmapper 111 TCP UDP. Mountd 745 747
TCP UDP.

man: NFS, portmap, mountd, nfsd, exports.


NFS-HOWTO.

Copyright & A K-C

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.

Copyright & A K-C

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.

smbmount, SMB- Linux, Microsoft DFS /opt/samba. , , .


Samba configure --help.

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).
.

Copyright & A K-C

27. Samba Windows

431

27.1 smb.conf Samba, .


27.1
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options (perhaps too
# many!) most of which are not shown in this example
# Any line which starts with a ; (semi-colon) or a # (hash)
# is a comment and is ignored. In this example we will use a #
# for commentary and a ; for parts of the config file that you
# may wish to enable
# NOTE: Whenever you modify this file you should run the command "testparm"
# to check that you have not many any basic syntactic errors.
#
#======================= Global Settings ================================
[global]
# workgroup = NT-Domain-Name or Workgroup-Name
workgroup = Kontora
# server string is the equivalent of the NT Description field
server string = Kontora Samba Server
# This option is important for security. It allows you to restrict
# connections to machines which are on your local network. The
# following example restricts access to two C class networks and
# the "loopback" interface. For more examples of the syntax see
# the smb.conf man page
hosts allow = 192.168.10.
# if you want to automatically load your printer list rather
# than setting them up individually then you'll need this
#

printcap name = /etc/printcap

load printers = yes

# 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

Copyright & A K-C

V. Linux

432
# otherwise the user "nobody" is used
;

guest account = pcguest

# 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 server = <NT-Server-Name>

# Password Level allows matching of _n_ characters of the password for


# all combinations of upper and lower case.
;

password level = 8

username level = 8

# You may wish to use password encryption. Please read


# ENCRYPTION.txt, Win95.txt and WinNT.txt in the Samba documentation.
# Do not enable this option unless you have read those documents
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
# The following are needed to allow password changing from Windows to
# update the Linux system password also.
# NOTE: Use these with 'encrypt passwords' and 'smb passwd file' above.
# NOTE2: You do NOT need these to allow workstations to change only
#
#

the encrypted SMB passwords. They allow the Unix password


to be kept in sync with the SMB password.

unix password sync = Yes

passwd program = /usr/bin/passwd %u

# Unix users can map to different SMB User names


;

username map = /etc/samba/smbusers

# Using the following line enables you to customise your configuration


# on a per machine basis. The %m gets replaced with the netbios name

Copyright & A K-C

27. Samba Windows

433

# of the machine that is connecting


;

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
#

request announcement to, or browse list sync from:

a specific host or from / to a whole subnet (see below)

remote browse sync = 192.168.3.25 192.168.5.255

# Cause this host to announce itself to local subnets here


;

remote announce = 192.168.1.255 192.168.2.44

# Browser Control Options:


# set local master to no if you don't want Samba to become a master
# browser on your network. Otherwise the normal election rules apply
;

local master = no

# OS Level determines the precedence of this server in master browser


# elections. The default value should be reasonable
;

os level = 33

# Domain Master specifies Samba to be the Domain Master Browser. This


# allows Samba to collate browse lists between subnets. Don't use this
# if you already have a Windows NT domain controller doing this job
;

domain master = yes

# Preferred Master causes Samba to force a local browser election on #startup


and gives it a slightly higher chance of winning the election
;

preferred master = yes

# Enable this if you want Samba to be a domain logon server for


# Windows95 workstations.
;

domain logons = yes

# if you enable domain logons then you may want a per-machine or

Copyright & A K-C

V. Linux

434
# per user logon script

# run a specific logon batch file per workstation (machine)


;

logon script = %m.bat

# run a specific logon batch file per username


;

logon script = %U.bat

# All NetBIOS names must be resolved to IP Addresses


# 'Name Resolve Order' allows the named resolution mechanism to be
# specified the default order is "host lmhosts wins bcast".
name resolve order = wins lmhosts bcast
# Windows Internet Name Serving Support Section:
# WINS Support Tells the NMBD component of Samba to enable it's WINS Server
wins support = yes
# WINS Server Tells the NMBD components of Samba to be a WINS Client
#
;

Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
wins server = w.x.y.z

# WINS Proxy Tells Samba to answer name resolution queries on


# behalf of a non WINS capable client, for this to work there must be
# at least one
;

WINS Server on the network. The default is NO.

wins proxy = yes

# 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

short preserve case = no

# Default case is normally upper case for all DOS files


default case = lower
# Be very careful with case sensitivity it can break things!
case sensitive = no
client code page = 866
character set = koi8-r
printer driver file=/home/samba/hplj1200/printers.def
#============================ Share Definitions =========================

Copyright & A K-C

27. Samba Windows

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. # ; .

Copyright & A K-C

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), -

Copyright & A K-C

27. Samba Windows

437

, ,
. .

dns proxy = yes NetBIOS- IP-

DNS.
username map = /etc/samba/smbusers

Samba, Linux- Samba; Samba


Linux-.
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192 , .
interfaces = 192.168.10.0/24 ,
() ; ,
.
name resolve order = wins lmhosts bcast
.
wins support = yes , Samba WINS.
wins server = w.x.y.z IP- WINS-; wins
support = yes, wins server .
default case = lower ,
Samba.
case sensitive = no .
client code page = 866 ; DOS-
866.
character set = koi8-r , .
printer driver file=/home/samba/hplj1200/printers.def
.
time server = true Windows,
.

[homes]
[homes]
Linux-. Linux-. [homes].
comment = Home Directories .
browseable = no .
writable = yes .
valid users = yura katya alst ,
; .

Copyright & A K-C

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

Copyright & A K-C

27. Samba Windows

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

, encrypt password yes, /etc/samba/smbpasswd,


.
Samba? . Windows-
. Linux . shadow
(hash) , Linux , MD5.
. , . ., ,
. Samba
.
, .

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 .

Copyright & A K-C

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

Copyright & A K-C

27. Samba Windows


--------ADMIN$
public
C$
HP

---Disk
Disk
Disk
Printer

441

------Remote Admin
Public
Default share
HP6L

This machine has a browse list:


Server
--------HOP
ZIGA

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.

Copyright & A K-C

V. Linux

442

samba-client smbmount smbumount,


mount umount. gnomba, Windows.

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

Copyright & A K-C

27. Samba Windows

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;

Copyright & A K-C

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.

Copyright & A K-C

27. Samba Windows

445

. 27.2. Webmin Samba

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 -

(Primary Domain Controller, PDC).


www.linuxoid.ru/how_to/samba5.html . Samba .
www.linux.org.ru/books/HOWTO/SMB-HOWTO.html SMB-HOWTO (

).
www.samba.org Samba.
www.webmin.com Webmin.

Copyright & A K-C

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 , .

Copyright & A K-C

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,
.

Copyright & A K-C

448

V. Linux

ipsec IPSec: , IPSec.


IPSec "", ""
"". IPSec : .
(datagram) . , IP, . "
". IP- , .
.
IPSec-,
.
FreeS/WAN ipsec.conf
ipsec.secrets.

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

Copyright & A K-C

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 ,
.

Copyright & A K-C

V. Linux

450

Test, , . : IP- , , "" .


keyingtries=0 IKE .
keyexchange=ike IKE
.
keylife=24h .
auth=ah .
authby=secret .

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= ""

leftrsasigkey rightsasigkey RSA-.


/etc/ipsec.secrets.

FreeS/WAN .

MS Windows NT VPN (PPTP)


Microsoft VPN
PPTP (Point-to-Point Tunneling Protocol).
, , PPTP 128 .

Copyright & A K-C

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

Copyright & A K-C

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

/usr/sbin/pptp-command, (IP-, DNS, , . .).


VPN- pptpcommand.

OpenVPN
. openvpn.net. UNIX- , MAC OS X Windows.
. OpenSSL,
LZO.

securitylab.ru/34649.html . Sys Admin Magazine.

IPSec VPN Linux. .


securitylab.ru/34764.html . Sys Admin Magazine.

IPSec VPN Linux. .


www.bruy.info/vpn.html ., . Linux-: .
www.freeswan.org FreeS/WAN.
www.multik.ru/linux/linuxvpn/ . VPN Linux.
www.opennet.ru/base/net/vpn_pptp.txt.html . VPN
(PPTP) Linux.

Copyright & A K-C

29


Linux.
,
.
, , ,
.
. - . ,
, root nobody.
, .
root , , . ,
(shell).

(Process Identification, PID). , .



(foreground) (background).
.
, . . , ,
( ) ( ).
, . .
, , .

Copyright & A K-C

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

&

,
, .

Copyright & A K-C

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>. -

Copyright & A K-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

Copyright & A K-C

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 .

Copyright & A K-C

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 ?

0:00 lpd Waiting

732 ?

0:00 sendmail: accepting connections

751 ?

0:00 gpm -t ps/2 -m /dev/mouse

769 ?

0:00 crond

835 ?

0:00 xfs -droppriv -daemon

853 ?

0:00 anacron

871 ?

0:00 /usr/sbin/atd

885 tty1

0:00 login -- root

886 tty2

0:00 /sbin/mingetty tty2

887 tty3

0:00 /sbin/mingetty tty3

888 tty4

0:00 /sbin/mingetty tty4

889 tty5

0:00 /sbin/mingetty tty5

890 tty6

0:00 /sbin/mingetty tty6

893 tty1

0:00 -bash

1037 tty1

0:00 /usr/bin/mc -P

1038 ?

0:00 cons.saver /dev/tty1

1039 pts/0

0:00 bash -rcfile .bashrc

1067 pts/0

0:00 ps ax

, . ,
, ,
, .

Copyright & A K-C

29.

459

STAT. (status) . ps,


:
R , ;
S (sleeping) ; - ,
;
Z "" (zombied),
, .
TTY. , , , , , ? . ,
. , .
,

ps -aux

29.2 .
29.2
USER

RSS TTY

STAT START TIME COMMAND

root

PID %CPU %MEM


1

1.2

0.2

1412

VSZ

520 ?

14:51 0:04 init

root

0.0

0.0

0 ?

SW

14:51 0:00 [keventd]

root

0.0

0.0

0 ?

SW

14:51 0:00 [kapm-idled]

root

0.0

0.0

0 ?

SWN

14:51 0:00 [ksoftirqd_CPU0]

root

0.0

0.0

0 ?

SW

14:51 0:00 [kswapd]

root

0.0

0.0

0 ?

SW

14:51 0:00 [kreclaimd]

root

0.0

0.0

0 ?

SW

14:51 0:00 [bdflush]

root

0.0

0.0

0 ?

SW

14:51 0:00 [kupdated]

root

0.0

0.0

0 ?

SW<

14:51 0:00 [mdrecoveryd]

root

13

0.0

0.0

0 ?

SW

14:51 0:00 [kjournald]

root

437

0.0

0.2

1472

592 ?

14:52 0:00 syslogd -m 0

root

442

0.0

0.4

1928 1040 ?

14:52 0:00 klogd -2

rpc

462

0.0

0.2

1552

588 ?

14:52 0:00 portmap

rpcuser 490

0.0

0.2

1596

756 ?

14:52 0:00 rpc.statd

root

590

0.0

0.2

1396

524 ?

14:52 0:00 /usr/sbin/apmd -p

root

647

0.0

0.4

2676 1268 ?

14:52 0:00 /usr/sbin/sshd

root

680

0.0

0.3

2264

992 ?

14:52 0:00 xinetd -stayalive

lp

704

0.0

0.3

2600 1020 ?

14:52 0:00 lpd Waiting

root

732

0.0

0.7

5296 1984 ?

14:52 0:00 sendmail: accepti

root

751

0.0

0.1

1440

492 ?

14:52 0:00 gpm -t ps/2 -m /d

root

769

0.0

0.2

1584

660 ?

14:52 0:00 crond

xfs

835

0.0

1.4

4988 3612 ?

14:52 0:00 xfs -droppriv -da

root

853

0.0

0.2

1416

14:52 0:00 anacron

600 ?

Copyright & A K-C

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 ?

14:52 0:00 /usr/sbin/atd

2320 1076 tty1

14:52 0:00 login -- root

1384

448 tty2

14:52 0:00 /sbin/mingetty tt

0.1

1384

448 tty3

14:52 0:00 /sbin/mingetty tt

0.0

0.5

2464 1312 tty1

14:52 0:00 -bash

0.0

0.7

3284 1804 tty1

14:56 0:00 /usr/bin/mc -P

1038

0.0

0.1

1380

14:56 0:00 cons.saver /dev/t

root

1039

0.0

0.5

2552 1392 pts/0 S

14:56 0:00 bash -rcfile .bas

root

1068

0.0

0.3

2780

14:57 0:00 ps -aux

348 ?

824 pts/0 R

. :
USER , -

;
%CPU, %MEM ,

;
TIME .

. 29.2 ps.
29.2. ps

""

txx

Copyright & A K-C

29.

461

ps ,
, .

top
, .
top. , ( 29.3).
29.3
2:55pm

up 3 min,

1 user,

load average: 0,06, 0,09, 0,03

32 processes: 31 sleeping, 1 running, 0 zombie, 0 stopped


CPU states:

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

0,0% nice, 95,8% idle

212676K free,

0K shrd,

257000K free

8560K buff

19920K cached

RSS SHARE STAT %CPU %MEM

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

: ,
,
, ,
. ,

Copyright & A K-C

462

V. Linux

, , .
, ps.
:
;
( );
;
;
;
;
,
;
.
top
, .

kill
kill ( )
. ,
, . , .
, PID
. , "" 123,
kill 123

, , . , root
.
kill . , ,
, .

kill 9 123

? - kill , SIGTERM (terminate, ). kill . , ,


( , / . .).
9 kill SIGKILL.
, . ( 29.4) ,

kill l

Copyright & A K-C

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.

Copyright & A K-C

464

V. Linux

nice
nice
, . , . nice
- , .
root. nice :
nice -number command

number, . 10, number ,


.
, top , 5. , :
nice 10 top

top , 5.
root ,
number.

renice
renice, nice, . :
renice -number PID

, renice nice . number,


. 10, number
, .
root ,
number.



. , , 24

( ) . , .

Copyright & A K-C

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 .

Copyright & A K-C

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. .

Copyright & A K-C

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. .

Copyright & A K-C

30


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


,
UNIX- . , ,
, , , . : ,
, ,
, .
.
Linux .
Linux
ACLs (Access Control Lists, ) POSIX ACLs
Linux. Linux ACLs
, ,
- , .

Copyright & A K-C

30.

469

Linux ACLs (Extended Attributes) .


/, .
inode .
. ACL :
ACL_USER_OBJ -;
ACL_GROUP_OBJ -;
ACL_OTHER .

ACL :
ACL_USER UID , , .
. ;
ACL_GROUP , ACL_USER, ;
ACL_MASK .

ACL_MASK.
.
ACL,
. ACL, ACL, .


getfacl setfacl .
getfacl
. 30.1 getfacl vasya.
30.1
getfacl

/home/vasya

file: home/vasya
owner: vasya
group: users
user::rwx
group::--other:---

, /home/vasya vasya, users 0700. -

Copyright & A K-C

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:---


, .
,
, , ,
. ,

Copyright & A K-C

30.

471


, .


.
, ,
. .
,

. . , .
, , , , ICQ, . .
.
SSL (Secure Sockets
Layer). HTTP (HTTPS),
SMTP, POP3,
IMAP .
, SSL Linux Windows, Stunnel.
, .

Stunnel
,
.

Stunnel OpenSSL. OpenSSL


Linux ( , Red
Hat Linux), OpenSSL .
Stunnel RPM-.


Stunnel . Stunnel , ,

Copyright & A K-C

V. Linux

472

. Stunnel ,

.
telnet- ( , SSH) ( ).
Stunnel :
stunnel -d 999 -r 23

-d Stunnel , 999. , 999,


23 .
Stunnel :
stunnel -c -d 1055 -r B:999

c , , 1055, 999 .
telnet- . telnet
:
telnet localhost 1055

, .
.

Stunnel , SSL
,
SSL, SSL.
Stunnel , SSL.
, SSL.
30.3 SSL-.
30.3
https

443/tcp

# http protocol over TLS/SSL

smtps

465/tcp

# smtp protocol over TLS/SSL (was ssmtp)

nntps

563/tcp

# nntp protocol over TLS/SSL (was snntp)

imap4-ssl

585/tcp

# IMAP4+SSL (use 993 instead)

sshell

614/tcp

# SSLshell

ldaps

636/tcp

# ldap protocol over TLS/SSL (was sldap)

ftps-data

989/tcp

# ftp protocol, data, over TLS/SSL

ftps

990/tcp

# ftp protocol, control, over TLS/SSL

telnets

992/tcp

# telnet protocol over TLS/SSL

imaps

993/tcp

# imap4 protocol over TLS/SSL

ircs

994/tcp

# irc protocol over TLS/SSL

pop3s

995/tcp

# pop3 protocol over TLS/SSL (was spop3)

Copyright & A K-C

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:
;
, , , ;

Copyright & A K-C

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;

Copyright & A K-C

30.

475

BLOCK_UDP , BLOCK_TCP, UDP;


KILL_ROUTE , -

. 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-.

Copyright & A K-C

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 .

Copyright & A K-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
.

Copyright & A K-C

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

# Everybody gets emergency messages


*.emerg

# 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 . , , . *,
.

Copyright & A K-C

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).
.

Copyright & A K-C

480

V. Linux


, ?
? ,
. ,
, .


, . ,
,
? .
. - , sendmail, ,
- , , " " , , ,
.
. ,
, , , -
, ,
- . , - .
, rootkit.

Rootkit
Rootkit ( ) ,
. Rootkit (,
,
, )
, log-, ,
, , ps, netstat, ifconfig,
killall, login.
rootkit ,
. telnetd
sshd. ,
, . rootkit
, .

Copyright & A K-C

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 . , .

Copyright & A K-C

482

V. Linux


, ,
. ,
.
nmap,

nmap -p 1-65535 192.168.0.1

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 ,
.

Copyright & A K-C

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.
, .

Copyright & A K-C

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. ;

Copyright & A K-C

30.

485

Allow any program to switch LIDS protections

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 :
[+|-] :

Copyright & A K-C

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 ;

Copyright & A K-C

30.

487

CAP_SYS_RAWIO / ,

/dev/mem, /dev/kmem, /dev/port, /dev/hd, /dev/sd;


CAP_SYS_CHROOT
;
CAP_SYS_PTRACE ptrace(), -
-;
CAP_SYS_PACCT ;
CAP_SYS_ADMIN : /dev/random, ,
, klogd, , , , , / swap-, ;
CAP_SYS_BOOT ;
CAP_SYS_NICE ,
root;
CAP_SYS_RESOURCE
: , , . .;
CAP_SYS_TIME ;
CAP_SYS_TTY_CONFIG tty;
CAP_HIDDEN . ;
CAP_INIT_KILL "" - init.
, . ,
, .

lidsadm I

/etc/rc.d/rc.local,
, .


LIDS lidsadm. Lidsadm
. /etc/lids/lids.conf.
lidsadm -L

30.5.

Copyright & A K-C

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 .

Copyright & A K-C

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.

Copyright & A K-C

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 ,
.
.
.

Copyright & A K-C

30.

491

acl.bestbits.at Linux ACLs (Access Control

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.

Copyright & A K-C

31


UNIX- ,
X Window,
( )
. UNIX
, , , ,
.
: Telnet, SSH, r- .
.

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

Telnet
Telnet RFC854. , Telnet , , , , . , "" () "" ( ).
Telnet ,
TCP. Telnet:
(Network Virtual Terminal, NVT);
;
" ".

Copyright & A K-C

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

Copyright & A K-C

V. Linux

494

31.1 ()

NOP

241

Data Mark

242

Break

243

BRK

Interrupt Process

244

Abort Output

245

Are You There

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.

Copyright & A K-C

31.

495

31.2. telnet

Open <host> [<port>]

Telnet- <host>
<port>.
IP-,

close

Telnet-

Quit

telnet

"" Telnet-
.
Exit

Mode <type>

<type> line,
, character

? [<command>] help [<command>]

Send <argument>


Telnet,

- telnetd
telnetd , Telnet.
telnetd TCP- 23, .
telnetd
: , , , .

Telnet
Telnet
. ,

. , telnet (, SMTP POP3),
(,
).
Telnet . - ,
. Telnet SSH
OpenSSH.

Copyright & A K-C

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-
.

Copyright & A K-C

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.

Copyright & A K-C

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 ;

Copyright & A K-C

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.

Copyright & A K-C

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 ;

Copyright & A K-C

31.

501

Ciphers aes128-cbc, 3des-cbc, blowfish-cbc, cast128-cbc, arcfour, aes192cbc, aes256-cbc

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;

Copyright & A K-C

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.

Copyright & A K-C

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.

Copyright & A K-C

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 <-->]

OpenSSH DSA OpenSSH DSA :


ssh-keygen -y [-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.

Copyright & A K-C

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> [<->]] ;

Copyright & A K-C

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 <-> .

Copyright & A K-C

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.

Copyright & A K-C

32

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

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


(),
,
. .

Copyright & A K-C

32. Firewall

509

""
, ,
. :
;
;
proxy-.
, , .
IP-, , .

. ,
. ,
. , ,
, .
Proxy- , . proxy- , .
, proxy-. , proxy- ,
. , , .
, :
;
.
, .
. , ,
(HTTP, FTP . .), ,
.
, -,
" ", . ,
, :
, . , ,
.

Copyright & A K-C

510

V. Linux


"" ,
. Linux
, ICMP-, UDP- TCP-.
. ,
.

:
;
;
.
,
. ,
, , .
, .
, , IP- , TCP UDP, TCP- ICMP-.
. ,

,
. , , ,
(chains). "" ,
,
.
, .
.
,
.
. , , IP- ,
, . , , , .

Copyright & A K-C

32. Firewall

511


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

, , . , , .
. , , . ,
, .
, , .
(ACCEPT), (DENY)
, . . (REJECT).
, ?
(REJECT) , ICMP . (DENY) , .
,
. -, , -,
. ,
"" .

Copyright & A K-C

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.

Copyright & A K-C

32. Firewall

513

IP- .
, IP-
.
IP-, .

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

,
, ,
. ,
.


. , . , .

, ,
- , . , .

, . , ,
, .
TCP-

, TCP-, . .
, , SYN,
ACK . TCP-

Copyright & A K-C

514

V. Linux

. , , ACK, SYN .

. , , ACK, TCP- .
"" ,
.


, , . ,
.

, ,
, , .
,
IP- . .

, ,
.
, .

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


, .

, .

Copyright & A K-C

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.
, , . ,
, .

Copyright & A K-C

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

[<>]

. input, output forward. ,


-i

<>

,
. ,

- <>

TCP/IP, . ,
.
tcp, udp, icmp all. , /etc/protocols

, TCP-,
SYN , ACK .
, SYN ACK

,
TCP-, ACK
. ! ,
ACK

Copyright & A K-C

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"

Internal_ INTERFACE = "eth1"

, ( )

LAN_1="192.168.1.0/24"

LAN_IPADDR_1="192.168.1.1"

LOOPBACK_INTERFACE = "lo"

IPADDR = "ipaddress"

Copyright & A K-C

V. Linux

518

32.2 ()

ANYWHERE ="any/0"

MY_ISP = " ip range"

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-


. , , .
.


, . ,
.

Copyright & A K-C

32. Firewall

519

. . input, output forward :


ipchains F



, . , , , .

,
, . , , , ICMP- . , , ,
, ,
, .
, , , .
;
, , :
ipchains P input
DENY
ipchains P output REJECT
ipchains P forward REJECT

, ,
.



, , , . .
. . -
,
.

Copyright & A K-C

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
,
, , .

Copyright & A K-C

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

Copyright & A K-C

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)
( ).

Copyright & A K-C

32. Firewall

523

ICMP- .
Echo Request (-), Echo Reply (-), Destination Unreachable, Time Exceeded
( ). ,
.
, , . 32.3 Redirect ().
. .
, .
Source Quench

ICMP- Source Quench ( )


, ,
. Source Quench . , .
, ICMP-
Source Quench:
ipchains A input -i $EXTERNAL_INTERFACE p icmp -s $ANYWHERE 4 d $IPADDR j ACCEPT
ipchains A output -i $EXTERNAL_INTERFACE p icmp -s $ANYWHERE 4 d $IPADDR j ACCEPT

, ,
Source Quench, .
,
Source Quench.
Parameter Problem

ICMP- Parameter Problem ( ) ,


, .
ICMP Parameter Problem:
ipchains A input -i $EXTERNAL_INTERFACE p icmp -s $ANYWHERE 12 d $IPADDR j ACCEPT
pchains A output -i $EXTERNAL_INTERFACE p icmp -s $ANYWHERE 12 d $IPADDR j ACCEPT

Destination Unreachable

ICMP- Destination Unreachable ( )


. , , .
ICMP Destination Unreachable:
ipchains A input -i $EXTERNAL_INTERFACE p icmp -s $ANYWHERE 3 d $IPADDR j ACCEPT
ipchains A output -i $EXTERNAL_INTERFACE p icmp -s $ANYWHERE 3 d $IPADDR j ACCEPT

Copyright & A K-C

524

V. Linux

, .
, Destination Unreachable .
Fragmentation Needed Destination Unreachable
.
.
, traceroute, ,
Port Unreachable Destination Unreachable.
Time Exceeded

ICMP- Time Exceeded ( )


, , , .
Time Exceeded UDP- traceroute.
, traceroute,
ICMP- Time Exceeded:
ipchains A input -i $EXTERNAL_INTERFACE p icmp -s $ANYWHERE 11 d $IPADDR j ACCEPT
ipchains A output -i $EXTERNAL_INTERFACE p icmp -s $IPADDR 11 d $MY_ISP j ACCEPT

traceroute . traceroute , Time Exceeded.


, Time
Exceeded .
ping: Echo Request Echo Reply

ping ICMP : Echo Request (-) Echo Reply (-). ping :


ipchains A output -i $EXTERNAL_INTERFACE p icmp -s $IPADDR 11 d $MY_ISP j ACCEPT
ipchains A input -i $EXTERNAL_INTERFACE p icmp -s $ANYWHERE 11d $IPADDR j ACCEPT

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 .

Copyright & A K-C

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

-p icmp -d $NETWORK j DENY -l

ipchains A output -i $EXTERNAL_INTERFACE -p icmp -d $NETWORK j REJECT -l


, , . .

() .
, FTP, HTTP . ., . , , ,
, .
DNS

DNS 53 UDP TCP. , .

Copyright & A K-C

V. Linux

526

:
ipchains A
$NAMESERVER
ipchains A
$NAMESERVER

input -i $EXTERNAL_INTERFACE p udp -s $IPADDR $UNPRIVPORTS -d


53 j ACCEPT
output -i $EXTERNAL_INTERFACE p udp -s $IPADDR $UNPRIVPORTS -d
53 j ACCEPT

, UDP-, TCP-.
DNS-.
:
ipchains A
$NAMESERVER
ipchains A
$NAMESERVER

input -i $EXTERNAL_INTERFACE p tcp -s $IPADDR $UNPRIVPORTS -d


53 j ACCEPT
output -i $EXTERNAL_INTERFACE p tcp -s $IPADDR $UNPRIVPORTS -d
53 j ACCEPT

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

E-mail

:
SMTP 25 TCP;
POP3 110 TCP;
IMAP 143 TCP.
, SMTP-, , .

Copyright & A K-C

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

Copyright & A K-C

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

Telnet 23 TCP. Telnet - , -


, , SSH, Telnet.
SSH

SSH 22 TCP. Telnet r-.


5131023.
32.4 , SSH
SSH-.
32.4
ipchains A output -i $EXTERNAL_INTERFACE p tcp -s $IPADDR $UNIPRIVPORTS -d
$ANYWHERE 22 j ACCEPT
ipchains A input -i $EXTERNAL_INTERFACE p tcp ! y -s $ANYWHERE 22 -d
$IPADDR $UNIPRIVPORTS j ACCEPT
ipchains A input -i $EXTERNAL_INTERFACE p tcp -s $ANYWHERE $SSH_PORTS -d
$IPADDR 22 j ACCEPT
ipchains A output -i $EXTERNAL_INTERFACE p tcp ! y -s $IPADDR 22 -d
$ANYWHERE $SSH_PORTS j ACCEPT

, 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

Copyright & A K-C

32. Firewall

529

ipchains A -i $EXTERNAL_INTERFACE p tcp -s $IPADDR $SSH_PORTS -d $ANYWERE 22


j ACCEPT
ipchains A input -i $EXTERNAL_INTERFACE p tcp ! y -s $ANYWHERE 22 -d
$IPADDR $SSH_PORTS j ACCEPT

FTP

(TCP 21, 20). ,


.
FTP-:
ipchains A output -i $EXTERNAL_INTERFACE p tcp -s $IPADDR $UNPRIVPORTS -d
$ANYWERE 21 j ACCEPT
ipchains A input -i $EXTERNAL_INTERFACE p tcp ! y -s $ANYWHERE 21 -d
$IPADDR $UNPRIVPORTS j ACCEPT

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

Copyright & A K-C

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

Copyright & A K-C

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


, .
, , - .

Copyright & A K-C

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

Copyright & A K-C

32. Firewall

533

ACCEPT DENY, output ,


, . ,
,
, ,
, .
, .

. IP-, , , .
.
.
. , ,
IP- .
: IP- , .
,
,
.
ipchains.
, ,
:
ipchains -A forward -i $EXTERNAL_INTERFACE \ -s LAN_1 -j MASQ

,
IP- , , . .
. ,
. , .
proxy- ,
SOCKS. , . , , .


, ,
. . -

Copyright & A K-C

534

V. Linux

, , , . , , .
, ,
.
.
.
proxy-
, , . ,
, , . , (choke), .
,
. , . , .


.

. , . , .
, , .
, (choke). , -,
.
- , . , , . , - , ,
-.
, , , - .
, -, .
.
, , .
, , , , .

Copyright & A K-C

32. Firewall

535

,

.
, .

, ,
.
, , .


, , ,
, . ,
.


, .
,

, .
. . .
.
.
.
, ,
.
, : input output. , ,
, , , .
"", , , , , , DNS. - ,
DNS, IP-.
, DNS.
ipchains.

.
, . , v.
-v, ,

Copyright & A K-C

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

Copyright & A K-C

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
;

Copyright & A K-C

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 ,
. . ,

Copyright & A K-C

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) ,

Copyright & A K-C

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-.

Copyright & A K-C

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

iptables -A INPUT ...

-D, --delete

iptables -D INPUT
--dport 80 -j DROP,
iptables -D INPUT 1

.
,

-D,
.
,
,
,
,
.
1

Copyright & A K-C

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

iptables -P INPUT DROP


. ,
,

-E, --renamechain

iptables -E allowed
disallowed

.
.
TCP- TCP-.
UDP- UDP-.
ICMP- ICMP-.
: state, owner, limit .

Copyright & A K-C

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.
!

Copyright & A K-C

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.

Copyright & A K-C

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

Copyright & A K-C

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

"" User ID (UID),


--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

Copyright & A K-C

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.

Copyright & A K-C

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.

Copyright & A K-C

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) .

Copyright & A K-C

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.

Copyright & A K-C

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- . .

Copyright & A K-C

552

V. Linux



. , , , , .

Linux pppd, chat , , .
:
PPP ( SLIP, ). ( ). ,
.
,
dial on demand ( ). diald, ,

, diald . diald .
, .


,
:
,
;
pppd, chat diald;
ipchains iptables;
( );
proxy-;
.
, , .

, , ,
- . , .

Copyright & A K-C

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. -

Copyright & A K-C

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

Copyright & A K-C

33.

555

,
, , .
192.168.0.100:192.168.0.101,
IP- .
, IP. ,
. IP- .
, route ,
. , (
, ),
defaultroute, , .

pppd
pppd (. 33.2).
33.2. pppd

asyncmap 0

Async- 32-bit hex; , escape-,


pppd

auth

bsdcomp 0

. ,

chap-interval

, pppd

chap-restart

chap (
challenges)

chap-max-challenge

chap challenge

connect <>

Crtscts

Debug

.
, pppd .
log- syslog.

/etc/syslog.conf

Copyright & A K-C

V. Linux

556

33.2 ()

disconnect <>

,
pppd

domain _

ipcp-max-configure

IPCP configurerequest

ipcp-max-terminate

IPCP terminaterequest

ipcp-max-failure

IPCP configure-NAK, configure-Rejects

ipcp-restart

IPCP

local

lock

, pppd lock
UUCP

login

modem

mru

MRU (Maximum Receive Unit, ) . pppd



. MRU 128. MRU 1500.
296 (40 TCP/IP
256 )

mtu

MTU (Maximum Transmit Unit, ) .


MRU, pppd

PPP

name _

( )

noauth

noipdefalut

, IP-, IP- .
IP- IPCP- (
options)

pap-restart

PAP

pap-max-authreq

PAP authenticaterequest ( PAP)

Copyright & A K-C

33.

557

33.2 ()

passive

passive LCP. pppd ,


, pppd LCP-

silent

pppd LCP- , LCP-


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. .

Copyright & A K-C

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 "$*"
}

Copyright & A K-C

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,
, .

Copyright & A K-C

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

Copyright & A K-C

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 , , -.

Copyright & A K-C

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,
, .

Copyright & A K-C

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-? , -

Copyright & A K-C

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 ,
.

Copyright & A K-C

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.

Copyright & A K-C

V. Linux

566

. 33.1. MRTG

MRTG
MRTG mrtg.cfg, . , , , .
:
;
, ;
;
#.
, mrtg.cfg :
Include: _ ;
WorkDir: _ , , HtmlDir, ImageDir LogDir;
HtmlDir: _ ;

Copyright & A K-C

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]: , ,
;

Copyright & A K-C

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.

Copyright & A K-C

33.

569

RRDtool (Round Robin Database)


: , ,
. MRTG.
, . . . MRTG,
, HTML- .
stdin.


,

. ,
, .
, 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
. -

Copyright & A K-C

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.

Copyright & A K-C

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,

Copyright & A K-C

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

PPP-, TCP IP-. (Build a virtual network over a PPP


link across a TCP stream through an existing IP network.)

Extra escaping

- , , ,
, ,

, , ,
.

PPP
PPP
point-to-point- :
PPP HDLC (High-Level Data Link Control, )
PPP ;

Copyright & A K-C

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;

Copyright & A K-C

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-:
;
;
.

Copyright & A K-C

34.

575

,
PPP
. 34.2 ,
PPP. ,
.
34.2. , PPP

ack

Acknowledgement

AO

Active Open [state diagram]

Close [state diagram]

CHAP

Challenge-Handshake Authentication Protocol (RFC1334)

Lower layer down [state diagram]

DES

Data Encryption Protocol

DNA

Digital Network Architecture

IETF

Internet Engineering Task Force ,

FCS

Frame Check Sequence [X.25]

LCP

Link Control Protocol

LQR

Link Quality Report

MD4

MD4 digital signature algorithm

MD5

MD5 digital signature algorithm

MRU

Maximum Receive Unit

MTU

Maximum Transmission Unit

NAK

Negative Acknowledgement

NCP

Network Control Protocol

PAP

Password Authentication Protocol (RFC1334)

PDU

Protocol Data Unit

PO

Passive open

PPP

Point to Point Protocol "-"

RCA

Receive Configure-Ack

RCJ

Receive Code-Reject

RCN

Receive Configure-Nak or -Reject

Copyright & A K-C

V. Linux

576

34.2 ()

RCR+

Receive good Configure-Request [state diagram]


RER

Receive Echo-Request -

RTA

Receive Terminate-Ack [state diagram]

RUC

Receive unknown code [state diagram]

SCA

Send Configure-Ack [state diagram]

SCJ

Send Code-Reject [state diagram]

SCN

Send Configure-Nak or -Reject [state diagram]

ST-II

Stream Protocol

TO+

Timeout with counter > 0 [state diagram] -


TO

Timeout with counter expired [state diagram] -

VJ

Van Jacobson (RFC1144 header compression algorithm) PPP

XNS

Xerox Network Services Xerox

, PPP
. 34.3 (RFC) PPP.
34.3. PPP
RFC

1144

Compressing TCP/IP headers for low-speed serial links


1220

Point-to-Point Protocol extensions for bridging PPP

1332

PPP Internet Protocol Control Protocol (IPCP) IP

1333

PPP link quality monitoring PPP

1334

PPP authentication protocols PPP

1547

Requirements for an Internet Standard Point-to-Point Protocol


- PPP

1552

The PPP Internetwork Packet Exchange Control Protocol (IPXCP)

1570

PPP LCP Extensions LCP

1598

PPP in X.25 PPP X.25

Copyright & A K-C

34.

577

34.3 ()
RFC

1618

PPP over ISDN PPP ISDN

1619

PPP over SONET/SDH PPP


SONET/SDH

1638

PPP Bridging Control Protocol (BCP) PPP

1661

The Point-to-Point Protocol (PPP) "-"

1662

PPP in HDLC-like Framing PPP HDLC-

1663

PPP Reliable Transmission PPP

1717

The PPP Multilink Protocol (MP) PPP-

(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.

Copyright & A K-C

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

Copyright & A K-C

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 , .

Copyright & A K-C

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-, .

Copyright & A K-C

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.

Copyright & A K-C

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 , .

Copyright & A K-C

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).

Copyright & A K-C

584

V. Linux

. 34.3.

. 34.4.

Copyright & A K-C

34.

. 34.5.

. 34.6.

585

Copyright & A K-C

586

V. Linux

. 34.7.

. 34.8.

Copyright & A K-C

34.

. 34.9.

. 34.10. PPP

587

Copyright & A K-C

V. Linux

588

,
. , ,
(. 34.9).
PPP IP (. 34.10).
. .
3G-, , Flasch- . ,
/ . ,
usb-modeswitch usb-modeswitch-data.
, Flasch- .

cs.uni-bonn.de/ppp/part1.html, netware.nwsoft.ru John Wobus.

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.

Copyright & A K-C

35




. ,
. , .
, . ,
. ,
.
, tar, cpio, gzip
.
:
, ;
(snapshots) . ;
.
. , .


. , ,
, ,
. .

Copyright & A K-C

590

V. Linux

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

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

cron, . ,
. ,

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

Copyright & A K-C

35.

591

,
. .
.
.
,
(,
Windows). tar gzip,
.
.
" ", .
.
, tar cpio, .
, , .
. ,
. ,
tar, cpio dump.

,
. API
, , .
, .
, , , ,
.
, ,
. . , ,
.
.
. .

Copyright & A K-C

592

V. Linux


, , . , :
/proc ,
, ;
/sys /proc;
/mnt (CDROM, . .);
/tmp ;
/lost+found "" ,
;
NFS, Samba
;
, .
, ,
,
.


.
, - . , .


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

. ,
, .

Copyright & A K-C

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 , . (),
. , . ,
.

Copyright & A K-C

594

V. Linux

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

NAS
Network Attached Storage . , , .
RAID-,
. , NAS . 200 .



. . ,
.
, -,
, -,
.
, ,
.
root, GNU tar ( ) ,
(--preserve-permission).
tar UMASK.
tar ,
!
, , /etc/passwd /etc/group.
, Linux
,
.

Copyright & A K-C

35.

595


,
. , .

, , .


, tar, cpio dump/restore.
, .
.

tar
tar , . tar :
tar /

. , ,
,
. -, . , /r, CD-ROM, NFS Samba, .
. ,
GNU tar sparse- (, ,
, ) .
:
tar cSlzf $(backdirs) | buffer - /dev/st0

() sparse- (S), (l). (z)


(f) stdout, (backdirs).
buffer,
() SCSI. .

Copyright & A K-C

V. Linux

596

bakdirs , , . backdirs echo,


( /r, /temp,
CD-ROM, NFS ). bakdirs
mount, . .
, tar. /some/moutpoint
/some/mountpoint/somedir, , tar /some/mountpoint/
somedir.

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 |

ssh $TAPEHOST "cpio 0 I buffer -o /dev/st0"

,
buffer.

Copyright & A K-C

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

Copyright & A K-C

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.

Copyright & A K-C

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 ,

Copyright & A K-C

600

V. Linux

. ,
. , , -.

www.veter.sky.net.ua/docs/linux/LINUXSOS/index.html Gerhard Mourani. -

Linux. Red Hat.


www.amanda.org AMANDA.
man.

Copyright & A K-C

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

Copyright & A K-C

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"

Copyright & A K-C

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
: , ,
. .

Copyright & A K-C

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 ( ,
);

Copyright & A K-C

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/ , . ,

.
,
.

Copyright & A K-C

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, .

Copyright & A K-C

36. Window

607

. 36.1. GNOME

KDE K Desktop Environment


.
GNOME. Qt. KDE GNOME ,
. GNOME, KDE, . , , ,
Windows, . Windows.
, KDE,
. ,
- , . , , :
;
QT ( ).
KDE GNOME . , KDE
.

Copyright & A K-C

608

V. Linux

knot.pu.ru/faq/xfaq XFAQ X Window.


www.linux.org.ru/books/gnome-ug/ug/ GNOME.
www.linux.org.ru/books/kde/general/userguide/index.html

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.

Copyright & A K-C

37

, , X Window ,
, ,
, . . .
.
, , ,
. : , USB Ethernet.
,
Win-, .
.
"" ,
UNIX- . ,

.


. , ,
, ,
.

. :
cat mytext.txt > /dev/lp

DOS:
copy mytext.txt > prn

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

Copyright & A K-C

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 ;

Copyright & A K-C

37.

611

quit (or exit) lpc;


restart lpd ;
status ;
up lpd;

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,

Copyright & A K-C

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). , -

Copyright & A K-C

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 , ;
;
, ,
. .;

Copyright & A K-C

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.

Copyright & A K-C

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-.

Copyright & A K-C

V. Linux

616

- Surecom UNIX- LPD,


. -
:
TCP/IP;
IP- -;
LPD- ;
.
.
TCP/IP IP- -
psetup, -.
:
TCP/IP Configuration;
TCP/IP Support ENABLE;
IP Address IP-, -, , ;
DHCP server IP-;
Gateway IP IP- ;
Netmask ;
Name server DNS-.
, ping
-.
LPD.
, ( 37.4).
37.4
mkdir
chown
chgrp
chmod

/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> ...

Copyright & A K-C

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:

HP LaserJet Jet Direct


LPD: "raw", PCL ( PostScript), "text", "" ASCII .


- X Window.
Linux , printconfgui. HP DeskJet 400.
. 37.1 , .

. 37.1.

Copyright & A K-C

618

V. Linux

(. 37.2)
.
. . . 37.2,
. . , .
, , . 37.3.
( ). . (. 37.4).

. 37.2. printconf-gui

. 37.3.

Copyright & A K-C

37.

619

. 37.4.

. 37.5.

Copyright & A K-C

620

V. Linux

. 37.6.

. 37.7.

. 37.8.

Copyright & A K-C

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.

Copyright & A K-C

VI

Copyright & A K-C

38

, Linux ,
Linux. , , Linux .
, , . :
, ;
;
;
;
.
, ,
. .
.
Gimp Photoshop, ; , .
.
Linux .
, ,
Linux, .
,
, , "" ( ) , , .

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

Copyright & A K-C

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

Copyright & A K-C

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

Copyright & A K-C

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

600 IIIEP Plus

Umax

Paragon 600 II N
AstraSlim SE

USB

Copyright & A K-C

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

Copyright & A K-C

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

/etc/hotplug/usb.handmap, 0x100. , log-


, 38.1.
38.1
usb.c: USB disconnect on device 5
hub.c: USB new device connect on bus1/1, assigned device number 6
usb.c: USB device 6 (vend/prod 0x4b0/0x100) is not claimed by any active driver.

Copyright & A K-C

38.

631

usb.c: registered new driver usbscanner


scanner.c: probe_scanner: User specified USB scanner -- Vendor:Product
4b0:100
scanner.c: USB Scanner support registered.

,
, .
. .

SANE
Linux
, .
,
. SANE.
SANE , ,
. USB- SCSI-, , , FireWire (IEE1394), .
,
(frontends), .

frontend backend. Frontend , "" ,


. Backend ,
, frontend
- , backend .

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.

Copyright & A K-C

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.

Copyright & A K-C

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.

Staroffice v7/ OpenOffice 1.1


,
SANE.

Copyright & A K-C

VI.

634

NSane
SANE NeXTStep.

VueScan
VueScan SANE.
. . Shareware,
. : , ,
, , . : , .

www.bog.pp.ru . Hardware: USB-

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

Copyright & A K-C

39

""

,
Linux. , (, )
, Flash-. , "", , ,
.
? ,
Windows,
. Linux
.

Linux
, ,
, Nokia. ,
, , ,
?
, SIM-? ? , , , . ...
? , , , ,
. .
, (Siemens, Sony Ericsson, Motorola)
Bluetooth. Nokia.
Gammu (Gammu+) "" Gnokii.
. , Bluetooth-
USB-. .
, GSM-

Copyright & A K-C

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 /. ,
, ,
,

Copyright & A K-C

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-.

Copyright & A K-C

Vi.

638

. 39.1. J-Pilot

. 39.2. KPilot

Copyright & A K-C

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-), .
( ) . .

Copyright & A K-C

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 -

Copyright & A K-C

39. ""

641

tuner type=3. tuner


type 1 5.
.xawtv 39.1.
39.1
[global]
fullscreen = 800 x 600
freqtab = europe-east
pixsize = 128 x 96
pixcols = 1
jpeg-quality = 75
[defaults]
norm = SECAM
capture = over
source = Television

, ,
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 , .

Copyright & A K-C

Vi.

642

- . TV- ( msp34xx, tda8425, tea6300). ( ).


, , , , TV-.
,
. /etc/conf.modules 39.2.
39.2
alias char-major-81-0 bttv
alias char-major-81 videodev
options tuner type=3
options bttv card=8
pre-install bttv modprobe -k tuner

, xawtv
TV-. , X Window.

wmtv
, .
, , -
. ,
, xawtv.

kWinTV
,
KDE (. 39.3).

. 39.3. kWinTV

Copyright & A K-C

39. ""

643

LIRC
LIRC (Linux Infrared Remote Control,
). , . , ,
bttv. LIRC .
, ,
kWinTV.

Real Video Linux


TV-, Real Video, .

Real Video :
1. Real Producer Basic www.real.com.
2. root, ,
real producer,
realproducer -o /tmp/testing.rm -t 7 -a 3 -v 0 -f 0 -b "Testing Video" -h
"localhost" -c "Personal" -vc video -l 2:1,8:1

, 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. ,

Copyright & A K-C

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

"NVIDIA GeForce2 DDR"

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"

# .

Copyright & A K-C

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- -

Copyright & A K-C

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.

Copyright & A K-C

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.

Copyright & A K-C

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.

Copyright & A K-C

40

, Linux . ,
MS Windows DOS.
. "-" .
,
Windows.
, ,
, .
-.

. .
1. .
,
.
2. . Linux
FAT, VFAT, NTFS . . Microsoft
, Microsoft.
3. , .
:
"" , . ,
, , .
,
. , ;

Copyright & A K-C

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"

Copyright & A K-C

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

Copyright & A K-C

VI.

652

, Linux-, DOS-,
IRQ DOS:
$_irqpassing = ""

# IRQ (2-15) DOS

$_speaker = ""

# or "native" or "emulated"

, .
,
:
$_ports = ""

# , "0x1ce 0x1cf 0x238"

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) .

Copyright & A K-C

40.

$_X_aspect_43 = (on) 4:3


$_X_winsize = "" .
$_X_gamma = (1.0) -.
$_X_vgaemu_memsize = (1024) -

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.

Copyright & A K-C

654

VI.

$_com2 = "/dev/modem" , Linux

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

DOS- DOSEmu (DEXE) . ,


DOS-.
, ,
. ,
DOS-.
DEXE :
mtools;
DOSEmu;
zip-, , DOS-;

Copyright & A K-C

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 ]

dosexec 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

Wine , Cedega, CrossOwer


Office WINE@Etersoft.

Cedega
Cedega (WineX) , Wine. " " Wine, ,
Windows. ,
. Wine.

Copyright & A K-C

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 , .
.

VMWare rpm- . VMWare


root. vmware-config.pl ,
VMWare.
, VMWare,
.
/usr/bin/vmware.
VMWare.
:
Run Configuration Wizard
;
Run Configuration Editor ;
Open An Existing Configuration
.
,

Copyright & A K-C

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, .

Copyright & A K-C

658

VI.

XEN
XEN (). .
, .
. .
. Linux NetBSD.
, Windows. XEN , Virtual Iron, XenSource Server, Oracle VM.

KVM
KVM (Kernel-based Virtual Machine) . XEN , Linux. Linux Windows,
.

linuxbegin.by.ru/articles/article17.shtml Windows- Linux.


www.linux-ve.chat.ru Linux.
linux.yaroslavl.ru/Docum/Other/dosemu/README.html

DOSEmu v. 0.97 pl. 3.0. .


www.suse.com/~dosemu/ DOSEmu.
www.osp.ru/os/2001/07-08/023.htm .

.
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.

Copyright & A K-C

41

,
Linux, , . .
.
,
.


.
. , , ,
. -, , ,
. -, www.alsa-project.org. .
, .


, ,
. ,
.
, aumix (. 41.1).
, , alsamixer, xmix.
. , ,
Audio-CD. .
CD-ROM . , - ,
cdplay. , , - .
, cdp.

Copyright & A K-C

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,
-.

Copyright & A K-C

41.

661

cdparanoia wav-.
MP3. wav- MP3 ,
lame. , ,
. wav- MP3.
- MP3 ,
cdparanoia 1 | lame my_music.mp3

MP3-, mp3c (. 41.2).

. 41.2. - MP3

, - -.
mp3c
, , , MP3.

X Window
, , X Window.
. KDE GNOME.

Copyright & A K-C

VI.

662

. ,
GNOME.
. . 41.3 ,
Windows. .
: , , .
. . 41.4
-.

. 41.3.

. 41.4. -

Copyright & A K-C

41.

663

xmms (. 41.5) winamp. MP3-, play-list. ,


.
, KDE. GNOME,
. .
KMid (. 41.6) midi-.
, , .
, , KMidi. . 41.7.

. 41.5. xmms

. 41.6. KMid

Copyright & A K-C

VI.

664

. 41.7. Kmidi

. 41.8. CD-

. 41.9.

- KDE (. 41.8).
, ,
(. 41.9).

Copyright & A K-C

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).

Copyright & A K-C

VI.

666

. 41.10. XMPS

avifile-player
avifile-player . 41.11. Win32-, DivX, AVI-,
Windows-.

. 41.11. avifile-player

Copyright & A K-C

41.

667

xmms
,
MP3-. plug-ins
. xmms-avi avifile- AVI- Win32.
, .

XMMP LinuX MultiMedia Player


XMMP LinuX MultiMedia Player. avifile-
AVI- Win32. , , , .
XMMP (. 41.12)
. , , .
.

. 43.11. XMMP

MPlayer
MPlayer Movie Player for Linux (. 41.13).
Linux.
, ,
.

Copyright & A K-C

VI.

668

(. 41.14). 1520%. , , . , ,
.
,
- .

. 41.13. MPlayer

. 41.14. MPlayer

XINE
(. 41.15).
:
MPEG1;
MPEG2;

. 41.15. XINE

Copyright & A K-C

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 ( ,
). ,
.

Copyright & A K-C

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

Copyright & A K-C

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-.

Copyright & A K-C

VI.

672

. 41.16. K3b

. 41.17. Eroaster

Copyright & A K-C

41.

673

, K3b - .

Eroaster
Eroaster .
, .
, Recorder/Reader (. 41.17).

D Bake Oven
Nero.
, , ,
CD-RW. Drag'n'Drop, ,
, ,
ISO-, , , ,
. . ,
.
,
. , .
, , .

avifile.sourceforge.net avifile; AVI

Windows (Indeo, Video, DivX).


divx.euro.ru avifile-player.
mplayer.sourceforge.net Mplayer (Movie Player for Linux).
people.freenet.de/for_Ki/ Enjoympeg.
sourceforge.net/projects/dumpmpeg
dumpmpeg.
www.chez.com/tsc/zzplayer/zzplayer.html KDE MPEG-
ZZPlayer.
www.divx.com DivX-.
www.frozenproductions.com/xmmp XMMP (LinuX MultiMedia Player).
www.linuxjournal.com/article.php?sid=4382 Adam Williams. Issue 81: Movie Making
on a Linux Box? No Way!
www.linuxoid.ru/how_to/DivX.html . DivX Linux.
www.lokigames.com/development/smpeg.php3 smpeg.
www.opendivx.org DivX .
www.softerra.ru/freeos/13036/ . .

Copyright & A K-C

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.

Copyright & A K-C

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

Copyright & A K-C

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 -

( , ).

Copyright & A K-C

42. ,

677


wget -i _ ; _ ,

.
wget -r -l5 http://sample.org/ -o log -

5 log-.

-k.

wget -r --no-parent http://example.org/my-archive/

.
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).

Copyright & A K-C

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 ,
.
.

Copyright & A K-C

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

Copyright & A K-C

VI.

680

. 42.3. GGet

. 42.4. KWebGet

Copyright & A K-C

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.

. 42.5. Web- MLdonkey;

Copyright & A K-C

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.

Copyright & A K-C

42. ,

683

. 42.7. Transmission

Vuze
Torrent-, Java (. 42.8). .
.

. 42.8. Vuze

vap.org.ru/storeforever/wget/ "Wget ".


http://mldonkey.sourceforge.net/ MLdonkey.

Copyright & A K-C

43


, .
. , , , ,
"" .
" Linux".

root

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



root ( root, -,
), root
passwd. passwd shadow
, root , -
passwd.


.
<Ctrl>+<Alt>+<Delete>. .

Copyright & A K-C

43.

685

reboot, poweroff, halt,

, 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. .

Copyright & A K-C

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. ,
,
,
.

Copyright & A K-C

43.

687

2. " " ,
. , ,
. :
log- ,
;
( errata, support,
updates . .) (bugtraq,
www.securityfocus.org)
(
) . "", ,
-.

, , ,
log- ( )
, "" log-
. - , log- , ,
log- .

3. .
, , ,
"" , .
,
, ,
,

. , , , .
4. ,
.


, , . .

Copyright & A K-C

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
. , .

Copyright & A K-C

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 .
.

Copyright & A K-C

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

Copyright & A K-C

43.

691


.
LILO, /sbin/lilo
/etc/lilo.conf.


, , LILO.
, LILO . .

Loading Kernel..., , ,
. reserve= exclude=, LILO.


.
-
- .
, -.
- .
,
.
,
,
.



Linux ,
. ,
, rdev.
, . rdev, .
, , .
root=.

Copyright & A K-C

692

VI.

rdev /
/etc/lilo.conf, , append="root=hda2".
, ,
, , ,
, .

,


, , .
, . , /dev
.
gpm ,
. startx . Window.
, Window ,

.
, Window , .


, .
, .


, ,
.
Linux
,
. Linux
.
File Hierarchy Standard (

Copyright & A K-C

43.

693

) , /lib ,
.
, , ,
Magic SysRq, .
,
.

"getcwd: cannot access parent directories"


.
setuidO setgidO ,
, , .
, , , is echo *.
, , .

SIG11
, SIG11
, , .
- ,
, .
.
.
Linux Internal compiler error SIG11, , , .
Fedora
memtest86
. 45 ,
.
,
.
, ", , "
.
, , .

Copyright & A K-C

694

VI.



, , . , .
, /proc/sys/kernel/file-max // sys/kernel/inode-max.
:
inode-max = 32768 file-max .=5.120


.
.


,
.

"unable to find swap-space signature"


,
, swap-.
fdisk
, . , ,
mkswap.


, ,
root . , .
tune2fs.
.
root , root, , .
root ,
, .

Copyright & A K-C

43.

695


-
.




, .
,
.
4 , , .
( -i mke2fs).
, , .



, ,
. ,
, .

Ext2 e2fsck -.

mount

"",
,
. , SCSI-, .

, telnet
. . ps, "" D.
kill -9 ,
, .

, , mount

Copyright & A K-C

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 .

Copyright & A K-C

43.

697

/
, . (, emacs),
.



,
.
. .
reset, , . , .

,

, , , ,
. ,
loadkeys -d , . .


xmodmap .
Window.

loadkeys.

Window

Window , .
"", ,
, Window, .

kill -9
. ,
, . - init " " . , ""
.

Copyright & A K-C

VI.

698


- . .

,

: , , CD-RW, ZIP Drive .
,
, ,
lsmod , , .

, ,



.
mem=xxxM,
.



( Pentium
Pentium II) .
mem=xxxM, . , , .

http://www.bitwizard.nl/sig11 "SIG11 Problem". SIG11

.
HOWTO:

Multiboot Using LILO mini-HOWTO;


LILO mini-HOWTO.

Copyright & A K-C

Copyright & A K-C


.
, , . , .
, . ,
, .
., ., ., . . UNIX: . : . . 3- ., . .
.: ; : BHV, 2007.
. , , , Linux.
.
., ., . Linux: .
; . . .: "", 2000.
.
, .
IT.
. Linux: . ; . . .:
"", 2000.
.
.
. Linux : . . : , 2000.
. 2.4 ,
Linux.
. . UNIX. .: , 2002.
.
, , TCP/IP .
. Linux. . . .: ,
2001.
CVS-
( ).

Copyright & A K-C

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 . ,

Copyright & A K-C

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-.

Copyright & A K-C

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.

Copyright & A K-C

2.

705

acl.bestbits.at Linux ACLs (Access Control Lists).


www.amanda.ocg AMANDA.
www.apache.org Apache.
www.eecis.udel.edu/~ntp ,
XNTP.
www.freshmeat.net , Linux.
www.gnokii.org Gnokii.
www.gnome.org GNOME.
www.gnu.org/software/grub/ - GRUB.
www.idsoftware.com - Doom, Quake, Quake II,
Quake III. ( )
Linux,
.
www.isc.org/products/INN INN.
www.kde.org KDE.
www.kdevelop.org kdevelop.
koffice.kde.org Koffice.
www.kernel.org Linux.
www.lids.org LIDS.
www.linmodems.org , Win-
Linux.
linux.freeware.ru Linux.
www.lirc.org Linux Infrared Remote Control, LIRC.
www.mostang.com/sane SANE.
www.mozilla.org Mozilla. - Web Mozilla, Gecko
Netscape. . . Mozilla
Web-.
www.mrtg.org MRTG.
www.mysql.org SQL- MySQL. , . , SQL, .
MySQL
Web-.
www.opendivx.org DivX .
www.openoffice.org Open Office.
www.openssh.com SSH.
www.opera.com - Web- Opera.
- Web- Mozilla:

Copyright & A K-C

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 , -

Copyright & A K-C

/
/ 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

Copyright & A K-C

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

Copyright & A K-C

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

Copyright & A K-C

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

MRTG (Multi Router Traffic


Grapher) 565
mv 247
N
NCPs (Network Control Protocols,
) 571
NetBSD 11
netcat 613
netcfg 251
NeTraMet 476
netstat 251
News- 361
NFS (Network File System) 45, 425
nfs 70
NIC (Network Information Center) 46
nice 256, 464
NIS (Network Information Service) 410
NIS+ 411
nnrp.access 366
NNTP (Network News Transfer
Protocol) 361
Node 46
nohup 267, 457
nslookup 251
NTP (Network Time Protocol) 401
402
ntp.conf 404
ntpdate 407
ntpq 407
ntptrace 408
ntsysv 143, 148
NVT (Network Virtual Terminal) 492
O
OpenBSD 11
OpenSSH 497
openvt 267
OSI (Open System Interconnection) 46
OSPF (Open Shortest Path First) 53
P
PAM 157
passwd 146, 256
Pdq 613
perl 267
PGP (Pretty Good Privacy) 321

Copyright & A K-C

PID (Process Identification) 453


Pilot-Link 636
pine 251
ping 251
pipe 239
pnpdump 256
Portsentry 473, 489
PPP (Point-to-Point Protocol,
"-") 571
pppd 552, 578
PPTP (Point-To-Point Tunneling
Protocol) 446, 450
Primary Domain Controller 429
printenv 267
Proc 69
procmail 251
proxy- 382, 509
ps 261, 457
purp 189
pwd 247

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

S/MIME (Secure/Multipurpose Internet Mail


Extensions) 157, 320
Samba 429
SambaSentinel 444
SANE 631
saned 633
SATAN 473
scanadf 633
scanimage 633
scanlite 633
Scp 506
Secure Sockets Layer 157
Security-Enhanced Linux 490
setserial 231, 257
setterm 257
setup 148
SFM 274
Sftp 505
SGID 68
shadow 146
size 247
skill 257
Slackware 38
Slackware-LiveCD 40
slocate 248
Smb.conf 430
smbclient 444

Copyright & A K-C

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

Telnet 46, 492


TkScan 633
tload 261
top 261, 461
Top Level Domains 293
traceroute 252
traffic shaper 565
Transparent proxy 564
tripwire 489
Tripwire 155
true 268
tune2fs 75, 77
tunneling 446
TurboLinux 38
tyx 231
U
UDP (User Datagram Protocol) 46
umount 71, 258
umsdos 69
Unicode 274
uniq 264
Usenet 361
useradd 258
users 262
uudecode 252
V
vdir 249
Vector Multicast Routing
Protocol 54
VectorLinux 38
VFS 69
vi 264
vim 264
VirtualBox 657
vlock 152
VMWare 656
VPN (Virtual Private
Networks) 157, 446
VueScan 634
W
w 263
Webmin 444
wget 252
whatis 235, 264

Copyright & A K-C

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

Copyright & A K-C

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