First taste of HP-UX system administration

Posted on in Categories News last updated August 26, 2005

Recently I had chance to play with HP-UX UNIX on HP hardware. To my surprise most of Linux command do work with HP-UX with some minor changes in syntax :). It has nifty tool called SAM (The System Administration Manager) is a GUI user interface for performing most routing administrative tasks without using command line admin utility. The SAM works under CDE (common desktop environment).

I’m gone administrate at least 3-4 HP-UX box for next couple of weeks before they are going to get new UNIX admin for growing data center. So I will have chance to get my hands on dirty with HP-UX. That means you will see couple of HP-UX related entries in this blog. As soon as these HP-UX box comes in our IDC, I was asked to add user accounts. To be frank I was bit frightened because I never worked on HP-UX. Here is what so far I have learned:

HP-UX USER ADMIN COMMANDS:
These are almost same as Linux user admin commands, here is quick summery:

Important files:

  • /etc/passwd – User account database file
  • /etc/group – Group database file
  • /etc/profile – System login script
  • ~/.profile – Users own login script
  • ~/.shrc OR ~/.kshrc OR ~/.cshrc – Users own shell startup script (these are executed always whenever users login)
  • /etc/skel/ – Default directory from which all files copied when new users created.

a) useradd – Create a new users

# useradd -m rocky

b) usermod – Modify user account

# usermod -G dbusers rocky

Modify secondary group membership of rocky
c) userdel – Remove user account, -r removes user foo home directory.

# userdel foo
# userdel -r foo

e)groupadd – Create a group

# groupadd dbusers

f) groupmod – Modify a group
Chantge the name of ftpusers to wwwproject

# groupmod -n wwwproject ftpusers

g) groupdel – Delete/remove the account group

# groupdel  wwwproject 

h) grpck – Check for syntax error in /etc/group file

i) pwck – Check for sysntax error in /etc/passwd file

j) passwd – Setup password and manage password restriction
Setup foo’s password

# passwd foo

Remove/delete password/null password

# passwd -d foo

Force to change password at next login

# passwd -f foo

Disable/Lock user account

# passwd -l foo

Unlock HP-UX user account by editing (using vi text editor) /etc/passwd file:

# vi /etc/passwd

Man pages are real help. These system are in our internal network; in coming days at least 2 system will go online for testing purpose so I may need to configure routing and other stuff (right now they are getting IP from our DHCP server).

So far so good. To be frank, I like the HP-UX , no problem to administrate it. May be in coming days I will see more surprises (ill keep my finger crossed).

Between I have noticed Sun had redesigned sun.com website. New sites looks quite cool and tries to improve corporate image.

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin and a trainer for the Linux operating system/Unix shell scripting. He has worked with global clients and in various industries, including IT, education, defense and space research, and the nonprofit sector. Follow him on Twitter, Facebook, Google+.

13 comment

  1. Hee HP-UX is always fun. You *reminder* me the old days when I use to work with MC ServiceGuard with HP-UX 🙂 it was fun and boy HP-UX rocks. I hope you will enjoy it too… ALL THE BEST.

    Regards,
    Bill

  2. You can’t use vi to re-enable an account if you are using password aging or “trusted” password databases, and the user is aged out or locked out due to too many login failures.

    To enable a disabled HP-UX account via the command line, run one of these commands:

    /usr/lbin/modprpw -l -k username

    /usr/lbin/modprpw -l -x username

    The first one re-enables the account; the second one re-enables the account and generates a new random password; -l means you are using a “local” files database. You’d need different options if you are using NIS. Run modprpw with no arguments to see the possibilities (not what they mean, but at least you know what they are).

    I haven’t found documentation for modprpw; I just found these command in my “samlog” after using sam to re-enable accounts.

    http://docs.hp.com/en/B3921-90010/modprpw.1M.html

  3. its nice that we all share our knowlage
    i want to know 2 things
    1> how we copy data from one physical volume to other physical volume in same volume group.
    2> what is logical partition

  4. hey man,yeah the hp-ux is real simple i mean not as hard as i imagined when i came into unix or linux world.The command is similar but syntax is different. I still like getting to get used with it,since i am now jumping from unix sysadmin to now hp-ux sysadmin and ibm-aix.Hope i can come frequent here to check if any issue arised later or maybe in touch with you personally if i could not find it HP site about it.

Leave a Comment