Monday, December 31, 2007
How to duplicate a drive--diskdup
# dd if =/dev/rdsk/(input file ex. c1t1d0s2) of= /dev/rdsk/(outputfile ex.c1t2d0s2) bs=64k
How to see if the account is locked in Nis
If you are running nis or nis+ and want to see if a user is locked out
do
# niscat passwd.org_dir | grep -i (user name)
do
# niscat passwd.org_dir | grep -i (user name)
how to bring up another xterm
# /usr/openwin/bin/xterm &
do a # which xterm to find your path, but most should be the above.
do a # which xterm to find your path, but most should be the above.
Saturday, December 29, 2007
some system checks
The first thing I do when I take over a new system , is write a check script.
You can check several things and tailor it to your system, but here are a few to get you started:
check for users and groups that are equal with root
# grep ':00*:' /etc/passwd
check for invalid passwords
# grep invalid /usr/adm/syslog
list the last 20 logins
# last | head -20
#/usr/platform/sun4u (uname -n)/sbin/prtdiag -v
will show you useful hardware information.
#df -k -F ufs
will show you only local disks , and show you the total space used space, and free space
#/usr/sbin/psrinfo -v
will show you the cpus adn their speed.
You can check several things and tailor it to your system, but here are a few to get you started:
check for users and groups that are equal with root
# grep ':00*:' /etc/passwd
check for invalid passwords
# grep invalid /usr/adm/syslog
list the last 20 logins
# last | head -20
#/usr/platform/sun4u (uname -n)/sbin/prtdiag -v
will show you useful hardware information.
#df -k -F ufs
will show you only local disks , and show you the total space used space, and free space
#/usr/sbin/psrinfo -v
will show you the cpus adn their speed.
global replace in vi
nice bit of information , although who uses vi any more ? gvim, nedit maybe.
# : / $ s /(search for this)/( replace with this) / g
# : / $ s /(search for this)/( replace with this) / g
Friday, December 28, 2007
zero out a file
most sysadmins know this , but I am not sure who my audience is going to be yet.
anyway in order to zero out a file ...wtmp for example
cat /dev/null > wtmp (filename)
anyway in order to zero out a file ...wtmp for example
cat /dev/null > wtmp (filename)