I'm running Mac OS X 10.14.1 revision 18B75
I created a user using dscl and set its home directory to a wrong path with this command:
sudo dscl . -create /Users/theusername NFSHomeDirectory /the/wrong/path
Now I want to fix this. I tried these commands:
sudo dscl . -changei /Users/theusername NFSHomeDirectory 1 /the/right/path
and
sudo dscl . -change /Users/theusername NFSHomeDirectory /the/wrong/path /the/right/path
but in both cases I get this:
<main> attribute status: eDSPermissionError
<dscl_cmd> DS Error: -14120 (eDSPermissionError)
Why am I getting a permission error even if I'm running as root? How can I fix the wrong path?