Results 1 to 7 of 7
  1. #1
    Lost my suders file  Mountain Lion

    Member Since
    Jun 27, 2011
    Location
    Riverside CA
    Posts
    15
    Specs:
    I've had an iMac for over a year and got an Air when the new ones came out several months ago.
    Question Lost my suders file Mountain Lion
    I attempted to edit my sudoers file using visudo. I've done this before in LINUX but I now know it is different in OX-X. I saved the file but there were errors, it's gone, and it won't recreate for for visudo.

    What do I do now? (other than cry)

  2. #2
    Lost my suders file  Mountain Lion
    XJ-linux's Avatar
    Member Since
    Jul 02, 2007
    Location
    Going Galt...
    Posts
    3,418
    Specs:
    MacBookAir5,2:10.9.5-MacMini3,1:10.9.5-iPhone6,1:8.3
    Revert to a backup from Time Machine?

    OR, here's a sample:

    Permissions:

    -r--r----- 1 root wheel 1275 Jul 28 10:05 sudoers

    # sudoers file.
    #
    # This file MUST be edited with the 'visudo' command as root.
    # Failure to use 'visudo' may result in syntax or file permission errors
    # that prevent sudo from running.
    #
    # See the sudoers man page for the details on how to write a sudoers file.
    #

    # Host alias specification

    # User alias specification

    # Cmnd alias specification

    # Defaults specification
    Defaults env_reset
    Defaults env_keep += "BLOCKSIZE"
    Defaults env_keep += "COLORFGBG COLORTERM"
    Defaults env_keep += "__CF_USER_TEXT_ENCODING"
    Defaults env_keep += "CHARSET LANG LANGUAGE LC_ALL LC_COLLATE LC_CTYPE"
    Defaults env_keep += "LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME"
    Defaults env_keep += "LINES COLUMNS"
    Defaults env_keep += "LSCOLORS"
    Defaults env_keep += "SSH_AUTH_SOCK"
    Defaults env_keep += "TZ"
    Defaults env_keep += "DISPLAY XAUTHORIZATION XAUTHORITY"
    Defaults env_keep += "EDITOR VISUAL"
    Defaults env_keep += "HOME MAIL"

    # Runas alias specification

    # User privilege specification
    root ALL=(ALL) ALL
    %admin ALL=(ALL) ALL

    # Uncomment to allow people in group wheel to run all commands
    # %wheel ALL=(ALL) ALL

    # Same thing without a password
    # %wheel ALL=(ALL) NOPASSWD: ALL

    # Samples
    # %users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
    # %users localhost=/sbin/shutdown -h now
    Never judge a man, untill you have walked a mile in his shoes...
    That way you'll be a mile away from him, and you'll have his shoes.

  3. #3
    Lost my suders file  Mountain Lion

    Member Since
    Jun 27, 2011
    Location
    Riverside CA
    Posts
    15
    Specs:
    I've had an iMac for over a year and got an Air when the new ones came out several months ago.
    Thanks for the file, I thought of that but I cant create a file in /etc without invoking sudo, alas. I guess it's a visit to the Genius Bar since it's a Mac Air with and no system DVD.

  4. #4
    Lost my suders file  Mountain Lion
    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,398
    Specs:
    2012 13" MBP (2.5 i5, 8GB)
    Create it elsewhere, open up Finder, push Shift-Command-G, enter /etc, paste. Nice and simple.
    Important Links: Community Guidelines : Use the reputation system if you've been helped.
    M-F Blog :: Write for the blog
    Writing a Quality Post

  5. #5
    Lost my suders file  Mountain Lion

    Member Since
    Jun 27, 2011
    Location
    Riverside CA
    Posts
    15
    Specs:
    I've had an iMac for over a year and got an Air when the new ones came out several months ago.
    Both the owner and the permissions are wrong and I cannot change them.
    I sent a copy of the file to me from another mac and the problems persist. I can't use sudo chown ... because the sudoers file doesn't have the right permissions neither can I use sudo chmod ... for the same reason. I almost wich I had created a root user, but that's bad secuirity.

  6. #6
    Lost my suders file  Mountain Lion
    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,398
    Specs:
    2012 13" MBP (2.5 i5, 8GB)
    Enable the root user then and use that to recreate the sudoers file (more info here).
    Important Links: Community Guidelines : Use the reputation system if you've been helped.
    M-F Blog :: Write for the blog
    Writing a Quality Post

  7. #7
    Lost my suders file  Mountain Lion

    Member Since
    Jun 27, 2011
    Location
    Riverside CA
    Posts
    15
    Specs:
    I've had an iMac for over a year and got an Air when the new ones came out several months ago.
    Many thanks, I (obviously) didn't know one could do that or how to enable the root account. I''ll disable root now. All is right with the world (except in my office for my official "enterprise" desktop).

    Now to read about sudoers before I attempt to edit it again.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. media and file sharing on mountain lion
    By DrDandroid in forum OS X - Operating System
    Replies: 0
    Last Post: 09-16-2013, 01:40 AM
  2. Hard drive 'lost' space after upgrade to Mountain Lion
    By pw_168 in forum OS X - Operating System
    Replies: 15
    Last Post: 07-14-2013, 06:05 PM
  3. Mountain Lion Hosts File
    By Shikarnov in forum OS X - Operating System
    Replies: 4
    Last Post: 04-01-2013, 01:27 PM
  4. File transfer from Mountain Lion to Windows 7
    By kjeand in forum OS X - Operating System
    Replies: 0
    Last Post: 10-02-2012, 04:56 AM
  5. Lost Windows 7 partition upon installing Mountain Lion
    By Dprelutzki in forum Running Windows (or anything else) on your Mac
    Replies: 1
    Last Post: 07-31-2012, 05:55 PM

Posting Permissions

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