Monday, December 19, 2016

How to create and delete user on Lubuntu


Creating, deleting and show list of users on lubuntu is very easy to do, there are command line tool for these purpose, and that's what i'm going to show you in this article.

How to create new user on Lubuntu
To create new user on lubuntu you can use 'adduser' tool from the command line, simply run adduser followed by the username you want to create.
sudo adduser [username]
Example:
sudo adduser jason77
sudo adduser johnwatson
How to show list of users on Lubuntu
There are no dedicated command for showing list of user on lubuntu, but there is a trick that can be use to show list of user on lubuntu/ubuntu, like this:
awk -F'[/:]' '{if ($3 >= 1000 && $3 != 65534) print $1}' /etc/passwd

How to delete user on Lubuntu
To delete user on lubuntu, you can use the 'userdel' command, simply run userdel followed by the username of the user that you want to delete.
sudo userdel [username]
Example:
sudo userdel jonnycash
sudo userdel sarah
NOTE: you can add parameter -r if you want the home directory also deleted.

No comments:

Post a Comment