{"id":1636,"date":"2026-01-29T02:35:17","date_gmt":"2026-01-29T02:35:17","guid":{"rendered":"https:\/\/sailexhost.com\/blog\/?p=1636"},"modified":"2026-01-29T02:40:49","modified_gmt":"2026-01-29T02:40:49","slug":"how-to-protect-your-linux-and-windows-system-using-software-firewalls","status":"publish","type":"post","link":"https:\/\/sailexhost.com\/blog\/how-to-protect-your-linux-and-windows-system-using-software-firewalls\/","title":{"rendered":"How to Protect Your Linux and Windows System Using Software Firewalls"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"h-setting-up-a-basic-firewall-for-linux\">Setting up a Basic Firewall for Linux<\/h2>\n\n\n\n<p>By default SSH connections are normally established through Port 22 (TCP). The most advantage of using its default SSH-2 protocol (compared to VNC) is the encrypted connection of a AES algorithm along with a 128-bit key length. Thus, it is generally recommended to prefer using SSH instead of VNC!<\/p>\n\n\n\n<p>In Linux you should consider to use the onboard software package&nbsp;<strong>\u2018iptables\u2019<\/strong>, which comes with the initial installation on most distributions by default.<\/p>\n\n\n\n<p>There are two advantages of using&nbsp;<strong>iptable<\/strong>s: First of all the required software package is installed by default on most distributions of Linux. Furthermore it is compatible to any Linux distribution (Ubuntu, Debian, CentOS etc.) without restrictions. Feel also free to define&nbsp;<strong>IPv4<\/strong>&nbsp;and&nbsp;<strong>IPv6<\/strong>&nbsp;rules corresponding to your own needs.<\/p>\n\n\n\n<p>Before configuring our firewall there are no rules defined. To check this, use this command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>iptables -L<\/code><\/pre>\n\n\n\n<p>The output will look similar to this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"486\" height=\"218\" src=\"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/iptables-L.jpg.webp\" alt=\"\" class=\"wp-image-1638\" style=\"width:640px;height:auto\" srcset=\"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/iptables-L.jpg.webp 486w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/iptables-L.jpg-300x135.webp 300w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/iptables-L.jpg-400x179.webp 400w\" sizes=\"auto, (max-width: 486px) 100vw, 486px\" \/><\/figure>\n\n\n\n<p>As you can see, currently there are no rules defined. The Software-Firewall will not block anything.<\/p>\n\n\n\n<p>In order to add firewall rules, use the following syntax:<\/p>\n\n\n\n<p><strong>iptables<\/strong>&nbsp;&lt;ADD:&nbsp;<strong>-A<\/strong>&gt; | &lt;Chain:&nbsp;<strong>INPUT&nbsp;<\/strong>\/<strong>&nbsp;Output<\/strong>&gt; | &lt;Source\/Destination:&nbsp;<strong>-d&nbsp;<\/strong>\/<strong>&nbsp;-s<\/strong>&gt; | &lt;action:&nbsp;<strong>-j<\/strong>&gt; | &lt;Art:&nbsp;<strong>ACCEPT<\/strong>&gt;<\/p>\n\n\n\n<p>Here\u2019s an example of how to use the iptables command to allow incomming traffic at port 80<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em>iptables -A INPUT -p tcp --dport 80 -j ACCEPT<\/em><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-example-firewall-configuration-for-linux\">Example Firewall Configuration for Linux<\/h3>\n\n\n\n<p>Here is an example script which will open the most used ports on your Linux server:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\n\n # Delete the current firewall setup:\niptables -F\n\n # Define default rules for all chains:\niptables -P INPUT DROP\niptables -P FORWARD DROP\n\n # Allow incoming\/outgoing localhost frames for tests (e.g.  Webserver, Mailserver):\niptables -A INPUT -d 127.0.0.1 -j ACCEPT\niptables -A OUTPUT -s 127.0.0.1 -j ACCEPT\n\n # Allow loopback frames for the internal process management:\niptables -A INPUT -i lo -j ACCEPT\n\n # Allow incoming\/outgoing related-established connections:\niptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT\niptables -A OUTPUT -m state --state RELATED,ESTABLISHED -j ACCEPT\n\n # Allow incoming PING-Requests:\niptables -A INPUT -p icmp -j ACCEPT\n\n # Allow incoming SSH connections: \niptables -A INPUT -p tcp --dport 22 -j ACCEPT\n\n # Allow incoming HTTP\/HTTPS requests:\niptables -A INPUT -p tcp --dport 80 -j ACCEPT\niptables -A INPUT -p tcp --dport 443 -j ACCEPT\n\n # Allow incoming DNS requests:\niptables -A INPUT -p udp --dport 53 -j ACCEPT\niptables -A INPUT -p tcp --dport 53 -j ACCEPT<\/code><\/pre>\n\n\n\n<p>To use this script login to your Linux server as root and create a shellscript with this command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nano firewall.sh<\/code><\/pre>\n\n\n\n<p>Now paste in the content shown above.<\/p>\n\n\n\n<p>Save the file with&nbsp;<strong>[CTRL] + O<\/strong>&nbsp;and exit the editor with&nbsp;<strong>[CTRL] + X<\/strong>.<\/p>\n\n\n\n<p>Make the script executeable with this command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>chmod +x firewall.sh<\/code><\/pre>\n\n\n\n<p>To run the script and open the ports provided by the script, use the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.\/firewall.sh<\/code><\/pre>\n\n\n\n<p><em>Please check all&nbsp;<\/em><strong><em>port numbers<\/em><\/strong><em>&nbsp;corresponding to your own needs! If you need to change existing rules or to add further rules (e.g. Mail-Service or FTP), feel free to add them into the script.<\/em><\/p>\n\n\n\n<p>Once you have modified your bash script corresponding to your own needs, feel free to copy your firewall script into a regular text file and save the file as \u201cfirewall.sh\u201d. Afterwards, make the script executable and run it as shown earlier.<\/p>\n\n\n\n<p>If you are going to use our sample script, you should get the following output using the&nbsp;<strong>iptables -vL<\/strong>&nbsp;command:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"932\" height=\"441\" src=\"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/iptables-vL.jpg.webp\" alt=\"\" class=\"wp-image-1639\" srcset=\"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/iptables-vL.jpg.webp 932w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/iptables-vL.jpg-300x142.webp 300w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/iptables-vL.jpg-768x363.webp 768w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/iptables-vL.jpg-400x189.webp 400w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/iptables-vL.jpg-800x379.webp 800w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/iptables-vL.jpg-832x394.webp 832w\" sizes=\"auto, (max-width: 932px) 100vw, 932px\" \/><\/figure>\n\n\n\n<p>Please be generally informed, that all firewall rules will not be added permanently in this way! After a server reboot, every rule would have to be set manually again.<\/p>\n\n\n\n<p>Thus, in order to set them permanently, please run the following commands depending on your own OS:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-permanent-firewall-settings\">Permanent Firewall Settings<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-permanent-settings-for-centos-7-or-higher\">Permanent Settings for CentOS 7 or higher<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>yum install -y iptables-services\nsystemctl stop firewalld\nsystemctl mask firewalld\nsystemctl enable iptables.service\nsystemctl -t service | grep iptables\n\/usr\/libexec\/iptables\/iptables.init save <\/code><\/pre>\n\n\n\n<p>If you need to update your IPv4\/IPv6 firewall setup, please modify the following files:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/etc\/sysconfig\/iptables\n\/etc\/sysconfig\/ip6tables <\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-permanent-settings-for-debian-ubuntu\">Permanent Settings for Debian\/Ubuntu<\/h3>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>apt-get install iptables-persistent netfilter-persistent<\/p>\n<\/blockquote>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2019\/07\/Debian-FW-1024x144.jpg\" alt=\"How to Setup a Software-Firewall in Linux and Windows\" class=\"wp-image-5867\"\/><\/figure>\n\n\n\n<p>If you need to update your IPv4\/IPv6 firewall setup, please modify the following files:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/etc\/iptables\/rules.v4\n\/etc\/iptables\/rules.v6<\/code><\/pre>\n\n\n\n<p>You can also save your currently configured firewall rules if you have not saved them to the above files with this command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>iptables-save &gt; \/etc\/iptables\/rules.v4 &amp;&amp; ip6tables-save &gt; \/etc\/iptables\/rules.v6<\/code><\/pre>\n\n\n\n<p>Please also make sure that the default network identifier (<strong>eth0<\/strong>) matches to the system network device. Maybe you will have to update the network interface, if required (e.g.&nbsp;<strong>Ubuntu 18 \u2013 Netplan environment<\/strong>).<\/p>\n\n\n\n<p>Feel free to check it shortly on your server system as follows:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"822\" height=\"267\" src=\"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Netzwerk-Interface.jpg.webp\" alt=\"\" class=\"wp-image-1640\" srcset=\"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Netzwerk-Interface.jpg.webp 822w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Netzwerk-Interface.jpg-300x97.webp 300w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Netzwerk-Interface.jpg-768x249.webp 768w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Netzwerk-Interface.jpg-400x130.webp 400w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Netzwerk-Interface.jpg-800x260.webp 800w\" sizes=\"auto, (max-width: 822px) 100vw, 822px\" \/><\/figure>\n\n\n\n<p>We strongly recommend to create a backup of the current firewall setup in order to be able to immediately restore the previous configuration (e.g. connection locks).<\/p>\n\n\n\n<p>To save your current IPv4\/IPv6 firewall setup into a backup file, feel free to use the following commands:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>iptables-save &gt; \/root\/iptables_rules<\/strong>\n<strong>ip6tables-save &gt; \/root\/ip6tables_rules<\/strong><\/code><\/pre>\n\n\n\n<p>To restore the backup files, please use:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>iptables-restore &lt; \/root\/iptables_rules<\/strong>\n<strong>iptables-restore &lt; \/root\/ip6tables_rules<\/strong><\/code><\/pre>\n\n\n\n<p>If you need to re-connect to your server due to a misconfigured firewall setup, you could use your VNC connection for your VPS in order to be able to restore a previous configuration: you can summit ticket for your VPN credentials<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"374\" height=\"398\" src=\"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/VNC.jpg.webp\" alt=\"\" class=\"wp-image-1641\" srcset=\"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/VNC.jpg.webp 374w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/VNC.jpg-282x300.webp 282w\" sizes=\"auto, (max-width: 374px) 100vw, 374px\" \/><\/figure>\n\n\n\n<p>If you have a Dedicated Server, it is unfortunately not possible to use VNC access, so you will have to reboot your server into the Linux rescue system in order to get access again.<\/p>\n\n\n\n<p>If you are a SailexHost Customer this can be performed within your\u00a0<a href=\"https:\/\/sso.sailexhost.com\/index.php?rp=\/login\" type=\"link\" id=\"https:\/\/sso.sailexhost.com\/index.php?rp=\/login\" target=\"_blank\" rel=\"noreferrer noopener\">customer control panel<\/a>.<\/p>\n\n\n\n<p>Please find below more information how to handle the Linux rescue mode:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-setting-up-a-basic-firewall-for-windows\">Setting up a Basic Firewall for Windows<\/h2>\n\n\n\n<p>The Windows Firewall can be found within the Server-Manager settings as follows:<\/p>\n\n\n\n<p><strong>Windows-Firewall -&gt; Public: On-&gt; Advanced settings<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"766\" height=\"508\" src=\"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-1_EN.jpg.webp\" alt=\"\" class=\"wp-image-1642\" srcset=\"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-1_EN.jpg.webp 766w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-1_EN.jpg-300x199.webp 300w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-1_EN.jpg-400x265.webp 400w\" sizes=\"auto, (max-width: 766px) 100vw, 766px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"600\" src=\"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-2_EN.jpg.webp\" alt=\"\" class=\"wp-image-1643\" srcset=\"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-2_EN.jpg.webp 800w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-2_EN.jpg-300x225.webp 300w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-2_EN.jpg-768x576.webp 768w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-2_EN.jpg-400x300.webp 400w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"586\" height=\"507\" src=\"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-3_EN.jpg.webp\" alt=\"\" class=\"wp-image-1644\" srcset=\"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-3_EN.jpg.webp 586w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-3_EN.jpg-300x260.webp 300w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-3_EN.jpg-400x346.webp 400w\" sizes=\"auto, (max-width: 586px) 100vw, 586px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"563\" height=\"455\" src=\"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-8_EN.jpg.webp\" alt=\"\" class=\"wp-image-1645\" srcset=\"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-8_EN.jpg.webp 563w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-8_EN.jpg-300x242.webp 300w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-8_EN.jpg-400x323.webp 400w\" sizes=\"auto, (max-width: 563px) 100vw, 563px\" \/><\/figure>\n\n\n\n<p>Now you can modify your firewall rules due to your own needs.<\/p>\n\n\n\n<p>The most difference between Linux and Windows is related to the fact, that Windows provides a basic firewall configuration by default. In most of the cases, it should be enough to keep the default setup or to modify existing rules.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"804\" src=\"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-4_EN.jpg-1024x804.webp\" alt=\"\" class=\"wp-image-1646\" srcset=\"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-4_EN.jpg-1024x804.webp 1024w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-4_EN.jpg-300x236.webp 300w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-4_EN.jpg-768x603.webp 768w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-4_EN.jpg-400x314.webp 400w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-4_EN.jpg-800x628.webp 800w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-4_EN.jpg-832x653.webp 832w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-4_EN.jpg-1248x980.webp 1248w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-4_EN.jpg.webp 1336w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"804\" src=\"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-5_EN.jpg-1024x804.webp\" alt=\"\" class=\"wp-image-1647\" srcset=\"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-5_EN.jpg-1024x804.webp 1024w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-5_EN.jpg-300x236.webp 300w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-5_EN.jpg-768x603.webp 768w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-5_EN.jpg-400x314.webp 400w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-5_EN.jpg-800x628.webp 800w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-5_EN.jpg-832x653.webp 832w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-5_EN.jpg-1248x980.webp 1248w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-5_EN.jpg.webp 1335w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"891\" src=\"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-6_EN.jpg-1024x891.webp\" alt=\"\" class=\"wp-image-1648\" srcset=\"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-6_EN.jpg-1024x891.webp 1024w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-6_EN.jpg-300x261.webp 300w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-6_EN.jpg-768x668.webp 768w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-6_EN.jpg-400x348.webp 400w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-6_EN.jpg-800x696.webp 800w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-6_EN.jpg-832x724.webp 832w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/Windows-FW-6_EN.jpg.webp 1098w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>All of the active firewall rules are marked with a green tag. The rest of the rules (without any tag) do need to be activated, if required. Feel free to customize the firewall setup due to your own needs.<\/p>\n\n\n\n<p>For example, if you would like to change your RDP port to another one instead of the default \u201c3389\u201d, you will have to modify the following two firewall rules within the \u201cInbound rule\u201d chain as follows:<\/p>\n\n\n\n<p>Remote Desktop &#8211; User Mode (TCP-In)<br>Remote Desktop &#8211; User Mode (UDP-In)<br>Afterwards you have to modify the affected Windows registry entry to the new value. However, in order to prevent disasters, please make sure to create a full backup of the registry beforehand:<\/p>\n\n\n\n<p>WINDOWS button + R (keyboard command)<br>regedit<br>File &gt;&gt; Export<br>Now you can navigate to the following path in order to set the new RDP port number:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Terminal Server\\WinStations\\RDP-Tcp\\PortNumber<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"884\" height=\"840\" src=\"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/RDP-Port_EN-1.jpg.webp\" alt=\"\" class=\"wp-image-1649\" srcset=\"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/RDP-Port_EN-1.jpg.webp 884w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/RDP-Port_EN-1.jpg-300x285.webp 300w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/RDP-Port_EN-1.jpg-768x730.webp 768w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/RDP-Port_EN-1.jpg-400x380.webp 400w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/RDP-Port_EN-1.jpg-800x760.webp 800w, https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/RDP-Port_EN-1.jpg-832x791.webp 832w\" sizes=\"auto, (max-width: 884px) 100vw, 884px\" \/><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"Setting up a Basic Firewall for Linux By default SSH connections are normally established through Port 22 (TCP).&hellip;","protected":false},"author":1,"featured_media":1637,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"csco_singular_sidebar":"","csco_page_header_type":"","csco_page_load_nextpost":"","footnotes":""},"categories":[16,8],"tags":[74,75],"class_list":{"0":"post-1636","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-vps-hosting","8":"category-website-security","9":"tag-firewall-security","10":"tag-installing-firewall","11":"cs-entry"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Protect Your Linux and Windows System Using Software Firewalls - sailexhost.com<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/sailexhost.com\/blog\/how-to-protect-your-linux-and-windows-system-using-software-firewalls\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Protect Your Linux and Windows System Using Software Firewalls - sailexhost.com\" \/>\n<meta property=\"og:description\" content=\"Setting up a Basic Firewall for Linux By default SSH connections are normally established through Port 22 (TCP).&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/sailexhost.com\/blog\/how-to-protect-your-linux-and-windows-system-using-software-firewalls\/\" \/>\n<meta property=\"og:site_name\" content=\"sailexhost.com\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/profile.php?id=100086330631833\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-29T02:35:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-01-29T02:40:49+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/How-to-Protect-Your-Linux-and-Windows-System-Using-Software-Firewalls.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1640\" \/>\n\t<meta property=\"og:image:height\" content=\"924\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Smauel Eric\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@sailexhost\" \/>\n<meta name=\"twitter:site\" content=\"@sailexhost\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Smauel Eric\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/sailexhost.com\/blog\/how-to-protect-your-linux-and-windows-system-using-software-firewalls\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/sailexhost.com\/blog\/how-to-protect-your-linux-and-windows-system-using-software-firewalls\/\"},\"author\":{\"name\":\"Smauel Eric\",\"@id\":\"https:\/\/sailexhost.com\/blog\/#\/schema\/person\/512a81330709cc9c1c05e516459f48f5\"},\"headline\":\"How to Protect Your Linux and Windows System Using Software Firewalls\",\"datePublished\":\"2026-01-29T02:35:17+00:00\",\"dateModified\":\"2026-01-29T02:40:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/sailexhost.com\/blog\/how-to-protect-your-linux-and-windows-system-using-software-firewalls\/\"},\"wordCount\":969,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/sailexhost.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/sailexhost.com\/blog\/how-to-protect-your-linux-and-windows-system-using-software-firewalls\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/How-to-Protect-Your-Linux-and-Windows-System-Using-Software-Firewalls.jpg\",\"keywords\":[\"Firewall security\",\"installing Firewall\"],\"articleSection\":[\"VPS Hosting\",\"Website Security\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/sailexhost.com\/blog\/how-to-protect-your-linux-and-windows-system-using-software-firewalls\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/sailexhost.com\/blog\/how-to-protect-your-linux-and-windows-system-using-software-firewalls\/\",\"url\":\"https:\/\/sailexhost.com\/blog\/how-to-protect-your-linux-and-windows-system-using-software-firewalls\/\",\"name\":\"How to Protect Your Linux and Windows System Using Software Firewalls - sailexhost.com\",\"isPartOf\":{\"@id\":\"https:\/\/sailexhost.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/sailexhost.com\/blog\/how-to-protect-your-linux-and-windows-system-using-software-firewalls\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/sailexhost.com\/blog\/how-to-protect-your-linux-and-windows-system-using-software-firewalls\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/How-to-Protect-Your-Linux-and-Windows-System-Using-Software-Firewalls.jpg\",\"datePublished\":\"2026-01-29T02:35:17+00:00\",\"dateModified\":\"2026-01-29T02:40:49+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/sailexhost.com\/blog\/how-to-protect-your-linux-and-windows-system-using-software-firewalls\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/sailexhost.com\/blog\/how-to-protect-your-linux-and-windows-system-using-software-firewalls\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/sailexhost.com\/blog\/how-to-protect-your-linux-and-windows-system-using-software-firewalls\/#primaryimage\",\"url\":\"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/How-to-Protect-Your-Linux-and-Windows-System-Using-Software-Firewalls.jpg\",\"contentUrl\":\"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/How-to-Protect-Your-Linux-and-Windows-System-Using-Software-Firewalls.jpg\",\"width\":1640,\"height\":924,\"caption\":\"How to Protect Your Linux and Windows System Using Software Firewalls\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/sailexhost.com\/blog\/how-to-protect-your-linux-and-windows-system-using-software-firewalls\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/sailexhost.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Protect Your Linux and Windows System Using Software Firewalls\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/sailexhost.com\/blog\/#website\",\"url\":\"https:\/\/sailexhost.com\/blog\/\",\"name\":\"sailexhost.com\",\"description\":\"Sailexost Official Blog - Hosting Review, Deals, New Update\",\"publisher\":{\"@id\":\"https:\/\/sailexhost.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/sailexhost.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/sailexhost.com\/blog\/#organization\",\"name\":\"sailexhost.com\",\"url\":\"https:\/\/sailexhost.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/sailexhost.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2025\/07\/Sailexhost-1.png\",\"contentUrl\":\"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2025\/07\/Sailexhost-1.png\",\"width\":500,\"height\":500,\"caption\":\"sailexhost.com\"},\"image\":{\"@id\":\"https:\/\/sailexhost.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/profile.php?id=100086330631833\",\"https:\/\/x.com\/sailexhost\",\"https:\/\/instagram.com\/@sailexhost\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/sailexhost.com\/blog\/#\/schema\/person\/512a81330709cc9c1c05e516459f48f5\",\"name\":\"Smauel Eric\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/sailexhost.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/aaabb9db0b702789d913ac21ff9e642e2aff7131940a927281e1e80465a703a6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/aaabb9db0b702789d913ac21ff9e642e2aff7131940a927281e1e80465a703a6?s=96&d=mm&r=g\",\"caption\":\"Smauel Eric\"},\"sameAs\":[\"https:\/\/sailexhost.com\/blog\"],\"url\":\"https:\/\/sailexhost.com\/blog\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Protect Your Linux and Windows System Using Software Firewalls - sailexhost.com","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/sailexhost.com\/blog\/how-to-protect-your-linux-and-windows-system-using-software-firewalls\/","og_locale":"en_US","og_type":"article","og_title":"How to Protect Your Linux and Windows System Using Software Firewalls - sailexhost.com","og_description":"Setting up a Basic Firewall for Linux By default SSH connections are normally established through Port 22 (TCP).&hellip;","og_url":"https:\/\/sailexhost.com\/blog\/how-to-protect-your-linux-and-windows-system-using-software-firewalls\/","og_site_name":"sailexhost.com","article_publisher":"https:\/\/www.facebook.com\/profile.php?id=100086330631833","article_published_time":"2026-01-29T02:35:17+00:00","article_modified_time":"2026-01-29T02:40:49+00:00","og_image":[{"width":1640,"height":924,"url":"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/How-to-Protect-Your-Linux-and-Windows-System-Using-Software-Firewalls.jpg","type":"image\/jpeg"}],"author":"Smauel Eric","twitter_card":"summary_large_image","twitter_creator":"@sailexhost","twitter_site":"@sailexhost","twitter_misc":{"Written by":"Smauel Eric","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/sailexhost.com\/blog\/how-to-protect-your-linux-and-windows-system-using-software-firewalls\/#article","isPartOf":{"@id":"https:\/\/sailexhost.com\/blog\/how-to-protect-your-linux-and-windows-system-using-software-firewalls\/"},"author":{"name":"Smauel Eric","@id":"https:\/\/sailexhost.com\/blog\/#\/schema\/person\/512a81330709cc9c1c05e516459f48f5"},"headline":"How to Protect Your Linux and Windows System Using Software Firewalls","datePublished":"2026-01-29T02:35:17+00:00","dateModified":"2026-01-29T02:40:49+00:00","mainEntityOfPage":{"@id":"https:\/\/sailexhost.com\/blog\/how-to-protect-your-linux-and-windows-system-using-software-firewalls\/"},"wordCount":969,"commentCount":0,"publisher":{"@id":"https:\/\/sailexhost.com\/blog\/#organization"},"image":{"@id":"https:\/\/sailexhost.com\/blog\/how-to-protect-your-linux-and-windows-system-using-software-firewalls\/#primaryimage"},"thumbnailUrl":"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/How-to-Protect-Your-Linux-and-Windows-System-Using-Software-Firewalls.jpg","keywords":["Firewall security","installing Firewall"],"articleSection":["VPS Hosting","Website Security"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/sailexhost.com\/blog\/how-to-protect-your-linux-and-windows-system-using-software-firewalls\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/sailexhost.com\/blog\/how-to-protect-your-linux-and-windows-system-using-software-firewalls\/","url":"https:\/\/sailexhost.com\/blog\/how-to-protect-your-linux-and-windows-system-using-software-firewalls\/","name":"How to Protect Your Linux and Windows System Using Software Firewalls - sailexhost.com","isPartOf":{"@id":"https:\/\/sailexhost.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/sailexhost.com\/blog\/how-to-protect-your-linux-and-windows-system-using-software-firewalls\/#primaryimage"},"image":{"@id":"https:\/\/sailexhost.com\/blog\/how-to-protect-your-linux-and-windows-system-using-software-firewalls\/#primaryimage"},"thumbnailUrl":"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/How-to-Protect-Your-Linux-and-Windows-System-Using-Software-Firewalls.jpg","datePublished":"2026-01-29T02:35:17+00:00","dateModified":"2026-01-29T02:40:49+00:00","breadcrumb":{"@id":"https:\/\/sailexhost.com\/blog\/how-to-protect-your-linux-and-windows-system-using-software-firewalls\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/sailexhost.com\/blog\/how-to-protect-your-linux-and-windows-system-using-software-firewalls\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/sailexhost.com\/blog\/how-to-protect-your-linux-and-windows-system-using-software-firewalls\/#primaryimage","url":"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/How-to-Protect-Your-Linux-and-Windows-System-Using-Software-Firewalls.jpg","contentUrl":"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2026\/01\/How-to-Protect-Your-Linux-and-Windows-System-Using-Software-Firewalls.jpg","width":1640,"height":924,"caption":"How to Protect Your Linux and Windows System Using Software Firewalls"},{"@type":"BreadcrumbList","@id":"https:\/\/sailexhost.com\/blog\/how-to-protect-your-linux-and-windows-system-using-software-firewalls\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/sailexhost.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Protect Your Linux and Windows System Using Software Firewalls"}]},{"@type":"WebSite","@id":"https:\/\/sailexhost.com\/blog\/#website","url":"https:\/\/sailexhost.com\/blog\/","name":"sailexhost.com","description":"Sailexost Official Blog - Hosting Review, Deals, New Update","publisher":{"@id":"https:\/\/sailexhost.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/sailexhost.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/sailexhost.com\/blog\/#organization","name":"sailexhost.com","url":"https:\/\/sailexhost.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/sailexhost.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2025\/07\/Sailexhost-1.png","contentUrl":"https:\/\/sailexhost.com\/blog\/wp-content\/uploads\/2025\/07\/Sailexhost-1.png","width":500,"height":500,"caption":"sailexhost.com"},"image":{"@id":"https:\/\/sailexhost.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/profile.php?id=100086330631833","https:\/\/x.com\/sailexhost","https:\/\/instagram.com\/@sailexhost"]},{"@type":"Person","@id":"https:\/\/sailexhost.com\/blog\/#\/schema\/person\/512a81330709cc9c1c05e516459f48f5","name":"Smauel Eric","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/sailexhost.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/aaabb9db0b702789d913ac21ff9e642e2aff7131940a927281e1e80465a703a6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/aaabb9db0b702789d913ac21ff9e642e2aff7131940a927281e1e80465a703a6?s=96&d=mm&r=g","caption":"Smauel Eric"},"sameAs":["https:\/\/sailexhost.com\/blog"],"url":"https:\/\/sailexhost.com\/blog\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/sailexhost.com\/blog\/wp-json\/wp\/v2\/posts\/1636","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sailexhost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sailexhost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sailexhost.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sailexhost.com\/blog\/wp-json\/wp\/v2\/comments?post=1636"}],"version-history":[{"count":3,"href":"https:\/\/sailexhost.com\/blog\/wp-json\/wp\/v2\/posts\/1636\/revisions"}],"predecessor-version":[{"id":1654,"href":"https:\/\/sailexhost.com\/blog\/wp-json\/wp\/v2\/posts\/1636\/revisions\/1654"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sailexhost.com\/blog\/wp-json\/wp\/v2\/media\/1637"}],"wp:attachment":[{"href":"https:\/\/sailexhost.com\/blog\/wp-json\/wp\/v2\/media?parent=1636"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sailexhost.com\/blog\/wp-json\/wp\/v2\/categories?post=1636"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sailexhost.com\/blog\/wp-json\/wp\/v2\/tags?post=1636"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}