I am trying to set up a user account on a new M1 MacBook pro, in the terminal in recovery mode.
I use the following commands:
dscl . -create /Users/luser
dscl . -create /Users/luser UserShell /bin/bash
dscl . -create /Users/luser RealName "Lucius Q. User"
dscl . -create /Users/luser UniqueID "1010"
dscl . -create /Users/luser PrimaryGroupID 80
dscl . -create /Users/luser NFSHomeDirectory /Users/luser
dscl . -passwd /Users/luser password
However when I execute the final command I get the following error:
passwd: DS error:eDSOperationFailed
<dscl_cmd> DS Error: -14483 (eDSOperationFailed)
The error code doesn't really tell me much - listed as an authentication error here: http://www.manpagez.com/man/8/DirectoryService/osx-10.4.php
When I execute:
dscl . -read /Users/luser
It seems to have set up the user account.
Does anyone know the correct steps to set up a user account from the terminal in recovery mode on an M1 MacBook Pro, or know how to fix the above error?