Do it your self hobby code

Create a sudo user — Ubuntu

To have an administrator privileges, you have to add the user to sudo group.

Log in to your Ubuntu server using your root account or a sudo user if you already have.

While on the terminal type this command:

adduser your_username
or 
sudo adduser your_username

Assign a password. Enter it twice. Now that you have created a user, we can proceed to add it to sudo group

Adding the user to sudo group:

usermod -aG sudo your_username

Swith to the the newly created user:

su your_username

To make a test, type:

sudo ls -la /root

It will ask to enter the user password. If you got it right, you will see files displayed. But if it is not successful, you will get this report:

ls: cannot open directory ‘/root’: Permission denied

Leave a Comment

Your email address will not be published.