Win32-OpenSSH icon indicating copy to clipboard operation
Win32-OpenSSH copied to clipboard

Chroot %u token not working.

Open todag opened this issue 6 years ago • 2 comments

Server 2019 OpenSSH 8.1.0.0

Is the %u token not supported on Windows?

I have a domain joined sftp server and would like to chroot my domain users to their home directory which is "x:\home\username"

"ChrootDirectory x:\home" works, but "ChrootDirectory x:\home\%u" does not and immediately disconnects.

todag avatar Jan 16 '20 13:01 todag

OpenSSH for Windows: 8.1.0.0 Server OperatingSystem: Windows Server 2016 Standard

We are having the same issue for domain accounts. Any news here? Is there a description somewhere of how %u is expanded when a user logs in with user@domain or domain\user?

lars-nystrom-mio avatar Mar 31 '20 09:03 lars-nystrom-mio

I started to look into the code and figured out a workaround (or maybe this is expected?):

For example, with this setting: ChrootDirectory D:\sftp\%u

The result when user@domain logs in is that it tries to access this folder: D:\sftp\domain\user

As for now this works fine for us.

lars-nystrom-mio avatar Mar 31 '20 11:03 lars-nystrom-mio