Results 1 to 5 of 5

Thread: /etc/sudoers broken

  1. #1
    Join Date
    May 2009
    Beans
    109
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    /etc/sudoers broken

    I tried to alter my sudoers file, and now I have no sudo priveledges. What I can't figure out is why it's not working. I boot into recovery mode and:

    Code:
    visudo
    
    -or-
    
    vim /etc/sudoers
    and the file displayed is an exact replica of the default sudoers file for 8.04. I enter:

    Code:
    :q
    to exit vim and it tells me that /etc/sudoers.tmp is unchanged. Only there is no such file as /etc/sudoers.tmp?

    I have no idea what to do at this point. Initially, there was an /etc/sudoers.tmp.swp file and a list of instructions to follow, but I apparently screwed that up somehow...

    What can I do to fix this?

  2. #2
    Join Date
    Jul 2006
    Location
    Here
    Beans
    10,401

    Re: /etc/sudoers broken

    the tmp thing is normal, it's buffered while your changing it.

    if it's screwed up you can boot into safe mode and remove sudo then reinstall it.
    in safe mode:
    apt-get remove --purge sudo
    apt-get install sudo


    that will remove it completely then install it again just like new.

    by the way only use "sudo visudo" or "visudo" in safe mode to edit sudoers! it is the "only" safe way to do it.

  3. #3
    Join Date
    May 2009
    Beans
    109
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: /etc/sudoers broken

    Thanks for the help kerry.

    Problem: When I try to remove sudo, it wants to remove a bunch of packages, including gparted, network-manager-gnome, ubuntu-desktop, update-manager, update-notifier and several linux-headers.

    I tried several different methods,

    Code:
    apt-get remove --purge sudo
    apt-get remove sudo
    aptitude remove sudo_
    apt-get remove sudo; apt-get install sudo
    and they all lead to deleting the same packages. Any ideas? Or am I just going to have to reinstall everything?

  4. #4
    Join Date
    Mar 2006
    Location
    Williams Lake
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: /etc/sudoers broken

    I would suggest checking if the permissions have changed. The permissions should be set to 440 it should look similar to this:

    Code:
    -r--r----- 1 root root 557 2009-07-09 12:44 sudoers

  5. #5
    Join Date
    May 2009
    Beans
    109
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: /etc/sudoers broken

    Update: I reinstalled. Removing sudo was a bad idea (almost as bad an idea as trying to edit the sudoers file).

    Everything's good now. Thanks for the suggestions.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •