0

While trying to figure out why another user doesn't have sudo privileges I got rid of % in %sudo ALL=(ALL:ALL) ALL and after doing I myself cannot lost sudo access. I get the message "xxxx is not in the sudoers file. This incident will be reported." When I do su, I get "su: Authentication failure" which means (based on googling) the root account is disabled. Any ideas on how to fix this? I also cannot run pkexec visudo as it says "Error executing command as another user: Not authorized". So any suggestions on how to fix this are appreciated. I am using Ubuntu 22.04 Unfortunately none of the solutions listed at How to modify an invalid '/etc/sudoers' file? worked for me

Many thanks

  • If you had a root account enabled, your chance will not have impacted that at all, ie. you can login as root & correct the issue. The root login is disabled however for on-topic Ubuntu systems by default (don't forget there is a specific command to edit the sudoers files, that checks for errors before you exit; as any errors get treated as an end-of-file) You didn't provide release, so we're limited to being generic in replies. – guiverc Aug 17 '23 at 10:47
  • 1
    The easiest fix I'd likely use is booting live media, manually navigating to the file & correcting from there. You didn't specify if you're talking Ubuntu 22.04 LTS Server, Ubuntu 22.04 LTS Desktop, but you can use whatever 22.04 media your machine is capable of booting & using. – guiverc Aug 18 '23 at 09:54

0 Answers0