How to create a sudo user on Ubuntu 20.04 step-by-step instructions
Create a sudo user using the 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 the user to
sudo
group hence effectively changing the user account from Regular to Administrator. The below example will add a 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)