"Connection timed out" usually indicates some firewall is blocking the connection. Assuming your VPN provides an unrestricted network path between the PCs, it might be located:
- on your local system (but if you have added
putty.exe
to firewall exceptions, this should not be the problem)
- on the remote system (note that on the remote system, you must allow the SSH server process, not
putty.exe
- PuTTY is just a client)
Windows systems also won't necessarily include a SSH server by default: in PowerShell, run:
Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH.Server*'
to see if a SSH server is installed, and
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
to install it if necessary.
After installing the SSH server, you must also start it and configure it to start automatically at boot. That can be done with these PowerShell commands:
Start-Service sshd
Set-Service -Name sshd -StartupType 'Automatic'
Here's a PowerShell snippet for configuring Windows Firewall to accept incoming SSH connections (you may need to run this on the remote PC):
if (!(Get-NetFirewallRule -Name "OpenSSH-Server-In-TCP" -ErrorAction SilentlyContinue | Select-Object Name, Enabled)) {
Write-Output "Firewall Rule 'OpenSSH-Server-In-TCP' does not exist, creating it..."
New-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
} else {
Write-Output "Firewall rule 'OpenSSH-Server-In-TCP' has been created and exists."
}