How to Install OpenSSH SFTP server on Windows 10

If you need to transfer files securely between a Windows machine and a remote server or other Windows device, then you should consider installing the OpenSSH SFTP server on your Windows computer. The following tutorial will guide you through the process of installing and configuring the OpenSSH SFTP server on your Windows 10 machine.

Pre-requisites

  1. A Windows 10 machine with administrative privileges
  2. An internet connection
  3. A text editor such as Notepad++

Steps

1. Download the OpenSSH installation package

The first thing you need to do is download the OpenSSH installation package from the official website. You can download the package using the following link: https://github.com/PowerShell/Win32-OpenSSH/releases/

2. Unzip the package

Once you have downloaded the ZIP file, you need to extract the contents of the ZIP file to a folder on your computer.

3. Install OpenSSH

Open a PowerShell window with administrative privileges and navigate to the folder where you unzipped the OpenSSH package.

Run the following command to initiate the installation process:

Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0

Press Enter.

After the installation is successful, run the following command to verify that the installation has completed successfully:

ssh -V

You should see the version of OpenSSH that you installed listed in the output.

4. Configure OpenSSH

The next step is to configure OpenSSH on your Windows 10 machine.

  1. Open the sshd_config file located in the C:\ProgramData\ssh folder.

  2. Uncomment the following lines by removing the # symbol at the beginning of each line:

    #Subsystem sftp /usr/libexec/sftp-server
    Subsystem sftp internal-sftp
    
  3. Add the following lines to the bottom of the sshd_config file:

    Match User your-username
    ForceCommand internal-sftp
    ChrootDirectory %h
    X11Forwarding no
    AllowTcpForwarding no
    

    Note: Replace your-username with your actual Windows username.

  4. Save the changes made to the sshd_config file.

5. Restart OpenSSH service

To apply the changes made to the sshd_config file, you must restart the OpenSSH service. Open a PowerShell window with administrative privileges and run the following command:

Restart-Service sshd

6. Connect to the OpenSSH SFTP server

You can connect to the OpenSSH SFTP server using an SFTP client such as FileZilla or WinSCP. Use the following settings to connect:

  1. Server: Your Windows 10 IP address
  2. Port: 22
  3. Username: Your Windows 10 username
  4. Password: Your Windows 10 password

Conclusion

OpenSSH SFTP server is an excellent choice for secure file transfer between Windows machines. By following the above steps, you should now have a working OpenSSH SFTP server running on your Windows 10 machine.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!