1

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?

1 Answer 1

1

You 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. [...]

1
  • Thank you for your answer!) sshd_config on a MAC OS X is located here: /private/etc/httpd_config.
    – neo
    Mar 4, 2016 at 11:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .