How To Add and Delete User on Ubuntu From Shell

RSS
FACEBOOK
FACEBOOK
PINTEREST
PINTEREST
LINKEDIN
INSTAGRAM

Linux users can be added with different ways. but one of the most used way is adding them throughout the shell because Linux admins loves shell usage. In this tutorial we will look how to add user into a Ubuntu, Kali, Mint, Debian box and provide or change required parameters. We will also look user deletion.

Root Privileges

In order to add or remove user from a Linux box we need root privileges. We can get root privileges with different ways. We can login to root account like below.

OR we can use sudo  command which operates given command with the current user but with root privileges.

Add User with adduser

We can use adduser  command in order to add user.  We will add user named poftut . This command will ask user detailes step by step. At the end of the process we will accept adding given user with Yes\no question.

Add User with adduser 

Add User with adduser  

Add User with useradd

useradd is the fastest way to add user. useradd will not look for any user detail. Just add user to the Linux box. But it will not configure any password for the given user so we should set recently added user password with passwd like below. In this test we will add user named test1 and change its password.

Add User with useradd

Add User with useradd

Delete User

We can easily delete existing user with userdel  command. In the following example we will delete user named test1 . We need root privileges again.

LEARN MORE  How To Disable or Lock Linux User Account?

RSS
FACEBOOK
FACEBOOK
PINTEREST
PINTEREST
LINKEDIN
INSTAGRAM

You may also like...

Leave a Reply

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

Open

Enjoy this blog? Please spread the word :)