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
- 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
May be interested
- 4 ways to run the software using administrative rights in Windowshere are 4 ways to run the application using administrative rights in windows.
- How to run Task Manager with admin rights in Windows 11task manager is an important windows tool that allows you to monitor the applications and processes running on your computer. it also provides access to important system information, such as ram usage and cpu temperature.
- How to open the hosts file with Admin rights - Apply to open the file systeminstructions to open the host file with admin rights on windows using the windows admin rights and change the file properties, see how to read the host file here
- Changing user on Macbook has lost admin rights, what should Apple do?changing user on macbook and losing admin rights makes many apple fans worried because they don't know what to do. the following measures will help you
- You can gain admin rights of Windows 10 just by plugging in a Razer mousethe printnightmare vulnerability makes the hacker community and security researchers pay attention to vulnerabilities that appear on microsoft products when installing third-party drivers.
- What is Admin? Admin Facebook, what is the website?so what are the main roles and responsibilities of the admin? many of you are still vague about them. to understand this work, please read the following article to learn more about the basic concepts and tasks of admin.
- How to pin Command Prompt to the Taskbar and run it with Admin rightshow to pin command prompt (cmd) to the taskbar and run it with admin rights is the content that tipsmake will share with you today. as we know, with cmd, we can use many commands to check our computer system.
- Access the home router with admin rightsalthough you do not need to connect to your router every day, but you need to solve problems across the network or make changes to your network, such as setting up port forwarding rules, configuring firmware updates, etc. ..
- The trick to create a shortcut to run the application under Adminif you want to allow a user account to launch an application as an administrator without the uac (user account control) or password, you can create a shortcut using the runas / savecred command. this command will save your password.
- What's New in Ubuntu 21.10?version 21.10 is the latest release of ubuntu and although canonical is turning more attention to the cloud and developers, ubuntu 'impish indri' still comes with some notable changes for those users use the ubuntu desktop every day.