How can I set a user's home directory on Mac OS X Server using the command line?
MacOS – Setting a user’s home directory on Mac OS X (Server) from the command line
command linemacososx-server
command linemacososx-server
How can I set a user's home directory on Mac OS X Server using the command line?
Best Answer
As you asked how to do it from the command line, I take you can open a SSH session for the Mac OS X server, or you can open a terminal window directly from the server.
If this is the case, then execute the following command:
sudo dscl . -change /Users/<username> NFSHomeDirectory <old-path> <new-path>
; replace<username>
,<old-path>
, and<new-path>
with, respectively, the user name, the old home directory, and the new home directory. The command-change
requires the old value of the key being changed; if you don't know the old value, then you cannot do anything.If you are not using any SSH session, or you cannot open a terminal window in the Mac OS X, but you can still access the server from another Mac, then the command is a little different. The dot after
sudo dscl
is the datasource is described in the (dscl(1) Mac OS X Manual Page) as the following:References
man dscl
)