Permission denied /private/etc - sudo not possible !
Hello,
I have a new Mac for now one week and I have a problem with the access to some files. I would like to change the file /private/etc/hosts but the access to it is impossible: permission denied.
The next problem is that I can't execute sudo -s .. the result is:
sudo: unable to stat /etc/sudoers: Permission denied
sudo: no valid sudoers sources found, quitting
But the strange point is I think a step before, concerning the repertory /private/etc. Normally I have the permission to go into this repertory but when I try, it appears "permission denied".
For example:
ls -l /private/
total 0
drwxrw-rw- 87 root wheel 2958 21 fév 15:14 etc
drwxr-xr-x 2 root wheel 68 9 sep 23:24 tftpboot
drwxrwxrwt 4 root wheel 136 21 fév 15:14 tmp
drwxr-xr-x 24 root wheel 816 9 oct 13:54 var
So normally I should be able to read the content of /etc, no?
But when I execute :
-bash-3.2$ ls -l /private/etc/
ls: afpovertcp.cfg: Permission denied
ls: aliases: Permission denied
ls: aliases.db: Permission denied
ls: apache2: Permission denied
ls: asl: Permission denied
ls: asl.conf: Permission denied
ls: auto_home: Permission denied
ls: auto_master: Permission denied
ls: autofs.conf: Permission denied
ls: bashrc: Permission denied
...
ls: sudoers: Permission denied
ls: syslog.conf: Permission denied
ls: ttys: Permission denied
ls: xtab: Permission denied
ls: zshenv: Permission denied
As you can see all those files are unaccessible for me.. Even /private/etc/bashrc ! This is certainly also why I have a strange prompt : "-bash-3.2$" instead of my computer name et username.. And I didn't change it !
Please, could someone help me? I really don't understand the problem 😟
MacBook Pro (Retina, 13-inch, Mid 2014), OS X Yosemite (10.10.2)