I recently installed ubuntu on a virtual machine using VirtualBox and whenever i need to use a sudo command(any) i can't because my only user is not in the sudoer file. I tried using the sudo -i command or visudo but it always gives me no permission to use it. How then to I go about using root privileges?
Asked
Active
Viewed 196 times
sudoers
and be able to run allsudo
commands. However, if somehow the user didn't get in there or was removed, see - How do I reset a lost administrative password? – NotTheDr01ds Dec 10 '22 at 17:14sudo
rights. You've also not said if you altered thesudoers
file, as any error/mistake introduced into that file is treated as the EOF (end of file) marker & subsequent lines are ignored (that's why it has a special command to edit it; that command checks for errors prior to exist to avoid making the file ~empty thru careless error) – guiverc Dec 10 '22 at 20:39sudo
group?id
will tell. If not, Boot to single user mode (to getroot
), thenadduser your_user sudo
. Then boot back to multiuser withsudo shutdown -r now
. Login, and test withid;sudo id
. – waltinator Dec 10 '22 at 22:21