Categories: DebianLinuxShell

How to manage user accounts in Debian 10

System administrators create user accounts when they have finished setting up a new machine. Removing and assigning root privileges to existing users is also part of their job.

In this article, I am going to discuss the topic of managing user accounts in Debian version 10. This includes creating a new user, changing the password, deleting a user and assigning root privileges to an existing user.

Therefore, let’s continue without wasting any further time.

How to create a new user

To create a new user, you need to open up a terminal and execute the command with root privileges having the following syntax.

adduser {username}

For instance, if you want to add user “tony” the command will have the following shape.

adduser tony

As soon as you execute the adduser command you will be prompted to add a password and other information like full name, room number, work, and home phone. You will then be prompted to press Y if you have entered the correct information.

Passwords are not visible on the terminal.

 

How to change the password of an existing user

If you are changing the password of an existing user, you need to have root privileges. The command has the following syntax,

passwd {username}

Suppose you want to change the password of a user “tony”, the command should have the following shape.

passwd tony

You will be prompted to enter the new password to proceed.

How to change own password

If a user wants to change his/her own password, he/she needs to execute the following command on terminal.

passwd

As soon as it is executed, you will be prompted to enter the new password.

How to delete an existing user

Again, you need to have root privileges to delete an existing user. The syntax of the complete command is as follows,

deluser {username}

Suppose you want to delete a user tony, you need to execute the following command.

deluser tony

How to assign root privileges to an existing user

An ordinary user cannot perform an administrative task. If you want to do this, you need to add an existing user to the “sudo” group. Users in sudo group have all the rights to perform an administrative task.

As a root user, execute the following command.

usermod -aG sudo {username}

Suppose you want to add the user tony to sudo group, you will have to execute the following command on terminal.

usermod -aG sudo tony

So we have completed our discussion on basic user management. These were some of the basic and handy operations that can be used for a day to day task.

Karim Buzdar

About the Author: Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. You can reach Karim on LinkedIn

Recent Posts

How to Install Magento 2 on AlmaLinux

Magento is a free and open-source e-commerce platform written in PHP. It is simple, easy…

1 year ago

How to Install ISPConfig Hosting Control Panel with Apache Web Server on Ubuntu 24.04

ISPConfig is an open-source control panel that allows users to manage multiple servers from a…

1 year ago

How to Test your Email Server (SMTP) Using the Telnet Command

As a Linux administrator, you may find it necessary to troubleshoot or test your Simple…

1 year ago

Managing Network Interfaces and Settings on Ubuntu 24.04 with nmcli

Ubuntu 24.04, like many modern Linux distributions, relies on the NetworkManager for managing network connections.…

2 years ago

Using Restic Backup on Ubuntu 24.04

Restic is a modern, open-source backup program designed for efficiency, security, and simplicity. It enables…

2 years ago

Installing phpMyAdmin on Rocky Linux 9 and Securing it with Let’s Encrypt SSL

phpMyAdmin is a popular free tool written in PHP intended to administer MySQL and MariaDB…

2 years ago