How To Add and Delete User on Ubuntu From Shell

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/add-delete-user-ubuntu-shell/
PINTEREST
PINTEREST
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  Linux usermod Command Tutorial With Examples

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/add-delete-user-ubuntu-shell/
PINTEREST
PINTEREST
INSTAGRAM

You may also like...

Leave a Reply

Your email address will not be published.

Enjoy this blog? Please spread the word :)