Unix/Linux Administration - adduser, usermod , userdel, finger

As Linux is a multi-user operating system, there is a high need of an administrator, who can manage user accounts, their rights and the overall system security.

You should know the basics of Linux admin so that you can handle the user accounts and usergroups.

Please be patient . Video will load in some time. If you still face issue viewing video click here

 

Creating a User

In Linux , every user is assigned an individual account which contain 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

1. Use command sudo adduser

2. Enter password for the new account and confirm

3. Enter details of the new user and press Y

New account is created.

 

Using GUI

1. Go to the system settings look for an icon which says 'User Accounts'.

2.  Click on the unlock icon and enter password when prompted, then click the plus sign.

3. A new window would pops up, asking you for adding information to the new user account.The account type offers two choices - standard and administration(Ubuntu Limitation). If you want the new user to have administrative access to the computer, select Administrator as the account type. Administrators can do things like add and delete users, install software and drivers, and change the date and time. Otherwise, choose standard.Fill in the full name, username and click on create.

 

4. The new account would show , but would be disabled by default.

To activate it, click the password option and add a new password. Click change to enable the account.

 

Deleting, disabling account

Terminal

For disabling an account using Terminal , remove the password set on the account.

sudo passwd -l 'username'

To delete an account , use the command -

sudo userdel -r 'username'

GUI

1.   Highlight the user account and click the minus sign to delete.

2. For disabling click on the area where the password is stored and you would get the following prompt. Select disable this account and click on change.

 

Adding users to the usergroups

You can view the existing groups on your Linux operating system by entering the following command:

groupmod "Press Tab key twice"

Now to add a user to a group, use the following syntax:

sudo usermod -a -G GROUPNAME USERNAME

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 USER GROUPNAME

The GUI method

If you do not want to run the  commands  in terminal to manage users and groups, then you can install a GUI add-on .

sudo apt-get install gnome-system-tools

Once done, type

users-admin

Check user settings and a tab Manage Groups will appear-

Finger

This command is used to procure information of the users on a Linux machine. You can use it on both local & remote machines 

The syntax 'finger' gives data on all the logged users on the remote and local machine.

The syntax 'finger username' specifies the information of the user.

Summary:

  • You can use both GUI or Terminal for User Adminsitation
  • You can create, disable and remove user accounts .
  • You can add/delete a user to a usergroup.

Command

Description

sudo adduser

Adds a user

sudo passwd -l 'username'

 

Disable a user

sudo userdel -r 'username'

 

Delete a user

sudo usermod -a -G GROUPNAME USERNAME

 

Add user a to a usergroup

sudo deluser USER GROUPNAME

 

Remove user from a user group

finger

Gives information on all logged in user

finger username

Gives information of a particular user

 

comments powered by Disqus