Results 1 to 7 of 7
-
09-15-2012, 06:56 PM #1
- 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.
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)
-
09-15-2012, 11:47 PM #2
- Member Since
- Jul 02, 2007
- Location
- Going Galt...
- Posts
- 3,482
- Specs:
- MacBookAir5,2:10.13.2-iMac18,3:10.13.2-iPhone9,3:11.2.1
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 nowNever 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.
-
09-16-2012, 12:41 PM #3
- 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.
-
09-16-2012, 12:45 PM #4
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
-
09-16-2012, 04:15 PM #5
- 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.
-
09-16-2012, 04:57 PM #6
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
-
09-16-2012, 05:48 PM #7
- 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
-
media and file sharing on mountain lion
By DrDandroid in forum macOS - Operating SystemReplies: 0Last Post: 09-16-2013, 01:40 AM -
Hard drive 'lost' space after upgrade to Mountain Lion
By pw_168 in forum macOS - Operating SystemReplies: 15Last Post: 07-14-2013, 06:05 PM -
Mountain Lion Hosts File
By Shikarnov in forum macOS - Operating SystemReplies: 4Last Post: 04-01-2013, 01:27 PM -
File transfer from Mountain Lion to Windows 7
By kjeand in forum macOS - Operating SystemReplies: 0Last Post: 10-02-2012, 04:56 AM -
Lost Windows 7 partition upon installing Mountain Lion
By Dprelutzki in forum Running Windows (or anything else) on your MacReplies: 1Last Post: 07-31-2012, 05:55 PM