A sudo user on the Ubuntu operating system is a user with root/administrative permissions. This short tutorial will explain how to create a sudo user on Ubuntu 20.04 Focal Fossa Linux.
In this tutorial you will learn:
- How to create sudo user from command line
- How to create sudo user from graphical user interface
- How to retrieve user and group information
Software Requirements and Conventions Used
Category | Requirements, Conventions or Software Version Used |
---|---|
System | Installed or upgraded Ubuntu 20.04 Focal Fossa |
Software | N/A |
Other | Privileged access to your Linux system as root or via the sudo command. |
Conventions |
# – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command$ – requires given linux commands to be executed as a regular non-privileged user |
How to create sudo user on Ubuntu 20.04 step by step instructions
Create a sudo user using command line
-
To be able to add/create a sudo user we first need to create a regular user. To do so we can use the
adduser
command. Visit our How to Add user on Ubuntu 20.04 tutorial for more information on how to create new users.
- Once the regular user is created you can add user to
sudo
group hence effectively change the user account from Regular to Administrator. The bellow example will add userlubos
tosudo
group:$ sudo usermod -aG sudo lubos
- (optional) Lastly, retrieve user and group information to confirm that the given user has been added to the
sudo
group:$ id lubos uid=1001(lubos) gid=1001(lubos) groups=1001(lubos),27(sudo)