User & Group Management in Solaris
User & Group Management in Solaris
User Management:
1. Hard User
2. Soft User
1. Hard User Creation: You must be root (superuser) to add a user. An easy way to
remember the syntax of the useradd command in Solaris is to run it with no
options. Follow the resulting usage information including the parts that you
require. Important options are:
-d home-directory-path
-m
Make home directory and copy the default skeleton files (these files are located
in /etc/skel directory).
-u uid
The uid (userid) is a number from 0 to 65535 which identifies the user on the
system. uid 0 is reserved for root. If you dont specify one, the next available uid
will be used automatically.
-c User Name
Comment field which usually contains the name of the user. Make sure you
enclose the name in quotes if it contains a space.
-s /path/to/shell
The shell to use. If you dont specify this, it will default to /bin/sh. Make sure you
specify the fully qualified path.
So, putting it together, a typical addition of a user named tushar would be:
#userdel -r tushar
2. Soft User Creation: You must be root (superuser) to add a user. However, you
will get limited access to system by using Soft User. Simply use the below
command;
If you want to change any authorization of any User use the 'usermod' command;
Configuration files:
Its a smart idea to run pwck (passwd check) whenever you make a change to
the /etc/passwd file (as when adding or changing a user). This program will
identify any problems with the passwd file. If it doesnt tell you anything, then
you are in good shape.
# vi /etc/passwd
# pwck
Group Management:
# groupadd INVAS
# groupdel INVAS
If you manually modified the /etc/group file then you can check any group file
inconsistencies with grpck command:
# vi /etc/group
# grpck
Configuration file:
/etc/group