User management commands in linux
How to add user in linux?
In Linux, a ‘useradd‘ command is a low-level utility that is used for adding/creating user accounts in Linux and other Unix-like operating systems.
Let the new user to be add is Testuser ,then the command will be :
useradd Testuser
Creating password for a user :
passwd Testuser
Enter the new password for the user.
We can see this user details in /etc/passwd file.
cat /etc/passwd
When we run ‘useradd‘ command in Linux terminal, it performs following major things:
- It edits /etc/passwd, /etc/shadow, /etc/group and /etc/gshadow files for the newly created User account.
- Creates and populate a home directory for the new user.
- Sets permissions and ownership to home directory.
useradd –d [directory] Testuser
Author :
Ajith Michael
System Engineer
Bayasys Infotech (P) Ltd., Kochi.
Image source : www.google.com
System Engineer
Bayasys Infotech (P) Ltd., Kochi.
Image source : www.google.com
0 comments