Thursday, April 16, 2020

Adding / Deleteing users in Linux

In linux users can be added / deleted from GUI (graphical user interface). These options are in settings > Users and Groups. It is very easy and type of user can also be selected from options like Administrator, Desktop user, Custom user etc.

Sometime we need to add / delete user from command line terminal. The procedure is as below:

Command to add user "xyzabc"

sudo useradd xyzabc

Command to delete user "xyzabc"

sudo userdel xyzabc

If home directory (all files created by that user will be deleted) for this user has also to be deleted along with user deletion

sudo userdel -r xyzabc

No comments: