User in Linux System

                                                              User in Linux System

  There are three types of user in linux
  1) General User
  2) Administrative User
  3) System program User 

  # Maximum possible general user in RHEL- 7 is 1000--- 60000
  # System program user --- 1 – 999   
  #  Administrative (root)  user ID --- 0

How to add user in the system
Step- 1: First Create user in the system
adduser <user_name> --- To add useroruseradd <username> --- To add user

Step-2:  Then set password in the system
passwd <user_name> --- To assign a password of the user.

How delete user from the system
#userdel –r <user_name> --- Delete this user from the system

How delete user from the system
#passwd –d <user_name> --- Delete the password of the user.

Set time limit for the user
#chage -E  YYYY/MM/DD <user_name> --- Expire the user at YYYY/MM/DD
#usermod -e YYYY/MM/DD <user_name> --- Expire the user at YYYY/MM/DD
#chage -E -1 <user_name> --- This user will never expire.

Change User ID
#usermod -u <new_ID> <user_name> --- Change the user ID of this user.

Change User Comment
#usermod -c <comment> <user_name> --- Change the comment for this user.

Change User Shell
#usermod -s /bin/ksh <user_name> --- Change the shell into /bin/ksh for this user

Lock and Unlock password for the User

#passwd -l  <user_name> --- Lock the password for this user
#passwd -u <user_name> --- Unlock the password for that user

Change The host name of the system
#vi /etc/hostname --- Then write the new host name in this file.

Change the host name by command

Show the User Database
#cat /etc/passwd --- Show all user database of the machine.


Post a Comment