HP-UX System Administrator's Guide: Configuration Management
1. Add the user to the/etc/passwd file.
As root, use the/usr/sbin/vipw command to edit /etc/passwd. See vipw(1M),
passwd(4), and passwd(1).
For example, you might want to add this line for user tom:
tom:*:102:20:Tom,,,:/home/tom:/usr/bin/sh
This creates the entry and disables logins (the * in the password field). The home
directory is /home/tom and the login shell is /usr/bin/sh. The user ID is 102
and the primary group ID is 20, conventionally, users.
2. Use the passwd command to set an initial password for the account. For example:
# passwd tom
Changing password for tom
New password: password
Re-enter new password: password
Passwd successfully changed
3. Use the passwd command to force a password change at the next login. For
example:
# passwd -f tom
4. Create a home directory. For example:
# /usr/bin/mkdir /home/tom
Change the ownership of the directory to the user’s name. For example:
# /usr/bin/chown tom:users /home/tom
5. Ensure that the user has the appropriate shell start-up files to execute when logging
in.
You can create standard start-up files (templates) that can be copied to users’
directories. The directory most often used for this purpose is/etc/skel. See
“Skeleton Directory” (page 54).
For example:
# cp /etc/skel/.profile /users/tom/.profile
6. Change the ownership of the start-up file to the new user’s account and group.
For example:
# /usr/bin/chown tom:users .profile
62 Configuring Users and Groups