- To add new user
#adduser <username>#useradd <username>
EX.
#adduser text#useradd text1
- To set password for user
#passwd <username>
EX.
#passwd text#passwd text1
-
Follow files are able to save user's information.
/etc/password/etc/group/etc/shadow/etc/gshadow
Note : "default home directory will be /home/<username>"
-
vim /etc/shadow
User name Encrypted Password Max Age Max Password age
Note : "This file stores the user's password and a/c & password ageing information"
-
vim /etc/passwd
- User name
- Link to shadow file for chacking password
- User id
- Group ID
- User description
- User home Directory
- User interface
Note : "This file stors the user's id no, group id no, home directory and shell prompt information."
-
vim /etc/group
cdrom : x : 24 : vivek, student13, rajgroup_name : Password : Group ID(GID) : Group list.
Note : "This file stores only group releteated information"
-
To set defaults password and a/c policy for user & group
#vim /etc/login.defs
-
To change defaults home directory, shell, Skel for user
#vim /etc/default/useradd
-
Hidden file for create home directory
#vim /etc/skel
-
To change user's home director
#useradd -d <path> <username>
EX.
#useradd -d /text text
-
Do not create home directory
#useradd -m <username>
EX.
#useradd -m text
-
To delete user and user's releted all information
#userdel -r <user name>
EX.
#userdel -r text
-
To remove password for user
#passwd -d <username>
EX.
#passwd -d text
-
To chech password status
#passwd -s <username>
EX.
#passwd -s text
-
To lock user's a/c
#usermod -L <username>
EX.
#usermod -L text
-
To unlock user's a/c
#usermod -U <username>
EX.
#usermod -U text
-
To change user a/c and password age
#chage <username>
EX.
#chage text
-
To check age list
#chage -l <username>
EX.
#chage -l text
-
to change user's shell
#chsh -s <shell path> <username>
EX.
#chsh -s /bin/bash text#chsh -s /sbin/nologin text