Please refer to the following steps to setup SFTP on Windows Server 2016.
- At first, Download OpenSSH-Win64.zip from https://github.com/PowerShell/Win32-OpenSSH/releases
- Create a folder called OpenSSH-Win64 at location C:\Program Files (x86) and extract the downloaded file into it.
- Right-click and open the command prompt with admin credentials and run the below command.
powershell.exe -file ”C:\Program Files (x86)\OpenSSH-Win64\install-sshd.ps1”
- Go to the services.msc >> Find OpenSSH Authentication Agent and OpenSSH SSH Server.
- Start both the service and change startup type from Manual to Automatic.
- Go to the path C:\ProgramData\ssh and open the sshd_config file, change the root directory to your path where you want to upload your files using SFTP.
- Create a user to login for FTP. Please refer to Create User > Windows 2016 to create a user.
- Provide the Read/Write folder permission to a newly created user and click on the OK button.
- Open your favorite FTP client. Here, we have used a Filezilla FTP client.
- Click on Site Manager and enter the below details and click on the connect button.
- Host : Enter Server IP Address.
- Port : 22.
- Protocol, SFTP- SSH File transfer.
- User : Enter Newly Created User.
- Password : User Password.
- If there is a message that says Directory listing of "/" successful, it means FTP is working fine.