How to Make a User an Administrator in Debian 11 Debian linux shell

If you have multiple user accounts in your system, it is not a good idea to give administrative privileges to all of them. It is always safe to limit the privileges of certain accounts to prevent unauthorized and potentially harmful changes to the system.

However, if you want to assign administrative privileges to certain users, you can do it using various methods. In this article, we will discuss the methods you can use to make a user an administrator in your Debian operating system. This includes both the GUI and the command line. When you make a user an administrator, they are given all administrative privileges, such as installing and uninstalling software, making changes to system settings and configurations, etc.

We used Debian 11 and Debian 10 to successfully test the commands and procedures mentioned in this article.

Make a User an Administrator in Debian Through the GUI

In the following method, we will make a user an administrator though the Settings utility. To open the settings utility in your Debian system, hit the super key on your keyboard and type users. You will see the Settings icon in the results as shown in the following screenshot. Click on it to open the Settings utility directly in the Users tab.

<img alt="Users" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/06/echo/word-image-213.png" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="137" loading="lazy" src="data:image/svg xml,” width=”727″> Alternatively, go to the top right corner of your desktop and click on the downward arrow. From the menu that appears, click on the Account Settings to open the Settings utility in the Users tab.

<img alt="Account settings" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/06/echo/word-image-214.png" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="290" loading="lazy" src="data:image/svg xml,” width=”280″>

When the settings utility will open, you will see the following view. To make the changes, make sure you have administrator privileges, otherwise, you will not be able to make any kind of changes.

Now you will need to unlock the tab to make required changes. To do so, click the unlock button at the top right corner of the following window.

<img alt="Debian user account settings" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/06/echo/word-image-215.png" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="400" loading="lazy" src="data:image/svg xml,” width=”629″>

You will be prompted to enter the password for the authorized user. Enter the password and click Authenticate.

<img alt="Authenticate as admin to be able to change the account" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/06/echo/word-image-216.png" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="281" loading="lazy" src="data:image/svg xml,” width=”421″>

Now you are allowed to make changes to any user’s settings. Select the user you want to make an administrator. There you will see two labels: Standard and Administrator next to the account type of the user. Click on the Administrator to assign the selected user an administrator privilege.

<img alt="Make user an administrator" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/06/echo/word-image-217.png" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="406" loading="lazy" src="data:image/svg xml,” width=”629″>

Make a User an Administrator in Debian Through the Command Line

In the following method, we will make the user an administrator through the following command line methods:

  • Through the usermod command
  • Through the gpasswd command

To open the command line terminal application in the Debian OS, go to the Activities tab in the top left corner of your desktop. Then in the search bar, type terminal. When the Terminal icon appears, click on to launch it.Advertisement

Through the usermod command

To make a user an administrator, enter the command in the Terminal using the following syntax:

$ sudo usermod -aG sudo “username”

In the following example, we are going to make our user with the name “testuser” an administrator:

$ sudo usermod -aG sudo testuser

You will be prompted to enter the password. Enter the sudo password and the user will be added to the sudo group. The next time the user logs in, it will be granted sudo privileges.

<img alt="usermod command" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/06/echo/word-image-218.png" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="29" loading="lazy" src="data:image/svg xml,” width=”602″>

To verify if the new user has been added to the sudo group, you can run the following command:

$ groups user_name

For instance, to verify if the “testuser” is in the sudo group, the command would be:

$ groups testuser

The output shows our user “testuser” is now in the sudo group and have all administrator privileges.

<img alt="groups command" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/06/echo/word-image-219.png" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="50" loading="lazy" src="data:image/svg xml,” width=”494″>

Through the gpasswd command

Another way of making a user an administrator is through the gpasswd command. To do so, open the Terminal and enter the command in the following syntax.

$ sudo gpasswd -a “user_name” sudo

For instance, to add “testuser” in the sudo group, the command would be:

$ sudo gpasswd -a testuser sudo

By running this command, our user will be added to the sudo group and will be granted administrator privileges.

<img alt="gpassword command" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/06/echo/word-image-220.png" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="49" loading="lazy" src="data:image/svg xml,” width=”592″>

In case, you want to remove the user from the sudo group added via gpasswd command, you can do so using the following command:

$ sudo gpasswd -a sampleuser sudo

For instance, to remove our user “testuser” from the sudo group, we will enter the following command:

$ sudo gpasswd -a testuser sudo

<img alt="Add sudo privileges to user using gpassword" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/06/echo/word-image-221.png" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="46" loading="lazy" src="data:image/svg xml,” width=”556″>

So these were some methods using which you can make an ordinary user an administrator so that they can perform any kind of administrative tasks on the system.