To create a sudo user on Ubuntu 20.04 LTS, you can follow these steps:
Open a terminal and log in to the system as the root user.
Run the adduser
command to create a new user account. Replace username
with the desired username:
adduser username
Follow the prompts to set the password and other user information for the new account.
Run the usermod
command to add the new user to the sudo
group:
usermod -aG sudo username
Log out of the root account and log in to the system using the new sudo user account.
To test the sudo privileges of the new user, run a command that requires root privileges, such as apt-get update
. You will be prompted to enter the password for the new user account:
sudo apt-get update
If the password is accepted and the command executes successfully, the new user has been granted sudo privileges.