1

It looks like I made a mistake in the sudoers file. I am not able anymore to login as root with sudo -i, I always get:

>>> /etc/sudoers: Syntaxfehler near line 38 <<<
>>> /etc/sudoers: Syntaxfehler near line 39 <<<
sudo: Syntax-Fehler in /etc/sudoers bei der Zeile 38
sudo: Keine gültige sudoers-Quelle gefunden, Programmende
sudo: Regelwerks-Plugin konnte nicht initialisiert werden

So I tried to edit the sudoers file, but I get Error on reading file, no permissions.

So I entered recovery mode and voila, I can see the file content, but I cannot edit it.

How can I possibly fix this without reinstalling Ubuntu?

4
  • 1
    Boot live distro (I think Ubuntu installer can work as such) and edit from there? Tip: get familiar with visudo tool to avoid basic syntax errors while modifying the sudoers file. Mar 20, 2017 at 7:52
  • Where can I find the smallest live cd ?
    – Black
    Mar 20, 2017 at 8:12
  • Can you still log in as normal root, preferably from a virtual console ("text screen", Ctrl-Alt-F2 etc.)? If you can't, give root a proper password to avoid this problem next time. SystemRescueCD is great for booting from CD or USB stick or even the Network to do system repairs.
    – dirkt
    Mar 20, 2017 at 8:52
  • 1
    @Black some real small live cd's are puppylinux, or I was looking at finnix the other day, it's about 170MB but may be command line only. I think TinyCore is 10MB to 20MB. Also, I don't remember exactly what the single boot option does, but it might be useful next time to get you logged in
    – Xen2050
    Mar 22, 2017 at 20:43

1 Answer 1

2

I solved it by downloading the minimal ubuntu from here, then I had to go to another computer to "burn" this file bootable on my USB device. After booting ubuntu mini in recover mode I corrected the syntax errors in the sudoers file and rebooted the system. Now it works again.

1
  • 1
    While there may be faster ways, you have my up vote for sharing the solution that worked for you. Mar 20, 2017 at 9:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .