Quick Fix : ssh/sftp stop working. "fatal: accept_ctx died"

Problem: User suddenly can't ssh/sftp to Solaris 10 server anymore.

Symptom: ssh or sftp dies and get " fatal: accept_ctx died" in log file.

....
Mar 24 06:23:12 your-host sshd[19553]: [ID 800047 auth.crit] fatal: accept_ctx died
Mar 24 06:23:25 your-host sshd[19629]: [ID 800047 auth.crit] fatal: accept_ctx died
....

Quick Fix:

Kerberos host file /etc/krb5/krb5.keytab is missing, restore the file back. Problem solved.

Details:

1. Check ssh/sftp -v / debug info and see "RECV : KEXGSS_ERROR"

A bad connection shows the following error: (in bold)

[LOCAL] : Changing state from STATE_EXPECT_KEX_INIT to STATE_KEY_EXCHANGE
[LOCAL] : GSS SPN : host@your-host.foo.com
[LOCAL] : SEND : KEXGSS_INIT [540 bytes]
[LOCAL] : RECV : KEXGSS_HOSTKEY
> [LOCAL] : RECV : KEXGSS_ERROR
> [LOCAL] : RECV: TCP/IP close
> [LOCAL] : Changing state from STATE_KEY_EXCHANGE to STATE_CLOSED

> [LOCAL] : Connected for 0 seconds, 1319 bytes sent, 1100 bytes received

While a good connection should look like this:

[LOCAL] : Changing state from STATE_EXPECT_KEX_INIT to STATE_KEY_EXCHANGE
[LOCAL] : GSS SPN : host@your-host.foo.com
[LOCAL] : SEND : KEXGSS_INIT [540 bytes]
[LOCAL] : RECV : KEXGSS_HOSTKEY
< [LOCAL] : RECV : KEXGSS_COMPLETE < [LOCAL] : SEND : NEWKEYS < [LOCAL] : Changing state from STATE_KEY_EXCHANGE to STATE_EXPECT_NEWKEYS < [LOCAL] : RECV : NEWKEYS < [LOCAL] : Changing state from STATE_EXPECT_NEWKEYS to STATE_CONNECTION
< [LOCAL] : SEND: SERVICE_REQUEST[ssh-userauth]
< [LOCAL] : RECV: SERVICE_ACCEPT[ssh-userauth] -- OK
< [LOCAL] : SENT : USERAUTH_REQUEST [gssapi-keyex]
< [LOCAL] : RECV : USERAUTH_FAILURE, continuations [gssapi-keyex,gssapi-with-mic,p
< ublickey,password,keyboard-interactive]
< [LOCAL] : SENT : USERAUTH_REQUEST [keyboard-interactive]
< [LOCAL] : RECV : SSH_MSG_USERAUTH_INFO_REQUEST[keyboard-interactive]
---

2. To fix: Kerberos host file /etc/krb5/krb5.keytab is missing, restore the file back. Problem solved.

******** Bad connection full msg *********
[LOCAL] : SSH2Core version 6.1.0.383
[LOCAL] : Connecting to your-host.foo.com:22 ...
[LOCAL] : Changing state from STATE_NOT_CONNECTED to STATE_EXPECT_KEX_INIT
[LOCAL] : Using protocol SSH2
[LOCAL] : RECV : Remote Identifier = "SSH-2.0-Sun_SSH_1.1"
[LOCAL] : CAP : Remote can re-key
[LOCAL] : CAP : Remote sends language in password change requests
[LOCAL] : CAP : Remote sends algorithm name in PK_OK packets
[LOCAL] : CAP : Remote sends algorithm name in public key packets
[LOCAL] : CAP : Remote sends algorithm name in signatures
[LOCAL] : CAP : Remote sends error text in open failure packets
[LOCAL] : CAP : Remote sends name in service accept packets
[LOCAL] : CAP : Remote includes port number in x11 open packets
[LOCAL] : CAP : Remote uses 160 bit keys for SHA1 MAC
[LOCAL] : CAP : Remote supports new diffie-hellman group exchange messages
[LOCAL] : CAP : Remote correctly handles unknown SFTP extensions
[LOCAL] : CAP : Remote correctly encodes OID for gssapi
[LOCAL] : CAP : Remote correctly uses connected addresses in forwarded-tcpip re
quests
[LOCAL] : CAP : Remote can do SFTP version 4
[LOCAL] : CAP : Remote uses SHA1 hash in RSA signatures for x.509v3
[LOCAL] : CAP : Remote x.509v3 uses ASN.1 encoding for DSA signatures
[LOCAL] : GSS : [Kerberos] SPN : host@your-host.foo.com
[LOCAL] : GSS : [Kerberos w/ Group Exchange] SPN : host@your-host.foo.com
[LOCAL] : SEND : KEXINIT
[LOCAL] : RECV : Read kexinit
[LOCAL] : Available Remote Kex Methods = gss-group1-sha1-toWM5Slw5Ew8Mqkay+al2g=
=,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
[LOCAL] : Selected Kex Method = gss-group1-sha1-toWM5Slw5Ew8Mqkay+al2g==
[LOCAL] : Available Remote Host Key Algos = ssh-rsa,ssh-dss
[LOCAL] : Selected Host Key Algo = ssh-dss
[LOCAL] : Available Remote Send Ciphers = aes128-ctr,aes128-cbc,arcfour,3des-cbc
,blowfish-cbc
[LOCAL] : Selected Send Cipher = aes128-cbc
[LOCAL] : Available Remote Recv Ciphers = aes128-ctr,aes128-cbc,arcfour,3des-cbc
,blowfish-cbc
[LOCAL] : Selected Recv Cipher = aes128-cbc
[LOCAL] : Available Remote Send Macs = hmac-md5,hmac-sha1,hmac-sha1-96,hmac-md5-
96
[LOCAL] : Selected Send Mac = hmac-sha1
[LOCAL] : Available Remote Recv Macs = hmac-md5,hmac-sha1,hmac-sha1-96,hmac-md5-
96
[LOCAL] : Selected Recv Mac = hmac-sha1
[LOCAL] : Available Remote Compressors = none,zlib
[LOCAL] : Selected Compressor = none
[LOCAL] : Available Remote Decompressors = none,zlib
[LOCAL] : Selected Decompressor = none
[LOCAL] : Changing state from STATE_EXPECT_KEX_INIT to STATE_KEY_EXCHANGE
[LOCAL] : GSS SPN : host@your-host.foo.com
[LOCAL] : SEND : KEXGSS_INIT [540 bytes]
[LOCAL] : RECV : KEXGSS_HOSTKEY

******** Bad connection full msg ends *********

Copy Unix Terminal to Terminal in Real Time

How can you dump someone else's terminal to yours?

The problem:
Your client, a developer, Peter is at a remote place. Peter wants you to install some packages for him as root on his Unix server. You need to know the options/choices when installing the packages and Peter needs to see the actual installation progress on your screen before he can tell you what options to use.

The solutions:
1. Like most "Unix SAs" do, have Peter on the phone and tell him what's on the screen during the installation...

OR, do it the Unix way
2. Copy your screen output to Peter's terminal:

a. Peter and you both login the same server,

b. Ask Peter type "tty" to find out his pts number:
Peter@server-d1:/home/peter # tty

/dev/pts/3

(or you can use command 'w' or 'who' to see a list of pts/x)

c. He's on pts/3. To dump you terminal output to Peter's, type:
#script -a /dev/null | tee /dev/pts/3

Now, start installation, Peter will be surprised to see what's on his screen...

When you're done, Ctrl D to stop script.

Bonus tasks:

1. To record screen output into a file, replace "/dev/null" with a filename.

2. Spying someone's unix activity:
AIX and linux -q option to run it quietly. Put the script command in someone's .profile or .kshrc to redirect his tty to yours or log it in a logfile to spy the user's activity.

3. You want to show 5 remote users how to troubleshoot Oracle database problem on a production server. No one have access to the production server except you and you have access to users Unix workstations. Use the above trick to temporarily propagate your terminal to 5 different users on 5 different workstations... (Hint, ssh is your best friend!)

Solaris 10 Syslog

syslog

Key:

Facility.Level Action

Facilities
- kern
- daemon
- user
- mail
- auth
- syslog
- cron
- lpr
- news
- uucp
- mark (the time when the message was last saved.
- * all except mark

Level Priority
emerg 0
alert 1
crit 2
err 3
warning 4
notice 5
info 6
debug 7
none 8



Action

- /dev/sysmsg console
- /var/adm/messages message file
- /file write into target file
- root send to root
- @host1 send to syslogd on a remote host
- operator send to user if user is logging in
* send to all users who currently logged in


/etc/syslog.conf ;parsed by m4

Facility.Level Action
-------------------------------------------------
kern.crit /dev/sysmsg ;/dev/sysmsg is console
kern.crit; daemn.notice /var/adm/messages
kern,daemon.crit root
*.crit @host1

Meaning: Facility.Level and above will be Actioned

sample /etc/syslog.conf file
----------------------------------------------------
#if a non-loghost machine chooses to have authentication messages
# sent to the loghost machine, un-comment out the following line:
#auth.notice ifdef(`LOGHOST', /var/log/authlog, @loghost)

mail.debug ifdef(`LOGHOST', /var/log/syslog, @loghost)

#
# non-loghost machines will use the following lines to cause "user"
# log messages to be logged locally.
#
ifdef(`LOGHOST', ,
user.err /dev/sysmsg
user.err /var/adm/messages
user.alert `root, operator'
user.emerg *
)
-----------------------------------------------------

Special Note:

mail.debug ifdef('LOGHOST',/var/log/syslog,@loghost)

m4 -syntax :
If LOGHOST env is defined as true, the line would be
mail.debug /var/log/syslog ;send to local /var/log/syslog

Otherwise, LOGHOST FALSE, loghost is defined, the line would be:

mail.debug @loghost
-----------------------------------------------------

NOTE:
loghost is defined in /etc/hosts. When the server boots up, it uses /etc/hosts
to resolve loghost.

/usr/ccs/bin/m4 -D LOGHOST ; causing the m4 LOGHOST variable to be defined as TRUE.



Enabling TCP tracing using syslog

The inetd daemon uses the syslog command to record incoming network connection
requests made by using TCP.

The inetd listens for service requests on the TCP and UDP prots associated with
each of the services listed in the inetd configuration file. You can modify
the inetd to log TCP connections by using syslogd daemon.

#inetadm -p
NAME=VALUE
bind_addr=""
bind_fail_max=-1
bind_fail_interval=-1
max_con_rate=-1
max_copies=-1
con_rate_offline=-1
failrate_cnt=40
failrate_interval=60
inherit_env=TRUE
tcp_trace=FALSE
tcp_wrappers=FALSE


Turn on tracing

#inetadm -M tcp_trace=TRUE
#inetadm -p
NAME=VALUE
bind_addr=""
bind_fail_max=-1
bind_fail_interval=-1
max_con_rate=-1
max_copies=-1
con_rate_offline=-1
failrate_cnt=40
failrate_interval=60
inherit_env=TRUE
tcp_trace=TRUE
tcp_wrappers=FALSE


You can enable the trace option for each inetd-managed service to send
messages to the syslogd daemon. Use the inetadm command to modify the
settings of the service to enable TCP tracing.

#inetadm -m telnet tcp_trace=TRUE
#inetadm -l telnet
SCOPE NAME=VALUE
name="telnet"
endpoint_type="stream"
proto="tcp6"
isrpc=FALSE
wait=FALSE
exec="/usr/sbin/in.telnetd"
user="root"
default bind_addr=""
default bind_fail_max=-1
default bind_fail_interval=-1
default max_con_rate=-1
default max_copies=-1
default con_rate_offline=-1
default failrate_cnt=40
default failrate_interval=60
default inherit_env=TRUE
tcp_trace=TRUE
default tcp_wrappers=FALSE

Solaris 10 Swap Configuration

Two type of swap devices - disk slices or files

Disk Layout- normally, swapfs is on partition 1. root is on partition 0.

The following is a non-labled partition -
because swap slice starts at 0 sector.

Partition
0 root wm 258 - 508 500.04MB (251/0/0) 1024080
1 swap wu 0 - 257 513.98MB (258/0/0) 1052640
2 backup wm 0 - 38306 74.53GB (38307/0/0) 156292560
3 var wm 509 - 764 510.00MB (256/0/0) 1044480
4 unassigned wm 765 - 767 5.98MB (3/0/0) 12240
5 unassigned wm 768 - 770 5.98MB (3/0/0) 12240
6 usr wm 771 - 4284 6.84GB (3514/0/0) 14337120
7 unassigned wm 4285 - 38306 66.19GB (34022/0/0) 138809760s

labled partition - root is at the beginning of the disk, vtoc at 0 sector.

Example:
Sector Content
================
0 vtoc ;sector 0 of cyclinder 0
1-15 bootblk
16- ufs

SWAP
Physical Memory -> swap/swapfs -> Virtual Memory=(swapfs + physical)
Memory contention - paging/swaping. Put anonymous pages on the swap.

1)The default location for the primary swap space is slice 1 of the boot disk.
2)Entry in /etc/vfstab determines the congiruation of the swap partition.

----- /etc/vfstab -----------------------------------------------------------
#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
#
...
/dev/dsk/c0t0d0s1 - - swap - no -
swap - /tmp tmpfs - yes -
-----------------------------------------------------------------------------

Two forms of swap:
1) swap slices (like the above c0t0d0s1)
1) swap files - swap files are files reside on the file system. (use mkfile)

Commands:

swap -s ; summary of the swap
swap -l ; longer listing
swap -a ; add additional swap, don't put two swaps in the one disk.
swap -d ; delete swap

To Add swap slice; (assume s1 is available)
1. vi /etc/vfstab
echo "/dev/dsk/c1t3d0s1 - - swap - no -" >> /etc/vfstab
2.
#swap -a /dev/dsk/c1t3d0s1

To Add swap files:
1. mkdir -p /usr/local/swap
2. mkfile 20m /usr/local/swap/swapfile
3. swap -a /usr/local/swap/swapfile
4. echo "/usr/local/swap/swapfile - - swap - no -" >> /etc/vfstab
swap -l

swapfile dev swaplo blocks free
/usr/local/swap/swapfile - 16 40944 40944

swap -s

To remove swap space
;swap slice
#swap -d /dev/dsk/c1t3d0s1

;swap file
#swap -d /usr/local/swap/swapfile; rm /usr/local/swap/swapfile

Paging - the transfer of selected memory pages between RAM and the swap area.

Commands:
pagesize ; display current page size
pagesize -a ; display all supported pagesizes

Solaris 10 NSCD

Name Service Cache Daemon (nscd)

The nscd ddaemon is a process that provides a cache for the most common
name server requests. The nscd daemon starts during multiuser boot.

/etc/nscd.conf controls the behavior of the nscd.

nscd provides caching for :
- passwd
- group
- hosts
- ipnodes
- exec_attr
- prof_attr
- user_attr


#svc:/system/name-service-cache:default

#svcadm disable system/name-service-cache:default

Solaris 10 NIS (1)

NIS: Network Information Service

Server Daemons
- ypserv
- rpc.yppasswdd ; handles client's password reset requests
- ypxfrd ; updates slave maps
- ypbind ; client side

slave daemon
- ypserv
- ypbind ; client side

Client
- ypbind ; client side

sourcefiles
/etc/passwd
/etc/hosts
/etc/group

/var/yp/...
Makefile
passwd.byname.time ; if this time is older than /etc/passwd, rebuild.
hosts.byname.time ; ...

/var/yp/binding/domain/ypservers ;list servers to bind to

/var/yp/domain/passwd.byname.pag
/var/yp/domain/hosts.byname.pag


/usr/lib/netsvc/yp/...
ypstart
ypstop
ypxfr
rpc.yppasswdd
ypxfr.1perhour

Map contents and sort keys

map.key.pag
map.key.dir

map : the base name of the map (hosts,passwd...)
key : the map's sort key (byname, byaddr...)
pag : the map's data
dir : An index to the *.pag file. If the *.pag file is small,
the *.dir file might be empty.

example:

/var/yp/domain/hosts.byname.pag
/var/yp/domain/hosts.byname.dir
/var/yp/domain/hosts.byaddr.pag
/var/yp/domain/hosts.byaddr.dir

NIS security

/var/yp/securenets
-----
host 127.0.0.1
255.255.255.255.0 150.10.1.0
host 13.13.14.1
-----

passwd.adjunct file

o

ypinit -m ; setup master not starting the daemon, but setup
ypinit -s ; setup slave
ypinit -c ; setup client

Solaris 10 LDAP (very brief)

#ldapclient -v init -a proxyPassword=proxy -a proxyDN=cn=proxyagent \
,ou=profile,dc=la,dc=alrns,dc=com -a domainname=la.alrns.com 10.16.1.100

Parsing proxyPassword=proxy
Parsing proxyDN=cn=proxyagent,ou=profile,dc=la,dc=alrns,dc=com
Parsing domainname=la.alrns.com
Arguments parsed:
domainName: la.alrns.com
proxyDN: cn=proxyagent,ou=profile,dc=la,dc=alrns,dc=com
proxyPassword: proxy
defaultServerList: 10.16.1.100
Handling init option
About to configure machine by downloading a profile
No profile specified. Using "default"
findBaseDN: begins
findBaseDN: ldap not running
findBaseDN: calling __ns_ldap_default_config()
found 2 namingcontexts
findBaseDN: __ns_ldap_list(NULL, "(&(objectclass=nisDomainObject)(nisdomain=la.alrns.com))"
rootDN[0] dc=la,dc=alrns,dc=com
found baseDN dc=la,dc=alrns,dc=com for domain la.alrns.com
Proxy DN: cn=proxyagent,ou=profile,dc=la,dc=alrns,dc=com
Proxy password: {NS1}ecc423aad0
Credential level: 1
Authentication method: 1
About to modify this machines configuration by writing the files
Stopping network services
Stopping sendmail
stop: sleep 100000 microseconds
stop: sleep 200000 microseconds
stop: network/smtp:sendmail... success
Stopping nscd
stop: sleep 100000 microseconds
stop: system/name-service-cache:default... success
Stopping autofs
stop: sleep 100000 microseconds
stop: sleep 200000 microseconds
stop: sleep 400000 microseconds
stop: sleep 800000 microseconds
stop: sleep 1600000 microseconds
stop: sleep 3200000 microseconds
stop: system/filesystem/autofs:default... success
ldap not running
nisd not running
nis(yp) not running
file_backup: stat(/etc/nsswitch.conf)=0
file_backup: (/etc/nsswitch.conf -> /var/ldap/restore/nsswitch.conf)
file_backup: stat(/etc/defaultdomain)=0
file_backup: (/etc/defaultdomain -> /var/ldap/restore/defaultdomain)
file_backup: stat(/var/nis/NIS_COLD_START)=-1
file_backup: No /var/nis/NIS_COLD_START file.
file_backup: nis domain is "la.alrns.com"
file_backup: stat(/var/yp/binding/la.alrns.com)=-1
file_backup: No /var/yp/binding/la.alrns.com directory.
file_backup: stat(/var/ldap/ldap_client_file)=-1
file_backup: No /var/ldap/ldap_client_file file.
Starting network services
start: /usr/bin/domainname la.alrns.com... success
start: sleep 100000 microseconds
start: sleep 200000 microseconds
start: sleep 400000 microseconds
start: network/ldap/client:default... success
start: sleep 100000 microseconds
start: sleep 200000 microseconds
start: system/filesystem/autofs:default... success
start: sleep 100000 microseconds
start: sleep 200000 microseconds
start: system/name-service-cache:default... success
start: sleep 100000 microseconds
start: sleep 200000 microseconds
start: network/smtp:sendmail... success
restart: sleep 100000 microseconds
restart: sleep 200000 microseconds
restart: milestone/name-services:default... success
System successfully configured



/etc/nsswitch.conf is updated to use ldap

ksh:gulf1# more /etc/nsswitch.conf
#
# /etc/nsswitch.ldap:
#
# An example file that could be copied over to /etc/nsswitch.conf; it
# uses LDAP in conjunction with files.
#
# "hosts:" and "services:" in this file are used only if the
# /etc/netconfig file has a "-" for nametoaddr_libs of "inet" transports.

# LDAP service requires that svc:/network/ldap/client:default be enabled
# and online.

# the following two lines obviate the "+" entry in /etc/passwd and /etc/group.
passwd: files ldap
group: files ldap

# consult /etc "files" only if ldap is down.
hosts: ldap [NOTFOUND=return] files

# Note that IPv4 addresses are searched for in all of the ipnodes databases
# before searching the hosts databases.
ipnodes: ldap [NOTFOUND=return] files

networks: ldap [NOTFOUND=return] files
protocols: ldap [NOTFOUND=return] files
rpc: ldap [NOTFOUND=return] files
ethers: ldap [NOTFOUND=return] files
netmasks: ldap [NOTFOUND=return] files
bootparams: ldap [NOTFOUND=return] files
publickey: ldap [NOTFOUND=return] files

netgroup: ldap

automount: files ldap
aliases: files ldap

# for efficient getservbyname() avoid ldap
services: files ldap

printers: user files ldap

auth_attr: files ldap
prof_attr: files ldap

project: files ldap
ksh:gulf1# ping instructor1
instructor1 is alive
ksh:gulf1# ldaplist
dn: cn=Directory Administrators, dc=la,dc=alrns,dc=com

dn: ou=People, dc=la,dc=alrns,dc=com

dn: ou=Special Users,dc=la,dc=alrns,dc=com

dn: ou=group,dc=la,dc=alrns,dc=com

dn: ou=Groups, dc=la,dc=alrns,dc=com

dn: ou=rpc,dc=la,dc=alrns,dc=com

dn: ou=protocols,dc=la,dc=alrns,dc=com

dn: ou=networks,dc=la,dc=alrns,dc=com

dn: ou=netgroup,dc=la,dc=alrns,dc=com

dn: ou=aliases,dc=la,dc=alrns,dc=com

dn: ou=hosts,dc=la,dc=alrns,dc=com

dn: ou=services,dc=la,dc=alrns,dc=com

dn: ou=ethers,dc=la,dc=alrns,dc=com

dn: ou=profile,dc=la,dc=alrns,dc=com

dn: ou=printers,dc=la,dc=alrns,dc=com

dn: ou=SolarisAuthAttr,dc=la,dc=alrns,dc=com

dn: ou=SolarisProfAttr,dc=la,dc=alrns,dc=com

dn: ou=Timezone,dc=la,dc=alrns,dc=com

dn: automountMapName=auto_home,dc=la,dc=alrns,dc=com

dn: automountMapName=auto_direct,dc=la,dc=alrns,dc=com

dn: automountMapName=auto_master,dc=la,dc=alrns,dc=com

dn: automountMapName=auto_shared,dc=la,dc=alrns,dc=com

ksh:gulf1# more /etc/nsswitch.conf
#
# /etc/nsswitch.dns:
#
# An example file that could be copied over to /etc/nsswitch.conf; it uses
# DNS for hosts lookups, otherwise it does not use any other naming service.
#
# "hosts:" and "services:" in this file are used only if the
# /etc/netconfig file has a "-" for nametoaddr_libs of "inet" transports.

# DNS service expects that an instance of svc:/network/dns/client be
# enabled and online.

passwd: files
group: files

# You must also set up the /etc/resolv.conf file for DNS name
# server lookup. See resolv.conf(4).
hosts: files dns

# Note that IPv4 addresses are searched for in all of the ipnodes databases
# before searching the hosts databases.
ipnodes: files dns

networks: files
protocols: files
rpc: files
ethers: files
netmasks: files
bootparams: files
publickey: files
# At present there isn't a 'files' backend for netgroup; the system will
# figure it out pretty quickly, and won't use netgroups at all.
netgroup: files
automount: files
aliases: files
services: files
printers: user files

auth_attr: files
prof_attr: files
project: files

Solaris 10 crash dumps

crash dumps - content of memory

kernel - kernel
current activities - curproc
other

The default dump area is the swap space

/var/crash/host1/vmcore.0 - memory content
/var/crash/host1/unix.0 - symbol table

savecore - a utility that saves crushdump into a file on reboot.

Commands:
#dumpadm
#dumpadm -c curproc -d swap

#dumpadm -n ; turn off savecore
#dumpadm -u ; update kernel from /etc/dumpadm.conf
#dumpadm -y ; turn on savecore, default
#dumpadm -c ; specify the dump content - kernel,all or curproc
#dumpadm -d ; specify the dump device

#dumpadm -m minK ; set a mininum space savecore should reserve,normally,
in /var/crash/host1/ filesystem.

#dumpadm -s savecore_dir ; specify the directory where savecore saves
#dumpadm -r root_dir ; specify the relative root dir, default /

/etc/dumpadm.conf stores coredump configurations. don't edit this file.
use dumpadm instead.

Task
---------------------------------------------

ksh:gulf1# dumpadm
Dump content: kernel pages
Dump device: /dev/dsk/c0t0d0s1 (swap)
Savecore directory: /var/crash/gulf1
Savecore enabled: yes

ksh:gulf1# dumpadm -d /dev/dsk/c1t0d0s5
Dump content: kernel pages
Dump device: /dev/dsk/c1t0d0s5 (dedicated)
Savecore directory: /var/crash/gulf1
Savecore enabled: yes

ksh:gulf1# sync

ksh:gulf1# savecore -L
dumping to /dev/dsk/c1t0d0s5, offset 65536, content: kernel
100% done: 11679 pages dumped, compression ratio 3.14, dump succeeded

System dump time: Tue Dec 5 13:21:05 2006
Constructing namelist /var/crash/gulf1/unix.0
Constructing corefile /var/crash/gulf1/vmcore.0
100% done: 11679 of 11679 pages saved

ksh:gulf1# ksh:gulf1# cd /var/crash/gulf1
-rw-r--r-- 1 root root 1201176 Dec 5 13:21 unix.0
-rw-r--r-- 1 root root 97640448 Dec 5 13:21 vmcore.0
ksh:gulf1# file vmcore.0
vmcore.0: SunOS 5.10 Generic_118822-25 64-bit SPARC crash dump from ''
---------------------------------------------





==========
Core Files
==========

A core file is a point-in-time copy (snapshot) of the RAM allocated to
a process.

Two types of core files:
1)Per-process core file ; owned by user mode 600
2)Glboal core file - not created by default ; owned by root mode 600


#coreadm
#coreadm -g /var/core/core.%f.%p -e global

/etc/coreadm.conf

ksh:gulf1# coreadm
global core file pattern:
global core file content: default
init core file pattern: core
init core file content: default
global core dumps: disabled
per-process core dumps: enabled
global setid core dumps: disabled ;security options
per-process setid core dumps: disabled
global core dump logging: disabled



Changing Core File Configuration

use command coreadm to modify /etc/coreadm.conf file.

coreadm -p pattern pid
coreadm -i pattern ;survives reboot
coreadm -e global/process/global-setid/proc-setid/log ;enable options
coreadm -d ;disables corefile option
coreadm -u ;updates
coreadm -g ;sets the global core file name pattern.

%p ; PID
%u ; uid
%g ; gid
%f ; executable filename
%n ; system node name uname -n
%m ; machine hardware name = uname -m
%t ; time in seconds since 1970,1,1.
%d ; executable file directory/name
%z ; zonename
%% ; % itself

Examples:

coreadm -p core.%f.%p $$ ; $$ pid of the current shell
coreadm -p $HOME/corefiles/%n.%f.%p $$
coreadm -g /var/core/core.%f.%p -e global ;

coreadm 228 507
coreadm -p /var/core/usr/bin ; listing corefiles for pid
coreadm -G all -g /var/core/%d/%f %p %n



Tasks
---------------------------------------------

coreadm

ksh:gulf1# coreadm
global core file pattern:
global core file content: default
init core file pattern: core
init core file content: default
global core dumps: disabled
per-process core dumps: enabled
global setid core dumps: disabled
per-process setid core dumps: disabled
global core dump logging: disabled

ksh:gulf1# mkdir /var/core

ksh:gulf1# coreadm -e global -g /var/core/core.%f.%p

ksh:gulf1# coreadm -e log

ksh:gulf1# coreadm
global core file pattern: /var/core/core.%f.%p
global core file content: default
init core file pattern: core
init core file content: default
global core dumps: enabled
per-process core dumps: enabled
global setid core dumps: disabled
per-process setid core dumps: disabled
global core dump logging: enabled

ksh:gulf1# mkdir /var/tmp/dir
ksh:gulf1# cd /var/tmp/dir
ksh:gulf1# pwd
/var/tmp/dir

ksh:gulf1# ps
PID TTY TIME CMD
1094 pts/6 0:00 ps
1056 pts/6 0:00 ksh

ksh:gulf1# kill 8 1056

ksh:gulf1# ls /var/core
core.ksh.729
core.ksh.893
/var/core/core.ksh.729: ELF 32-bit MSB core file SPARC Version 1, from 'ksh'
/var/core/core.ksh.893: ELF 32-bit MSB core file SPARC Version 1, from 'ksh'


#tail /var/adm/messages
Dec 5 13:21:08 gulf1 genunix: [ID 851671 kern.notice] dump succeeded
Dec 5 13:21:29 gulf1 savecore: [ID 748169 auth.error] saving system crash dump
in /var/crash/gulf1/*.0
Dec 5 13:26:29 gulf1 genunix: [ID 603404 kern.notice] NOTICE: core_log: ksh[893
] core dumped: /var/core/core.ksh.893
Dec 5 13:27:23 gulf1 genunix: [ID 603404 kern.notice] NOTICE: core_log: ksh[729
] core dumped: /var/core/core.ksh.729

Solaris 10 AutoFS

AutoFS

- AutoFS is a file system mechanism that provides automatic mounting using
the NFS protocol.
- AutoFS is a client-side service.
- AutoFS file system is initialized by the /lib/svc/method/svc-autofs script.

How that works?
automount command reads maps, send to kernel module "autofs", kernel updates
automountd to mount the fs.

Three components
- The AutoFS filesystem (kernel module)
- The automountd daemon
- The automount command

Automount maps

- master map (/etc/auto_master)
- direct map (/etc/auto_direcct)
- indirect map (/etc/auto_home)
- special map

/net -hosts is a special map

1) Master map
/etc/auto_master

+auto_master ;check the NIS map first for master map


Trigger points maps
--------------------
/net -hosts ;the name of the map is nfs server
/home auto_home ;the name of the map is auto_home
/- auto_direct ;the name of the map is auto_direct
^--- maps
|
Trigger point


2) Direct map - auto_direct ;NIS recommend to use this one.
/etc/auto_direct
-------------------
/opt/moreapps host1:/export/opt/apps

*mount point is in the direct map


3) Indirect map - auto_home
/etc/auto_home
-------------------
mary host1:/export/home/mary
joe host1:/export/home/joe

*mount point is in the master map /home

OR use this wildcard (host1 is the NFS server hosting all the users' home directories)
* host1:/export/home/&


Trick:
automount trigger point, only one hard link (no . and ..)
autofs monitors trigger points.

# ls -ald /home
#dr-xr-xr-x 1 root root 1 Dec 5 11:08 /home/

#cd /net/instructor1/export/share ;auto mount /net special map

#df -k | grep instructor1
instructor1:/export/share
68336699 66293 67587040 1% /net/instructor1/export/share

Note:
Do not manually mount autofs.
grep autofs /etc/mnttab shows autofs


Updating the Automount Maps

When making changes to the master map or creating a direct map, run the
automount command to make the changes effective.

#automount -t duration remains mounted when not in use -v verbosemode


No need to update when direct map is changed.
Any changes to indirect maps are automatically used by the automountd.
Run automount when Master map or Direct map is changed.


To create direct map on a client.
#vi /etc/auto_master
add
/- auto_direct

#vi /etc/auto_direct
/usr/share/man server1:/usr/share/man

#automount -v ; run automount to update the list of directories
#df -k
#man ls


The plus (+) symbol at the beginning of the +auto_master line in this file
directs the automountd daemon to look at the NIS/NIS+ or LDAP databases before
it reads the rest of the map. If this line is comment out, only the local files
are searched unless the /etc/nsswitch.conf file specifies that NIS/NIS+, or
LDAP should be searched.

Solaris 10 NFS (1)

Network File System (NFS) Version 3.0

1. Concept:
NFS is a set of protocals

2. Daemons:
Server
----------
nfsd
mountd ; receives client's mount request and sends back handle
statd
lockd

Client
----------
statd
lockd

3. Files
A) Server
/etc/dfs/dfstab ;list what to share out
------------------
share -o ro /usr/share/man

related commands:
share
shareall
unshare
unshareall

share ;show what's currently share out
/etc/dfs/sharetab ;stores the results of the share command

B) Client
/etc/vfstab ;specifies nfs server's share
/etc/rmtab ;shows what's currently mounted


#dfshares server

#dfmounts server ;not supported in NFS 4.0


NFS 4.0
-----------------------------
Features:
- Stateful connections
- Single protocal - (server) nfsd,nfsmapid (client) nfs4cbd,nfsmapid
- Improved firewall support, uses well-known port 2049


Note: server may run mountd/lockd/statd to support earlier versions of nfs.

Extra daemon: nfs4cbd - NFS V4 callback daemon. Runs on the client.
Files
/etc/dfs/dfstab
/etc/dfs/sharetab
/etc/nfs/nfslog.conf
/etc/default/nfslogd
/etc/default/nfs
/etc/dfs/fstypes ; the default filesystem types for remote FS

ksh:gulf1# cat /etc/dfs/fstypes
nfs NFS Utilities
autofs AUTOFS Utilities
cachefs CACHEFS Utilities


----------------------------------
Commands:
To start NFS server
#/etc/init.d/nfs.server start or
svcadm -v enable svc:/network/nfs/server

#mount -o ro server:/usr/share/man /usr/share/man
#mount ; shows what's currently mounted


share -F nfs -o ro /directory

share -F nfs -o rw,rw=client1 /directory

share -F nfs -o root=client2 /directory

share -F nfs -o ro,anon=0 /directory ; anonymous user is uid 0, jumpstart

share -F nfs \
-o ro=client:client2,rw=netgrp:@192.168.100:.us.db.com,root=client4 /directory

By default, anonymous user is mapped as nobody 60001. But anon= access list
can set it to something else. anonymous user is any user who doesn't have
account on the server. "-o anon=-1 " will deny anonymous users.


Quick Guide:
Server -
#svcadm -v enable svc:/network/nfs/server
#echo "share -F nfs -o ro=client /export/home/nfs" >> /etc/dfs/dfstab
#shareall
#share

Client -
#svcadm -v enable svc:/network/nfs/client
#dfsshare server
#mount -F nfs server:/export/home/nfs /mnt

mount options:
rw | ro
bg | fg ; default is fg - trys mount in foreground
soft | hard ; soft reports error and stops trying
intro | nointr ; enable or disable keyboard interrupts to kill hanging client
; intr+hard will allow control C to stop trying
suid | nosuid ; whether to enable setuid
timeo=n ; time out n thenths of a second
retry=n ; number of retry, default 10,000 times!!!!
retrans=n ; number of NFS retransmissions . default udp 5. NA for tcp



nfslogging

Server logging isn't supported in NFS version 4.

nfslogd
/etc/nfs/nfslog.conf


Read write for client1, read only for the rest clients
#share -o rw=client, ro=10.10.100.0 /directory


Cliff notes:
NFS uses dynamic rpc port allocation. see /etc/rpc for program # and rpcinfo -p for actual port.

Solaris 10 JumpStart and Client Boot Sequence

========================================================================================
Major Services for Jumpstart

- Boot Service
- Indentification Service
- Configuration Service
- Installation Service


==============
Boot Service
==============

Details:

1. When a Jumpstart client boots, the boot PROM broadcasts a RARP request to the local subnet;

2. The in.rarpd daemon on the boot server processes the client's RARP request by
a. Looking up the client's Ethernet address and hostname in the /etc/ethers;
b. Checking for a corresponding hostname in the /etc/hosts;
c. Returning the associated IP address to the client.

3. The client's boot PROM sends a TFTP request for a network bootstrap program.

4. The in.tftpd daemon on the boot srver processes the client's TFTP request. The daemon searches the /tftpboot directory for a file with a hexadecimal representation of the client's IP address. The hexadecimal representation is th ename of the file. This file is a symbolic link to the network bootstrap program (inetboot.Sun4U.Solaris_10_2);

5. The in.tftpd daemon on the boot server returns the network bootstrap program to the Jumpstart client.

6. The JumpStart client runs the network bootstrap program.

7. The network bootstrap program issues a whoami request to discover the Jumpstart client's hostname.

8. The rpc.bootparamd daemon on the boot server looks up the client's hostname and returns it to the client.

9. The network bootstrap program issues a getfile request to obtain the location of the root (/) filesystem.

10. The server responds with the location of the /, obtained from the appropriate source:
- the /etc/bootparams file
- A name servie such as NIS, LDAP.

11. After the client obtains its boot parameters, the network bootstrap program mounts the root (/) from the boot server.

12. The client loads its kernel and starts the init program. When the client finishes booting, it attempts to find configuration information.

13. The client searches for the configuration server using BOOTPARAMS information. The client mounts the configuration directory, and runs the sysidtool daemon.

14. The client uses BOOTPARAMS information to locate mount the Solaris OS installation image.

15. The client runs the suninstall program and installs the Solaris.


The followign files/directories must be properly configured on the boot server:

/etc/ethers
/etc/hosts
/tftpboot ; saves the bootstrap programs inetboot.SUN4U.Solaris_10_2
/etc/bootparams ; provides the location of / for client
/etc/dfs/dfstab ; nfs share, share out directory where sysidcfg and rules/rules.ok, check,

/etc/inetd.conf must allow in.tftpd daemon.

A sample /etc/bootparams file. The file is created by add_install_client program.

client1
root=server1:/export/install/Solaris_10/Tools/Boot
install=server1:/export/install
boottype=:in
sysid_config=server1:/export/config
install_config=server1:/export/config
rootopts=:rsize=32768


================================
Introducing the JumpStart Client Boot Sequence
================================
Protocals:
- RARP
- TFTP
- Bootparams


- RARP

1. client sends out mac address in ARP broadcast;
2. Server checks /etc/ethers and /etc/hosts then send back client the ip address;
3. Client acquires the ip address;

Files:
/etc/ethers mac:ip
/etc/hosts ip:hostname


- TFTP

4. Client uses tftp to request its boot program;
5. Server searches for a symbolic link pointing to a boot program; /tftpboot/0A986322----> inetboot.SUN4U.Solaris_10_2
6. Server returns inetboot.SUN4U.Solaris_10_2 program;
7. Client runs inetboot.SUN4U.Solaris_10_2 program and sends whoami request;
8. Server receives whoami request and sends hostname back to client; (not IP but hostname. Setp 2 was IP address)


- Bootparams

9. Client sends a getfile request;
10. Server returns information from /etc/bootparams;
11. The inetboot boot program mounts the / root filesystem;
12. Client loads its kernel and starts "init" program;
13. Client mounts the configuration directory and runs "sysidtool";
14. Client uses bootparams information to mount the installation directory;
15. clinet runs the suninstall program to install the operating environment.


cliff notes:

add_install_client


2. Identity Services

/etc/port/config

(key file)
sysidcfg ; list identification items and sources,

name service


3. Config Services

/export/config

/etc/dfs/dfstab

Profile,which specifies:
- install tape
- disk partitions
- file systems
- cluster info
- custom s/w pkgs

Rules File : associates clients with profiles


check script: checks the rules file syntax, if OK, creates rules.ok file
make sure run "check" script after you update the rules file. This will
create a new rules.ok file.



Begin/Finish scripts : before/after the jumpstart, things to do.

eg. Use finish script to patch system after jumpstart.


4. Installation Services

/export/install
/etc/dfs/dfstab

Provides install image:
CD
DVD
spooled image
flush archive

......................

setup_install_server
add_to_install_server

UNIX RPC - Remote Procedure Call


Thanks GOOGLE for making this the #1 page in searching "rpcinfo clnt_create"




Let's jump into the details of RPC!

RPC Key Facts
- rpcbind daemon listens at 111
- /etc/rpc has the program number for rpc programs.
- rpcbind table is maintained - starting the service will update the table.
- rpcinfo -p to see rpcbind table
- uses program number instead of well-known ports
- clients send program number asking for ports
- rpc server check program number against /etc/rpc to know the service
- rpcbind check rpcbind table to get port.
- if service isn't started, no entry in rpcbind table - rpcinfo -p returns nothing
- start service will register port inside rpcbind table
- unregister service by 'rpcinfo -d service' ver command


Background Information
Network Ports

Two different approaches to port assignments
1)Central Authority
- www.iana.org
- well known ports
- /etc/services lists all the well-known services
lrwxrwxrwx /etc/services -> ./inet/services

Central Authority
telnet example:
inetd listens at port 23.
- client sends telnet request
- inetd detects the request and assign different port back to client
- client talks to server on the given port
- inetd keeps listening at port 23 for new telnet request.


Features of RPC

Dynamic Binding - RPC
- client doesn't know the port #
- hosts assign port dynamically
- sun created RPCs
- sun hard code the program number
- service not listed in /etc/services but program# in /etc/rpc
- when start a service, it record its port in rpcbind table, rpcinfo -p to see
- client requests by program# to rpcbind and rpcbind checks prg# and rpcbind table,
then returns port to client
- the rest communication is just like 1).

-------------

Hands-on Examples 1:
host1 spray host2

host1 spray sends (dest port#:111, source Port#,program# 100012) ---> rpcbind @port 111 on host2

host2: rpcbind reads host1 packets' program# 100012 and checks rpcbind table for
(proto,port,service).

on Host2:
1. host2 check program# with /etc/rpc file and knows this is spray.
rpc program number - 100012 for spray (consults /etc/rpc file, records rpc prog#)

2. host2 rpcbind checks program# against rpcbind table - rpcbind table is generated
during the boot by rpcbind. It has the format of:
program#, port#,service
100012,32760,spray
To list current rpcbind table , use 'rpcinfo -p' command

'rpcinfo -p' shows:

- program number
- version number of the RPC program number
- RPC protocol
- port number
- RPC service

#rpcinfo -p hostname ; get rpcbind table from remote host
#rpcinfo -p ; get rpcbind table from local host
program vers proto port service
100000 4 tcp 111 rpcbind
100000 3 tcp 111 rpcbind
100000 2 tcp 111 rpcbind
100000 4 udp 111 rpcbind
100000 3 udp 111 rpcbind
100000 2 udp 111 rpcbind
100024 1 udp 32802 status
100012 1 udp 33563 sprayd
......
3. host2 sends back the port number (33563) for spray back to the client.
4. the client sends another request with the correct port number for spray to host2.
5. host2 inetd receives the requests (by listening at spray's port) and rpc.sprayd
takes over the communcation.



#rpcinfo -d 100012 1 ; unregisters the RPC service with prog#100012


#svcadm disable svc:/network/rpc/spray:udp
#svcadm enable svc:/network/rpc/spray:udp


To start spray services
#svcadm enable svc:/network/rpc/spray:default


---------------------
Hands-on Examples 2:

ksh:gulf1# svcadm enable svc:/network/rpc/spray:default
ksh:gulf1# grep rpcbind /etc/services
sunrpc 111/udp rpcbind
sunrpc 111/tcp rpcbind

ksh:gulf1# rpcinfo -p | grep spray ;spray started,rpcbind has it
100012 1 udp 33563 sprayd

ksh:gulf1# grep gray /etc/services ;not listed as well-known port


ksh:gulf1# grep sprayd /etc/rpc ;check prog#
sprayd 100012 spray

ksh:gulf1# spray hotel1
spray: cannot clnt_create hotel1:netpath: RPC: Program not registered


Start spray on hotel1 server.

ksh:gulf1# spray hotel1
sending 1162 packets of length 86 to hotel1 ...
no packets dropped by hotel1
25270 packets/sec, 2173285 bytes/sec

unregister 'spray - rpcinfo -d spray 1'

ksh:hotel1#rpcinfo -d spray 1
ksh:gulf1# spray hotel1
spray: cannot clnt_create hotel1:netpath: RPC: Program not registered

Restart spray
ksh:gulf1# svcadm disable svc:/network/rpc/spray:default
ksh:gulf1# svcadm enable svc:/network/rpc/spray:default

Confirm spray is listed in rpcbind
ksh:gulf1# rpcinfo -p hotel1 | grep spray
100012 1 udp 32949 sprayd

ksh:gulf1# spray hotel1
sending 1162 packets of length 86 to hotel1 ...
no packets dropped by hotel1
28799 packets/sec, 2476752 bytes/sec


==============
Below is a tcpdump capture of detailed "rpcinfo -p" query between a Linux host and a Sun Solaris server.

ETHER: ----- Ether Header -----
ETHER:
ETHER: Packet 1 arrived at 22:24:53.67045
ETHER: Packet size = 74 bytes
ETHER: Destination = 0:c:29:2e:ed:c1,
ETHER: Source = 0:c:29:e5:d:fb,
ETHER: Ethertype = 0800 (IP)
ETHER:
IP: ----- IP Header -----
IP:
IP: Version = 4
IP: Header length = 20 bytes
IP: Type of service = 0x00
IP: xxx. .... = 0 (precedence)
IP: ...0 .... = normal delay
IP: .... 0... = normal throughput
IP: .... .0.. = normal reliability
IP: .... ..0. = not ECN capable transport
IP: .... ...0 = no ECN congestion experienced
IP: Total length = 60 bytes
IP: Identification = 5703
IP: Flags = 0x4
IP: .1.. .... = do not fragment
IP: ..0. .... = last fragment
IP: Fragment offset = 0 bytes
IP: Time to live = 64 seconds/hops
IP: Protocol = 6 (TCP)
IP: Header checksum = a058
IP: Source address = 192.168.1.104, ipc4.shanjing.com
IP: Destination address = 192.168.1.100, sun1.shanjing.com
IP: No options
IP:
TCP: ----- TCP Header -----
TCP:
TCP: Source port = 750
TCP: Destination port = 111
TCP: Sequence number = 3368322776
TCP: Acknowledgement number = 0
TCP: Data offset = 40 bytes
TCP: Flags = 0x02
TCP: 0... .... = No ECN congestion window reduced
TCP: .0.. .... = No ECN echo
TCP: ..0. .... = No urgent pointer
TCP: ...0 .... = No acknowledgement
TCP: .... 0... = No push
TCP: .... .0.. = No reset
TCP: .... ..1. = Syn
TCP: .... ...0 = No Fin
TCP: Window = 5840
TCP: Checksum = 0xc95d
TCP: Urgent pointer = 0
TCP: Options: (20 bytes)
TCP: - Maximum segment size = 1460 bytes
TCP: - SACK permitted option
TCP: - TS Val = 2134176, TS Echo = 0
TCP: - No operation
TCP: - Window scale = 2
TCP:

ETHER: ----- Ether Header -----
ETHER:
ETHER: Packet 2 arrived at 22:24:53.67077
ETHER: Packet size = 78 bytes
ETHER: Destination = 0:c:29:e5:d:fb,
ETHER: Source = 0:c:29:2e:ed:c1,
ETHER: Ethertype = 0800 (IP)
ETHER:
IP: ----- IP Header -----
IP:
IP: Version = 4
IP: Header length = 20 bytes
IP: Type of service = 0x00
IP: xxx. .... = 0 (precedence)
IP: ...0 .... = normal delay
IP: .... 0... = normal throughput
IP: .... .0.. = normal reliability
IP: .... ..0. = not ECN capable transport
IP: .... ...0 = no ECN congestion experienced
IP: Total length = 64 bytes
IP: Identification = 27277
IP: Flags = 0x4
IP: .1.. .... = do not fragment
IP: ..0. .... = last fragment
IP: Fragment offset = 0 bytes
IP: Time to live = 64 seconds/hops
IP: Protocol = 6 (TCP)
IP: Header checksum = 4c0e
IP: Source address = 192.168.1.100, sun1.shanjing.com
IP: Destination address = 192.168.1.104, ipc4.shanjing.com
IP: No options
IP:
TCP: ----- TCP Header -----
TCP:
TCP: Source port = 111
TCP: Destination port = 750
TCP: Sequence number = 1322806787
TCP: Acknowledgement number = 3368322777
TCP: Data offset = 44 bytes
TCP: Flags = 0x12
TCP: 0... .... = No ECN congestion window reduced
TCP: .0.. .... = No ECN echo
TCP: ..0. .... = No urgent pointer
TCP: ...1 .... = Acknowledgement
TCP: .... 0... = No push
TCP: .... .0.. = No reset
TCP: .... ..1. = Syn
TCP: .... ...0 = No Fin
TCP: Window = 49232
TCP: Checksum = 0xeedf
TCP: Urgent pointer = 0
TCP: Options: (24 bytes)
TCP: - No operation
TCP: - No operation
TCP: - TS Val = 1532405, TS Echo = 2134176
TCP: - Maximum segment size = 1460 bytes
TCP: - No operation
TCP: - Window scale = 0
TCP: - No operation
TCP: - No operation
TCP: - SACK permitted option
TCP:

ETHER: ----- Ether Header -----
ETHER:
ETHER: Packet 3 arrived at 22:24:53.67082
ETHER: Packet size = 66 bytes
ETHER: Destination = 0:c:29:2e:ed:c1,
ETHER: Source = 0:c:29:e5:d:fb,
ETHER: Ethertype = 0800 (IP)
ETHER:
IP: ----- IP Header -----
IP:
IP: Version = 4
IP: Header length = 20 bytes
IP: Type of service = 0x00
IP: xxx. .... = 0 (precedence)
IP: ...0 .... = normal delay
IP: .... 0... = normal throughput
IP: .... .0.. = normal reliability
IP: .... ..0. = not ECN capable transport
IP: .... ...0 = no ECN congestion experienced
IP: Total length = 52 bytes
IP: Identification = 5705
IP: Flags = 0x4
IP: .1.. .... = do not fragment
IP: ..0. .... = last fragment
IP: Fragment offset = 0 bytes
IP: Time to live = 64 seconds/hops
IP: Protocol = 6 (TCP)
IP: Header checksum = a05e
IP: Source address = 192.168.1.104, ipc4.shanjing.com
IP: Destination address = 192.168.1.100, sun1.shanjing.com
IP: No options
IP:
TCP: ----- TCP Header -----
TCP:
TCP: Source port = 750
TCP: Destination port = 111
TCP: Sequence number = 3368322777
TCP: Acknowledgement number = 1322806788
TCP: Data offset = 32 bytes
TCP: Flags = 0x10
TCP: 0... .... = No ECN congestion window reduced
TCP: .0.. .... = No ECN echo
TCP: ..0. .... = No urgent pointer
TCP: ...1 .... = Acknowledgement
TCP: .... 0... = No push
TCP: .... .0.. = No reset
TCP: .... ..0. = No Syn
TCP: .... ...0 = No Fin
TCP: Window = 1460
TCP: Checksum = 0xea46
TCP: Urgent pointer = 0
TCP: Options: (12 bytes)
TCP: - No operation
TCP: - No operation
TCP: - TS Val = 2134177, TS Echo = 1532405
TCP:

ETHER: ----- Ether Header -----
ETHER:
ETHER: Packet 4 arrived at 22:24:53.67095
ETHER: Packet size = 110 bytes
ETHER: Destination = 0:c:29:2e:ed:c1,
ETHER: Source = 0:c:29:e5:d:fb,
ETHER: Ethertype = 0800 (IP)
ETHER:
IP: ----- IP Header -----
IP:
IP: Version = 4
IP: Header length = 20 bytes
IP: Type of service = 0x00
IP: xxx. .... = 0 (precedence)
IP: ...0 .... = normal delay
IP: .... 0... = normal throughput
IP: .... .0.. = normal reliability
IP: .... ..0. = not ECN capable transport
IP: .... ...0 = no ECN congestion experienced
IP: Total length = 96 bytes
IP: Identification = 5707
IP: Flags = 0x4
IP: .1.. .... = do not fragment
IP: ..0. .... = last fragment
IP: Fragment offset = 0 bytes
IP: Time to live = 64 seconds/hops
IP: Protocol = 6 (TCP)
IP: Header checksum = a030
IP: Source address = 192.168.1.104, ipc4.shanjing.com
IP: Destination address = 192.168.1.100, sun1.shanjing.com
IP: No options
IP:
TCP: ----- TCP Header -----
TCP:
TCP: Source port = 750
TCP: Destination port = 111 (Sun RPC)
TCP: Sequence number = 3368322777
TCP: Acknowledgement number = 1322806788
TCP: Data offset = 32 bytes
TCP: Flags = 0x18
TCP: 0... .... = No ECN congestion window reduced
TCP: .0.. .... = No ECN echo
TCP: ..0. .... = No urgent pointer
TCP: ...1 .... = Acknowledgement
TCP: .... 1... = Push
TCP: .... .0.. = No reset
TCP: .... ..0. = No Syn
TCP: .... ...0 = No Fin
TCP: Window = 1460
TCP: Checksum = 0xe454
TCP: Urgent pointer = 0
TCP: Options: (12 bytes)
TCP: - No operation
TCP: - No operation
TCP: - TS Val = 2134177, TS Echo = 1532405
TCP:
RPC: ----- SUN RPC Header -----
RPC:
RPC: Record Mark: last fragment, length = 40
RPC: Transaction id = 450618384
RPC: Type = 0 (Call)
RPC: RPC version = 2
RPC: Program = 100000 (PMAP), version = 2, procedure = 4
RPC: Credentials: Flavor = 0 (None), len = 0 bytes
RPC: Verifier : Flavor = 0 (None), len = 0 bytes
RPC:
PMAP: ----- Portmapper -----
PMAP:
PMAP: Proc = 4 (Dump the mappings)
PMAP:

ETHER: ----- Ether Header -----
ETHER:
ETHER: Packet 5 arrived at 22:24:53.67117
ETHER: Packet size = 66 bytes
ETHER: Destination = 0:c:29:e5:d:fb,
ETHER: Source = 0:c:29:2e:ed:c1,
ETHER: Ethertype = 0800 (IP)
ETHER:
IP: ----- IP Header -----
IP:
IP: Version = 4
IP: Header length = 20 bytes
IP: Type of service = 0x00
IP: xxx. .... = 0 (precedence)
IP: ...0 .... = normal delay
IP: .... 0... = normal throughput
IP: .... .0.. = normal reliability
IP: .... ..0. = not ECN capable transport
IP: .... ...0 = no ECN congestion experienced
IP: Total length = 52 bytes
IP: Identification = 27278
IP: Flags = 0x4
IP: .1.. .... = do not fragment
IP: ..0. .... = last fragment
IP: Fragment offset = 0 bytes
IP: Time to live = 64 seconds/hops
IP: Protocol = 6 (TCP)
IP: Header checksum = 4c19
IP: Source address = 192.168.1.100, sun1.shanjing.com
IP: Destination address = 192.168.1.104, ipc4.shanjing.com
IP: No options
IP:
TCP: ----- TCP Header -----
TCP:
TCP: Source port = 111
TCP: Destination port = 750
TCP: Sequence number = 1322806788
TCP: Acknowledgement number = 3368322821
TCP: Data offset = 32 bytes
TCP: Flags = 0x10
TCP: 0... .... = No ECN congestion window reduced
TCP: .0.. .... = No ECN echo
TCP: ..0. .... = No urgent pointer
TCP: ...1 .... = Acknowledgement
TCP: .... 0... = No push
TCP: .... .0.. = No reset
TCP: .... ..0. = No Syn
TCP: .... ...0 = No Fin
TCP: Window = 49188
TCP: Checksum = 0x2faa
TCP: Urgent pointer = 0
TCP: Options: (12 bytes)
TCP: - No operation
TCP: - No operation
TCP: - TS Val = 1532405, TS Echo = 2134177
TCP:

ETHER: ----- Ether Header -----
ETHER:
ETHER: Packet 6 arrived at 22:24:53.67211
ETHER: Packet size = 66 bytes
ETHER: Destination = 0:c:29:2e:ed:c1,
ETHER: Source = 0:c:29:e5:d:fb,
ETHER: Ethertype = 0800 (IP)
ETHER:
IP: ----- IP Header -----
IP:
IP: Version = 4
IP: Header length = 20 bytes
IP: Type of service = 0x00
IP: xxx. .... = 0 (precedence)
IP: ...0 .... = normal delay
IP: .... 0... = normal throughput
IP: .... .0.. = normal reliability
IP: .... ..0. = not ECN capable transport
IP: .... ...0 = no ECN congestion experienced
IP: Total length = 52 bytes
IP: Identification = 5709
IP: Flags = 0x4
IP: .1.. .... = do not fragment
IP: ..0. .... = last fragment
IP: Fragment offset = 0 bytes
IP: Time to live = 64 seconds/hops
IP: Protocol = 6 (TCP)
IP: Header checksum = a05a
IP: Source address = 192.168.1.104, ipc4.shanjing.com
IP: Destination address = 192.168.1.100, sun1.shanjing.com
IP: No options
IP:
TCP: ----- TCP Header -----
TCP:
TCP: Source port = 750
TCP: Destination port = 111
TCP: Sequence number = 3368322821
TCP: Acknowledgement number = 1322807580
TCP: Data offset = 32 bytes
TCP: Flags = 0x10
TCP: 0... .... = No ECN congestion window reduced
TCP: .0.. .... = No ECN echo
TCP: ..0. .... = No urgent pointer
TCP: ...1 .... = Acknowledgement
TCP: .... 0... = No push
TCP: .... .0.. = No reset
TCP: .... ..0. = No Syn
TCP: .... ...0 = No Fin
TCP: Window = 1856
TCP: Checksum = 0xe574
TCP: Urgent pointer = 0
TCP: Options: (12 bytes)
TCP: - No operation
TCP: - No operation
TCP: - TS Val = 2134179, TS Echo = 1532405
TCP:

ETHER: ----- Ether Header -----
ETHER:
ETHER: Packet 7 arrived at 22:24:53.67212
ETHER: Packet size = 858 bytes
ETHER: Destination = 0:c:29:e5:d:fb,
ETHER: Source = 0:c:29:2e:ed:c1,
ETHER: Ethertype = 0800 (IP)
ETHER:
IP: ----- IP Header -----
IP:
IP: Version = 4
IP: Header length = 20 bytes
IP: Type of service = 0x00
IP: xxx. .... = 0 (precedence)
IP: ...0 .... = normal delay
IP: .... 0... = normal throughput
IP: .... .0.. = normal reliability
IP: .... ..0. = not ECN capable transport
IP: .... ...0 = no ECN congestion experienced
IP: Total length = 844 bytes
IP: Identification = 27279
IP: Flags = 0x4
IP: .1.. .... = do not fragment
IP: ..0. .... = last fragment
IP: Fragment offset = 0 bytes
IP: Time to live = 64 seconds/hops
IP: Protocol = 6 (TCP)
IP: Header checksum = 4900
IP: Source address = 192.168.1.100, sun1.shanjing.com
IP: Destination address = 192.168.1.104, ipc4.shanjing.com
IP: No options
IP:
TCP: ----- TCP Header -----
TCP:
TCP: Source port = 111
TCP: Destination port = 750 (Sun RPC)
TCP: Sequence number = 1322806788
TCP: Acknowledgement number = 3368322821
TCP: Data offset = 32 bytes
TCP: Flags = 0x18
TCP: 0... .... = No ECN congestion window reduced
TCP: .0.. .... = No ECN echo
TCP: ..0. .... = No urgent pointer
TCP: ...1 .... = Acknowledgement
TCP: .... 1... = Push
TCP: .... .0.. = No reset
TCP: .... ..0. = No Syn
TCP: .... ...0 = No Fin
TCP: Window = 49232
TCP: Checksum = 0xf9c4
TCP: Urgent pointer = 0
TCP: Options: (12 bytes)
TCP: - No operation
TCP: - No operation
TCP: - TS Val = 1532405, TS Echo = 2134177
TCP:
RPC: ----- SUN RPC Header -----
RPC:
RPC: Record Mark: last fragment, length = 788
RPC: Transaction id = 450618384
RPC: Type = 1 (Reply)
RPC: This is a reply to frame 4
RPC: Status = 0 (Accepted)
RPC: Verifier : Flavor = 0 (None), len = 0 bytes
RPC: Accept status = 0 (Success)
RPC:
PMAP: ----- Portmapper -----
PMAP:
PMAP: Proc = 4 (Dump the mappings)
PMAP: Program Version Protocol Port
PMAP: 100000 4 6 111 PMAP
PMAP: 100000 3 6 111 PMAP
PMAP: 100000 2 6 111 PMAP
PMAP: 100000 4 17 111 PMAP
PMAP: 100000 3 17 111 PMAP
PMAP: 100000 2 17 111 PMAP
PMAP: 100024 1 17 32772 STATMON2
PMAP: 100024 1 6 32771 STATMON2
PMAP: 100133 1 17 32772 ?
PMAP: 100133 1 6 32771 ?
PMAP: 1073741824 1 6 32772 transient
PMAP: 100021 1 17 4045 NLM
PMAP: 100021 2 17 4045 NLM
PMAP: 100021 3 17 4045 NLM
PMAP: 100021 4 17 4045 NLM
PMAP: 100021 1 6 4045 NLM
PMAP: 100021 2 6 4045 NLM
PMAP: 100021 3 6 4045 NLM
PMAP: 100021 4 6 4045 NLM
PMAP: 100001 2 17 32773 RSTAT
PMAP: 100001 3 17 32773 RSTAT
PMAP: 100001 4 17 32773 RSTAT
PMAP: 100068 2 17 32774 CMSD
PMAP: 100068 3 17 32774 CMSD
PMAP: 100068 4 17 32774 CMSD
PMAP: 100068 5 17 32774 CMSD
PMAP: 100083 1 6 32775 ?
PMAP: 100002 2 6 32776 RUSERS
PMAP: 100002 3 6 32776 RUSERS
PMAP: 100002 2 17 32775 RUSERS
PMAP: 100002 3 17 32775 RUSERS
PMAP: 100011 1 17 32776 RQUOTA
PMAP: 300598 1 17 32779 ?
PMAP: 300598 1 6 32777 ?
PMAP: 805306368 1 17 32779 ?
PMAP: 805306368 1 6 32777 ?
PMAP: 100249 1 17 32780 ?
PMAP: 100249 1 6 32778 ?
PMAP: 38 maps
PMAP:

ETHER: ----- Ether Header -----
ETHER:
ETHER: Packet 8 arrived at 22:24:53.68476
ETHER: Packet size = 66 bytes
ETHER: Destination = 0:c:29:2e:ed:c1,
ETHER: Source = 0:c:29:e5:d:fb,
ETHER: Ethertype = 0800 (IP)
ETHER:
IP: ----- IP Header -----
IP:
IP: Version = 4
IP: Header length = 20 bytes
IP: Type of service = 0x00
IP: xxx. .... = 0 (precedence)
IP: ...0 .... = normal delay
IP: .... 0... = normal throughput
IP: .... .0.. = normal reliability
IP: .... ..0. = not ECN capable transport
IP: .... ...0 = no ECN congestion experienced
IP: Total length = 52 bytes
IP: Identification = 5711
IP: Flags = 0x4
IP: .1.. .... = do not fragment
IP: ..0. .... = last fragment
IP: Fragment offset = 0 bytes
IP: Time to live = 64 seconds/hops
IP: Protocol = 6 (TCP)
IP: Header checksum = a058
IP: Source address = 192.168.1.104, ipc4.shanjing.com
IP: Destination address = 192.168.1.100, sun1.shanjing.com
IP: No options
IP:
TCP: ----- TCP Header -----
TCP:
TCP: Source port = 750
TCP: Destination port = 111
TCP: Sequence number = 3368322821
TCP: Acknowledgement number = 1322807580
TCP: Data offset = 32 bytes
TCP: Flags = 0x11
TCP: 0... .... = No ECN congestion window reduced
TCP: .0.. .... = No ECN echo
TCP: ..0. .... = No urgent pointer
TCP: ...1 .... = Acknowledgement
TCP: .... 0... = No push
TCP: .... .0.. = No reset
TCP: .... ..0. = No Syn
TCP: .... ...1 = Fin
TCP: Window = 1856
TCP: Checksum = 0xe562
TCP: Urgent pointer = 0
TCP: Options: (12 bytes)
TCP: - No operation
TCP: - No operation
TCP: - TS Val = 2134196, TS Echo = 1532405
TCP:

ETHER: ----- Ether Header -----
ETHER:
ETHER: Packet 9 arrived at 22:24:53.68489
ETHER: Packet size = 66 bytes
ETHER: Destination = 0:c:29:e5:d:fb,
ETHER: Source = 0:c:29:2e:ed:c1,
ETHER: Ethertype = 0800 (IP)
ETHER:
IP: ----- IP Header -----
IP:
IP: Version = 4
IP: Header length = 20 bytes
IP: Type of service = 0x00
IP: xxx. .... = 0 (precedence)
IP: ...0 .... = normal delay
IP: .... 0... = normal throughput
IP: .... .0.. = normal reliability
IP: .... ..0. = not ECN capable transport
IP: .... ...0 = no ECN congestion experienced
IP: Total length = 52 bytes
IP: Identification = 27280
IP: Flags = 0x4
IP: .1.. .... = do not fragment
IP: ..0. .... = last fragment
IP: Fragment offset = 0 bytes
IP: Time to live = 64 seconds/hops
IP: Protocol = 6 (TCP)
IP: Header checksum = 4c17
IP: Source address = 192.168.1.100, sun1.shanjing.com
IP: Destination address = 192.168.1.104, ipc4.shanjing.com
IP: No options
IP:
TCP: ----- TCP Header -----
TCP:
TCP: Source port = 111
TCP: Destination port = 750
TCP: Sequence number = 1322807580
TCP: Acknowledgement number = 3368322822
TCP: Data offset = 32 bytes
TCP: Flags = 0x10
TCP: 0... .... = No ECN congestion window reduced
TCP: .0.. .... = No ECN echo
TCP: ..0. .... = No urgent pointer
TCP: ...1 .... = Acknowledgement
TCP: .... 0... = No push
TCP: .... .0.. = No reset
TCP: .... ..0. = No Syn
TCP: .... ...0 = No Fin
TCP: Window = 49232
TCP: Checksum = 0x2c51
TCP: Urgent pointer = 0
TCP: Options: (12 bytes)
TCP: - No operation
TCP: - No operation
TCP: - TS Val = 1532406, TS Echo = 2134196
TCP:

ETHER: ----- Ether Header -----
ETHER:
ETHER: Packet 10 arrived at 22:24:53.68522
ETHER: Packet size = 66 bytes
ETHER: Destination = 0:c:29:e5:d:fb,
ETHER: Source = 0:c:29:2e:ed:c1,
ETHER: Ethertype = 0800 (IP)
ETHER:
IP: ----- IP Header -----
IP:
IP: Version = 4
IP: Header length = 20 bytes
IP: Type of service = 0x00
IP: xxx. .... = 0 (precedence)
IP: ...0 .... = normal delay
IP: .... 0... = normal throughput
IP: .... .0.. = normal reliability
IP: .... ..0. = not ECN capable transport
IP: .... ...0 = no ECN congestion experienced
IP: Total length = 52 bytes
IP: Identification = 27281
IP: Flags = 0x4
IP: .1.. .... = do not fragment
IP: ..0. .... = last fragment
IP: Fragment offset = 0 bytes
IP: Time to live = 64 seconds/hops
IP: Protocol = 6 (TCP)
IP: Header checksum = 4c16
IP: Source address = 192.168.1.100, sun1.shanjing.com
IP: Destination address = 192.168.1.104, ipc4.shanjing.com
IP: No options
IP:
TCP: ----- TCP Header -----
TCP:
TCP: Source port = 111
TCP: Destination port = 750
TCP: Sequence number = 1322807580
TCP: Acknowledgement number = 3368322822
TCP: Data offset = 32 bytes
TCP: Flags = 0x11
TCP: 0... .... = No ECN congestion window reduced
TCP: .0.. .... = No ECN echo
TCP: ..0. .... = No urgent pointer
TCP: ...1 .... = Acknowledgement
TCP: .... 0... = No push
TCP: .... .0.. = No reset
TCP: .... ..0. = No Syn
TCP: .... ...1 = Fin
TCP: Window = 49232
TCP: Checksum = 0x2c50
TCP: Urgent pointer = 0
TCP: Options: (12 bytes)
TCP: - No operation
TCP: - No operation
TCP: - TS Val = 1532406, TS Echo = 2134196
TCP:

ETHER: ----- Ether Header -----
ETHER:
ETHER: Packet 11 arrived at 22:24:53.68535
ETHER: Packet size = 66 bytes
ETHER: Destination = 0:c:29:2e:ed:c1,
ETHER: Source = 0:c:29:e5:d:fb,
ETHER: Ethertype = 0800 (IP)
ETHER:
IP: ----- IP Header -----
IP:
IP: Version = 4
IP: Header length = 20 bytes
IP: Type of service = 0x00
IP: xxx. .... = 0 (precedence)
IP: ...0 .... = normal delay
IP: .... 0... = normal throughput
IP: .... .0.. = normal reliability
IP: .... ..0. = not ECN capable transport
IP: .... ...0 = no ECN congestion experienced
IP: Total length = 52 bytes
IP: Identification = 2
IP: Flags = 0x4
IP: .1.. .... = do not fragment
IP: ..0. .... = last fragment
IP: Fragment offset = 0 bytes
IP: Time to live = 64 seconds/hops
IP: Protocol = 6 (TCP)
IP: Header checksum = b6a5
IP: Source address = 192.168.1.104, ipc4.shanjing.com
IP: Destination address = 192.168.1.100, sun1.shanjing.com
IP: No options
IP:
TCP: ----- TCP Header -----
TCP:
TCP: Source port = 750
TCP: Destination port = 111
TCP: Sequence number = 3368322822
TCP: Acknowledgement number = 1322807581
TCP: Data offset = 32 bytes
TCP: Flags = 0x10
TCP: 0... .... = No ECN congestion window reduced
TCP: .0.. .... = No ECN echo
TCP: ..0. .... = No urgent pointer
TCP: ...1 .... = Acknowledgement
TCP: .... 0... = No push
TCP: .... .0.. = No reset
TCP: .... ..0. = No Syn
TCP: .... ...0 = No Fin
TCP: Window = 1856
TCP: Checksum = 0xe55e
TCP: Urgent pointer = 0
TCP: Options: (12 bytes)
TCP: - No operation
TCP: - No operation
TCP: - TS Val = 2134198, TS Echo = 1532406
TCP:

Solaris 10 SMF for Network Services

The Internet Service Daemon (inetd)

- The inetd doesn't start automatically at boot time.
- The inetd daemon starts at boot time by svc.startd.
- the inetd is the server process for both the standard Internet services and RPC.


inetadm command
#inetadm

ENABLED STATE FMRI
enabled online svc:/application/x11/xfs:default
enabled online svc:/application/font/stfsloader:default
enabled online svc:/application/print/rfc1179:default
disabled disabled svc:/network/rpc/ocfserv:default
enabled online svc:/network/rpc/smserver:default
enabled online svc:/network/rpc/gss:default
disabled disabled svc:/network/rpc/mdcomm:default
disabled disabled svc:/network/rpc/meta:default
disabled disabled svc:/network/rpc/metamed:default
disabled disabled svc:/network/rpc/metamh:default
disabled disabled svc:/network/rpc/rex:default
enabled online svc:/network/rpc/rstat:default
enabled online svc:/network/rpc/rusers:default
disabled disabled svc:/network/rpc/spray:default
disabled disabled svc:/network/rpc/wall:default
disabled disabled svc:/network/tname:default
enabled online svc:/network/security/ktkt_warn:default
disabled disabled svc:/network/security/krb5_prop:default
enabled online svc:/network/telnet:default
enabled online svc:/network/nfs/rquota:default
disabled disabled svc:/network/apocd/udp:default
disabled disabled svc:/network/uucp:default
disabled disabled svc:/network/chargen:dgram
disabled disabled svc:/network/chargen:stream
disabled disabled svc:/network/daytime:dgram
disabled disabled svc:/network/daytime:stream
disabled disabled svc:/network/discard:dgram
disabled disabled svc:/network/discard:stream
disabled disabled svc:/network/echo:dgram
disabled disabled svc:/network/echo:stream
disabled disabled svc:/network/time:dgram
disabled disabled svc:/network/time:stream
enabled online svc:/network/ftp:default
disabled disabled svc:/network/comsat:default
enabled online svc:/network/finger:default
disabled disabled svc:/network/login:eklogin
disabled disabled svc:/network/login:klogin
enabled online svc:/network/login:rlogin
disabled disabled svc:/network/rexec:default
enabled online svc:/network/shell:default
disabled disabled svc:/network/shell:kshell
disabled disabled svc:/network/talk:default
disabled disabled svc:/platform/sun4u/dcs:default
enabled online svc:/network/rpc-100235_1/rpc_ticotsord:default
enabled online svc:/network/rpc-100083_1/rpc_tcp:default
enabled online svc:/network/rpc-100068_2-5/rpc_udp:default


#inetadm -l telnet

SCOPE NAME=VALUE
name="telnet"
endpoint_type="stream"
proto="tcp6"
isrpc=FALSE
wait=FALSE
exec="/usr/sbin/in.telnetd"
user="root"
default bind_addr=""
default bind_fail_max=-1
default bind_fail_interval=-1
default max_con_rate=-1
default max_copies=-1
default con_rate_offline=-1
default failrate_cnt=40
default failrate_interval=60
default inherit_env=TRUE
default tcp_trace=FALSE
default tcp_wrappers=FALSE

To enable
#inetadm -e telnet
enabled online svc:/network/telnet:default

#inetadm | grep telnet
enabled online svc:/network/telnet:default

To disable:
#inetadm -d telnet
#inetadm | grep telnet
disabled disabled svc:/network/telnet:default