Aug 23, 2016

Create & delete users account on Ubuntu 16.04 LTS

Today topic in this article around the user management on Ubuntu such as add (create new user) & remove (delete) user both using Ubuntu terminal command line or graphical mode for discussion. The first option, How to add (Create) a User on Ubuntu and remove user on Ubuntu using Ubuntu command line.
Ubuntu add remove user command line

1. Ubuntu command line to add and remove user:

A. Add (Create) a User on Ubuntu
Here are a few ideas that show how to create a new user from a terminal in Ubuntu, for example i want to add new user "mynewuser":
sudo adduser mynewuser
It will ask you for couple of questions like (password, fullname etc), you can input the data or skip by just hitting the enter key. Now we have a new user named mynewuser and by default above command will create users mynewuser home directory as /home/. next step how do we grant sudo privileges to this new user mynewuser?.

B. Add user to sudo group on Ubuntu
This will grant a newly created user (mynewuser) sudo privileges (as sudoer) in Ubuntu using these commands:
sudo usermod -a -G sudo mynewuser
sudo visudo
then take a look at the following code:
# User privilege specification
Add the following code right after (below) that line code to make grant root privileges to the user mynewuser:
mynewuser ALL=(ALL:ALL) ALL
This will grant privileges mynewuser. Now we have a user setup by the name of mynewuser which can use sudo to run commands as root.

C. Remove user
This Ubuntu command to delete user, in this case we want to delete existing user mynewuser
sudo userdel mynewuser
above command will remove user mynewuser, to remove all of the files for the user mynewuser, use -r option:
sudo userdel -r mynewuser

2. Graphical mode to add and remove user on Ubuntu:

In this graphical mode mode to add and remove user on Ubuntu i used Ubuntu Gnome 16.04 to demonstrate. Go to "user setting" this could be found under Applications --> System Tools --> Settings --> Users or (in Gnome) click menu from your top right corner, under your user name click Account Settings

A. Adding User
Under "Users" menu, Simply click "unlock" and enter your password to make any User Management modification as root or Administrator.
- To add a new user click plus "+" sign. Next enter new user detail.
- Set Account type could be Standard or Administrator account for new added user.
- Then Fill Full Name, User Name and Password for new user.
by defaul Ubuntu will create "home directory" for the new user.

D. Delete User
To delete existing users, Simply select existing users you desire to delete then click minus "-" sign.

These how to create or add new user, remove or delete user add user to sudoers or sudo on Ubuntu using Ubuntu terminal command line. Manage user using Graphical mode (GUI) on Ubuntu Gnome 16.04.


We are only a handful of Linux users who want to share

Enter your email address:


Useful Source

Getting started with Ubuntu Linux from Infinite Skills.
Learning Ubuntu Linux. A Training Video From Infinite Skills

Learning Linux MInt with GUI and command line tips.
A step-by-step introduction to one of the most popular Linux distributions available with GUI and command line tips.

Recent post