2
So I had no idea of the dangers of messing with the /etc/sudoers file, and was just trying to make a simple change in there. However, I seem to have put something with incorrect syntax in there, causing this problem:
$ sudo
sudo: >>> /etc/sudoers: syntax error near line 122 <<<
sudo: parse error in /etc/sudoers near line 122
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
I can't edit the /etc/sudoers file anymore because I don't have root access.
One fix I see online is to use:
$ su -
and enter the root password. However, this amazon ec2 box doesn't seem to HAVE a root password, thus preventing me from using su -
The other thing I see is rebooting the computer and doing some single user stuff which allows you to reset the password. Big problem is that this is amazon ec2 and I'm just SSHing into the box, I don't have physical access.
Question, am I completely screwed or is there a possible workaround? This is not Ubuntu, it appears to be CentOS. I also understand now about visudo
, but the site I had gotten the change from didn't mention that.
2If you cannot get root access, you will not be able to access the files needed to fix this. You should probably contact Amazon for support. – hololeap – 2013-10-04T00:28:04.017