Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I accidentally screwed up my sudoers file and I don't know where the changes I made are. I know how to get a new sudoers file to that location but the problem is that I don't know what is in it. So to help me, can you please first write the version of OS X you are running and then go into terminal. You have to type these commands that are separated by lines:

cd /etc

sudo cp sudoers ~

Then just open the sudoers file which is in your home directory and copy the text and put it in your reply.

share|improve this question
2  
There's no need to copy the file. sudo cat /etc/sudoers will reveal the content immediately. Also note that you'll be able to break your sudo installation if you don't use visudo. –  Sebastian Stumpf May 14 '12 at 3:14
1  
Also check if you didn't change the permissions. Obviously, you should take more care in the future when messing with system files and working as root, which shows in the commands you gave us. There's no need to be root to copy the file somewhere else. –  slhck May 14 '12 at 7:42
4  
And since Mac OS X ships with various open-source components (including sudo), you could have found your defaults here: opensource.apple.com/source/sudo/sudo-60/src/sudoers –  Sebastian Stumpf May 17 '12 at 6:27
add comment

1 Answer

I'm running Mac OS X Lion 10.7.3.

Here's my sudoers file:

# 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
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.