Add Sudoers without Sudo
Let's say you have just freshly installed your new Linux OS on a brand new PC or VM. After you setup the username and password, you encountered a problem when trying to install a new software. The problem is you could not use sudo.
Here is a guide on how to add yourself into sudoers. Make sure to follow the instructions on this first to prevent any errors.
1. Open terminal.
2. Type the following command and enter the root password.
su root
3. You will now be in root.
4. Type this command and press Enter.
sudo visudo
5. /etc/sudoers.tmp file will be opened and this is what it will look like.
6. Scroll down until you see this.
#User Privilege Specification
7. Add the following line {username} ALL=(ALL:ALL) ALL at the back. In my scenario:
eusoff ALL=(ALL:ALL) ALL
8. Press Ctrl + X to save, when asked to save modified buffer, press Y and then Enter.

9. Now your username will have sudo permissions.
Now, you are able to run commands that require sudo permission without going into root!
