User Tools

Site Tools


sudoers

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
sudoers [2025/01/13 10:08] – created 1211112228sudoers [2025/01/18 08:46] (current) – 1211112299
Line 1: Line 1:
 ====== Add Sudoers without Sudo ====== ====== 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.
  
 +{{:screenshot_2025-01-13_181052.png?nolink}}
 +
 +**Here is a guide on how to add yourself into sudoers. Make sure to follow the instructions on [[root|this]] first to prevent any errors.**
 +-----
 +1. Open terminal.
 +
 +2. Type the following command and enter the root password. 
 +  su root
 +
 +{{:screenshot_2025-01-13_203238.png?nolink}}
 +
 +3. You will now be in root.\\ {{:screenshot_2025-01-13_203828.png?nolink}}
 +
 +4. Type this command and press ''Enter''.
 +  sudo visudo
 +
 +{{:screenshot_2025-01-13_203940.png?nolink}}
 +
 +5. ''/etc/sudoers.tmp'' file will be opened and this is what it will look like. \\ {{:screenshot_2025-01-13_204022.png?nolink}}
 +
 +6. Scroll down until you see this. 
 +  #User Privilege Specification
 +
 +{{:screenshot_2025-01-13_204225.png?nolink}}
 +
 +7. Add the following line ''{username} ALL=(ALL:ALL) ALL'' at the back. In my scenario:
 +  eusoff ALL=(ALL:ALL) ALL
 +  
 +{{:screenshot_2025-01-13_204812.png?nolink}}
 +
 +8. Press ''Ctrl + X'' to save, when asked to save modified buffer, press ''Y'' and then ''Enter''. \\ {{:screenshot_2025-01-13_205029.png?nolink|}}\\ {{:screenshot_2025-01-13_205041.png?nolink|}}
 +
 +9. Now your username will have sudo permissions.\\ {{:screenshot_2025-01-13_205404.png?nolink&600|}}
 +-----
 +Now, you are able to run commands that require sudo permission without going into root! 
sudoers.1736762900.txt.gz · Last modified: 2025/01/13 10:08 by 1211112228

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki