Sudoers File Hosed - Help

Discussion in 'macOS' started by drobati, Jun 11, 2009.

  1. drobati macrumors newbie

    Joined:
    Jun 11, 2009
    #1
    So, I was messing around inside my system. I used Finders Go To folder command to go inside my /etc/ folder.

    At the time I was editing profile and bashrc. Then I saw sudoer and thought to myself hey lets see if I can edit that. So I opened it inside TextMate using Shell Script (BASH). This turned out to be a bad idea as I didn't see anything inside the file, I somehow saved and closed the file. I assume making it blank.

    I was recently trying to install a cpan dependencies for a perl geektool script. And discovered that I destroyed the sudo command. It spits this back at me.

    Code:
    >>> sudoers file: syntax error, line 0 <<<
    sudo: parse error in /private/etc/sudoers near line 0
    
    Ive looked elsewhere for a solution. I now realize that to edit the file you must use visudo (at least in ubuntu) and this is why the file appeared empty. Unfortunately I have no idea what to put inside the file and to top it off visudo doesn't even work for me either. Output was:

    Code:
    visudo: /private/etc/sudoers: Permission denied
    
    To give you a little more information; I run as a standard user. I have a separate account (admin) which I use when its appropriate. So for any solutions please keep in mind I have to use a su commands where appropriate.

    I have an iMac at home that I can probably go look at to see what is going on in it. That might give me some guidance but any extra information would be appreciated.

    I would also like to point out that this MacBook has a faulty combo drive (I hate apples combo drives) which means its quite difficult to use my Leopard Disk to repair anything.

    Thanks ahead for any help. :D

    (This is a learning experience for me)
     
  2. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2

Share This Page