Set up an SFTP server in Windows using OpenSSH

Page updated :

Operating environment

Windows
  • Windows 10 Pro
  • Windows Server 2019
  • More Windows
Openssh
  • 7.7p1
  • 8.1p1 - Beta

※ Works in other versions, but is unconfirmed

At first

SFTP is a mechanism for sending and receiving files between two PCs , usually divided into clients and servers.

This standard is commonly referred to as "FTP", but FTP sends and receives the contents of the transmission and reception in plain text (unencrypted data). It may be read easily by a third party.

SFTP uses an encryption technique called SSH to encrypt the contents of ftp sending and receiving Can be difficult to read by a third party.

This section provides step-by-step instructions on how to use the free OpenSSH to set up the Server side of SFTP.

Windows 10, OpenSSH server installation instructions for Windows Server 2019 and later

Windows 10 provides a mechanism for installing openSSH servers easily.

Open Settings from the Start menu.

image

Select Apps.

image

Select Options from Apps and Features.

image

Select Add Feature.

image

Select Install from the OpenSSH server.

image

The item disappears, so you go back to the previous screen.

image

The OpenSSH server is installed.

image

Once added to the list, you're done.

image

OpenSSH server installation instructions on other Windows OS

Download and file placement

OpenSSH version of Windows is available, so download and set it up.

Download the file from the following page: For 32-bit OS, download "OpenSSH-Win32.zip" for 32-bit OS or "OpenSSH-Win64.zip" for 32-bit OS. You can use the latest versions, but at the moment they are all Beta versions.

image

Log in to the server and place the downloaded and deployed files on the server. The location is anywhere, but this time we have created a "C:\OpenSSH" folder and placed it there.

image

Environment variables

Register environment variables to make OpenSSH easier to work with. As described in Windows Server 2012 R2, the instructions are tailored to the os version.

Right-click the Start menu and select System.

image

Select Advanced System Settings.

image

From the Advanced tab, click the Environment Variables button.

image

In the System Environment Variables, select Path and click the Edit button.

image

At the very end of the variable value is "; (Semicolon), followed by the path of the folder where you placed the OpenSSH file. When you enter it, you will close everything with the "OK" button.

image

Setting up the OpenSSH service

Start PowerShell with administrative rights.

image

Navigate to the OpenSSH folder with the cd command and type .\install-sshd.ps1 to run it.

image

If "SUCCESS" is displayed, it is OK.

image

You can verify that the OpenSSH-related service has been configured.

image

You can now set up in much the same way that you installed OpenSSH on Windows 10. Next time, I'd like to actually set up SFTP and send and receive files.