Command Line Create Home Folder Structure for User in Catalina.

nap
New Contributor

[Remote MacOS Catalina machine accessed via SSH]

Hi, I've created a new user via the command line (SSH), and though the new user is able to log in, the user's home directory has no pre-defined folders (as is the case for users added via the GUI).

So, I've tried using sudo /usr/sbin/createhomedir -c -u UserName but that didn't do anything.

Can someone please help me with the right command to do this? Thanks.

3 REPLIES 3

sdagley
Esteemed Contributor II

@nap How did you create the user account? sysadminctl is the preferred tool these days (unless you're dealing with something older than Sierra), or you could use the createAccount option with the jamf binary.

yjian
New Contributor III

Hi, this is the command i used.

sudo sysadminctl -addUser admin -fullName "Admin" -password password -home /Users/admin -shell /bin/zsh -admin

yjian
New Contributor III

Hi, I used the following:

sudo sysadminctl -addUser admin -fullName "Admin" -password password -home /Users/admin -shell /bin/zsh -admin