Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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, James Feb 25 '12 at 1:02

This question was marked as an exact duplicate of an existing question.

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.