Is this directory protected by Mojave's new security features?
$ sudo ls -laR /var/db/dslocal/nodes/Default/ ls: Operation not permitted
It works in High Sierra but not Mojave. How do we view the contents of this directory?
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.Sign up to join this community
You can turn it of System Integrity Protection (the SIP) but be aware of potential risks.
Reboot the Mac and hold down Command + R.
From the Utilities menu, choose Terminal.
To turn it back on --Highly Recommended !!
You can re-enable SIP by following the above steps, but using
csrutil enable instead.
A less drastic way:
Go to System Preferences > Security & Privacy and give Full Disk Access to Terminal.
Adapted from https://discussions.apple.com/thread/8637915
Apple menu -> System Preferences -> Security & Privacy -> Privacy -> Full Disk Access -> +
Applications -> Utilities -> folder -> Terminal -> open/grant terminal full disk access privileges. -> Relaunch terminal
In my case helped simply:
chflags -R nouchg .
This code I used in terminal in folder with problematic file.