0

How to fix your /etc/sudoers permissions

Linux

So you decided to be brave and mess with your /etc/sudoers file but you end up just breaking it. Or maybe I am the only one who did that.

I was trying to find a way of running the Ubuntu update-manager without having to put my password in. I read that you have to edit the /etc/sudoers file to do that, so no problem, right. First I sudo gedit /etc/sudoers but it tells me that I don't have permissions to do this, no problem, just change the permissions. So I sudo chmod 0640 /etc/sudoers which changes the permissions, what I did realize that sudo does not work unless it has a permission of 0440. So now every time I try and sudo anything I get the message " sudo: /etc/sudoers is mode 0640, should be 0440" so I cannot sudo chmod 0440 /etc/sudoers.

The Fix:

After some more pain and searching for how to fix it, I find that I can just go into recovery mode from the GRUB menu and then chmod 0440 /etc/sudoers and reboot. So once again I avoid a reinstall of Ubuntu

 

tags:
Linux
Kari said:
 
Mmm...mmhmm, easy fix. Good thinking.
 
posted 857 days ago
Add Comment Reply to: this comment OR this thread
 
 
Been there, done that brotha. I bet I do it again some day :)

 
posted 857 days ago
View Replies (1) || Add Comment Reply to: this comment OR this thread
 
.: HIDE REPLIES :.
Jonathan said:
 
Works nice if you have physical access but i did this on a remote system where the ISP charges up the a to touch the system. So you're stuck dead in the water because the only way to fix it is to be root but you can't access root to fix it. Catch 22 solvable by physical access at the cost of expensive support tickets. Pure genius!
 
posted 456 days ago
Add Comment Reply to: this comment OR this thread
 

Search