How to create a user on Debian with root access

How to create a user on Debian with root access

One of the security tips is to disable the root user to log in and work with the operating system. you need to know how to create a user on Debian with root access with the ability to execute system commands, which is the same as root access users, you can take advantage of the ability to increase the security of your Debian. by making a user as well as finally granting access and settings to get acquainted with it in full.

How to create a user on Debian with root access


First, log in with your Root access to your debian and create a custom username using the following command:

useradd -m -c "Admin User" admin

After creating the user, enter the following command to set a password for it.

passwd admin

Note: The username in this command is admin and you can use your desired username instead.

Recommended Article: Initial Server Setup On Debian 11 (Bullseye)

What should be done after creating the user?

Now, after creating the user and setting the password, enter the following two commands so that the user becomes a member of the Sudo group to access the execution of the commands with the Sudo command:

usermod -aG sudo admin    

In this way, you will be able to create and configure a user with Root access, and now to test it, you can switch to the user interface of this user via the following command to test the commands you want. su admin


Two important point:

First: Make sure that before the security settings to disable Root, be sure to take the tests with the new user to ensure the accuracy and reliability of the execution of the desired commands.

Second: Be careful to execute commands with Root access in the user interface, you must use the Sudo command before all commands.

Dear user, we hope you would enjoy this tutorial about How to create a user on Debian with root access, you can ask questions about this training in the comments section, or to solve other problems in the field of Eldernode training, refer to the Ask page section and raise your problem in it as soon as possible. Make time for other users and experts to answer your questions.

How useful was this post?

Click on a star to rate it!

Average rating 3 / 5. Vote count: 2

No votes so far! Be the first to rate this post.

View More Posts
Marilyn Bisson
Content Writer
Eldernode Writer
We Are Waiting for your valuable comments and you can be sure that it will be answered in the shortest possible time.

Leave a Reply

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

We are by your side every step of the way

Think about developing your online business; We will protect it compassionately

We are by your side every step of the way


7 days a week, 24 hours a day