This is the hard way to learn when you MUST use visudo, specially in a remote server. That's right. I did something stupid like: and now have: So what if I have locked the root account (passwd -l root) and now I can't do su to fix sudoers file??? As i said this is in a remote server (VPS) so I can not use recovering special tools via CD or similar. thanks.-
no recovery mode or something like that? the thing is that it supposed to be nothing that you can do if you do not have recovery terminal.
You can boot from a recovery or live CD and try to fix the file. This should give you the idea: http://www.howtoforge.com/how-to-reset-a-forgotten-root-password-with-knoppix
Thanks for your answers. Yes, I do not have physical access. I am thinking in trying code some simple routine (as I have ssh access as user at least ) using something like http://www.kernel.org/doc/man-pages/online/pages/man3/getpwent.3.html Obviously I am not hurry and may be fun. Any idea to start? Thanks.-
Update What a odyssey! I was thinking in very rare things to solve this. === Solution: I have webmin installed. So as the root account WAS locked, I have another webmin user with access to all modules. Webmin > Users and Groups > root account > password: No password required === Can you believe it?