0

After I open a terminal, I run sudo su. But it then gives me

>>> /etc/sudoers: syntax error near line 27 <<< sudo: parse error in /etc/sudoers near line 27 sudo: no valid sudoers sources found, quitting sudo: unable to initialize policy plugin

I tried running su and then input the password but the terminal closes after a few seconds. What command do I use to become root? Also, I'm on Ubuntu 18.

1 Answers1

2

Boot from a live session, edit /etc/sudoers and fix the mistake.

An example on how to do that from a live session (change sda1 to what you need it to be and if you use another mount point also change below to what you used):

sudo mount -o rw,remount /dev/sda1 /mnt
sudo visudo -f /mnt/etc/sudoers

and then fix line 27.

Rinzwind
  • 299,756