How to create sudo user on Ubuntu 20.04 Focal Fossa Linux

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

How to add user on Ubuntu 20.04 Focal Fossa Linux

How to add user on Ubuntu 20.04 Focal Fossa Linux

Software Requirements and Conventions Used

Software Requirements and Linux Command Line Conventions
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

  1. 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.



  2. 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 user lubos to sudo group:
    $ sudo usermod -aG sudo lubos
    
  3. (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)
    

Create a sudo user from graphical user interface (GUI)

  1. Search Activities menu using user string and open Users settings

    Search Activities menu using user keyword and open Users settings



  2. Hit Unlock to obtain administrative privileges

    Hit Unlock to obtain administrative privileges. Enter administrative password. Note, your user needs to be a part of sudo group to successfully authenticate

  3. Select user you wish to add to sudo group and click administrator button. All done

    Select user you wish to add to sudo group and click Administrator button. All done