0

I am currently using ubuntu 18.04.I was trying to provide another user sudo permission.After editing visudo ,I can.t fix my sudo...

:~$ sudo
/etc/sudoers: syntax error near line 9
sudo: parse error in /etc/sudoers near line 9
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
riyadh@riyadh-Inspiron-3593:~$ 
BulletBob
  • 1,780

1 Answers1

0

I was able to fix this by creating a Ubuntu USB stick (like you would for installations). Boot from the USB and click "try Ubuntu without installing".

Once I was in the system I could mount my drive to /mnt, use fdisk -l to see the various drives and determine which is your drive. Then you can mount the drive

mount /dev/(name of drive) /mnt

Then, cd /mnt/etc/ and open the file in your text editor of choice. I use vi so I would vi sudoers. Once you have edited the file then you can save it, power down the machine, remove the usb, and restart the machine to boot back into your Ubuntu installation.

Gordster
  • 1,719