Skip to content

April 25, 2016

Add an user to Ubuntu Linux from command line

by linux

If you want to add an user to your Ubuntu Linux machine here is what you need to do. Login as root (or use sudo) and then run (as root):

useradd -d /home/john -m john
passwd john
usermod -aG sudo john

If you are not root run:

sudo useradd -d /home/john -m john
sudo passwd john
sudo usermod -aG sudo john

In our example john is the user we want to add. Last command (usermod) will allow our user to run root commands via sudo.

Read more from Linux Quick Tips

Leave a Reply


Note: HTML is allowed. Your email address will never be published.

Subscribe to comments