Enabling Remote Connection through FIrewall with Firewall diasbled

0

I'm running a dedicated server with Windows Server 2012 R2. Recently I locked myself out by Enabling Windows Firewall. No port rule was in place so the remote connection got blocked completely.

I had to order Firewall deactivation via the Serial Console (registry edit through Ubuntu) to be able to get in again. Right now Windows Firewall is disabled and I can only enable it by pushing the "Use recommended settings" button.

The problem is that I can't add a new In and OUT rule to the Firewall to enable Remote Connection without Enabling the Firewall again. I'm worried that if I enable it I'll be locked out again. Can't do it through PowerShell or netsh either because Firewall is disabled and cannot be edited.

Is there a way to add required rules in the registry or something so when I push that "Use recommended settings" button for the Firewall I'll not get disconnected and locked out?

Thanks.

Sybar

Posted 2016-06-25T21:38:51.050

Reputation: 1

Answers

0

To open the ports while the firewall is disabled start by making sure that the firewall service is enabled but not on. Now open up the Advanced Firewall snapin for MMC and select the Remote Desktop predefined rule for "In" only you DO NOT need outbound to remote in. Now select "Enable Rule" but when selecting the rules make sure not to select public unless your network connection is set this way. I have attached a picture for guidance.

FireWall

You should now be able to start the Firewall service and stay connected as well as establish new connections.

Hope this helps.

Charles Ludlow

Posted 2016-06-25T21:38:51.050

Reputation: 457

Thank you for your reply. Unfortunately after the Firewall got disabled through editing Registry via Ubuntu it now shows like this (http://prnt.sc/bo75db) in the 'Windows Firewall with Advanced Security. I'm not sure how I can edit any settings in its current state and I'm literally afraid to touch anything because I don't want to be locked out again.

– Sybar – 2016-07-03T11:01:19.247

As expected I enabled Windows Firewall in settings and it turned ON automatically. The effect is that I'm locked out again. Damn! – Sybar – 2016-07-03T11:51:11.830

I Enabled Windows Firewall in 'Services' and got locked out again. The weird thing is that after rebooting the server Firewall settings went back to 'Manual'. I can access my server again via Remote Desktop but the Firewall in Disabled again. Is it possible to prepare my dedicated server and client PC for a PowerShell connection so after enabling Firewall with default settings I'll still be able to edit the settings remotely using Power Shell? – Sybar – 2016-07-03T11:58:30.847

Are the computers in a domain or workgroup? – Charles Ludlow – 2016-07-03T19:47:41.297

Assuming a Domain config just run winrm quickconfig on the server and use valid domain admin credentials on the client and you should be set, a workgroup is a little more complex but I would be happy to provide instructions if needed. – Charles Ludlow – 2016-07-04T00:12:22.793