Creating a Sudo User in Debian or Ubuntu

Creating a Debian Sudo User

Creating a Debian sudo user involves a few simple steps. This procedure does not require you to edit the sudoers file. If you have an existing user that you want to grant sudo privileges, skip Step 2.

Step 1: Log in as the Root User

Before you can add a user to your system, log in to your server as the root user:

ssh root@ip_address

Replace ip_address with the IP address of your server.

Step 2: Add a New User in Debian

As the root user, create a new user with the adduser command. Append the desired user account name to the command:

adduser username

Step 3: Add User to the Sudo Group

Users with root privileges can add any account to the sudo group. On Debian and Ubuntu systems, everyone in this group automatically gets sudo access.

Run the following command to add a user to the sudo group:

usermod -aG sudo username

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.