Set a user's home directory from the Terminal

Aug 31, '02 05:48:10AM

Contributed by: Anonymous

You can change a user's login directory from the command line using niutil. This is very helpful if you want to chroot users to their webserving directories under /Library/WebServer/Documents.

sudo niutil -createprop . /users/shortname home \
/Library/WebServer/Documents/shortname
Replace shortname with the user's shortname, and you should be done.

[Editor's note: I added the backslash to narrow the displayed command's width. If you enter this as one line, you do NOT need the backslash! Note that I haven't test this hint myself, but it should work as described based on niload's man page.]

Comments (1)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20020831054810804