Managing users on Debian 10

When you initially set up your server, you will only have root access. For security purposes logging directly into your server as root should be disabled. Since root login will be disabled, in this article we will go over how to disable root access and creating new users so that you may access your server. 

 

Prerequisites:

  •  Debian server
  •  Root access

 

First, you need to disable root login access. You want to disable this access to prevent any malicious actors from brute-forcing the password and thus gaining root access to your server. With root access, hackers will be able to do all kinds of nasty things that may run up the CPU usage, which will cost you a lot of money. Use the text editor of your choice to edit the file /etc/ssh/sshd_config. Update the following to match this line. 

PermitRootLogin no

 

Next, let’s add a new user. 

sudo adduser username

 

To delete a user the following line.

sudo deluser username

 

When adding a new user you will need to grant root privileges to the user, which will allow them to run commands with root permissions. 

sudo usermod -aG wheel username

 

To add or delete users to a group use the following line. 

sudo groupadd groupname

sudo groupdel groupname

 

We have gone over how to disable root login access, create and delete users, create and delete groups and adding users to said groups. 

Leave a Reply

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