USER AND GROUP MANAGEMENT
In this user management we can do following commands
- Create user
- List user
- Change user
- Remove user
- Set password for users
1. Create user
Using mkuser command
we can create a new user, suppose you want to create new user Kumar,
#mkuser kumar
After this command execution, kumar home directory created in
/home/kumar/
Kumar user configuration details stored in /etc/passwd
Now you can login the terminal using kumar user name without password.
Then you have to set the password for kumar user using command passwd
#passwd kumar
Enter new password: ******
Confirm password again: ******
After this command
execution password assigned to kumar user and kumar user password configuration
entry added in /etc/security/passwd.
NOTE: user configuration data stored in /usr/lib/security/mkuser.sys
Whenever login the
server that last login information’s stored in /etc/security/lastlog file.
2. List user
Using lsuser command
we can list the user properties, i.e. user home directory, shell, group, etc.
except password
#lsuser all (It will
list all the user information’s except password)
#lsuser kumar (It
will list only kumar user information’s except password)
3. Change user
Using chuser command
we can change user properties, i.e. user home directory, shell group, etc.
except password
Whenever you create a
user that user home directory by default created in /home file system, and
default group is staff.
Suppose we want to
change the kumar user group to system, then your command will be.
#lsuser kumar (it
will show kumar user properties including group information)
#chuser pgrp=system
kumar (now kumar user is assigned to primary group system and secondary group
is assigned to staff)
#lsuser kumar (It
will list modified kumar properties, group is system, staff)
Like this we can change all the user properties
4. Remove user
Using rmuser command
we can remove the user, suppose you want to remove kumar user
#rmuser kumar
After this command execution, kumar user will be deleted.
5. Set password for
Users
Using passwd command we can set password for user and root
#passwd kumar
Enter new password: *****
Confirm password: *****
We are changing
password for kumar user from root path, it will not ask existing password for
kumar user, because root is administrator login.
Suppose you are
changing password from kumar login, it will ask existing password, because user
should know the existing password before changing the new password. Otherwise any user can change the kumar user
password. This not recommended security.
$pwd
/home/kumar
$passwd kumar
Enter the old password: *****
Enter the new password: *****
Confirm password again: *****
NOTE: Suppose you are forgotten root password that time what you will
do.
Answer: boot the
server with BOS Cd and go to maintenance mode, access the rootvg, then you can
change the password for root.
Like this we can change the password for users.
GROUP MANAGEMENT
In this group management we can do following things,
- Create group
- List group
- Change group
- Remove group
1. Create group
Using mkgroup command
we can create the group, suppose you want to create oracle group.
#mkgroup oracle
After this command
execution new oracle group has created and this group is added in /etc/groups
file.
2. List group
Using lsgroup command
we can list group information’s. Suppose we want to list oracle group
information
#lsgroup oracle (it
will display the oracle group information’s, gname, gid, members)
#lsgroup all (It will
list all group details)
3. Change group
Using chgroup command we can change the group information’s.
#chgroup options
oracle
4. Remove group
Using rmgroup command
we can remove a group, suppose we want to remove oracle group.
#rmgroup oracle
After this command
execution oracle group removed and group configuration information removed from
/etc/groups files.