How to create a sudo user on Ubuntu 20.04 step-by-step instructions

Create a sudo user using the 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 the user to sudo group hence effectively changing the user account from Regular to Administrator. The below example will add a 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)
Was this answer helpful? 0 Users Found This Useful (0 Votes)