HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Server Operation (http://www.howtoforge.com/forums/forumdisplay.php?f=5)
-   -   I screwed up sudoers and I haven't root access (remote server). (http://www.howtoforge.com/forums/showthread.php?t=51397)

nomikos 11th February 2011 21:56

I screwed up sudoers and I haven't root access (remote server).
 
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:

Quote:

$ sudo vi /etc/sudoers
and now have:

Quote:

$ sudo
>>> /etc/sudoers: syntax error near line 79 <<<
sudo: parse error in /etc/sudoers near line 79
sudo: no valid sudoers sources found, quitting
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.-

beyerservice 12th February 2011 03:30

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.

falko 12th February 2011 12:31

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-res...d-with-knoppix

beyerservice 12th February 2011 12:47

Quote:

Originally Posted by nomikos (Post 250940)
As i said this is in a remote server (VPS) so I can not use recovering special tools via CD or similar.

Quote:

Originally Posted by falko
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-res...d-with-knoppix

???not really helping.

nomikos 12th February 2011 17:51

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/...etpwent.3.html
Obviously I am not hurry and may be fun. Any idea to start?
Thanks.-

nomikos 12th February 2011 19:33

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?

beyerservice 12th February 2011 21:39

no. thats too much luck for you :-D

falko 13th February 2011 20:40

Quote:

Originally Posted by beyerservice (Post 250994)
???not really helping.

Why? He could boot from a live system, mount his hard drive and then try to fix /etc/sudoers.


All times are GMT +2. The time now is 21:52.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.