You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

sudo: can't open /private/etc/sudoers: permission denied

I used an archived link here http://discussions.apple.com/thread.jspa?threadID=1349600

Last login: Sun Mar 20 17:55:05 on console
MacBook-Pro:~ admin$ ls-lad/ /private/private/ect
-bash: ls-lad/: No such file or directoryMacBook-Pro:~ admin$ sudo du
sudo: can't open /etc/sudoers: Permission deniedMacBook-Pro:~ admin$ ls-le /private/ect/sudoers
-bash: ls-le: command not found
MacBook-Pro:~ admin$ ls -le /private/ect/sudoers
ls: /private/ect/sudoers: No such file or directory
MacBook-Pro:~ admin$ sudo -s
sudo: can't open /etc/sudoers: Permission denied
MacBook-Pro:~ admin$ ls -l /usr/bin/sudo
-r-s--x--x 1 root wheel 272384 23 Jun 2009 /usr/bin/sudo
MacBook-Pro:~ admin$ sudo -v
sudo: can't open /etc/sudoers: Permission denied
MacBook-Pro:~ admin$ dsmemberutil checkmembership -u $(id -u) -g 80
user is a member of the group
MacBook-Pro:~ admin$ ls -lh@Oe /private/etc/pam.d
total 0
-r--r--r-- 1 root wheel - 200B 24 Jun 2009 chkpasswd
-r--r--r-- 1 root wheel - 203B 20 Jul 2009 cups
-rw-r--r-- 1 root wheel - 204B 18 May 2009 ftpd
-r--r--r-- 1 root wheel - 475B 24 Jun 2009 login
-r--r--r-- 1 root wheel - 434B 24 Jun 2009 login.term
-r--r--r-- 1 root wheel - 191B 18 Jul 2009 other
-r--r--r-- 1 root wheel - 197B 24 Jun 2009 passwd
-r--r--r-- 1 root wheel - 211B 25 Jun 2010 rshd
-rw-r--r-- 1 root wheel - 141B 22 May 2009 samba
-rw-r--r-- 1 root wheel - 366B 31 Jul 2009 screensaver
-r--r--r-- 1 root wheel - 499B 11 Jul 2009 sshd
-r--r--r-- 1 root wheel - 356B 18 May 2009 su
-r--r--r-- 1 root wheel - 203B 23 Jun 2009 sudo
MacBook-Pro:~ admin$ cat /private/etc/pam.d/sudo
# sudo: auth account password session
auth required pam_opendirectory.so
account required pam_permit.so
password required pam_deny.so
session required pam_permit.so

MacBook-Pro:~ admin$ ls -lad / /private /private/etc
drwx---r-x+ 31 Lee wheel 1122 20 Mar 17:51 /
drwxr-xr-x@ 6 root wheel 204 30 Dec 15:30 /private
drwxr-xr-x 88 root wheel 2992 20 Mar 17:50 /private/etc

tried Reboot into single user mode
/sbin/fsck -fy
/sbin/mount -wu /
/bin/chmod 1775 /
/bin/sync
exit

still no luck, can anyone advise?

Message was edited by: Dinger

Macbook Pro 15" 2.4ghz Core 2 Duo, Mac OS X (10.6.6)

Posted on Mar 20, 2011 11:23 AM

Reply
11 replies

Mar 20, 2011 11:59 PM in response to Dinger

Nowhere in your post do you actually post the permissions on the /etc/sudoers file.

You try. Twice:

admin$ ls-le /private/ect/sudoers
-bash: ls-le: command not found


and:

admin$ ls -le /private/ect/sudoers
ls: /private/ect/sudoers: No such file or directory


but there are typos in both lines that miss the data you're looking for, and you never actually get it right.

So, above everything else, what are the permissions on /etc/sudoers?

ls -l /etc/sudoers

Mar 25, 2011 4:56 AM in response to Dinger

Which groups are you member of? FYI,

strangepork:~ dalek$ id dalek
uid=502(dalek) gid=20(staff) groups=20(staff),98( lpadmin),81(_appserveradm),79(appserverusr),80(admin)
strangepork:~ dalek$ ls -l /etc/sudoers
-r--r----- 1 root wheel 1135 Sep 23 2007 /etc/sudoers
strangepork:~ dalek$ sudo pwd
Password:
/Users/dalek
strangepork:~ dalek$

sudo: can't open /private/etc/sudoers: permission denied

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.