I was editing my
/etc/sudoers file and saved it but it has a syntax error in there. Now I can't
sudo vim /etc/sudoers because sudo thinks the sudoers file is not valid.
How can I fix this?
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.Sign up to join this community
If you have Docker installed and your user is a member of the
docker group you can easily get yourself out of this pickle (and some others) without rebooting or what-have-you:
$ docker run -it --rm -v '/etc/:/root/host.etc/' debian bash
apt-get update && apt-get install [vim|nano|whatever]
As noted in this similar question on askubuntu, this may well work without having to reboot into single-user mode: