OpenSSHSSHSFTP6 min read

Configure OpenSSH on Windows Server

Enable OpenSSH on Windows Server for SSH access and SFTP file transfers.


OpenSSH lets you access your Windows VPS via command line and transfer files over SFTP, without needing RDP.

Step 1 — Install OpenSSH Server

powershell
# Check availability
Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'

# Install server
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0

# Install client (optional)
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0

Step 2 — Start and enable the service

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

# Verify
Get-Service sshd

Step 3 — Configure firewall

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

Step 4 — Configure key authentication

From your local machine, copy your public key:

powershell
scp ~/.ssh/id_ed25519.pub Administrator@YOUR_IP:C:\Users\Administrator\.ssh\authorized_keys

On the server, adjust permissions:

powershell
# For administrators, the key goes in a different file
Copy-Item C:\Users\Administrator\.ssh\authorized_keys C:\ProgramData\ssh\administrators_authorized_keys
icacls C:\ProgramData\ssh\administrators_authorized_keys /inheritance:r /grant "Administrators:F" /grant "SYSTEM:F"

Step 5 — Configure sshd_config

Edit C:\ProgramData\ssh\sshd_config:

powershell
notepad C:\ProgramData\ssh\sshd_config

Recommended options:

terminal
PubkeyAuthentication yes
PasswordAuthentication no
PermitRootLogin no
Subsystem sftp sftp-server.exe

Restart:

powershell
Restart-Service sshd

Step 6 — Connect via SSH

From your local machine:

bash
ssh Administrator@YOUR_IP

Step 7 — Use SFTP

bash
sftp Administrator@YOUR_IP
put file.txt C:\Users\Administrator\Desktop\
get C:\logs\app.log ./

Change default shell to PowerShell

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

OpenSSH on your Baires Host Windows VPS gives you remote terminal access without depending on RDP.


Was this guide helpful?