{"id":31625,"date":"2020-03-04T15:14:58","date_gmt":"2020-03-04T21:14:58","guid":{"rendered":"https:\/\/www.rosehosting.com\/blog\/?p=31625"},"modified":"2022-06-03T03:33:07","modified_gmt":"2022-06-03T08:33:07","slug":"how-to-configure-a-firewall-with-ufw-on-debian-9","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/how-to-configure-a-firewall-with-ufw-on-debian-9\/","title":{"rendered":"How to Configure a Firewall with UFW on Debian 9"},"content":{"rendered":"<div id=\"bsf_rt_marker\"><\/div><p><img decoding=\"async\" class=\"alignnone size-full wp-image-32420\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2020\/02\/how-to-configure-a-firewall-with-ufw-on-debian9.jpg\" alt=\"\" width=\"742\" height=\"372\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2020\/02\/how-to-configure-a-firewall-with-ufw-on-debian9.jpg 742w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2020\/02\/how-to-configure-a-firewall-with-ufw-on-debian9-300x150.jpg 300w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2020\/02\/how-to-configure-a-firewall-with-ufw-on-debian9-150x75.jpg 150w\" sizes=\"(max-width: 742px) 100vw, 742px\" \/><\/p>\n<p>In this tutorial, we will show you how to install and use the UFW firewall system on a <a href=\"https:\/\/www.rosehosting.com\/linux-vps-hosting\/\" target=\"_blank\" rel=\"noopener noreferrer\">Linux VPS<\/a> running Debian 9. Security is a very important thing to consider when you run your own server.<\/p>\n<p><img decoding=\"async\" class=\"alignright size-full wp-image-32421\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2020\/02\/setup-ufw-uncomplicated-firewall-system-on-debian9.jpg\" alt=\"\" width=\"120\" height=\"132\" \/>UFW (Uncomplicated Firewall) is a simple and user-friendly front-end for managing iptables firewall rules &#8211; UFW aims to provide an easy to use interface for the user, making a secure server more accessible to more users. It is specially designed for beginner users who are unfamiliar with firewall concepts.<\/p>\n<p>Let&#8217;s begin with the installation.<br \/>\n<!--more--><\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_83 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a15bd88ca972\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a15bd88ca972\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-configure-a-firewall-with-ufw-on-debian-9\/#Prerequisites\" >Prerequisites<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-configure-a-firewall-with-ufw-on-debian-9\/#Step-1-Connect-via-SSH-and-Update-the-OS\" >Step 1: Connect via SSH and Update the OS<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-configure-a-firewall-with-ufw-on-debian-9\/#Step-2-Install-UFW\" >Step 2: Install UFW<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-configure-a-firewall-with-ufw-on-debian-9\/#Step-3-Allow-SSH-Connections\" >Step 3: Allow SSH Connections<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-configure-a-firewall-with-ufw-on-debian-9\/#Step-4-Enable-UFW\" >Step 4: Enable UFW<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-configure-a-firewall-with-ufw-on-debian-9\/#Allowing-Other-Services\" >Allowing Other Services<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-configure-a-firewall-with-ufw-on-debian-9\/#Allowing-Connections-from-Specific-IP-addresses-and-Port-Ranges\" >Allowing Connections from Specific IP addresses and Port Ranges<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-configure-a-firewall-with-ufw-on-debian-9\/#Rejecting-Incoming-Connections\" >Rejecting Incoming Connections<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-configure-a-firewall-with-ufw-on-debian-9\/#Displaying-UFW-Reports\" >Displaying UFW Reports<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-configure-a-firewall-with-ufw-on-debian-9\/#Disabling-UFW\" >Disabling UFW<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Prerequisites\"><\/span>Prerequisites<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li>For the purposes of this tutorial, we will use a <a href=\"https:\/\/rosehosting.com\/debian-hosting.html\">Debian 9 VPS<\/a>.<\/li>\n<li>Full SSH root access or a user with sudo privileges is also required.<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Step-1-Connect-via-SSH-and-Update-the-OS\"><\/span><span id=\"1-Connect-via-SSH\" class=\"ez-toc-section\">Step 1: Connect via SSH and Update the OS<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Connect to your server via SSH as the root user using the following command:<\/p>\n<pre>ssh root@<span style=\"color: #ff0000;\">IP_ADDRESS<\/span> -p <span style=\"color: #ff0000;\">PORT_NUMBER<\/span><\/pre>\n<p>Remember to replace \u201c<span style=\"color: #ff0000;\">IP_ADDRESS<\/span>\u201d and \u201c<span style=\"color: #ff0000;\">PORT_NUMBER<\/span>\u201d with your server&#8217;s respective IP address and SSH port number.<\/p>\n<p>Before starting with the installation, you will need to update your OS packages to their latest versions. It&#8217;s easy to do, and it won&#8217;t take more than a few minutes.<\/p>\n<p>You can do this by running the following command:<\/p>\n<pre>apt-get update \napt-get upgrade<\/pre>\n<p>Once the updates are completed, we can move on to the next step.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Step-2-Install-UFW\"><\/span>Step 2: Install UFW<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>By default, UFW is not installed on Debian 9. We can install UFW by running the following command:<\/p>\n<pre>apt-get install ufw<\/pre>\n<p>Once the installation is complete, we can check the status of UFW using the following command:<\/p>\n<pre>ufw status verbose<\/pre>\n<p>The output should be similar to the one below:<\/p>\n<pre>Status: inactive<\/pre>\n<p>UFW is disabled by default to avoid a lockout from the server.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Step-3-Allow-SSH-Connections\"><\/span>Step 3: Allow SSH Connections<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>By default, all incoming connections to your Debian VPS are blocked by UFW &#8211; nobody can connect to it. Therefore, we will need to allow incoming SSH connections before enabling the UFW firewall.<\/p>\n<pre>ufw allow ssh<\/pre>\n<p>or<\/p>\n<pre>ufw allow 22\/tcp<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"Step-4-Enable-UFW\"><\/span>Step 4: Enable UFW<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>To enable UFW, we can use the command below:<\/p>\n<pre>ufw enable<\/pre>\n<p>Once enabled, UFW will block all of the incoming connections and allow all outbound connections. To check the default configuration, we can use the following command:<\/p>\n<pre>ufw show raw<\/pre>\n<p>Or<\/p>\n<pre>grep 'DEFAULT_' \/etc\/default\/ufw<\/pre>\n<p>The output will looks like this:<\/p>\n<pre>DEFAULT_INPUT_POLICY=\"DROP\"\nDEFAULT_OUTPUT_POLICY=\"ACCEPT\"\nDEFAULT_FORWARD_POLICY=\"DROP\"\nDEFAULT_APPLICATION_POLICY=\"SKIP\"<\/pre>\n<p>That&#8217;s it! Your server now has UFW installed and enabled. As you can see, by default, every incoming connection is denied. We specifically need to open a port if we want to access the server remotely.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Allowing-Other-Services\"><\/span>Allowing Other Services<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>We may also need to allow some other incoming connections.<\/p>\n<pre>ufw allow 21\/tcp\nufw allow 80\/tcp\nufw allow 443\/tcp<\/pre>\n<p>We can check the UFW status using the following command:<\/p>\n<pre>ufw status<\/pre>\n<p>The output should be similar to one below:<\/p>\n<pre>Status: active\n\nTo                         Action      From\n--                         ------      ----\n22\/tcp                     ALLOW       Anywhere\n21\/tcp                     ALLOW       Anywhere\n80\/tcp                     ALLOW       Anywhere\n443\/tcp                    ALLOW       Anywhere\n22\/tcp (v6)                ALLOW       Anywhere (v6)\n21\/tcp (v6)                ALLOW       Anywhere (v6)\n80\/tcp (v6)                ALLOW       Anywhere (v6)\n443\/tcp (v6)               ALLOW       Anywhere (v6)<\/pre>\n<p>If we want to deny access to port 80 for example, we have to run the following command:<\/p>\n<pre>ufw deny 80\/tcp<\/pre>\n<p>To delete the rule that allows the incoming connections on port 21, run the following command:<\/p>\n<pre>ufw delete allow 21\/tcp<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"Allowing-Connections-from-Specific-IP-addresses-and-Port-Ranges\"><\/span>Allowing Connections from Specific IP addresses and Port Ranges<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>We can also allow connections from a specific IP address with the following command:<\/p>\n<pre>ufw allow 192.168.10.100<\/pre>\n<p>We can use a subnet mask to widen the range:<\/p>\n<pre>ufw allow 192.168.10.0\/24<\/pre>\n<p>We can also combine the IP address, port, and protocol with a single command. For example, in order to allow the connection only from the IP 192.168.10.100, protocol tcp, and to port 22, we have to run the following command:<\/p>\n<pre>ufw allow from 192.168.10.100 proto tcp to any port 22<\/pre>\n<p>We can also specify port ranges with UFW. For example, to allow TCP ports 1100 to 1200, run the following command:<\/p>\n<pre>ufw allow 1100:1200\/tcp<\/pre>\n<p>If we want to allow UDP on ports 1100 to 1200, for example, we have to use the following command:<\/p>\n<pre>ufw allow 1100:1200\/udp<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"Rejecting-Incoming-Connections\"><\/span>Rejecting Incoming Connections<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The UFW with deny syntax just ignores traffic. To let the sender know when traffic is being denied, run the command below:<\/p>\n<pre>ufw reject 443<\/pre>\n<p>If somebody tries to connect to port 443 they will get the following reject message:<\/p>\n<pre>telnet: Unable to connect to remote host: Connection refused<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"Displaying-UFW-Reports\"><\/span>Displaying UFW Reports<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>We can list of rules as they were added with the following command:<\/p>\n<pre>ufw show added<\/pre>\n<p>The output should be similar to one below:<\/p>\n<pre>Added user rules (see 'ufw status' for running firewall):\nufw allow 22\/tcp\nufw allow 21\/tcp\nufw allow 80\/tcp\nufw allow 443\/tcp<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"Disabling-UFW\"><\/span>Disabling UFW<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>If for some reason we need to disable UFW, we can run the following command:<\/p>\n<pre>ufw disable<\/pre>\n<p>In order to reset all rules to their default settings, use the following command:<\/p>\n<pre>ufw reset<\/pre>\n<p>We can use the &#8211;help flag for more usage commands:<\/p>\n<pre>ufw --help<\/pre>\n<p>That&#8217;s all \u2013 in this tutorial, we learned how to install and enable the UFW firewall system, and we also covered how to add and remove rules on it, with varying levels of criteria.<\/p>\n<hr \/>\n<p><img decoding=\"async\" class=\"alignleft size-full wp-image-32422\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2020\/02\/managed-firewall-configuration-by-expert-admins-ufw-debian-vps.jpg\" alt=\"\" width=\"120\" height=\"132\" \/>Of course, you don&#8217;t have to configure a firewall with UFW on Debian 9 if you use one of our <a href=\"https:\/\/www.rosehosting.com\/debian-hosting.html\">managed Debian VPS Hosting<\/a> Services, in which case you can simply ask our expert Linux admins to install and configure UFW on Debian 9 for you. They are available 24\u00d77 and will take care of your request immediately.<\/p>\n<p><span style=\"color: #ff0000;\"><strong>PS<\/strong><\/span>. If you liked this post on <strong>how to Configure a Firewall with UFW on Debian 9<\/strong>, please share it with your friends on the social networks using the share shortcuts below, or simply leave a comment down in the comments section. Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we will show you how to install and use the UFW firewall system on a Linux VPS &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How to Configure a Firewall with UFW on Debian 9\" class=\"read-more button\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-configure-a-firewall-with-ufw-on-debian-9\/#more-31625\" aria-label=\"Read more about How to Configure a Firewall with UFW on Debian 9\">Read More<\/a><\/p>\n","protected":false},"author":4,"featured_media":32420,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1700,1701,1703,13],"tags":[1577,1450],"class_list":["post-31625","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-debian","category-networking-and-domains","category-security","category-tutorials","tag-debian-9","tag-ufw","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.6 (Yoast SEO v27.6) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Configure a Firewall with UFW on Debian 9 | RoseHosting<\/title>\n<meta name=\"description\" content=\"How to Configure a Firewall with UFW on Debian 9 | RoseHosting\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-configure-a-firewall-with-ufw-on-debian-9\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Configure a Firewall with UFW on Debian 9\" \/>\n<meta property=\"og:description\" content=\"How to Configure a Firewall with UFW on Debian 9 | RoseHosting\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.rosehosting.com\/blog\/how-to-configure-a-firewall-with-ufw-on-debian-9\/\" \/>\n<meta property=\"og:site_name\" content=\"RoseHosting\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/RoseHosting\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/rosehosting.helpdesk\" \/>\n<meta property=\"article:published_time\" content=\"2020-03-04T21:14:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-06-03T08:33:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2020\/02\/how-to-configure-a-firewall-with-ufw-on-debian9.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"742\" \/>\n\t<meta property=\"og:image:height\" content=\"372\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Jeff Wilson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:site\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeff Wilson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-configure-a-firewall-with-ufw-on-debian-9\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-configure-a-firewall-with-ufw-on-debian-9\\\/\"},\"author\":{\"name\":\"Jeff Wilson\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/7ce77a842fa6a9a7f8efa186f2353713\"},\"headline\":\"How to Configure a Firewall with UFW on Debian 9\",\"datePublished\":\"2020-03-04T21:14:58+00:00\",\"dateModified\":\"2022-06-03T08:33:07+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-configure-a-firewall-with-ufw-on-debian-9\\\/\"},\"wordCount\":805,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-configure-a-firewall-with-ufw-on-debian-9\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/how-to-configure-a-firewall-with-ufw-on-debian9.jpg\",\"keywords\":[\"debian 9\",\"ufw\"],\"articleSection\":[\"Debian\",\"Networking and Domains\",\"Security\",\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-configure-a-firewall-with-ufw-on-debian-9\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-configure-a-firewall-with-ufw-on-debian-9\\\/\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-configure-a-firewall-with-ufw-on-debian-9\\\/\",\"name\":\"How to Configure a Firewall with UFW on Debian 9 | RoseHosting\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-configure-a-firewall-with-ufw-on-debian-9\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-configure-a-firewall-with-ufw-on-debian-9\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/how-to-configure-a-firewall-with-ufw-on-debian9.jpg\",\"datePublished\":\"2020-03-04T21:14:58+00:00\",\"dateModified\":\"2022-06-03T08:33:07+00:00\",\"description\":\"How to Configure a Firewall with UFW on Debian 9 | RoseHosting\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-configure-a-firewall-with-ufw-on-debian-9\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-configure-a-firewall-with-ufw-on-debian-9\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-configure-a-firewall-with-ufw-on-debian-9\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/how-to-configure-a-firewall-with-ufw-on-debian9.jpg\",\"contentUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/how-to-configure-a-firewall-with-ufw-on-debian9.jpg\",\"width\":742,\"height\":372},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-configure-a-firewall-with-ufw-on-debian-9\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Configure a Firewall with UFW on Debian 9\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\",\"name\":\"RoseHosting.com\",\"description\":\"Premium Linux Tutorials Since 2001\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\",\"name\":\"RoseHosting\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/android-chrome-192x192-1.png\",\"contentUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/android-chrome-192x192-1.png\",\"width\":192,\"height\":192,\"caption\":\"RoseHosting\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/RoseHosting\",\"https:\\\/\\\/x.com\\\/rosehosting\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/rosehosting\\\/\"],\"description\":\"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.\",\"email\":\"info@rosehosting.com\",\"telephone\":\"(314) 275-0414\",\"legalName\":\"Rose Web Services LLC\",\"foundingDate\":\"2001-04-02\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"11\",\"maxValue\":\"50\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/7ce77a842fa6a9a7f8efa186f2353713\",\"name\":\"Jeff Wilson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"caption\":\"Jeff Wilson\"},\"description\":\"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.\",\"sameAs\":[\"https:\\\/\\\/www.rosehosting.com\",\"https:\\\/\\\/www.facebook.com\\\/rosehosting.helpdesk\"],\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/author\\\/jwilson\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Configure a Firewall with UFW on Debian 9 | RoseHosting","description":"How to Configure a Firewall with UFW on Debian 9 | RoseHosting","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:\/\/www.rosehosting.com\/blog\/how-to-configure-a-firewall-with-ufw-on-debian-9\/","og_locale":"en_US","og_type":"article","og_title":"How to Configure a Firewall with UFW on Debian 9","og_description":"How to Configure a Firewall with UFW on Debian 9 | RoseHosting","og_url":"https:\/\/www.rosehosting.com\/blog\/how-to-configure-a-firewall-with-ufw-on-debian-9\/","og_site_name":"RoseHosting","article_publisher":"https:\/\/www.facebook.com\/RoseHosting","article_author":"https:\/\/www.facebook.com\/rosehosting.helpdesk","article_published_time":"2020-03-04T21:14:58+00:00","article_modified_time":"2022-06-03T08:33:07+00:00","og_image":[{"width":742,"height":372,"url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2020\/02\/how-to-configure-a-firewall-with-ufw-on-debian9.jpg","type":"image\/jpeg"}],"author":"Jeff Wilson","twitter_card":"summary_large_image","twitter_creator":"@rosehosting","twitter_site":"@rosehosting","twitter_misc":{"Written by":"Jeff Wilson","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-configure-a-firewall-with-ufw-on-debian-9\/#article","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-configure-a-firewall-with-ufw-on-debian-9\/"},"author":{"name":"Jeff Wilson","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713"},"headline":"How to Configure a Firewall with UFW on Debian 9","datePublished":"2020-03-04T21:14:58+00:00","dateModified":"2022-06-03T08:33:07+00:00","mainEntityOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-configure-a-firewall-with-ufw-on-debian-9\/"},"wordCount":805,"commentCount":0,"publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-configure-a-firewall-with-ufw-on-debian-9\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2020\/02\/how-to-configure-a-firewall-with-ufw-on-debian9.jpg","keywords":["debian 9","ufw"],"articleSection":["Debian","Networking and Domains","Security","Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.rosehosting.com\/blog\/how-to-configure-a-firewall-with-ufw-on-debian-9\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-configure-a-firewall-with-ufw-on-debian-9\/","url":"https:\/\/www.rosehosting.com\/blog\/how-to-configure-a-firewall-with-ufw-on-debian-9\/","name":"How to Configure a Firewall with UFW on Debian 9 | RoseHosting","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-configure-a-firewall-with-ufw-on-debian-9\/#primaryimage"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-configure-a-firewall-with-ufw-on-debian-9\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2020\/02\/how-to-configure-a-firewall-with-ufw-on-debian9.jpg","datePublished":"2020-03-04T21:14:58+00:00","dateModified":"2022-06-03T08:33:07+00:00","description":"How to Configure a Firewall with UFW on Debian 9 | RoseHosting","breadcrumb":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-configure-a-firewall-with-ufw-on-debian-9\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.rosehosting.com\/blog\/how-to-configure-a-firewall-with-ufw-on-debian-9\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-configure-a-firewall-with-ufw-on-debian-9\/#primaryimage","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2020\/02\/how-to-configure-a-firewall-with-ufw-on-debian9.jpg","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2020\/02\/how-to-configure-a-firewall-with-ufw-on-debian9.jpg","width":742,"height":372},{"@type":"BreadcrumbList","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-configure-a-firewall-with-ufw-on-debian-9\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.rosehosting.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Configure a Firewall with UFW on Debian 9"}]},{"@type":"WebSite","@id":"https:\/\/www.rosehosting.com\/blog\/#website","url":"https:\/\/www.rosehosting.com\/blog\/","name":"RoseHosting.com","description":"Premium Linux Tutorials Since 2001","publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.rosehosting.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.rosehosting.com\/blog\/#organization","name":"RoseHosting","url":"https:\/\/www.rosehosting.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","width":192,"height":192,"caption":"RoseHosting"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/RoseHosting","https:\/\/x.com\/rosehosting","https:\/\/www.linkedin.com\/in\/rosehosting\/"],"description":"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.","email":"info@rosehosting.com","telephone":"(314) 275-0414","legalName":"Rose Web Services LLC","foundingDate":"2001-04-02","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"11","maxValue":"50"}},{"@type":"Person","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713","name":"Jeff Wilson","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","caption":"Jeff Wilson"},"description":"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.","sameAs":["https:\/\/www.rosehosting.com","https:\/\/www.facebook.com\/rosehosting.helpdesk"],"url":"https:\/\/www.rosehosting.com\/blog\/author\/jwilson\/"}]}},"_links":{"self":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/31625","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/comments?post=31625"}],"version-history":[{"count":1,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/31625\/revisions"}],"predecessor-version":[{"id":40680,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/31625\/revisions\/40680"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media\/32420"}],"wp:attachment":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media?parent=31625"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/categories?post=31625"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/tags?post=31625"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}