UNIX LAB EXPERIMENT NO :8 Managing User Accounts

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 
Unix/Linux Administration - adduser, usermod , userdel, finger
Step 2) Enter password for the new account and confirm 
Unix/Linux Administration - adduser, usermod , userdel, finger
Step 3) Enter details of the new user and press Y 
Unix/Linux Administration - adduser, usermod , userdel, finger
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
Unix/Linux Administration - adduser, usermod , userdel, finger
To delete an account, use the command - 
sudo userdel -r netaji
Unix/Linux Administration - adduser, usermod , userdel, finger

Adding users to the usergroups

You can view the existing groups on your Linux operating system by entering the following command: 
groupmod
Unix/Linux Administration - adduser, usermod , userdel, finger
Now to add a user to a group, use the following syntax: 
sudo usermod -a -G home netaji
Unix/Linux Administration - adduser, usermod , userdel, finger
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. 
Unix/Linux Administration - adduser, usermod , userdel, finger
And it would show it as 
Unix/Linux Administration - adduser, usermod , userdel, finger
Removing a user from Usergroup 
Use the following syntax for removing a user. 
sudo deluser netaji home
Unix/Linux Administration - adduser, usermod , userdel, finger


No comments

File Uploading in PHP

  File Uploading in PHP PHP allow you to upload any type of a file i.e. image, binary or text files.etc..,PHP has one in built global variab...