sftp by OpenSSH server on windows 10 wouldn't be able to access another drive.

Junseo Park 20 Reputation points
2024-01-29T23:33:23.2533333+00:00

https://answers.microsoft.com/en-us/windowsclient/forum/all/sftp-by-openssh-server-on-windows-10-doesnt-work/8df305c6-c4df-4e0a-ac64-1055979c2da4 I asked a question on somewhere else and they told me to come here and ask questions, so here i am. haha hi! Basically I was told that OpenSSH doesn't really work on multiple drives But that's strange, because it used to work just a few days ago in my old windows OS on my system before i set up a new windows OS this weekend. I set it up so that the chroot directory is on e-drive and created a symbolic link to access another folder in s-drive to make it work. But the openSSH on the new system wouldn't be able access contents from the s-drive but only from the e-drive. Although, this new windows system became uefi/gpt instead of the bios/mbr. probably that was the reason why OpenSSH stopped working on multiple drives. Anyways, does anybody know how to make this OpenSSH from the windows 10 work on multiple drives? or should I have multiple sftp servers for each drive? or another SSH server from a third party would work the way I want it? It's been only 3 days and I already dont like gpt... maybe i should've stayed with mbr......................

Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} votes

Accepted answer
  1. MotoX80 36,401 Reputation points
    2024-01-31T15:31:36.7966667+00:00

    Got it. The ChrootDirectory statement is jailing the user to just that drive/folder.

    I defined 3 user accounts to test with. Here are the relevant sshd_config statements.

    # Authentication:
    Allowusers testuser*
    
    # ForceCommand internal-sftp 
    Subsystem	sftp	sftp-server.exe
    
    
    Match user testuser2
           ChrootDirectory e:/
    Match user testuser3
           ChrootDirectory C:/Temp
    
    
    

    Here is the first user. It sees all of the drives and can access files in e:\Data. Note the directory names. User's image

    The second user is jailed to the E: drive. User's image

    The 3rd user is jailed to c:\temp. User's image

    If you only want to have one user, then remove the chroot for it. If you need to jail the sftp accounts, then you will need 2 user accounts, one for E drive and one for the S drive. https://www.bing.com/search?q=sshd_config+ChrootDirectory+jail+windows

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. MotoX80 36,401 Reputation points
    2024-01-30T02:32:48.87+00:00

    created a symbolic link to access another folder in s-drive to make it work. But the openSSH on the new system wouldn't be able access contents from the s-drive

    What error do you get? Did you check the NTFS permissions?

    This worked for me on my E drive (ChrootDirectory) to access the temp folder on C.

    mklink /d CTemp c:\temp
    

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.