Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Possible Duplicate:
How to modify a invalid /etc/sudoers file? It throws out anderror and not allowing me to edit again

Hi guys I have meerkat and I must have messed sudoers. This is my situation now.

ubuntu:/etc$ ifconfig Command 'ifconfig' is available in
'/sbin/ifconfig' The command could not be located because '/sbin' is
not included in the PATH environment variable. This is most likely
caused by the lack of administrative privileges associated with your
user account. ifconfig: command not found @ubuntu:/etc$ ^C
@ubuntu:/etc$ htop @ubuntu:/etc$ ls -l /etc/environment
-rw-r--r-- 1 root root 79 Feb 15 09:54 /etc/environment @ubuntu:/etc$ cd /etc/environment
-bash: cd: /etc/environment: Not a directory @ubuntu:/etc$ sudo nano /etc/environment
>>> /etc/sudoers: syntax error near line 17 <<< sudo: parse error in /etc/sudoers near line 17 sudo: no valid sudoers sources found,

What would you recommend?

share|improve this question

marked as duplicate by Lekensteyn, bodhi.zazen, jrg Feb 25 '12 at 1:02

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

In this case a format seems like an aggressive solution to me.

I would try to fix the sudoers file (I guess you edited it by hand? You probably wanted to give a user "admin rights"?) and then add /sbin in to the PATH.

You may also want to add your user to the adim group and uncomment the line in the sudoers file that gives the members of the admin group root privileges.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.