0821.html 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Add A Firewall to Debian Linux with UFW</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <meta charset="UTF-8">
  7. <meta name="keywords" content="Home Lab Ideas,Home Lab,Install Guide,Debian,Firewall,Home Server,Homelab,Homelab Ideas,IT Security,Linux,UFW,Ubuntu Firewall,Network Firewall,Software Firewall,Install UFW On Debian,Debian Firewall,How To Install A Firewall On Debian Linux,How To,Tutorial,i12bretro">
  8. <meta name="author" content="i12bretro">
  9. <meta name="description" content="Add A Firewall to Debian Linux with UFW">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11. <meta name="revised" content="10/29/2022 12:17:59 PM" />
  12. <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
  13. <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  14. <script type="text/javascript" src="includes/js/steps.js"></script>
  15. <link href="css/steps.css" rel="stylesheet" type="text/css" />
  16. </head>
  17. <body>
  18. <div id="gridContainer">
  19. <div class="topMargin"></div>
  20. <div id="listName" class="topMargin">
  21. <h1>Add A Firewall to Debian Linux with UFW</h1>
  22. </div>
  23. <div></div>
  24. <div id="content">
  25. <h2>What is UFW?</h2>
  26. <blockquote><em>The Uncomplicated Firewall (ufw, and gufw - a Graphical User Interface version of the same) is a frontend for iptables and is particularly well-suited for host-based firewalls. Ufw provides a framework for managing netfilter, as well as a command-line interface for manipulating the firewall. -<a href="https://wiki.debian.org/Uncomplicated%20Firewall%20%28ufw%29" target="_blank">https://wiki.debian.org/Uncomplicated%20Firewall%20%28ufw%29</a></em></blockquote>
  27. <ol>
  28. <li>Log into the Debian device</li>
  29. <li>Run the following commands in a terminal window:
  30. <div class="codeBlock"># update software repositories<br />
  31. sudo apt update<br />
  32. # install ufw<br />
  33. sudo apt install ufw -y<br />
  34. # enable ufw<br />
  35. sudo ufw enable<br />
  36. # output the ufw status<br />
  37. sudo ufw status<br />
  38. # add some default firewall rules<br />
  39. sudo ufw default deny incoming<br />
  40. sudo ufw default allow outgoing<br />
  41. # if a webserver is running, allow the incoming traffic<br />
  42. sudo ufw allow 80/tcp<br />
  43. sudo ufw allow 443/tcp<br />
  44. # to allow incoming ssh connections, open port 22<br />
  45. sudo ufw allow 22/tcp<br />
  46. # output the ufw status<br />
  47. sudo ufw status<br />
  48. # to install a graphical user interface for ufw, install gufw<br />
  49. sudo apt install gufw -y</div>
  50. </li>
  51. </ol> </div>
  52. </div>
  53. </body>
  54. </html>