Issue with sudo
-
I created a VM with VirtualBox of Ubuntu 22.04 LTS. I got it installed fine and running, but when I try to install net-tools using sudo apt install net-tools, I get "<user> is not iin the sudoers file. This incident will be reported." I tried doing su root to add myself to the sudoers file, but get "Authentication failure." Not sure how to add my username to the sudoers file so I can issue sudo commands.
HELP ME!!!
-
Hey @David-Thompson ,
Can you try running the following command?
"usermod -aG sudo username"
When adding yourself to the sudoers file are you performing this in "/etc/sudoers"?
-
Hi @Andrew-Despres,
I'm a virtual n00b with Linux... When I run visudo in Terminator, I get "visudo /etc/sudoers: Permission denied. So I can't run anything in root or sudo, and cannot add myself to the sudoers file. I'm not sure how to go about editing permissions to this file and then giving myself the permissions. -
I am also a Linux noob. That is what I found on Google.
Is there anyway you can try to login as Root?
-
This seems like an odd issue to me, considering the times I've used Ubuntu before, I've never had to modify the sudoers file to run sudo. Maybe I'll try deleting the VM and rebuilding it.
-
Sounds like a plan. Looking forward to hearing about you're progress!
-
Disclaimer: I am putting this here for anybody who is looking for the solution to this error when using VirtualBox for Ubuntu for the first time. I am unsure whether this was put somewhere else, so mods please delete if I am duplicating information. Thank you!
If you are receiving the error "[user] is not in the sudoers file", this means that your current, logged on user profile for your installation of Ubuntu is not able to use commands with root/sudo access. To solve this issue, type su - to log in as the root user. The password is the same password you used to setup the Ubuntu virtual machine.
You should now be signed in as the root user. Now, type sudo adduser [your username] sudo and then restart the virtual machine.
https://www.reddit.com/r/linux4noobs/comments/y7cr34/user_is_not_in_the_sudoers_file_error_after/
-
Worked like a charm, Anthony! Thank you kindly, Sir!