Unix System Administration Handbook.pdf

(302 KB) Pobierz
27705171 UNPDF
SYSTEM INFORMATION
COMMON COMMAND EXAMPLES
TOKENS USED IN SENDMAIL.CF
Hostname
ifconfig plumb # Solaris: probe for network interfaces
ifconfig lo0 127.0.0.1 up # Loopback interface
ifconfig en0 inet 128.130.240.1 up netmask
0xFFFFFF00 broadcast 128.130.240.255
Token Debug Meaning
$@
Match zero tokens (V8 only)
$-
^R
Match exactly one token
Internet (IP) address
$+
^Q
Match one or more tokens
route add net 128.130.138.0 128.130.240.12 1
route add default 128.130.240.12 1
# BSD/OS and OSF/1 use –net and –host and no metric
route add net 128.130.138.0 128.130.240.12
route add default 128.130.240.12
$*
^P
Match zero or more tokens
$ X
Match value of macro variable X
$& X
Match value of X at run time
$= X
^S X
Match any token in class X
Ethernet address
$~ X
^T X
Match any token not in class X
netstat –rn # Routing table (numeric addresses)
netstat en0 5 # Monitor en0 at 5-second intervals
netstat –in
The Debug column shows the tokens as they will be printed
by sendmail in address test mode (sendmail -bt).
# Interfaces (numeric addresses)
Hub and port numbers
dump 0uf /dev/nrst0 /users # Level 0 dump
dump 0f /usr | (cd /mnt; restore rvf –) # Copy
DNS RECORD TYPES
tar cf ./from | (cd todir; tar xvfp –) # Copy dir
Type Syntax
SOA zone [ ttl ] IN SOA primary admin serial
refresh retry expire min
NS zone [ ttl ] IN NS host
A hostname [ ttl ] IN A ipaddr
PTR ipaddr [ ttl ] IN PTR hostname
MX hostname [ ttl ] IN MX pref host
CNAME nickname [ ttl ] IN CNAME hostname
RP
Emergency contact person
# Find object files larger than 1MB not accessed in a year
find /users –type f –name "*.o" –size +1048576c
–atime +365 –print
# List all C source files sorted by number of lines
find . –name "*.c" –exec wc –l {} \; | sort –nr
# A more efficient version
find . –name "*.c" –print | xargs wc –l | sort –nr
Boot command
hostname [ ttl ] IN RP admin txt
# Run in daemon mode, process queue every 30 min
sendmail –bd –q30m
# Run in address test mode with a new config file
sendmail –bt –C/etc/sendmail.cf.new
TXT
name [ ttl ] IN TXT text
Disk partitions, tape drives, etc.
In SOA, primary is the IP address of the primary name server,
and admin is the email address of the administrator with the
@ replaced by a period.
The last four values are timeouts in seconds. Secondaries
check in every refresh seconds; if the primary cannot be
contacted, the secondaries try again every retry seconds.
After expire seconds, a secondary will stop trying. min is the
default time-to-live ( ttl ) for all records.
We suggest the following values:
refresh 21600 (6 hours)
retry 1800 (30 minutes)
expire 1209600 (2 weeks)
min 432000 (5 days)
In RP, admin is the administrator’s email address (similarly
encoded), and txt is the name of a TXT record (or set of TXT
records) that contains further information.
Remember to update the SOA’s serial eld whenever you
modify a zone’s conguration les.
ps –axu # User-oriented output in BSD (slow)
ps –axl # Technical output in BSD (fast)
ps –ef # User-oriented output in System V
ps –efl # Technical output in System V
SENDMAIL RULESET ORDER
START
0
1
S
Envelope
A Prentice Hall book by Evi Nemeth, Garth Snyder, Scott
Seebass, and Trent R. Hein. ISBN 0-13-151051-7
Information and on-line orders: http://www.admin.com/
3
D
4
2
R
Headers
0
1
S
3
D
4
2
R
27705171.004.png 27705171.005.png 27705171.006.png
SUGGESTED HARDWARE VENDORS
DB-25 TO DB-25 RS-232 CONNECTIONS
CONTROLLING RUNNING PROCESSES
This is a table of network hardware vendors that we still
trust, recommend, and use ourselves today. We have no
association or connection with any of these vendors.
Legend
Straight
Nulled
Proc
Operation
Command
cron
Reread crontab (BSD)
kill -HUP pid
Frame ground
Transmitted data
Received data
Request to send
Clear to send
Data set ready
Signal ground
Data carrier detect
Data terminal ready
FG
TD
RD
RTS
CTS
DSR
SG
DCD
DTR
1
2
3
4
5
6
7
8
20
1
2
3
4
5
6
7
8
20
1
2
3
4
5
6
7
8
20
1
2
3
4
5
6
7
8
20
gated Reread cong le
Dump current state
Graceful shutdown
Toggle tracing
Check net interfaces
kill -HUP pid
kill -INT pid
kill -TERM pid
kill -USR1 pid
kill -USR2 pid
Vendor
State Telephone
Cables and connectors
AMP
PA
(800) 522-6752
Anixter
IL
(708) 677-2600
inetd
Reread cong le
kill -HUP pid
Belden Cable
IN
(319) 983-5200
init
(BSD)
Go to single-user mode
Reread terminal cong
kill -TERM 1
kill -HUP 1
Black Box Corporation
PA
(412) 746-5500
Krone
CO
(800) 992-9901
MINI DIN-8/DB-9 STRAIGHT CABLES
init
(Sys V)
Go to single-user mode
Change run level
Reread inittab le
telinit S
telinit level
telinit -q
Lan-Tech
CO
(303 695-9473
Newark Electronics
IL
(312) 784-5100
The Siemon Company
CT
(203) 274-2523
DIN-8 DB-9 DB-25 Signal and function
3
named Reread cong les
Dump DB and cache
Dump stats
Dump stats (some OSs)
Dump database les
Increment debug level
Turn off debugging
Toggle query logging
kill -HUP pid
kill -INT pid
kill -IOT pid
kill -ABRT pid
kill -TERM pid
kill -USR1 pid
kill -USR2 pid
kill -WINCH pid
Test equipment
Fluke
2
2
TD Transmitted data
WA
(800) 323-5700
5
3
3
RD Received data
The Siemon Company
CT
(203) 274-2523
6
8
4
RTS Request to send
Wavetek
CA
(800) 854-2708
2
7
5
CTS Clear to send
Repeaters and hubs
Allied Telesis
6
6
DSR Data set ready
CA
(415) 964-2771
4,8
5
7
SG
Signal ground
7
4
8
DCD Data carrier detect
Cabletron
NH
(603) 332-9400
1
1
20
DTR Data terminal ready
Routers
Cisco Systems
CA
(415) 326-1941
USEFUL INTERNET SITES
FOUR-PAIR UTP WIRING FOR RJ-45
PINOUTS FOR SERIAL CONNECTORS
Pair Colors
Wired to
Diagram
Category URL
Software ftp://ftp.uu.net/
ftp://wuarchive.wustl.edu/
ftp://gatekeeper.dec.com/
Sysadmin http://www.usenix.org/
http://www.ora.com/
Banking http://www.wellsfargo.com/
http://www.mastercard.com/
http://www.bofa.com/
Consumer goods http://www.internet.net/
http://internet-plaza.net/
http://www.hot.presence.com/
http://www.cdnow.com/
1
White/Blue
Pins 4/5
TOP
RJ-45
DB-9 (male)
2
White/Orange Pins 3/6
3
White/Green
Pins 1/2
8
1
4
White/Brown
Pins 7/8
Top
View
a. This scheme reects the TIA/EIA-568A standard.
1 2 3 4 5
8
1
6
7
8
9
DISK BLOCK SIZES
System
du
df
quot
Mini DIN-8 (male)
DB-25 (male)
Solaris 2.4
512 a
512 a
1024
Travel
http://www.goalamo.com/
http://www.vegas.com/
http://www.travelweb.com/
HP-UX 9.0
1024
1024
2048 b
1
13
IRIX 5.2
512 a
512 a
1024
SunOS 4.1.3
1024
1024
1024
6
7
8
Shipping
http://www.ups.com/
http://www.fedex.com/
DEC’s OSF/1 2.0
512 a
512 a
1024
3
4
5
BSD/OS 2.0
512 c
1024
14
25
Government
http://www.odci.gov/
http://www.uspto.gov/
1
2
a. You can get 1K blocks with the -k option.
b. True only with quot -h .
c. Uses environment variable BLOCKSIZE , if dened.
Weather
http://cirrus.sprl.umich.edu/wxnet/
27705171.007.png 27705171.001.png 27705171.002.png 27705171.003.png
Zgłoś jeśli naruszono regulamin