New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Operating System General OS operation information and support

Lost my suders file Mountain Lion


Post Reply New Thread Subscribe

 
Thread Tools
shellback3

 
Member Since: Jun 27, 2011
Location: Riverside CA
Posts: 15
shellback3 is on a distinguished road
Mac Specs: I've had an iMac for over a year and got an Air when the new ones came out several months ago.

shellback3 is offline
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)
QUOTE Thanks
XJ-linux

 
XJ-linux's Avatar
 
Member Since: Jul 02, 2007
Location: Going Galt...
Posts: 3,360
XJ-linux has a reputation beyond reputeXJ-linux has a reputation beyond reputeXJ-linux has a reputation beyond reputeXJ-linux has a reputation beyond reputeXJ-linux has a reputation beyond reputeXJ-linux has a reputation beyond reputeXJ-linux has a reputation beyond reputeXJ-linux has a reputation beyond reputeXJ-linux has a reputation beyond reputeXJ-linux has a reputation beyond reputeXJ-linux has a reputation beyond repute
Mac Specs: MacBookAir5,2:10.9.5-MacMini3,1:10.9.5-iPhone6,1:8.1

XJ-linux is offline
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

"Those who don't understand Unix are condemned to reinvent it, poorly." Henry Spencer
QUOTE Thanks
shellback3

 
Member Since: Jun 27, 2011
Location: Riverside CA
Posts: 15
shellback3 is on a distinguished road
Mac Specs: I've had an iMac for over a year and got an Air when the new ones came out several months ago.

shellback3 is offline
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.
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Toronto
Posts: 18,352
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is offline
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
QUOTE Thanks
shellback3

 
Member Since: Jun 27, 2011
Location: Riverside CA
Posts: 15
shellback3 is on a distinguished road
Mac Specs: I've had an iMac for over a year and got an Air when the new ones came out several months ago.

shellback3 is offline
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.
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Toronto
Posts: 18,352
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is offline
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
QUOTE Thanks
shellback3

 
Member Since: Jun 27, 2011
Location: Riverside CA
Posts: 15
shellback3 is on a distinguished road
Mac Specs: I've had an iMac for over a year and got an Air when the new ones came out several months ago.

shellback3 is offline
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.
QUOTE Thanks

Post Reply New Thread Subscribe


« isboxd ?? Eating up CPU | Icloud »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
dock on mountain lion markyb OS X - Operating System 18 08-05-2012 05:47 AM
UPGRADE to Mountain Lion? evangelist6589 OS X - Operating System 2 07-27-2012 01:31 PM
Can you guys open this site? Desolate One OS X - Apps and Games 13 04-29-2005 02:23 PM

All times are GMT -4. The time now is 10:40 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?