Save 10%Pay yearly on any plan. 6% half-yearly, 3% quarterly. Help centreWhatsAppTelegram TeamsOpen a ticket

How to Install an SSH Server on a Windows VPS

Windows Server includes OpenSSH. Install the server feature with one command, start it, open the firewall, connect, set PowerShell as the shell and add key login.

2 min readBy Swati

Reviewed by the AmazingRDP technical team

Installing an SSH server on a Windows VPS

Need a Windows server you can script over SSH? A Windows VPS gives you full admin access. See Windows VPS from $8.99

SSH gives you a command line on a remote machine and secure file transfer, and it is the standard way to automate servers. Windows has had its own OpenSSH server for years, as an optional feature of Windows Server 2019 and later and of Windows 10 and 11. There is nothing to download from other sites.

1. Install

Open PowerShell as administrator:

Get-WindowsCapability -Online | Where-Object Name -like "OpenSSH*"
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0

The first line shows whether client and server are present; the second installs the server. On Windows Server 2025 it is installed already and only needs starting. The same can be done by mouse under Settings, Optional features, Add a feature.

2. Start it, now and at every boot

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

3. Check the firewall

The installation creates a firewall rule for port 22. Confirm it, and create it if it is missing:

Get-NetFirewallRule -Name *OpenSSH-Server* | Select-Object Name, Enabled
New-NetFirewallRule -Name sshd -DisplayName "OpenSSH Server" -Direction Inbound -Protocol TCP -LocalPort 22 -Action Allow

If only you will connect, limit the rule to your own address by adding -RemoteAddress 203.0.113.10. More in enable a port through PowerShell.

4. Connect

From any computer with an SSH client (built into Windows, macOS and Linux):

ssh Administrator@203.0.113.10

Use the server's address and a Windows user name and password. You land in a command prompt on the server.

5. Make PowerShell the shell

By default SSH opens the old command prompt. To get PowerShell:

New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -PropertyType String -Force

6. Log in with a key

Keys are safer than passwords and needed for automation. On your own computer, create one if you have none: ssh-keygen -t ed25519. Then, on the server, put the public key in the right file:

Account typeFile
A normal userC:\Users\name\.ssh\authorized_keys
A member of AdministratorsC:\ProgramData\ssh\administrators_authorized_keys

The second file is the one people miss: for administrator accounts Windows ignores the file in the user's folder. It must also be readable only by Administrators and SYSTEM:

icacls C:\ProgramData\ssh\administrators_authorized_keys /inheritance:r /grant "Administrators:F" /grant "SYSTEM:F"

When key login works, you can switch passwords off: in C:\ProgramData\ssh\sshd_config set PasswordAuthentication no, then Restart-Service sshd. Keep your Remote Desktop session open while you test, so that a mistake does not lock you out.

Copy files

scp report.zip Administrator@203.0.113.10:C:/Users/Administrator/Desktop/
sftp Administrator@203.0.113.10

Graphical programs such as WinSCP use the same service: see our WinSCP guide.

If it does not work

  • Connection refused or timed out: the service is not running, or port 22 is blocked in Windows Firewall or at the provider.
  • Permission denied with a key: the key is in the wrong file for an administrator account, or the file's permissions are too open.
  • Details: Event Viewer, Applications and Services Logs, OpenSSH.

SSH or Remote Desktop?

They complement each other: Remote Desktop for the screen, SSH for scripts, quick commands and file copies. Both ports are tested by bots all day, so use strong passwords or keys and limit who can reach them. See our Windows VPS plans, and running .ps1 files with PowerShell.

Questions

Does Windows Server have an SSH server?

Yes. OpenSSH Server is an optional feature of Windows Server 2019 and later, and is installed by default on Windows Server 2025.

How do I install OpenSSH Server on Windows?

Run Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 in PowerShell as administrator, then start the sshd service.

Why does my SSH key not work for the Administrator account?

For administrators the key must be in C:\ProgramData\ssh\administrators_authorized_keys, with access for Administrators and SYSTEM only.

Which port does SSH use on Windows?

TCP port 22, as on other systems.