SFTP issue and cannot find out the path

Jonathan 400 Reputation points
2026-09-04T02:09:37.2166667+00:00

Hi,

I have the SFTP issue on the client to link to Server 2022. How to fix it and find out the path below?

User's image

Windows for business | Windows Server | Networking | Network connectivity and file sharing

2 answers

Sort by: Most helpful
  1. Daphne Huynh (WICLOUD CORPORATION) 1,735 Reputation points Microsoft External Staff Moderator
    2026-09-07T02:40:30.4+00:00

    Welcome to Microsoft Q&A!

    Thank you for taking the time to test the suggestions and share the screenshot.

    Based on the error shown in the screenshot, the issue occurs because: Subsystem sftp sftp-server.exe

    Is not a PowerShell command. It is a configuration entry that belongs in the OpenSSH server configuration file (sshd_config). When this line is executed directly in PowerShell, Windows returns the following error because it attempts to interpret Subsystem as a command: Subsystem : The term 'Subsystem' is not recognized...

    For OpenSSH on Windows Server 2022, the default SSH server configuration file is located at:

    C:\ProgramData\ssh\sshd_config

    Note: The ProgramData folder is hidden by default. You may need to enable Show hidden items in File Explorer to browse to this location.

    To verify the SFTP configuration, please follow these steps:

    1. Open Notepad or another text editor as Administrator.
    2. Open the file: C:\ProgramData\ssh\sshd_config
    3. Locate the SFTP subsystem entry. By default, it should appear similar to: Subsystem sftp sftp-server.exe
    4. Validate the OpenSSH configuration: sshd -t
    5. If no errors are reported, restart the OpenSSH service: Restart-Service sshd

    If sftp-server.exe cannot be found, please verify that the OpenSSH Server feature is installed:

    Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH.Server*'

    The default OpenSSH installation location is: C:\Windows\System32\OpenSSH\

    You can confirm that the SFTP executable exists by running: Get-ChildItem C:\Windows\System32\OpenSSH\sftp-server.exe

    For additional troubleshooting, I recommend reviewing Event Viewer for any OpenSSH-related errors and validating the configuration after making any changes. Also, enabling OpenSSH logging can also help identify the root cause of SFTP connection failures.

    For more information, please visit: OpenSSH Server Configuration for Windows | Microsoft Learn

    Troubleshoot Common SFTP Issues - Windows Server | Microsoft Learn

    Get started with OpenSSH Server for Windows | Microsoft Learn

    If you find the information helpful, please consider clicking Accept Answer.

    Thank you for using Microsoft Q&A.

    Was this answer helpful?

    0 comments No comments

  2. AI answer

    2026-09-04T02:09:54.1666667+00:00

    For OpenSSH SFTP on Windows Server 2022, the main configuration file path is:

    %ProgramData%\ssh\sshd_config

    ProgramData is a hidden folder, so the full default path is:

    C:\ProgramData\ssh\sshd_config

    To troubleshoot the SFTP issue:

    1. Open C:\ProgramData\ssh\sshd_config with an administrator account.
    2. Validate the configuration by running:
         sshd -t
      
    3. Check that the file has no trailing spaces and that this entry is present:
         Subsystem sftp sftp-server.exe
      
    4. If SFTP users are expected to be restricted to a folder, verify that ChrootDirectory points to a local directory, not a UNC path.
    5. Check NTFS permissions on the chroot directory and user-writable folders. Use icacls from an elevated Command Prompt to verify and fix ACLs.
    6. Review Event Viewer for related OpenSSH errors.
    7. After any change, restart the OpenSSH Server service.

    If logs are needed, SFTP log data is stored in:

    %ProgramData%\ssh\logs

    To enable SFTP logging in sshd_config, set:

    SyslogFacility LOCAL0
    LogLevel DEBUG3
    Subsystem sftp sftp-server.exe -f LOCAL0 -l DEBUG3
    

    Then restart the service with:

    NET STOP "OpenSSH SSH Server" && NET START "OpenSSH SSH Server"
    

    If the service does not start or SFTP connections hang even after correcting the configuration and permissions, uninstall and reinstall OpenSSH Server.


    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

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