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
scpand 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).- Server Manager
- PowerShell
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
Online : True and RestartNeeded : False.3
Start sshd and set it to start automatically
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 ruleOpenSSH-Server-In-TCP for inbound TCP port 22. This command, from Microsoft’s documentation, checks for it and creates it if it’s missing:
How to connect
From Windows 10/11, macOS or Linux: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 valueDefaultShell under HKLM:\SOFTWARE\OpenSSH (Microsoft Learn):
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:
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, useAllowUsers 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?
Can I change the SSH port on Windows?
Yes, with aPort 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.
Related guides
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:- Live Chat: Quick assistance via our website.
- Support Ticket: Open a Ticket
- Discord: Join our Community
- Email: support@freakhosting.com
Last Updated: November 2026