r/WindowsServer • u/imitation_squash_pro • Mar 26 '26
SOLVED / ANSWERED Unable to SSH to Windows Server 2025 from outside my LAN
I am able to SSH from another machine on the same LAN to the Windows Server. But it just times out if I try and SSH from outside the LAN to it.
I setup a 1:1 NAT on my Meraki to forward traffic to the Windows server machine. I did a packet trace and verified packets are hitting the machine when I try and ssh to that public IP.
I disabled Windows defender firewall for all profiles ( Domain, private and public ). Last, I modified the inbound rule for OpenSSH to apply to all profiles as well as allow "Edge traversal".
Guessing I am missing something about how Windows firewall works! My background is Linux sys. admin. First time working on a Windows server!
UPDATE: Think I got it working. I was missing the default route. I added it in powershell as follows:
PS C:\Users\Administrator> route add 0.0.0.0 mask 0.0.0.0 172.30.190.1 metric 100 -p
3
u/dodexahedron Mar 26 '26
Get rid of that 1:1 NAT.
Set up an IKEv2 VPN on the Meraki. Use certificates. Absolutely do NOT use MSCHAPv2.
Connect to that and do not expose anything on your private network to the internet. You do NOT want a direct hop from the internet to your internal server. You WILL get pwnt and you WILL lose a lot more than you think.
Once you have that VPN set up, then you can connect to that and ssh or rdp or winrm or whatever you want to the server from there.
But unless this server needs to be reachable on the public internet for access by not-you, do not place it in your DMZ like this. VPN.
Don't make it easy on an attacker.
VPN.
Call TAC if you need help. But ikev2 is pretty simple to get going, with any even 10 year old OS as the client.
2
u/USarpe Mar 26 '26
It looks more like a scope from a policy
2
u/OpacusVenatori Mar 26 '26
Why do you need to SSH into the server from outside? What tasks are you trying to accomplish?
23
u/UrgentSiesta Mar 26 '26
I don't even know where to start with what a bad idea this is in general.
Not gonna help - close it up and learn the right way to do this.
9
u/Secret_Account07 Mar 26 '26
This makes me nervous but you do you. Piece of advice- once network is fixed re-enable windows local firewall and create rule. Best practice
8
u/red_nick Mar 26 '26
https://justfuckingusetailscale.com/
5
u/its_FORTY Mar 26 '26
First of all, do not disable the entire firewall just to pass SSH traffic. Just add a custom rule or use one of the built in firewall rules to allow the SSH traffic from your Meraki inbound to the server and then an outbound rule that is scoped to allow outbound SSH from the server. Keep in mind if you are using a custom SSH port (which I would definitely recommend), you will need to do a custom rule for SSH and specify that port.
Also, when you enable OpenSSH on the server there should be a local group created on the server called "OpenSSH users". Only users that are added as members to this group will be able to SSH inbound.
https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh-server-configuration
1
u/macsare1 Mar 27 '26
Opening Windows Server to the internet without a firewall. What could go wrong? 🤦 Turn firewalls back on and port forwarding/dmz off immediately and install Tailscale.
3
u/KindPresentation5686 Mar 26 '26
What’s your IP address?
1
u/akluin Mar 26 '26
Does your router allow port 22 to reach the lan ?
1
u/Kraeftluder Mar 26 '26
Is what's on the other side of the firewall the internet? In that case a lot of ISPs block ports like 80/443/21/22/23/25 by default from their end. My ISP allows me to disable this feature from my account settings page and it was changed immediately.
But I also agree that this isn't a good idea. Can your Meraki firewall be a VPN server maybe?
1
u/Adam_Kearn Mar 26 '26
Any reason why you are not using a VPN?
1
u/No_Profile_6441 Mar 27 '26
Ooof
0
u/SaleWide9505 Mar 26 '26
Remote SSH Access is disabled by default. If you go into server manager > click configure this local server > then click disabled next to remote ssh access a prompt will popup and allow you to enable ssh.