I'm exploring a custom worklet to create a new user.
So far this has been successful creating the user.
However when trying to login, the password does not work.
Please help if you think of a way around this.
sudo ddcl . -create /Users/automox
sudo dscl . -create /Users/automox UserShell /bin/bash
sudo dscl . -create /Users/automox RealName Automox
sudo dscl . -create /Users/automox UniqueID 9999
sudo dscl . -create /Users/automox NFSHomeDirectory /Local/Users/automox
sudo dscl . -passwd /Users/automox password123
sudo dscl . -append /Groups/admin GroupMembership automox
ps - Don’t use password123… I’m sure that goes without saying 🙂 Also there’s better ways to make users, but we’re trying to conjure this up for a specific use case.
great work here cfrieberg,
dsclis indeed the preferred method for creating user accounts on macOS. One limitation of that tools is that it does not create a user’s home folder. Based on the last line it seems like you want this account to have admin rights, so I fixed that below as well.
This is great! Thank you Tim.
I tested it out in a custom worklet, it successfully created a user account that I could log into.
I wonder if there’s a way to automate the account setup steps (siri, language, etc that come up after loggin in)
There are ways to force a password reset on next login, if that seems like a nice feature to add.