Skip to main content
To enable OpenSSH Server on Windows Server 2025, open Server Manager > Local Server and set Remote SSH Access to Enabled, or run Start-Service sshd and Set-Service -Name sshd -StartupType 'Automatic'. On Windows Server 2019 and 2022, install it first with Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0. The firewall rule OpenSSH-Server-In-TCP allows port 22, and you then connect with ssh alex@203.0.113.10.

Before you start

  • Sign in as an administrator with Remote Desktop.
  • Open PowerShell as administrator: select Start, type PowerShell, right-click Windows PowerShell and choose Run as administrator.
  • SSH (Secure Shell) gives you an encrypted command line on the server, the same way you manage Linux servers. It’s handy for scripts, file copies with scp and quick admin tasks without a full Remote Desktop session.

How to enable OpenSSH Server on Windows Server 2025

OpenSSH Server is installed by default on Windows Server 2025; you only need to turn it on (Microsoft Learn).
1

Open Local Server

In Server Manager, select Local Server in the left pane.
2

Turn on Remote SSH Access

In Properties, find Remote SSH Access and select Enabled.

How to install OpenSSH Server on Windows Server 2019 and 2022

1

Check whether it's available

State : NotPresent means it isn’t installed yet.
2

Install it

The output shows Online : True and RestartNeeded : False.
3

Start sshd and set it to start automatically

On Desktop Experience you can also install it from Start: type Optional Features, select Add an optional feature, then Add a feature and install OpenSSH Server.

How to check the firewall rule

Installing OpenSSH Server creates and enables the firewall rule OpenSSH-Server-In-TCP for inbound TCP port 22. This command, from Microsoft’s documentation, checks for it and creates it if it’s missing:
If you use the Firewall panel, allow TCP 22 there as well, ideally only from your own IP.
SSH on port 22 is scanned and attacked constantly, exactly like RDP. Use strong passwords or, better, SSH keys, and consider limiting the rule to your IP: Set-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' -RemoteAddress 198.51.100.25. Keep Remote Desktop or the VNC console working while you change SSH settings.

How to connect

From Windows 10/11, macOS or Linux:
Type yes the first time to trust the server’s key, then enter the Windows password for alex. By default you land in Command Prompt (cmd.exe); type powershell to switch.

How to make PowerShell the default SSH shell

The default shell is set in the registry value DefaultShell under HKLM:\SOFTWARE\OpenSSH (Microsoft Learn):
New SSH sessions now open in PowerShell.

How to log in with an SSH key

Where the public key goes depends on the account: For administrators, the file must only be accessible to Administrators and SYSTEM. After adding your public key, set the permissions:
See create and use SSH keys for making a key pair. Settings live in C:\ProgramData\ssh\sshd_config; restart the service with Restart-Service sshd after any change.

How to check it worked

sshd shows Running and port 22 shows a listening entry. Then connect from your own computer.

Frequently asked questions

How do I set it up on Server Core?

Use the PowerShell commands on this page there: they don’t need Server Manager or any other desktop tool.

Who can sign in over SSH?

By default, local accounts can sign in with their Windows password. To restrict access, use AllowUsers or AllowGroups in sshd_config. On Windows Server 2025 you can also add the allowed users to the OpenSSH Users group.

How do I turn SSH off again?

On Windows Server 2025 you can instead set Remote SSH Access to Disabled in Server Manager.

Can I change the SSH port on Windows?

Yes, with a Port line in C:\ProgramData\ssh\sshd_config. Allow the new port in Windows Firewall first, then restart sshd, and test before closing your current session. The same order is explained in change the SSH port.

VPS and dedicated server guides

Every guide in this section.

Create and use SSH keys

Safer than passwords.

Copy files with scp and rsync

Transfer files over SSH.

PowerShell on Windows Server

What to do once connected.

Open a port in Windows Firewall

Limit SSH to your IP.

Checked against Microsoft Learn: Get started with OpenSSH for Windows, OpenSSH server configuration, key-based authentication and What’s new in Windows Server 2025 on 4 November 2026. Not tested on a live Windows server for this page.

Need Extra Help?

If you encounter any issues, our support team is ready to assist:

Save on Your Hosting

Ready to upgrade your hosting? Use code KB20 at checkout for 20% off your first order!

Last Updated: November 2026