Linux/Unix User Administration : adduser, usermod, userdel
Creating a User
In Linux, every user is assigned an individual account which contains all the files, information, and data of the user. You can create multiple users in a Linux operating system. The steps to creating a user are:
Using Terminal
Step 1) Use command sudo adduser
Step 2) Enter password for the new account and confirm
Step 3) Enter details of the new user and press Y
New account is created.
Deleting, disabling account
Terminal
For disabling an account using Terminal, remove the password set on the account.
sudo passwd -l netaji
To delete an account, use the command -
sudo userdel -r netaji
Adding users to the usergroups
You can view the existing groups on your Linux operating system by entering the following command:
groupmod
Now to add a user to a group, use the following syntax:
sudo usermod -a -G home netaji
The system would ask for authentication and then it would add the user to the group.
You can check whether the user is in a group by this command.
And it would show it as
Removing a user from Usergroup
Use the following syntax for removing a user.
sudo deluser netaji home
No comments