Add or delete a user from command line on Solaris 


June 17, 2010 15:23:02    Last update: June 17, 2010 15:35:40
Use useradd to add a user (the switches are not required, but it's a good idea to give them. For example, without -m you'd create a user without a home directory):
# -d switch specifies user home directory
# -m creates the home directory
# -s gives path to the default shell
# -c a comment
useradd -d /export/home/demo -m -s /bin/ksh -c "Demo User" demo

You also need to use the passwd command to set a new password before the user can log in.

To delete a user, use the userdel command:
userdel demo
Share |
| Comment  | Tags