How to assign admin rights to users in Ubuntu
The commands and processes mentioned in this article are performed on Ubuntu 20.04 and Ubuntu 22.04 systems.
Make user admin in Ubuntu via GUI
To change user settings through the user interface, you need to open the Users tab in the System Settings utility . You can access it through the following two ways:
Enter the keyword users into the system Dash and click on the Users search result.
Or
Click the down arrow located in the upper right corner of the Ubuntu screen, click your username in the following view, and then click Account Settings from the drop-down menu.
The Settings utility will open, displaying the Users tab. Please note that only authorized users can change user settings in Ubuntu. First, you need to unlock the tab to make changes as an admin by clicking the Unlock button located at the top right corner of the Users view:
This will open the following Authentication dialog , where you can provide the password for the authorized user:
Enter the password and then click the Authentication button. You can now change any user's settings. Click the username of the user you want to set as admin.
Under the user's Account Type, you'll see two buttons ; Standard button and Administrator button. Click the Administrator button to set this user to admin. As soon as you do this, the user will be granted admin rights and can now do all the operations that require root privileges.
Make user admin in Ubuntu via command line
The article will describe two ways to turn a standard Ubuntu user into an admin via the command line:
- Through the command usermod
- Via the gpasswd . command
We will use Ubuntu's command line application, Terminal, to do this. You can open Terminal via the system Dash or the keyboard shortcut Ctrl+Alt+T .
Method 1: Usermod . command
Open Terminal and enter the following command as sudo because only authorized users can edit user settings in Ubuntu:
Syntax:
$ sudo usermod -aG sudo 'username'
This example will use the following command to set the user with the username 'sampleuser' as admin:
$ sudo usermod -aG sudo sampleuser
Enter the password for sudo and the user will be added to the 'sudo' group which means that the person can perform all administrative tasks on Ubuntu.
You can verify that the user is currently in the 'sudo' group by checking the groups the user belongs to, via the following command:
$ groups 'username'
The following output of the groups command for "sampleuser" indicates that the user is now part of the sudo group.
Method 2: Command gpasswd
Open Terminal and enter the following gpasswd command as sudo because only authorized users can edit user settings in Ubuntu:
Syntax:
$ sudo gpasswd -a 'username' sudo
This example is adding 'sampleuser' to the sudo group via the following command:
$ sudo gpasswd -a sampleuser sudo
You can also remove a user from the sudo group via switch -r in the same gpasswd command:
Syntax:
$ sudo gpasswd -d 'username' sudo
This example is removing 'sampleuser' from the sudo group via the following command:
$ sudo gpasswd -a sampleuser sudo
Through the methods described in this article, you can turn a normal Ubuntu user into an admin so that they can perform all the tasks that require root privileges on the system.
You should read it
- How to open admin and folder permissions in Nautilus
- How to launch Admin rights application for User account in Windows?
- Losing Admin permissions on Windows 10 / 8.1, this is a fix
- What is Admin? Admin Facebook, what is the website?
- How to set up always opening applications with admin rights on Windows 11
- How to assign Administrator permissions on a Windows 7 computer?
- How to grant Admin rights to a User in Win 10
- How to open Notepad with admin rights
- The chat group on Facebook Messenger adds administrative rights
- 4 ways to run the software using administrative rights in Windows
- How to run Task Manager with admin rights in Windows 11
- You can gain admin rights of Windows 10 just by plugging in a Razer mouse
Maybe you are interested
Many Samsung users found using 'samsung' as password
YouTube Will Let Third Parties Train AI Models on User Content
US users can now access ChatGPT via 1-800-CHATGPT
How to Change the Default User Account Avatar in Windows
2 features users don't like in Photoshop Express photo editing application
Microsoft still recommends 15-year-old backup solution for Windows 11 and 10 users