Skip to content

SSH, SFTP Not following user's home directory #154

Open
@TomGood75

Description

@TomGood75

Good afternoon,

  • I'm new to using OpenSSH, so possibly this is user error, but it seems ssh/sftp are not following the home directory of the windows user. From what I've found, ChrootDirectory is not applicable in Win32, and the user home must be used. I created a local user of 'test2', set the home directory (in user config) to \test2home, and restarted SSHD.

If I connect to server through ssh or sftp (using user/pass), the default/home directory is c:\users\test2.

  • within SSH echo %HOME% returns c:\Users\test2, and echo %HOMEPATH% returns \Users\test2

If I log into the server locally and opening a cmd prompt, the default directory/home directory is c:\test2home.

  • within local windows cmd window echo %HOME% returns %HOME% and echo %HOMEPATH% returns \test2home.
  • So it seems to me windows is correctly handling the home path which was set, but Win32-OpenSSH is not. Due to needing to lock a remote user access down to a single 'empty' folder for sftp only for file exchanges, I need to use a 'nonstandard' home folder.
  • This is being used on Win Server 2008 R2.
  • Any pointers if I'm doing something wrong, or correcting the issue would be great!

Thanks,
~Tim

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions