Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sat Jun 29, 2013 5:38 pm 
Offline
Junior Member

Joined: Thu Dec 27, 2012 8:33 pm
Posts: 28
long story short:

I edited /etc/sudoers and now it no longer works. I can't sudo anything, including editing /etc/sudoers.

Gives an error like:

Code:
sudo: parse error in /etc/sudoers near line 30
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin


I cannot run

Code:
pkexec visudo


because I do not have it installed, and i cannot install it because I cannot sudo anything.

And yes, this is a production server. Not a high volume of usage, but still...

Is there any way to edit sudoers, or gain root access or am I totally screwed?


Top
   
PostPosted: Sat Jun 29, 2013 5:41 pm 
Offline
Senior Member

Joined: Tue May 03, 2011 11:55 am
Posts: 105
You can boot the Linode into rescue mode and then edit the file from there.
Or if you know the root login, you can login on the lish console for the same effect.


Top
   
PostPosted: Sat Jun 29, 2013 5:46 pm 
Offline
Senior Member
User avatar

Joined: Tue Nov 24, 2009 1:59 pm
Posts: 362
1. Do you have root password, or is this Ubuntu or another such distro where root login is disabled?
2. You can try using the "reset root password" feature in Linode Manager (will reboot the server).
3. If that doesn't work, use the Rescue function to reboot the machine into Finnix, and edit /etc/passwd and/or /etc/sudoers to taste.
4. Starting from today, do not edit /etc/passwd, /etc/group, and /etc/sudoers manually. Use the "vipw", "vigr", and "visudo" commands respectively. Won't help for misconfiguration, but will at least protect you from syntax errors.

_________________
rsk, providing useless advice on the Internet since 2005.


Top
   
PostPosted: Sat Jun 29, 2013 5:53 pm 
Offline
Junior Member

Joined: Thu Dec 27, 2012 8:33 pm
Posts: 28
Ghan_04,

You are a lifesaver. Was able to use lish as root and avoid a reboot. THANK YOU!!!!


Top
   
PostPosted: Sat Jun 29, 2013 5:54 pm 
Offline
Junior Member

Joined: Thu Dec 27, 2012 8:33 pm
Posts: 28
rsk,

Thank you for your response and the tips. I will learn those commands. It's actually amazing that I hadn't screwed up that file previously while editing.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group