How to add a new user in Ubuntu Linux

So, you have installed a fresh copy of Ubuntu and you need to start setting things up.  What is the first priority? You need to create new user accounts.  To add a new account, you can use useradd.

sudo useradd -d [user’s home folder] -m [username]

The above command creates the user’s account and their home folder but you still need to create their password.  For that, you want to use passwd.

sudo passwd [username]

So, now that we have created the account, how do you delete it?  For removal of user accounts, there is deluser.

deluser [username]

Now, let us check out a real-world example.

Ubuntu Linux useradd and passwd commandsdeluser Ubuntu Linux CommandIt’s as easy as that.  Just remember that deluser won’t remove the user’s home folder.  You will need to do that yourself.

Leave a Reply

Your email address will not be published. Required fields are marked *