[email protected]Support 24/7 · Billing 09:00 – 00:00LinkedInXFacebook
NexonHost
Netherlands Dedicated ServersAmsterdam · Equinix AM6Germany Dedicated ServersFrankfurt · Equinix FR4Romania Dedicated ServersBucharest · VoxilityAustria Dedicated ServersVienna · Interxion VIEBulgaria Dedicated ServersSofia · TelepointFrance Dedicated ServersParis · Interxion PAR — Marseille · Digital Realty MRS3Ireland Dedicated ServersDublin · Equinix DB2Italy Dedicated ServersMilan · Irideos AvalonPoland Dedicated ServersWarsawSpain Dedicated ServersMadrid · Equinix MD2United States Dedicated ServersAshburn · Equinix DC
All articles
Getting startedMay 30, 2023

How to Add and Delete Users on Debian 9.

How To Add And Delete Users On Debian 9.

This tutorial explains how to add and remove users on Debian 9.

Debian, as well as all other Linux distributions, is a multi-user operating system. Each user can have different permission levels and specific settings for various command-line and GUI applications.

Knowing how to add and remove users is one of the basic skills a Linux user should know.

 

Prerequisites

You’ll need to be logged in as root or user with sudo access to be able to add and delete users on your Debian system.

 

How To Add User in Debian

In Debian, there are two command-line tools that you can use to create a new user account: useradd and adduser.

useradd is a low-level utility for adding users while the adduser a friendly interactive frontend to useradd written in Perl.

To create a new user account named username using the adduser command you would run:

sudo adduser username
Adding user `username' ...
Adding new group `username' (1001) ...
Adding new user `username' (1001) with group `username' ...
Creating home directory `/home/username' ...
Copying files from `/etc/skel' ...

You will be asked a series of questions. The password is required, and all other fields are optional.

Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
Changing the user information for username
Enter the new value, or press ENTER for the default
	Full Name []: 
	Room Number []: 
	Work Phone []: 
	Home Phone []: 
	Other []: 
Is the information correct? [Y/n] 

On the last prompt you’ll need to confirm that the information is correct by entering Y.

The command will create the new user’s home directory, and copy files from /etc/skel directory to the user’s home directory. Within the home directory, the user can write, edit, and delete files and directories.

By default on Debian, members of the group sudo are granted with sudo access.

If you want the newly created user to have administrative rights, add the user to the sudo group :

sudo usermod -aG sudo username

 

How To Delete a User in Debian

If the user account is no longer needed, you can delete it either with userdel or deluser. On Debian, you should usually use the deluser command as it is more friendly than the low-level userdel.

To delete the user, without removing the user files, run:

sudo deluser username

If you want to delete the user and its home directory and mail spool, use the --remove-home flag:

sudo deluser --remove-home username

 

Conclusion

In this tutorial, you learned how to add and remove users in Debian. The same commands apply for any Debian-based distribution.

Keep reading
How to install Xen hypervisor on Ubuntu 20.4
August 28, 2023

How to install Xen hypervisor on Ubuntu 20.4

How To Install Xen Hypervisor On Ubuntu 20.4 Here is the basic architecture: Xen – this is the software that boots up when you boot the server. domain-0 – this controls Xen and all the virtual machines added to the machine. domain-u – these are the virtual machines. paravirtual drivers –…

Read article
How to install Xen hypervizor on CentOs 7.
August 28, 2023

How to install Xen hypervizor on CentOs 7.

How To Install Xen Hypervizor On CentOs 7. Install CentOs 7 on your vm/vps/server. Partition the Xen hypervisor box: The disk can be partitioned any way you like, with one exception: you must create a separate partition with LVM. This will be used to deploy block devices as hard disks for virtual…

Read article
How to understand  Xen virtualization.
August 28, 2023

How to understand Xen virtualization.

How To Understand Xen Virtualization. Xen is an open-source virtualization technology that allows you to create and manage virtual machines (VMs) on a physical host system. It was developed at the University of Cambridge and is widely used in data centers and cloud environments. Xen virtualization…

Read article
Get in Touch

Together, Let’s Build a Faster, Safer Internet.

Build scalable infrastructure with NexonHost — high-performance dedicated servers, VPS hosting, cloud hosting, and DDoS protection across Europe.

Get Started →Contact Us
[email protected]Support 24/7 · Billing 09:00 – 00:00