Solaris adding new user accounts
useradd command use to add a new user to the /etc/passwd and /etc/shadow and /etc/user_attr file. Before adding a new user you need to setup defaults by specifying useradd -D with the combination of options which sets the default values for the respective fields. So that Subsequent useradd commands without the –D option use these arguments. It will save your time.
# useradd -D -b /export/home -g pusers
Output:
group=pusers,100 project=default,3 basedir=/export/home skel=/etc/skel shell=/bin/sh inactive=0 expire= auths= profiles= roles= limitpriv= defaultpriv= lock_after_retries=
Where,
- -b : Base home directory
- -g : Primary group
Now add a user rockyjr:
# useradd -m rockyjr
# passwd -f rockyjr
Where,
- -m : creates a home directory for rockyjr user.
- -f : The -f option expires the password at first login, forcing the rockyjr to change it
Common option for useradd command
- -u 1030 : Use UID 101
- -g pusers : Specify user's primary login group
- -G ftp,admin,www : Specify user's secondary group membership
- -d /nas/home/user : Specify user's home directory
- -s /usr/bin/bash : Specify user's login shell
Want to stay up to date with the latest Linux tips, news and announcements? Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
You may also be interested in other helpful articles:
- User management: command line vs GUI tools
- Solaris managing users - Gathering more information
- Search for all account without password and lock them
- Solaris > Add / Install new software packages
- FreeBSD: Finding passwordless (no password) account and lock all accounts
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!


Recent Comments
Today ~ 5 Comments
Today ~ 12 Comments
Today ~ 2 Comments
Today ~ 18 Comments
Today ~ 5 Comments