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)