This tutorial focuses on how to create os user on Solaris 11 operating system with a home directory.
After installing a fresh operating system adding/creating new users is one of the most basic and primary tasks that you may have to do to start working on a new instance.
Table of Contents
Prerequisites
In order to create/add new users in Solaris 11, you need to be a sudo user or logged in as an administrator account such as root.
Step 1. Become an administrator
Become an administrator or login as a user having Administrative rights (User Security rights profile).
$ sudo su
OR
$ su -
Step 2. Create a user using useradd
$ sudo useradd -d dir -m username
-d to specify the location of the home directory of the user
-m to create a local home directory on the system for the user.
For example, run the below command to create a user “User1” with the home directory
$ sudo useradd -d localhost:/export/home/user1 -m user1
Step 3. Assign the user a password.
The account is locked or not activated until you assign the user a password. Assign the password to the user using the below command.
$ sudo passwd user1
New password: <Type user password>
Re-enter new password: <Retype password>