Windows Server & RDP8 min read•Last updated: •By SkyRain Cloud Team

How to Set Up an SFTP Server on Windows Server with OpenSSH

Copying files to a Windows server over Remote Desktop works for the occasional document, but it is slow for large uploads and awkward to automate. An SFTP server on Windows solves that: staff, scripts and partners can transfer files securely with tools like WinSCP or FileZilla, without a desktop session and without sending passwords in plain text the way old FTP does.

Windows Server ships with Microsoft's port of OpenSSH, so you do not need third-party software. This guide installs it, opens the firewall, creates SFTP-only accounts locked to a single folder, sets up key-based login and connects from common clients.

Quick answer

On Windows Server 2019 or 2022, install OpenSSH with Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 (Windows Server 2025 includes it already), then start the sshd service and set it to start automatically. SFTP works immediately for any Windows account. To restrict users to file transfer in one folder, add a Match Group block with ForceCommand internal-sftp and ChrootDirectory to C:\ProgramData\ssh\sshd_config and restart the service.

Why SFTP instead of FTP or RDP file copy

MethodEncrypted?Good forDrawbacks
RDP clipboard or drive redirectionYesOccasional small filesNeeds a desktop session; slow for large transfers; hard to script
FTPNoLegacy systems onlyPasswords and data travel in plain text
FTPS (FTP over TLS)YesSystems that require FTPNeeds extra ports and a certificate; firewall-unfriendly
SFTP (over SSH)YesUploads, backups, partners, automationClients need SFTP support (nearly all do)

SFTP uses a single port (22 by default), encrypts everything, and supports both passwords and SSH keys. That makes it the simplest secure choice for most file exchange.

SFTP server on Windows – SkyRain Cloud servers in India

Step 1: Install the SFTP server on Windows (OpenSSH Server)

Open PowerShell as Administrator. Check whether the server component is present:

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

If its state is NotPresent, install it (Windows Server 2019 and 2022):

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

Then start the service and make it start at boot:

Start-Service sshd
Set-Service -Name sshd -StartupType Automatic

Installation normally creates a firewall rule named OpenSSH-Server-In-TCP. Confirm it exists and is enabled:

Get-NetFirewallRule -Name *OpenSSH-Server* | Format-Table Name, Enabled

If it is missing, create it, ideally restricted to the IP addresses that will connect:

New-NetFirewallRule -Name sshd -DisplayName "OpenSSH Server (sshd)" -Direction Inbound -Protocol TCP -LocalPort 22 -Action Allow

Microsoft documents these steps in Get started with OpenSSH for Windows.

Step 2: Test a connection

From another computer, connect with any Windows account on the server:

sftp username@203.0.113.25

After the password prompt you get an sftp> prompt where ls, put file.zip and get report.xlsx work. Graphical users can use WinSCP or FileZilla: choose the SFTP protocol, port 22, and the same username and password.

Step 3: Create SFTP-only users locked to one folder

By default, an SFTP user can also open an SSH command shell and browse anything their Windows account can read. For partners, clients or upload scripts, restrict them to file transfer inside one folder.

Create a group, a user and the folder

New-LocalGroup -Name "sftpusers"
$pw = Read-Host -AsSecureString "Password for partner1"
New-LocalUser -Name "partner1" -Password $pw -PasswordNeverExpires
Add-LocalGroupMember -Group "sftpusers" -Member "partner1"
New-Item -ItemType Directory -Path "D:\sftp\partner1\upload"
icacls "D:\sftp\partner1\upload" /grant "partner1:(OI)(CI)M"

Do not add these accounts to Remote Desktop Users. They only need SFTP. If several staff also need full desktop sessions, plan those separately; see multiple RDP sessions on a Windows VPS.

Edit sshd_config

Open C:\ProgramData\ssh\sshd_config in Notepad as Administrator and add at the end:

Match Group sftpusers
    ChrootDirectory D:\sftp\%u
    ForceCommand internal-sftp
    AllowTcpForwarding no
    PermitTTY no

%u becomes the username, so each partner lands in their own folder and cannot browse above it. ForceCommand internal-sftp blocks shell access. Restart the service to apply:

Restart-Service sshd

The Windows port of OpenSSH supports ChrootDirectory for SFTP sessions only, which is exactly this use case.

Step 4: Use SSH keys instead of passwords

Keys are safer than passwords and let scripts log in without storing a password. Generate a key pair on the client (ssh-keygen -t ed25519) and place the public key on the server:

  • Standard users: in C:\Users\username\.ssh\authorized_keys.
  • Administrators: in C:\ProgramData\ssh\administrators_authorized_keys, not the user folder. That file must be readable only by Administrators and SYSTEM:
icacls C:\ProgramData\ssh\administrators_authorized_keys /inheritance:r /grant "Administrators:F" /grant "SYSTEM:F"

Once keys work, you can disable password logins by setting PasswordAuthentication no in sshd_config and restarting sshd. Test a key login in a second window before closing your current session.

Step 5: Harden the SFTP server

  • Restrict by IP in the firewall rule with -RemoteAddress if partners have fixed addresses.
  • Change the port by editing Port 22 in sshd_config, adding a matching firewall rule and restarting the service. As with RDP, this reduces noise rather than stopping attacks; see our guide to changing the RDP port for the same safe order.
  • Use strong, unique passwords for any account that still uses them, and review accounts regularly. Our guide to changing the Administrator password also covers what to update after a password change.
  • Keep OpenSSH updated through Windows Update.
  • Check logs in Event Viewer under Applications and Services Logs → OpenSSH → Operational.

The rest of the server needs the same care. Our RDP security guide covers account lockout, updates and monitoring.

Troubleshooting

ProblemCheck
Connection times outFirewall rule enabled; Get-Service sshd shows Running; provider firewall allows the port
Permission denied with a correct passwordAccount is enabled and not locked; it is not blocked by DenyUsers or AllowGroups
Key login fails for an administratorKey is in administrators_authorized_keys with the strict permissions above
Chrooted user sees an empty folder or cannot uploadThe user needs modify rights on the subfolder; path in ChrootDirectory matches
Changes have no effectService not restarted, or the Match block is above other settings it should follow

Why teams run Windows on SkyRain Cloud

A file server is only as reliable as the machine behind it. SkyRain Cloud Windows plans give you:

  • Windows Server ready to use. Plans come with Windows Server pre-installed and activated, so you log in over RDP and start working.
  • Full Administrator access. Install your own software, change the RDP port, create users and set firewall rules yourself.
  • Resources that are yours. Each plan is a private virtual machine with its own vCores, RAM and disk, not a shared terminal-server account.
  • Indian locations, Indian latency. Servers sit in India, so a remote desktop session from Mumbai, Delhi or Bengaluru feels responsive.
  • Unmetered 1 Gbps port. Updates, file transfers and browser work are not capped by a monthly data allowance.
  • Simple billing and real support. Monthly billing in rupees with UPI, net banking and cards, plus 24/7 tickets, WhatsApp and Discord.

Frequently Asked Questions

Does Windows Server have a built-in SFTP server?
Yes. Windows Server includes Microsoft's OpenSSH Server, which provides SFTP. It is an optional feature on Windows Server 2019 and 2022 and included with Windows Server 2025.
What port does SFTP use?
SFTP runs over SSH on TCP port 22 by default. You can change it with the Port setting in sshd_config and a matching firewall rule.
How do I restrict an SFTP user to one folder on Windows?
Add a Match User or Match Group block to C:\ProgramData\ssh\sshd_config with ChrootDirectory set to the folder and ForceCommand internal-sftp, then restart the sshd service.
Is SFTP the same as FTPS?
No. SFTP is a file-transfer protocol that runs over SSH on one port. FTPS is the older FTP protocol wrapped in TLS, which needs extra ports and a certificate.
Which client should I use to connect?
WinSCP and FileZilla are popular graphical clients. The sftp command built into Windows 10, Windows 11, macOS and Linux also works.
Where do SSH keys go for administrator accounts on Windows?
In C:\ProgramData\ssh\administrators_authorized_keys, readable only by Administrators and SYSTEM, not in the user's own .ssh folder.

Conclusion

Windows Server already contains everything you need for a secure SFTP server. Install OpenSSH Server, start sshd, check the firewall, and create SFTP-only groups with internal-sftp and ChrootDirectory for anyone who should only transfer files. Move to SSH keys, restrict by IP where you can, and you have a file-transfer service that is safer than FTP and easier than copying over RDP.

For a Windows server in India with full Administrator access, see our Windows RDP plans.

SkyRain Cloud Windows RDP Plans

Windows RDP servers in India with full Administrator access and a 1 Gbps unmetered uplink.

PlanvCoresRAMStorageNetworkPriceGood forBuy
RDP Plan 148 GB DDR460 GB Enterprise Disk1 Gbps, unmetered₹999/monthData entry, virtual assistants, one MetaTrader terminalOrder
RDP Plan 2616 GB DDR480 GB Enterprise Disk1 Gbps, unmetered₹1,799/monthTally Prime for small teams, several browser profiles or terminalsOrder
RDP Plan 3824 GB DDR4120 GB Enterprise Disk1 Gbps, unmetered₹2,499/monthMulti-user remote work, automation and SEO toolsOrder
RDP Plan 41232 GB DDR4160 GB Enterprise Disk1 Gbps, unmetered₹3,499/monthRemote teams, large ERP datasets, many concurrent sessionsOrder

Prices are monthly in INR as listed on the SkyRain Cloud store (verified 2026-11-23). Live stock and final price are shown at checkout.

Instant UPI • ₹649/mo
Fast KVM Cloud Provisioning