Escolar Documentos
Profissional Documentos
Cultura Documentos
Sysinfo
Networking
Crash Dump
Services
Patching / Packages
Accounts
NFS
NTP
Log Files
Security
Security information
Misc
sysinfo
Solaris
cat /etc/release
Red Hat
cat /etc/enterprise-release
cat /etc/redhat-release
Ubuntu/Debian
cat /etc/lsb-release
HP-UX
lsb_release -a
AIX
/stand/kernrel
oslevel -r
lsb_release -a
cat /proc/version
/usr/platform/`uname -i`/sbin/prtdiag -v
dmidecode
dmidecode
Server type
prtdiag -v
prtconf -D
prtpicl -v [-c <class>]
lspci
lsusb
lshal
lspci
lsusb
lshal
model
uname -a
ioscan
ioscan -fun [disk|tape|lan]
/opt/ignite/bin/print_manifest
cat /var/opt/ignite/local/manifest/manifest.info
Hardware Info
lscfg -v
lscfg -l ent0
lscfg -vl fcs0 (find the WWN of HBA adapter)
lsdev
lsdev -Cc disk
lsdev -Cc disk -p scsi0
Hardware Info
lsslot -c [pci|phb|port]
lsslot -c pci -l ent0
lspath -l hdisk0
diag
Operating System
uname -a
/usr/platform/`uname -i`/sbin/prtdiag -v
prtconf | grep -i mem
Memory
uname -a
uname -a
cat /proc/slabinfo
cat /proc/slabinfo
uname -a
oslevel [-r|-s]
Operating System
prtconf -m
prtconf |grep -i memory
lsattr -El sys0 -a realmem
bootinfo -r
Memory
cat /var/opt/ignite/local/manifest/manifest.info
/usr/platform/`uname -i`/sbin/prtdiag -v
CPU (type, number, etc)
## display,offline,online
psrinfo
psradm -f 0 (offline)
psradm -n 0 (online)
format
prtvtoc <device>
Disk Drives
/opt/ignite/bin/print_manifest
sam -> performance monitors -> system properties
cat /var/opt/ignite/local/manifest/manifest.info
fdisk -l
sfdisk -l (advanced server)
parted <device> print
partprobe -s <device>
fdisk -l
sfdisk -l (advanced server)
parted <device> print
partprobe <device>
smartctl -a <device>
Disk Drives
/kernel/genunix
Kernel File and associated
directories
/boot/initrd.img-?????-server
/boot/vmlinuz-????-server
/stand/vmunix
/unix
/usr/lib/boot
/usr/lib/drivers
/platform/`uname -m`/kernel
/platform/i86pc/kernel
/kernel
/usr/kernel
isainfo -kv (solaris 9+)
isalist (sparc v9 will be listed first)
isainfo -b
Kernel File
uname -a
uname -m
getconf -a |grep -i 'long_bit'
prtconf -k
bootinfo -K
Kernel 32 or 64
Kernel 32 or 64
Display Firmware
n/a
/proc/interrupts
/proc/ioports
/proc/dma
/proc/interrupts
/proc/ioports
/proc/dma
n/a
prtconf
admintool
linuxconf
linuxconf
sam
smit
smitty
workstations:
reboot
enter PDC
type: IN (information menu)
type: FV (Firmware Version)
Display Firmware
Memory
/usr/platform/`uname i`/sbin/prtdiag -v
prtconf | grep -i mem
Red Hat
Ubuntu/Debian
HP
dmesg | grep -i physical
/usr/sam/lbin/getmem
/opt/ignite/bin/print_manifest
AIX
prtconf -m
prtconf |grep -i memory
lsattr -El sys0 -a realmem
bootinfo -r
Memory
cat /var/opt/ignite/local/manifest/manifest.info
page size
(memory)
display swap
/usr/bin/pagesize
pagesize
pagesize -a (display all supported pagesizes)
swap -l
swap -s
lsps -a (detailed)
lsps -s
mkfile 5m /var/swapfile
swap -a /var/swapfile
device:
create partition with fdisk (type 82)
file(create 50MB swap file):
dd if=/dev/zero of=/var/swapfile
bs=1024 count=50000
device:
create partition with fdisk (type
82)
file(create 50MB swap file):
dd if=/dev/zero of=/var/swapfile
bs=1024 count=50000
update /etc/fstab
mkswap <device>|<file>
swapon <device>|<file>
mkswap <device>|<file>
swapon <device>|<file>
update /etc/fstab
update /etc/fstab
swapoff <device>|<file>
swapoff <device>|<file>
update /etc/vfstab
adding swap
adding swap
Note:
-a reconfigure paging space after restart
-s size of the page space (logical partitions)
-n activiates the paging space (use swapoff to deactivate)
also see /etc/swapspaces file
removing
swap
update /etc/vfstab
swap -d
swapoff /dev/paging00
rmps paging00
removing swap
Red Hat
fdisk -l
sfdisk -l (advanced server)
parted <device> print
partprobe <device>
Ubuntu/Debian
fdisk -l
sfdisk -l (advanced server)
parted <device> print
partprobe <device>
HP
ioscan -funC disk
AIX
lsdev -Cc disk
lsdev -Cc disk -p scsi0 (specific controller)
lsdev -Cc disk -S [a|d|s] (available, defined,stopped)
Disk Drives
luxadm probe
mpathadm list initiator-port
mpathadm show <initiator-port name>
iscsiadm list initiator-node
iscsiadm list discovery
lscfg -v -l hdisk0
Disk Drives
format
iostat -En
luxadm inq <disk> (A5x00 disk arrays)
prtvtoc <device>
cat /etc/vfstab
hdparm -i /dev/hda
hdparm -I /dev/hda (detailed)
hdparm -i /dev/hda
hdparm -I /dev/hda (detailed)
sdparm -i /dev/sdb
sdparm -i /dev/sdb
cat /proc/ide/ide0/hda/model
cat /proc/scsi/scsi
cat /proc/ide/ide0/hda/model
cat /proc/scsi/scsi
fdisk -l
sfdisk -l (advanced server)
fdisk -l
sfdisk -l (advanced server)
lvlnboot -v /dev/vg00
lifls -Clv <device>
lsvg -l rootvg
lchangelv
cat /etc/filesystems
Disk serial N
cat /etc/fstab
Disk disk pa
## Old way
/etc/sysconfig/rawdevices
service rawdevices start
chkconfig rawdevices on
## New way, Edit below file
/etc/udev/rules.d/60-raw.rules
udevinfo -d or udevadm info
badblocks
badblocks
df -k
df -h
df -k
df -h
df -k
df -h
bdf
df [-egiklnvfb]
df -k
lsfs [<filesystem>]
lsfs -q <filesystem> (detailed)
Bad Blocks
Filesystem commands
Filesystem (create|remove)
cat /etc/mke2fs.conf
-r remove the mountpoint
-i display warning before removing
chfs -a size=+1G /var (grow by additional 1GB)
chfs -a size=1G /var (grow to 1GB in size)
tunefs
tune2fs
tune2fs
tunefs -v <filesystem>
Filesystem c
chfs
Filesystem (
tune2fs -l /dev/sda1
tune2fs -l /dev/sda1
touch /forcefsck
shutdown -Fr now
fsck.mode=force (kernel parameter)
Force fsck
backup filesystem
# Disk fragmentation
fsadm -F vxfs -E / (report)
fsadm -F vxfs -e / (defrag)
touch /forcefsck
shutdown -r now
tune2fs -l /dev/sdb<?> |grep -i 'filesystem state'
Force fsck
ufsdump|ufsrestore
tar
dd
cpio
dump/restore
tar
dd
cpio
dump/restore
tar
dd
cpio
fbackup/frecover
dump/restore
ftio
tar
dd
cpio
backup|restore
tar
dd
cpio
cat /boot/grub/grub.conf
cat /etc/lilo.conf
cat /boot/grub/menu.lst
setboot
/boot/grub/menu.lst
# autoboot sequnce
setboot -b [on|off]
installboot /usr/platform/`uname i`/lib/fs/ufs/bootblk <raw-device>
grub-install <raw-device>
lilo -v
backup files
Display the
/boot/grub/grub.conf
/etc/lilo.conf
Tune Filesys
n/a
vxtunefs -v <filesystem>
fstyp -v <filesystem>
grub-install <raw-device>
mkboot -l <device>
Creating boo
mount/unmount floppy
mount/unmount CDROM
fdformat -v -U
volcheck -v
newfs -v /vol/disk/aliases/floppy0
n/a
volrmmount -l floppy0
eject floppy
n/a
mount -o remount,rw /
Format flop
mount/unm
mount/unm
start: /usr/sbin/pps_mountd
pps_mount
mount -o remount,rw /
remount a filesystem
format -d /dev/rfd0
format -d /dev/fd0.18 (high format)
n/a
/etc/init.d/volmgr start
eject cdrom
n/a
mksysb
create boot
using the grub window append the word single to enter PDC
the kernel line
> search
>boot p1 (cdrom)
interact with IPL? Y
ISL> hpux -is
f10 or f12
f10 or f12
n/a
>boot pri
interact with IPL? Y
floppy:
floppy:
/dev/fd0
floppy:
/dev/fd0
floppy:
n/a
disk:
/dev/hda or /dev/sda
/dev/hdb or /dev/sdb
disk:
/dev/hda or /dev/sda
/dev/hdb or /dev/sdb
disk:
/dev/dsk/c0t6d0
cdrom:
/dev/dsk/c0t6d0s0
/dev/scd0 (external usb cd)
tape:
tape:
tape:
/dev/dsk/rmt/0
cdrom:
/dev/hda (depends on number of IDE disks)
cdrom:
/dev/hda (depends on number of IDE disks)
cdrom:
/dev/dsk/c1t6d0
cdrom:
/dev/cd0
drvconfig
devlinks
disks|tapes|ports
/dev/MAKEDEV <device>
/dev/MAKEDEV <device>
cfgmgr
cfgmgr -l scsi0
disk:
/dev/dsk/c0t0d0s0
Device paths
tape:
/dev/rmt/0ucb
floppy:
/dev/fd0
/dev/rfd0
disk:
/dev/hdisk0
Device path
tape:
update /dev
mkdev
rmdev
rmdev -l cd0
remove or c
chdev
chdev -l rmt0 -a ret=no
prtconf -D
sysdef
cat /proc/devices
cat /proc/devices
lsdev
lsdev
lsdev -Cc disk
lsdev -Cc disk -p scsi0
lsslot -c pci -l ent0
lscfg
lscfg -l ent0
lscfg -vl fcs0 (find the WWN of HBA adapter)
list device d
lspath -l hdisk0
getconf DISK_SIZE hdisk1 (detailed)
Networking
Solaris
Basic network information
(hostname, ip address)
/etc/hostname.hme0
prtdiag -v
ifconfig -a
Red Hat
Ubuntu/Debian
HP
AIX
/etc/sysconfig/network
/etc/sysconfig/network-scripts/ifcfg-eth0
/etc/network/interfaces
/etc/rc.config.d/netconf
ifconfig
system-config-network (GUI)
ifconfig
ifconfig -a
entstat -d <interface>
lsdev -Cc if
lsdev -Cc tcpip
module:instance:name:statistics
# Solaris 11
netadm list
dladm
dladm
dladm
dladm
dladm
show-phys
show-link
show-linkprop
show-vnic
show-etherstub
ipadm
ipadm
ipadm
ipadm
show-if
show-ifprop
show-addr
show-addrprop
ifconfig
Basic
(hos
displa
inter
ifconfig
ifconfig
ifconfig <interface>
# Solaris 11 - Manual
netadm enable -p ncp DefaultFixed
netcfg
Configure network interface
dladm create-vnic
dladm delete-vnic
dladm rename-link
# remove an interface
ifconfig en1 detach
dladm create-etherstub
ipadm
ipadm
ipadm
ipadm
create-ip net1
create-addr -T static -a 192.168.0.110/24 net1/pfv
delete-ip
delete-addr
ifconfig qfe0 up
ifconfig qfe0 down
/sbin/ifup eth0
/sbin/ifdown eth0
/sbin/ifup eth0
/sbin/ifdown eth0
ifconfig lan0 up
ifconfig lan0 down
note: there is no "ifconfig -a" in hpux use lanscan
then "ifconfig <interface>"
# List parameters
ndd -get /dev/hme \?
ndd -get /dev/e1000g0 \?
ndd -get /dev/ip \?
ndd -get /dev/tcp \?
mii-tool -v
ethtool eth1
ethtool -t eth0 online
ethtool eth0
sysctl -a |grep net*
ifconfig en0 up
ifconfig en0 down
ifconfig en0 detach (remove)
Settin
netstat -v
entstat -d <interface>
no -a
no -o "ipforwarding=1"
ifconfig
system-config-network (GUI)
ifconfig
lanscan
netstat -ia
tcpdump -i <interface>
tcpdump -i <interface>
nettl -start
nettl -status all
nettl -tn pduin pduout -e ns_ls_driver -file
/var/adm/LAN
nettl -stop
tcpdump -i <interface>
iptrace -i <interface> <output file>
ipreport (used with iptrace to view reports)
Start
netw
Confi
inter
NIC s
Displa
displa
Displa
packe
edit /etc/sysconfig/network
if_mpadm -d
if_mpadm -r
(detach)
(reattach)
tail /var/adm/messages
edit /etc/network/interfaces
/etc/rc.config.d/netconf
netstat -rn
route -n
netstat -rn
route -n
cat /proc/net/bonding/bond0
cat /proc/net/bonding/bond0
netstat -rn
defau
netstat -rn
netstat -r -f inet
lsattr -EHl inet0 -a route
displa
# create bonding
/etc/sysconfig/network-scripts/ifcfg-bond0
Test IPMP, Bonding
Test
# modprobe
/etc/modprobe.d/bonding.conf
# for bonding options - use BONDING_OPTS
/etc/sysconfig/network-scripts/ifcfg-bond0
# see bonding mode
cat /sys/class/net/bond0/bonding/mode
/etc/sysconfig/network
/etc/hostname
/etc/hosts
/etc/hosts
/etc/nodename
/etc/hostname.<interface>
/etc/inet/hosts
/etc/inet/ipnodes
/etc/net - few files in here as well
chang
# Solaris 11
svccfg -s system/identity:node listprop config/nodename
svcfg -s system/identity:node setprop config/nodename =
astring: hostname
svcadm refresh system/identity:node
svcadm restart indentity:node
/etc/resolv.conf
/etc/resolv.conf
/etc/resolv.conf
/etc/resolv.conf
/etc/resolv.conf
setup
/etc/nsswitch.conf
/etc/host.conf
/etc/resolv.conf
/etc/nsswitch.conf
/etc/resolv.conf
/etc/nsswitch.conf
/etc/host.conf
/etc/resolv.conf
/etc/nsswitch.conf
/etc/resolv.conf
/etc/netsvc.conf
/etc/resolv.conf
/etc/irs.conf (may not be there)
chnamsv
(change name service)
rmnamsv
(remove a name service)
lsnamsv -C (list name services)
## if installed
service nscd restart
/etc/defaultdomain
Domain Name
n/a
/etc/host
/etc/resolv.conf
/etc/rc.config.d/netconf
domainname <domainname>
Name
(DNS
Flush
Doma
n/a
NFS servers:
rpcinfo -b mountd 1
NFS servers:
rpcinfo -b mountd 1
NFS servers:
rpcinfo -b mountd 1
NFS servers:
rpcinfo -b mountd 1
NFS servers:
rpcinfo -b mountd 1
NIS servers/slaves:
rpcinfo -b ypserv 1
NIS servers/slaves:
rpcinfo -u <yp server> ypserv
NIS servers/slaves:
rpcinfo -u <yp server> ypserv
NIS servers/slaves:
rpcinfo -b ypserv 1
NIS servers/slaves:
rpcinfo -b ypserv 1
Crash Dump
Solaris
Crash Dump
Red Hat
Ubuntu/Debian
diskdump
netdump
kdump (part of kexec rpm)
/etc/kdump.conf (select where you
want the dump to go)
service kdump start
chkconfig kdump on
## to crash the system
echo "c" > /proc/sysrq-trigger
HP
edit /stand/system
add either:
dump 2/0/1.5.0
dump lvol
dump none
# crash config file
/etc/rc.config.d/savecrash
AIX
sysdumpdev -l (list dump destination)
sysdumpdev -e (estimates dumpsize)
sysdumpdev -L (info)
sysdumpstart -p (start dump primary)
sysdumpstart -s (start dump secondary)
# set the dump device permanently
sysdumpdev -p <dump device> -P
# analyse dump file
echo "stat\n status\n t -m" | crash /var/adm/ras/vmcore.0
Crash Dump
Obtai
Find
netw
crash (used to analyse crash dumps) crash (used to analyse crash dumps)
CPU
Memory
Network
Red Hat
Ubuntu/Debian
HP
AIX
top (sunfreeware)
prstat
sar
mpstat
w
(load average)
uptime (load average)
ps
vmstat
top
sar
mpstat
w
(load average)
uptime (load average)
ps
vmstat
procinfo
oprofile
cat /proc/cpuinfo
top
sar
mpstat
w
(load average)
uptime (load average)
ps
vmstat
procinfo
cat /proc/cpuinfo
top
sar
w
(load average)
uptime (load average)
ps
vmstat
glance
sam
prstat
vmstat
top
sar
free
vmstat
top
procinfo
slabtop
sar
cat /proc/meminfo
free
vmstat
top
procinfo
slabtop
sar
cat /proc/meminfo
top
vmstat
sar
sam
glance
topas
vmstat
sar -b
svmon
ps
ipcs -a
lockstat (version 4)
rmss
ndd
netstat
lsof
snoop
route
ethtool
mii-tool
netstat
lsof
tcpdump
ip
iptraf
nmap
ethtool
mii-tool
netstat
lsof
tcpdump
ip
iptraf
netstat
lanadmin
sam
glance
[ent|tok|fddi|atm]stat
netstat
netpmon (trcstop to stop
trace)
sar -d
iostat
vmstat
lsof
sar -d
iostat
vmstat
lsof
sar -d
iostat
vmstat
lsof
iostat
sar
sam
glance
topas -D (disk)
topas -F (filesystem)
iostat
sar -D
fcstat (fibre)
lvmstat
filemon (trcstop to stop)
fileplace
Disk
topas -P
topas -L (logical partitions)
mpstat
sar -c
w
(load average)
uptime (load average)
lparstat
ps
iostat -tT 1
tprof
curt
CPU
Memory
Network I/O
Disk I/O
strace -p <pid>
strace -p <pid>
Application
NFS
nfsstat
Process
top
prstat
ps -ef
pargs <pid>
pcred <pid>
pfiles <pid>
pflags <pid>
pgrep <pattern>
pkill <pattern>
pmap <pid>
pldd <pid>
preap <pid>
prun <pid>
psig <pid>
pstack <pid>
pstop <pid>
ptime <pid>
ptree <pid>
pwait <pid>
pwdx<pid>
nfsstat
nfsstat
nfsstat
topas
truss
sar
probevue
tprof
svmon -P <pid>
nfsstat
Application
NFS
Solaris
modinfo
Red Hat
Ubuntu/Debian
Location:
/lib/modules/`uname -r`/kernel/drivers
Location:
/lib/modules/`uname -r`/kernel/drivers
display l
modprobe <module>
insmod
modprobe <module>
insmod
modprobe -r <module>
rmmod
modprobe -r <module>
rmmod
sysctl -w param=value
sysctl -w param=value
No reboot (dynamically):
echo "250 32000 100 28" > /proc/sys/kernel/sem
echo "536870912" > /proc/sys/kernel/shmmax
echo "4096" > /proc/sys/kernel/shmmni
echo "2097152" > /proc/sys/kernel/shmall
etc.............................................
No reboot (dynamically):
echo "250 32000 100 28" > /proc/sys/kernel/sem
echo "536870912" > /proc/sys/kernel/shmmax
echo "4096" > /proc/sys/kernel/shmmni
echo "2097152" > /proc/sys/kernel/shmall
etc.............................................
unload modules
/etc/system (edit and reboot)
AIX
genkex
Config:
/etc/modprobe.d/options
/etc/modprobe.d
Config:
/etc/modprobe.conf
/etc/modprobe.d
load modules
HP
kmadmin -k
n/a
load mod
n/a
unload m
kcweb (11i)
kctune (11i only)
rebuild kernel (< 11i see below)
set kern
vi /etc/security/limits
cd /etc/tunables
tunchange, tundefault, tunsave, tunrestore, tuncheck
Note: most parameters are dynamically changed in AIX , for example
memory segments are dynamically adjusted
cat /etc/system
sysdef -i
display kernel
parameters
build kernel
interprocess
communication
ipcs -a
sysctl -a
cat /etc/sysctl.conf
sysctl -a
cat /etc/sysctl.conf
cat /proc/sys/kernel/sem
cat /proc/sys/kernel/shmmax
etc...................................
cat /proc/sys/kernel/sem
cat /proc/sys/kernel/shmmax
etc...................................
cd /usr/src/linux-2.5
edit Makefile (change EXTRAVERSION)
make mrproper
backup .config
make xconfig
make dep
make bzImage
make modules
move new kernel
make modules_install
change lilo/grub config file
reboot
ipcs -a
ipcs -a
ipcs -a
display services
svcs -a
svcs -l <service>
svcs -vx
inetadm -l
Red Hat
service --status-all
Ubuntu/Debian
There is no services or chkconfig
command use the old fashioned way
/etc/init.d/<service>
HP
There is no services or chkconfig
command
use the old fashioned way
/sbin/init.d/<service>
AIX
lssrc -a
display services
startsrc -s <subsystem>
startsrc -g <group>
start services
stopsrc -s <subsystem>
stopsrc -g <group>
stop services
refresh -s <subsystem>
stopsrc -s <subsystem>
startsrc -s <subsystem>
restart service
svcs nfs
lssrc -a
service status
n/a
n/a
service dependencies
service dependants
n/a
n/a
service dependants
start services
stop services
reload service
restart service
service status
svcs -D network
# change or add
reload service
display k
build ke
ipcs -a
Services
Solaris
interpro
commun
Service notifications
svccfg
# verify or confirm
svcprop
change service
startup
/var/svc/log
/var/svc/manifest
/lib/svc/method
/etc/svc/repository.db
/system/volatile/svc_nonpersist.db
n/a
n/a
n/a
/var/adm/ras
/etc/syslog.conf
/etc/rc.tcpip
n/a
change service
startup
# Create your
stop/start
# script in /etc/init.d
Patching / Software
Solaris
display installed patches
Red Hat
Ubuntu/Debian
showrev -p
patchadd -p
patchadd
patchadd -M <dir> (multiple patches)
patchrm
rpm
rpm
rpm
rpm
# NEW IPS
pkg list (all packages)
pkg info (single package)
pkg search (find packages and files)
AIX
instfix -ia
instfix -k
adding patch
HP
swlist -l bundle
swlist -l product
swlist -l patch
adding patch
-l
-S <search string> (search)
-S <filename> (file belongs)
-s <package> (status)
-p <package> (detailed)
installp -r
lslpp
lslpp
lslpp
lslpp
rpm
rpm
rpm
rpm
removing patch
adding package
swinstall
swinstall -s <full_path/software>
# NEW IPS
pkg install
pkg update
installp -a
installp -c (cleanup after failed install)
rpm -i
adding package
pkgrm
removing packages
rpm -e <package>
swremove
# NEW IPS
pkg uninstall <package>
removing packages
geninstall -u <package>
pkginfo -l
pkginfo -p
verify package
n/a
# NEW IPS
pkg publisher
pkg verify <package>
pkgchk -l <package> | grep -i pathname
rpm -V <package>
# NEW IPS
pkg contents <package>
# NEW IPS
pkg history
lslpp -f <fileset>
rpm -ql <package>
pkg
pkg
pkg
pkg
pkg
pkg
purge-history
freeze
unfreeze
fix
refresh
publisher
/var/sadm
/var/lib/rpm
/var/lib/dpkg/info
/var/adm/sw
/usr/lpp
Package directory
Package directory
/var/lib/rpm
ldd <file>
ldd <file>
ldd <file>
chatr <file>
ldd <file>
Accounts
Solaris
Red Hat
cat /etc/passwd
cat /etc/passwd
system-config-users (GUI)
display users
Ubuntu/Debian
cat /etc/passwd
HP
AIX
cat /etc/passwd
logins -x
cat /etc/passwd
display users
logins -x [-p]
useradd
useradd
system-config-users (GUI)
useradd
useradd
sam
mkuser
useradd
create a user
userdel
userdel
system-config-users (GUI)
userdel
userdel
sam
rmuser
userdel
remove a user
modify a user
usermod
usermod
system-config-users (GUI)
usermod
usermod
sam
chuser -a
usermod
passwd -f
passwd -s
chfn <username>
chfn <username><shell>
modify a user
change user
password
passwd
passwd
passwd
passwd
passwd
pwdadm
pwdck -t ALL
create a group
groupadd
groupadd
groupadd
groupadd
create a group
remove a group
groupdel
groupdel
groupdel
groupdel
remove a group
modify a goup
groupmod
groupmod
groupmod
groupmod
modify a goup
password files
/etc/passwd
/etc/shadow
/etc/passwd
/etc/shadow
/etc/passwd
/etc/shadow
/etc/passwd
/tcb/files/auth/r/root (trusted system)
/etc/security/passwd
password files
id -a
whoami
who
w
finger
logins -p
id -a
whoami
who
w
finger
id -a
whoami
who
w
finger
id
whoami
who
w
uptime (displays # of users logged in)
finger
id
whoami
who
w
uptime (displays # of users logged in)
finger
create a user
remove a user
# user defaults
/usr/sadm/defadduser
useful user
commands
# License information
lslicense
chlicense
groups
setpgrp
newgrp
Password Policy
/etc/security/policy.conf /etc/login.defs
/etc/default/passwd
Password Aging
passwd
groups
groups
groups
setprivgrp
groups
setgroups
lsgroup ALL
chage -l <user>
chage <options> <user>
NFS
Solaris
NFS Daemons
NFS files
Red Hat
server: rpc.mountd,nfsd
client: rpc.statd, lockd
/etc/dfs/dfstab
/etc/dfs/sharetab
/etc/rmtab
/etc/exports
/var/lib/nfs/etab
/var/lib/nfs/xtab
Ubuntu/Debian
server: rpc.mountd,nfsd
client: rpc.statd, lockd
/etc/exports
/var/lib/nfs/etab
/var/lib/nfs/xtab
HP
server: rpc.mountd, nfsd
client: rpc.statd, lockd
/etc/exports
/etc/xtab
AIX
server: rpc.mountd, nfsd
client: rpc.statd, rpc.lockd
/etc/exports
/etc/xtab
/var/lib/nfs/rmtab
/var/lib/nfs/rmtab
/etc/rmtab
/etc/xtab
dfshares
showmount -e localhost
showmount -e localhost
showmount -e localhost
showmount -e localhost
exportfs
showmount -e localhost
redhat-config-nfs (GUI)
unshare <path>
/etc/dfs/dfstab (edit and remove share)
/etc/init.d/portmap restart
/etc/init.d/nfs-kernel-server restart
shareall
/etc/init.d/portmap start
/etc/init.d/nfs-kernel-server start
/etc/rc.config.d/nfsconf (edit)
exportfs -au (unshare all)
exportfs -u /home/vallep
/etc/exports (edit and remove share)
/sbin/init.d/nfs.core start
/sbin/init.d/nfs.server start
/sbin/init.d/nfs.client start
mknfs
chnfs
exportfs -u <filesystem>
unshareall
startsrc -s nfsd
startsrc -s rpc.mountd
mknfsexp -d <directory>
mknfsmnt
## /etc/exports example
/export *(rw,fsid=0,insecure,no_root_squash,sync)
/etc/init.d/nfs.server start
/etc/init.d/nfs.client start
/etc/rc.config.d/nfsconf (edit)
/etc/exports (edit and add share)
exportfs -a
/etc/init.d/portmap stop
/etc/init.d/nfs-kernel-server stop
/sbin/init.d/nfs.client stop
/sbin/init.d/nfs.server stop
/sbin/init.d/nfs.core stop
rmnfs
stopsrc -s nfsd
stopsrc -s rpc.mountd
nfs status
/etc/init.d/nfs-kernel-server status
nfs reload
shareall
exportfs -a
exportfs -av
nfs performanace
nfsstat
nfsstat
nfsstat
nfsstat
nfsstat
n/a
cat /var/lib/nfs/etab
cat /var/lib/nfs/etab
n/a
nfso -a
nfso -o <option>=<value>
n/a
n/a
n/a
nfs Options
n/a
NTP
Solaris
Time daemons
Ubuntu/Debian
HP
ntpd
xntpd
ntpd
# Solaris 8
/etc/ntp.conf
/etc/ntp.server
/etc/ntp.client
/etc/default/ntp
/etc/ntp.conf
/etc/init.d/ntp [start|stop|restart]
/etc/sysconfig/ntpd
/etc/default/ntp
/etc/rc2.d/xntpd [start|stop]
ntp setup
Red Hat
AIX
xntpd
xntpd
/etc/ntp.conf
Time daemons
startsrc -s xntpd
stopsrc -s xntpd
lslpp -L all|grep xntpd
ntp setup
# Solaris 10
/etc/inet/ntp.server
/etc/inet/ntp.client
svcadm enable ntpd
/lib/svc/method/xntp
/etc/rc.config.d/netdaemons
/etc/rc.tcpip
ntpq -p
ntptrace
ntpq -p
ntptrace
ntpq -p
ntptrace
ntpq -p
ntpdate (set the date)
ntpq -p
ntptrace
ntpdate
Log Files
Solaris
Red Hat
Ubuntu/Debian
HP
AIX
messages
/var/adm/messages
/var/log/messages
/var/log/messages
/var/adm/syslog/syslog.log
/var/adm/ras
messages
syslog
/var/log/syslog
/var/log/syslog
/var/log/syslog
/var/adm/syslog/syslog.log
/var/adm/ras
syslog
/var/log/mail
/var/log/mail.*
/var/adm/syslog/mail.log
/usr/spool/mqueue/syslog
/var/log/cron
/var/log/cron.log
/var/adm/cron/log
/var/adm/cron/log
cron
mail
cron
/var/cron/log
/var/adm/ras
boot
/var/adm/messages
dmesg
/var/log/boot
dmesg
/var/log/boot
dmesg
/var/adm/syslog/syslog.log
dmesg
alog -o -t boot
alog -o -t console
alog -L (list all the logs available)
boot
logger
logger
logger
Error logging
Security
Solaris
Red Hat
Ubuntu/Debian
HP
AIX
pwck
pwck
pwck
pwck
pwdck -t ALL
usrck -t ALL
grpck
grpck
grpck
grpck
grpck
# No reboot required
/etc/securetty
# No reboot required
/etc/securetty
# No reboot required
/etc/securetty
# No reboot required
/etc/security/user
chsec -f /etc/security/user -s root
console login (allow/deny)
Note: you may need to create this
file if it does not exist
Misc
Solaris
eeprom
startup
init status
0
1
2
3
4
5
6
Ubuntu/Debian
grub (GUI)
setenv boot-device
Red Hat
grub (GUI)
lilo (text based)
shutdown
shutdown
shutdown
shutdown
-h (halt)
-r (reboot)
-f (fast reboot no fsck)
-F (force fsck)
shutdown -h (halt)
shutdown -r (reboot)
shutdown -P (power off)
touch /forcefsck
touch /reconfigure
halt
init
poweroff
reboot
shutdown
telinit
uadmin
halt
init
poweroff
reboot
shutdown
telinit
0
1
2
3
4
5
6
0
1
2
3
4
5
6
shutdown
single user
n/a
Multi-user
n/a
power off
reboot
# change default
vi /etc/inittab
AIX
bootlist -m normal hdisk0 hdisk1
startup
# autoboot sequnce
setboot -b [on|off]
reboot -- -r (reboot/reconfigure)
HP
setboot -p <primary path>
setboot -a <alternate path>
halt
single user
multiuser (no networking)
multiuser (networking)
unused
GUI
reboot
# change default
vi /etc/inittab
halt
init
poweroff
reboot
shutdown
telinit
0
1
2
3
4
5
6
halt
single user
multiuser (default)
same as 2
same as 2
same as 2
reboot
shutdown
init
reboot
shutdown
0
1
2
3
4
5
6
halt
single users
multiuser (networking)
multiuser (networking, NFS, and CDE GUI) (default)
multiuser (netwrking, NFS, and VUE GUI)
n/a
n/a
init
shutdown
reboot
telinit
halt
0 - reserved
1 - reserved
2 - multiuser mode with NFS
3 - user defined
4 - user defined
5 - user defined
6 - user defined
7-9 - user defined
# change default - change the initdefault line
vi /etc/inittab
init status
0
1
2
3
4
5
6
boot <option>
Startup options
# Options
-s single user
-a interactive
-x no device drivers (used in
clustering)
-r reconfigure devices
-m milestone
# single user
ISL> hpux -is
/etc/init.d
/etc/init.d
/etc/init.d
/etc/rc0.d - /etc/rc6.d
/etc/rc0.d - /etc/rc6.d
/etc/rc0.d - /etc/rc6.d
/sbin/init.d
/etc/rc.config.d (startup config files)
/sbin/rc0.d - /sbin/rc6.d
startup scripts
Startup options
/etc/rc.d
/etc/rc.d/init.d
/etc/rc.d/rc2.d - rc9.d
startup scripts
boot prompt
commands
boot
printenv
setenv
banner
devalias
show-devs
show-pci-devs-all
probe-scsi-all
probe-fcal-all
probe-pci
watch-net-all
reset-all
Phases:
bootadm
bootadm
bootadm
bootadm
Boot Environments
(BE)
beadm
beadm
beadm
beadm
beadm
F10 or F12
Boot sequence
Boot process
F10 or F12
1. BIOS
2. POST
3. Master Boot Record (MBR) - point to the
bootloader GRUB or LILO
4. GRUB (stage 1) - point to GRUB stage 1_5
5. GRUB (stage 1_5) - deals with specific
filesystem types look at /boot/grub/*1_5 files
6. GRUB (stage 2) reads /etc/grub.conf and
displays the grub menu, it specifies the kernel
and the initrd files
7. KERNEL - control given to the kernel
8. INIT - reads /etc/inittab and runs
/etc/rc.d/rc.sysinit script
Boot sequence
Phases:
1. BIOS
2. POST
3. Master Boot Record (MBR) - point to the
bootloader GRUB or LILO
4. GRUB (stage 1) - point to GRUB stage 1_5
5. GRUB (stage 1_5) - deals with specific
filesystem types look at /boot/grub/*1_5
files
6. GRUB (stage 2) reads /boot/grub/menu.lst
and displays the grub menu, it specifies the
kernel and the initrd files
7. KERNEL - control given to the kernel
8. INIT - runs the /etc/event.d/rc-default script
Phases:
Boot process
list-archive
update-archive
list-menu
set-menu <option>
create
rename
activate
list
destroy
who -r
runlevel
who -r
runlevel
who -r
who -r
who -r
cat /etc/inittab
cat /etc/inittab
/etc/event.d/rc-default
/etc/inittab
/etc/inittab
list locale
locale -a
locale -a
locale -a
locale -a
locale -a
list locale
n/a
n/a
n/a
set_parms [initial|hostname|ip_address|timezone]
install_assist
start xwindows
sys-unconfig
initialize system
start xwindows
initialize system
/etc/TIMEZONE
/etc/default/init
/etc/sysconfig/clock
/usr/share/zoneinfo/zone.tab
/etc/timezone
/usr/share/zoneinfo/zone.tab
/etc/TIMEZONE
/etc/environment
/etc/profile
Timezone