Wednesday, January 25, 2012

HP-UX Notes & Hints

Some useful Tips and Tricks in HP-UX

Finding network related details on a HP-UX server like ip address, netmask, etc…

How to Find the IP Address of My Server
  • nslookup
  • getip
  • ifconfig
  • you simple can look in the hostfile can "grep -i /etc/hosts"
  • /usr/sbin/ifconfig lan0 or lan1
  • /usr/bin/netstat -in |grep lan0 or lan1
  • lanscan 
  • cat /etc/rc.config.d/netconf

 
While showing network related details, normally netmask is displayed in  HEX and not DEC so let us refer to the data given below:


Subnet Mask Information













































Unlocking an account in HP-UX

Loginto the box as "root" user, then,

Check the status of account lock - as follows:

/usr/lbin/getprpw $user                -             to show the status of that user

Example

/ (hostname) # /usr/lbin/getprpw user1
uid=9101, bootpw=NO, audid=40, audflg=1, mintm=0, maxpwln=-1, exptm=0, lftm=0, spwchg=Wed Jan  7 15:14:46 2009, upwchg=Wed May 21 13:17:31 2008, acctexp=-1, llog=0, expwarn=0, usrpick=DFT, syspnpw=DFT, rstrpw=DFT, nullpw=DFT, admnum=-1, syschpw=DFT, sysltpw=DFT, timeod=-1, slogint=Tue Dec 13 05:04:18 2011, ulogint=Wed Nov 23 04:33:09 2011, sloginy=tty, culogin=-1, uloginy=, umaxlntr=-1, alock=NO, lockout=0000000

In the above  lines “lockout=0000000” shows the account is not locked. If there were a “1” ie. “lockout=0000001” instead of “0” then the account is locked.

/usr/lbin/modprpw –k $user      -              to unlock that user, if its locked

For more details refer manual pages for these two commands… with ‘man’

No comments: