Superuser cannot access other users folders

Discussion in 'macOS Sierra (10.12)' started by asiga, Jul 22, 2017.

  1. asiga macrumors 6502a

    Nov 4, 2012
    I have installed 10.12.6 from scratch, using the Migration Assistant for copying everything from my 10.11.6 installation, but there's one thing that behaves differently.

    I have two users. My normal user isn't in the sudoers file. But I have another superuser, which is. So, whenever I need to do some system change, I enter the superuser password.

    However, in 10.11.6, when I wanted superuser privileges from Terminal, I just typed "su superuser" and then I was able to "sudo" as superuser. It worked fine even if the current directory belonged to my normal user.

    But now, in my new 10.12.6 installation, if I "su superuser" for a folder belonging to my normal user, I get:
    "shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied"

    which means that superuser cannot read my normal user folders.

    This error didn't happen in 10.11.6, although I don't remember if I had to change anything for it to work.

    What could be the easiest way of fixing this? Thanks!!!
  2. gsahli macrumors 6502a


    Jun 1, 2007
    Have you tried another form of the same command? Like sudo su
  3. asiga thread starter macrumors 6502a

    Nov 4, 2012
    If I do "sudo superuser" from my normal user account and then I do a "sudo -s" from the superuser, then the superuser has a root session and so it can access the folders and files of my normal user.

    However, this doesn't happen in the rest of my Macs. If I do "sudo superuser" in them, the superuser can access all my folders and files. As I said, what I don't remember now is if I changed something for getting that behaviour, or if it's because of a change in Sierra.

Share This Page