I'm trying to set up SFTP's home directory on a MAC OS X Mavericks for user my_user. Now, it looks like:
/Users/my_user
(i got it with sftp> pwd command)
but I want it be:
/Users/my_user/Documents/new/dirs
How can I do this?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityYou didn't specify if you want to change actual home directory of user or starting directory of sftp
. The first is not a good idea to change, but you can certainly do that using your user settings.
The start directory of your user can be set up in sshd_config
, where you define sftp
subsystem, like this (path on Mac will be probably different):
Subsystem sftp /usr/libexec/openssh/sftp-server
By adding -d start_directory
option to this line you are able to change starting directory as described in manual page:
-d start_directory
specifies an alternate starting directory for users. The pathname may contain the following tokens that are expanded at runtime: %% is replaced by a literal '%', %d is replaced by the home directory of the user being authenticated, and %u is replaced by the username of that user. The default is to use the user's home directory. [...]