UFW correctly setting

Uncomplicated firewall (ufw) is commonly the simplest choice in case you need a firewall through software (written in python). El software will apply the parameters of configuration in the iptables of our system to speed up the process of configuration of new rules. Iptables rules apply directly at the kernel level, so check if you have added Netfilter to your kernel.

Debian || Ubuntu:

apt install ufw

ArchLinux:

pacman -S ufw

Gentoo:

emerge -a ufw

If you are using the default kernel configuration of your distribution, already have all the modules and drivers installed then you doesn’t need to worry about. If not, check if your loaded kernel configuration has the Netfilter option is enabled.

zcat /proc/config.gz | grep CONFIG_NETFILTER=

CONFIG_NETFILTER=y

In case there is an “n” recompile your kernel with the added Netfilter functionality.

After installing ufw, we can start using it inmediatly. First of all, you are probably connected to your server using an ssh connection so check the port in wich you have your remote session established with. We need to check that for allowing the connections on that port before enabling ufw on our system. In my case it is:

ufw allow 22/tcp

Previously we have said that ufw is based on iptables, so that these changes that we have made through ufw, have had an immediate effect that we can see in more detail.

iptables -nL

It is time for the rules that we have set to enter into action

ufw enable

We can check all the table information from the previous iptables command in a summary

ufw status

By default ufw is gonna act as a DROP (aka DENY) with all the unwanted traffic, wich results in a “timeout” result in case of sending a request wich is not allowed on our firewall. If you prefer to obtain a response for example if the port is closed, you can chenge that behaviour from /etc/default/ufw and change DEFAULT_INPUT_POLICY=”REJECT”

Join the Conversation

243 Comments

  1. Thank you for the sensible critique. Me and my neighbor were just preparing to do a little research about this. We got a grab a book from our area library but I think I learned more from this post. I’m very glad to see such wonderful information being shared freely out there.

  2. Hello there! This blog post could not be written any better!
    Looking through this post reminds me of my previous roommate!
    He continually kept talking about this. I’ll send this post to him.
    Fairly certain he’s going to have a good read. Thank you for sharing!

  3. It’s appropriate time to make some plans for the future and it is time to be happy.

    I’ve read this post and if I could I want to suggest you some
    interesting things or suggestions. Perhaps you could write next articles referring to this article.
    I wish to read more things about it!

  4. Hi superb blog! Does running a blog such as this take a
    massive amount work? I’ve virtually no understanding of programming however I was hoping to start my
    own blog soon. Anyway, should you have any ideas or techniques for new blog owners please share.
    I understand this is off topic nevertheless I simply needed
    to ask. Thanks!

  5. Hallo zusammen! Ichh möchten gebven Ihnen einen big thumbs up
    für die ausgezeichnete Informationen Sie haben hier zu diesem Beitrag.
    Ich werde imjmer wiede auuf Blog für mehbr bald.

  6. Hi! I know this is kind of off-topic however I had
    to ask. Does managing a well-established website like yours require a
    lot of work? I’m completely new to operating a blog but I do write in my
    diary daily. I’d like to start a blog so I will be able to share my personal experience and feelings online.
    Please let me know if you have any ideas or tips for new aspiring
    blog owners. Thankyou!

  7. Hi, I do believe this is an excellent website.
    I stumbledupon it 😉 I will come back yet again since
    I book-marked it. Money and freedom is the best way to change, may you
    be rich and continue to guide others.

  8. Thank you for posting this awesome article. I’m a long
    time reader but I’ve never been compelled to leave a comment.
    I subscribed to your blog and shared this on my
    Twitter. Thanks again for a great article!

  9. Woah! I’m really digging the template/theme of this site.
    It’s simple, yet effective. A lot of times it’s tough to get that “perfect balance” between user friendliness and appearance.

    I must say that you’ve done a great job with this.
    In addition, the blog loads very quick for me on Chrome.
    Outstanding Blog!

  10. It’s a shame you don’t have a donate button! I’d without a doubt donate to
    this fantastic blog! I guess for now i’ll settle for
    book-marking and adding your RSS feed to my
    Google account. I look forward to fresh updates and
    will talk about this website with my Facebook group. Chat soon!

  11. My partner and I absolutely love your blog and find almost
    all of your post’s to be just what I’m looking for.
    Would you offer guest writers to write content for you personally?
    I wouldn’t mind composing a post or elaborating
    on many of the subjects you write about here. Again, awesome site!

  12. After exploring a number of the blog articles on your blog, I truly like your way of blogging.
    I saved it to my bookmark webpage list and will be checking back soon. Please check out my website too and tell
    me what you think.

  13. It is perfect time to make some plans for the future and it’s time to be happy.
    I’ve read this submit and if I could I want to counsel you some fascinating issues or advice.
    Maybe you could write next articles relating to this article.

    I wish to learn more things about it! Way cool! Some extremely valid points!

    I appreciate you penning this post and also the rest of the
    site is also really good. Howdy! This blog post could
    not be written any better! Going through this article reminds me
    of my previous roommate! He always kept preaching about this.
    I’ll forward this article to him. Pretty sure he’s going to have a very good read.
    Many thanks for sharing! http://samsung.com

  14. After I initially commented I appear to have clicked on the -Notify me when new comments are added-
    checkbox and from now on whenever a comment is added I receive 4
    emails with the same comment. Is there an easy method
    you can remove me from that service? Kudos!

  15. Hey! Quick question that’s completely off topic. Do you know how to make your
    site mobile friendly? My site looks weird when viewing from my iphone4.
    I’m trying to find a theme or plugin that might be able to fix this issue.

    If you have any recommendations, please share. Thank you!

  16. I used to be suggested this web site by means
    of my cousin. I’m now not positive whether or not this put up is written by him
    as no one else recognize such specified approximately my problem.
    You’re amazing! Thanks!

  17. Superb blog you have here but I was curious if
    you knew of any community forums that cover the same topics talked about in this
    article? I’d really like to be a part of community where I can get suggestions from other experienced people that share the same interest.

    If you have any suggestions, please let me know. Thanks
    a lot!

  18. Greetings! This is my 1st comment here so I just wanted to give a quick shout out and tell
    you I genuinely enjoy reading your posts. Can you recommend any other blogs/websites/forums that go over the same subjects?
    Appreciate it!

  19. Hello would you mind sharing which blog platform you’re using?
    I’m going to start my own blog soon but I’m having a difficult time making a
    decision between BlogEngine/Wordpress/B2evolution and Drupal.
    The reason I ask is because your design seems different then most blogs
    and I’m looking for something unique.
    P.S Sorry for getting off-topic but I had
    to ask!

  20. Appreciating the dedication you put into your website and in depth information you offer.
    It’s nice to come across a blog every once in a while that isn’t the same outdated rehashed material.
    Great read! I’ve saved your site and I’m adding your
    RSS feeds to my Google account.

  21. I loved as much as you’ll receive carried out right here. The sketch is attractive, your authored material stylish.
    nonetheless, you command get got an impatience over that you
    wish be delivering the following. unwell unquestionably come
    further formerly again as exactly the same nearly a lot often inside case you
    shield this hike.

  22. Appreciating the hard work you put into your blog and detailed information you offer.

    It’s nice to come across a blog every once in a while that isn’t the same unwanted rehashed
    information. Excellent read! I’ve bookmarked your site and I’m adding your RSS feeds to my Google account.

  23. Hi there! This post couldn’t be written any better! Reading through
    this post reminds me of my good old room mate! He always kept
    chatting about this. I will forward this article to him.

    Fairly certain he will have a good read. Thanks
    for sharing!

  24. You really make it seem so easy with your presentation but I find this matter
    to be actually something that I think I would never understand.
    It seems too complex and extremely broad for me. I’m looking forward for your next
    post, I’ll try to get the hang of it!

    1. I really appreciate that you want to support me, I will shortly give you a button to do it.

      Thank you!

  25. Greetings from Florida! I?m bored to tears at work so I decided to check
    out your site on my iphone during lunch break. I enjoy the knowledge you provide here and can?t wait to
    take a look when I get home.
    I?m amazed at how fast your blog loaded on my cell phone ..
    I?m not even using WIFI, just 3G
    .. Anyways, great blog! https://tesgo.ca/fr/a-propos

  26. Fantastic blog! Do you have any tips and
    hints for aspiring writers? I’m hoping to start my
    own blog soon but I’m a little lost on everything. Would you
    suggest starting with a free platform like WordPress or
    go for a paid option? There are so many choices out there that I’m totally overwhelmed ..
    Any suggestions? Many thanks!

  27. Oh my goodness! Incredible article dude! Many thanks,
    However I am experiencing problems with your RSS. I don’t know the reason why I can’t join it.
    Is there anybody getting identical RSS issues?
    Anybody who knows the solution can you kindly respond?
    Thanks!!

  28. Pretty section of content. I just stumbled upon your blog
    and in accession capital to assert that I acquire in fact
    enjoyed account your blog posts. Any way I will be subscribing to your augment
    and even I achievement you access consistently rapidly.

  29. Very nice post. I just stumbled upon your blog and wished to say that I’ve really enjoyed surfing around your blog posts.
    In any case I will be subscribing to your feed and I’m hoping you write again soon!

  30. Excellent post. I was checking continuously this weblog and
    I am impressed! Very helpful information specially the last part :
    ) I maintain such information a lot. I was looking for this certain information for a very long time.
    Thanks and best of luck.

  31. Great blog! Do you have any recommendations for aspiring
    writers? I’m planning to start my own site soon but
    I’m a little lost on everything. Would you recommend
    starting with a free platform like WordPress or go for a paid option? There are
    so many options out there that I’m completely confused .. Any tips?
    Thanks!

    1. Stay constant learning some subject that really interests you and show people what you are learning. Cheers!

  32. Whoa! This blog looks just like my old one! It’s on a completely different subject but it has
    pretty much the same page layout and design. Outstanding choice of
    colors!

  33. Good day! This is my first comment here so I just wanted
    to give a quick shout out and tell you I really enjoy reading through your articles.
    Can you recommend any other blogs/websites/forums that go
    over the same subjects? Appreciate it!

  34. naturally like your website however you have to test the
    spelling on quite a few of your posts. Several of them are rife with spelling problems
    and I find it very bothersome to tell the truth however I’ll certainly come
    back again.

    1. Thanks for the comment, I have to improve in this aspect, English is not my native language.

      Thanks!

  35. Hey! I could have sworn I’ve been to this blog before but after checking through some of the post I realized it’s new to me.
    Anyways, I’m definitely happy I found it and I’ll be bookmarking and checking back frequently!

  36. I think this is among the most important information for
    me. And i’m glad reading your article. But should remark on few general things, The web site style is
    great, the articles is really excellent : D. Good job, cheers

  37. Howdy! I could have sworn I’ve visited this website before but after browsing through many of the
    artifles I realized it’s neww tto me. Anyhow, I’m deffinitely pleased I found it and I’ll be book-marking it and checking back regularly!

  38. Hello there, just became alert to your blog through Google,
    and found that it is really informative. I am going to watch out for brussels.
    I will appreciate if you continue this in future. Lots of people
    will be benefited from your writing. Cheers!

  39. Hello! I know this is kinda off topic but I was wondering which blog platform are you using
    for this site? I’m getting sick and tired of WordPress because I’ve had problems
    with hackers and I’m looking at options for
    another platform. I would be awesome if you could point me in the direction of a good platform.

  40. Nice post. I was checking constantly this blog and I’m
    impressed! Very useful information particularly the ultimate section :
    ) I handle such information much. I was seeking this
    particular info for a long time. Thank you and good luck.

  41. Howdy! Someone in my Myspace group shared this site with us so I came to check it out.

    I’m definitely enjoying the information. I’m book-marking and will be tweeting this to my followers!
    Exceptional blog and fantastic design and style.

  42. Hi are using WordPress for your blog platform? I’m new to the
    blog world but I’m trying to get started and set up my own. Do you need any coding expertise to make your
    own blog? Any help would be really appreciated!

  43. It’s a pity you don’t have a donate button! I’d certainly donate to this brilliant blog!
    I guess for now i’ll settle for book-marking and
    adding your RSS feed to my Google account. I look forward to fresh updates and will talk about this blog
    with my Facebook group. Chat soon!

  44. This design is spectacular! You obviously know how to keep a reader
    entertained. Between your wit and your videos, I was almost moved to
    start my own blog (well, almost…HaHa!) Wonderful job.
    I really enjoyed what you had to say, and more than that, how you presented it.
    Too cool!

  45. Spot on wijth this write-up, I really believe that this website needs much moe attention.
    I’ll probably be returning too read through more, thanks for the info!

  46. You’re so awesome! I don’t suppose I’ve truly read
    through something like that before. So wonderful to find
    somebody with a few genuine thoughts on this topic. Really..
    thank you for starting this up. This site is something that’s needed on the
    internet, someone with a bit of originality!

  47. Interesting blog! Is your theme custom made or did you
    download it from somewhere? A design like yours with a few simple adjustements
    would really make my blog jump out. Please let me know where you
    got your design. Many thanks

  48. It’s perfect time to make some plans for the future and it’s time to be happy.
    I’ve read this post and if I could I wish to suggest you some interesting things or tips.
    Maybe you can write next articles referring to this
    article. I want to read even more things about it!

  49. Pretty part of content. I just stumbled upon your
    web site and in accession capital to assert that I acquire in fact enjoyed account your weblog posts.
    Any way I will be subscribing to your augment or even I fulfillment
    you get admission to persistently fast.

  50. Thanks on your marvelous posting! I certainly
    enjoyed reading it, you may be a great author.I will always bookmark your blog and will often come back from
    now on. I want to encourage you continue your great
    writing, have a nice holiday weekend!

  51. An outstanding share! I have just forwarded this onto a coworker who
    had been conducting a little research on this.

    And he actually bought me dinner because I stumbled upon it for him…
    lol. So allow me to reword this…. Thanks for the meal!!
    But yeah, thanx for spending time to discuss this matter here on your internet site.

  52. I’m very pleased to uncover this site. I need to to thank you for ones time just for this wonderful read!!
    I definitely savored every bit of it and i also have you book-marked to check out new
    things in your site.

  53. I don’t know if it’s just me or if perhaps everyone else encountering problems with your site.
    It appears as if some of the written text on your posts are running off the screen. Can someone else please provide feedback and let me know if this is happening
    to them too? This might be a issue with my browser because I’ve had this happen before.

    Thanks

  54. Thank you for every other informative site. Where else could I get that type
    of information written in such a perfect manner? I have a project that I’m simply now working on, and I have been on the glance out for such info.

  55. This design is incredible! You definitely know
    how to keep a reader entertained. Between your wit and
    your videos, I was almost moved to start my own blog (well,
    almost…HaHa!) Excellent job. I really loved what you had to say, and more than that, how you presented it.
    Too cool!

  56. Hi there would you mind sharing which blog platform you’re using?
    I’m planning to start my own blog in the near future
    but I’m having a tough time making a decision between BlogEngine/Wordpress/B2evolution and Drupal.
    The reason I ask is because your design seems different then most blogs and
    I’m looking for something completely unique.
    P.S Apologies for being off-topic but I had to ask!

  57. An interesting discussion is definitely worth comment.
    I do believe that you need to publish more about this subject, it may not be
    a taboo subject but typically people don’t speak about such topics.
    To the next! Cheers!!

  58. Hey! Someone in my Facebook group shared this site with us so I came to take a look.

    I’m definitely enjoying the information. I’m book-marking and will
    be tweeting this to my followers! Outstanding blog and fantastic style and design.

  59. Its like you read my mind! You appear to
    grasp a lot approximately this, like you wrote the ebook in it or something.
    I believe that you simply can do with some % to drive the message home a bit, however instead of that, this is fantastic blog.
    A great read. I will definitely be back.

  60. Just want to say your article is as surprising. The clearness in your post is
    just great and that i can assume you are knowledgeable in this subject.

    Fine along with your permission allow me to clutch your RSS feed to
    stay updated with coming near near post. Thanks one million and please continue the gratifying work.

  61. You actually make it seem so easy with your presentation but I find this matter to be really
    something which I think I would never understand.

    It seems too complex and extremely broad for me.
    I’m looking forward for your next post, I will
    try to get the hang of it!

  62. I don’t even understand how I ended up right here, but I thought this put up was good.
    I do not recognise who you are but definitely you are going to a famous blogger in the event you aren’t already.
    Cheers!

  63. Hey! This post could not be written any better! Reading through this post reminds me of my old
    room mate! He always kept chatting about this.

    I will forward this article to him. Fairly certain he
    will have a good read. Thanks for sharing!

  64. With havin so much written content do you ever run into any problems of plagorism or copyright violation? My blog has a lot of unique content I’ve either written myself or outsourced but it seems a
    lot of it is popping it up all over the web without my agreement.
    Do you know any techniques to help protect against content from
    being ripped off? I’d really appreciate it.

    1. The truth is that I do not know any subject so that they do not copy the contents of my blog, maybe the GPL license would be useful for us. But I have no idea…

  65. I like the valuable info you provide to your articles.
    I’ll bookmark your blog and test once more right
    here regularly. I am fairly sure I will be informed a lot of new stuff right right here!
    Best of luck for the following!

  66. It’s a shame you don’t have a donate button! I’d without a doubt donate
    to this brilliant blog! I guess for now i’ll settle for book-marking
    and adding your RSS feed to my Google account.
    I look forward to brand new updates and will talk about this site with my Facebook group.
    Talk soon!

  67. Appreciating the persistence you put into your blog and in depth information you provide.
    It’s great to come across a blog every once in a while that isn’t
    the same outdated rehashed information. Wonderful read!
    I’ve bookmarked your site and I’m adding your RSS feeds to my Google account.

  68. I am really inspired along with your writing skills and also with the layout on your blog.
    Is that this a paid subject matter or did you customize it your self?
    Anyway keep up the excellent high quality writing, it’s uncommon to look a nice blog like this one these
    days..

  69. I want to to thank you for this fantastic read!! I absolutely enjoyed every little bit of it.
    I have you saved as a favorite to check out new things you post…

  70. My business is certainly content with your writing ability and even while
    using the design within your blog page. Is mtss is a payed concept
    or possibly does one change it all one self? Anyway preserve the wonderful
    excellent making, it is usually unique to discover an ideal website
    just like it these days.

  71. Right here is the perfect web site for anyone
    who wants to understand this topic. You understand so much its almost
    tough to argue with you (not that I really would want to…HaHa).
    You certainly put a brand new spin on a subject
    that has been discussed for decades. Excellent stuff, just wonderful!

  72. Hmm it seems like your site ate my first comment (it was extremely long) so I guess
    I’ll just sum it up what I wrote and say, I’m
    thoroughly enjoying your blog. I too am an aspiring blog
    blogger but I’m still new to everything. Do you have any suggestions for beginner blog writers?
    I’d genuinely appreciate it.

    1. Sure you have many things to tell, that’s why you like to read blogs like mine. If you have visited my site it is because you are interested in the type of content that I show, so that you can take any type of subject that is interesting to you and expand the information that already exists on that material on the internet. It’s what I do, that’s why I love Linux 😉

  73. Fantastic beat ! I wish to apprentice while you amend your website, how can i subscribe for a blog website?
    The account helped me a acceptable deal. I had been a little bit
    acquainted of this your broadcast offered bright clear idea

  74. When I initially commented I clicked the “Notify me when new comments are added” checkbox and now
    each time a comment is added I gget several e-mails
    with thhe same comment. Is there any way you can remove people
    from that service? Bless you!

  75. Can I just say what a comfort to uncover somebody who truly knows what they’re discussing on the internet.
    You definitely realize how to bring a problem to light and make it important.
    A lot more people have to read this and understand this side of
    the story. I was surprised you are not more popular since
    you surely have the gift.

  76. Good day! This is kind of off topic but I need some advice from an established blog.

    Is it very hard to set up your own blog? I’m not very techincal but
    I can figure things out pretty fast. I’m thinking about making my own but I’m not sure where to
    start. Do you have any points or suggestions? Cheers

    1. What I have hosted in my own home, depends on the location from which you access the load time changes depending on the latency, I live in Spain

  77. There is definately a lot to find out about this topic. I like all of the points
    you have made. It’s the best time to make a few plans for
    the future and it is time to be happy. I’ve learn this post and if I may just
    I wish to suggest you few interesting issues or advice. Perhaps you can write next articles referring to this article.
    I wish to learn even more things approximately it! It
    is the best time to make some plans for the future and it is time to be happy.
    I have read this post and if I could I wish to suggest you few interesting things or tips.
    Perhaps you can write next articles referring to this article.
    I want to read more things about it! http://pepsi.net

  78. Can I simply just say what a relief to find somebody who truly knows what they’re talking about over the internet.
    You actually understand how to bring an issue to light and
    make it important. A lot more people must look at this and understand this side of your story.
    I was surprised you’re not more popular because you certainly possess the gift.

  79. When someone writes an piece of writing he/she keeps the image of a user in his/her mind that
    how a user can understand it. Therefore that’s why this paragraph is
    perfect. Thanks!

  80. Hi there, just became alert to your blog through Google, and
    found that it’s truly informative. I am going to watch out for brussels.

    I will appreciate if you continue this in future.
    A lot of people will be benefited from your writing.
    Cheers!

  81. Hmm is anyone else having problems with the images on this blog
    loading? I’m trying to figure out if its a
    problem on my end or if it’s the blog. Any responses would be greatly appreciated.

  82. Hello would you mind letting me know which
    web host you’re working with? I’ve loaded your blog in 3 completely different web browsers
    and I must say this blog loads a lot quicker then most.

    Can you suggest a good web hosting provider at a honest price?
    Many thanks, I appreciate it!

  83. I believe what you said made a lot of sense. But, think about this, what if you were to create a killer title?

    I ain’t saying your content is not solid., however suppose you added a title
    that grabbed a person’s attention? I mean UFW correctly setting – TheLinuxSect is a little vanilla.
    You ought to look at Yahoo’s front page and see how they create news titles to get viewers
    to click. You might add a related video or a pic or two
    to get people interested about what you’ve got to say.

    Just my opinion, it would bring your posts a
    little livelier.

  84. I’m not sure where you are getting your info, however great topic.

    I must spend a while learning more or understanding
    more. Thank you for fantastic information I was looking
    for this information for my mission.

  85. Greetings, You’ve succesfully done a great position. I’ll most certainly stumbleupon the idea not to mention personally recommend
    to successfully my buddies. I am certain they’ll possibly
    be benefited from this web site.

  86. Terrific work! This is the type of info that are meant to be shared around the
    net. Disgrace on the seek engines for now not positioning this
    post upper! Come on over and seek advice from my web site .
    Thanks =)

  87. I was extremely pleased to uncover this website. I wanted to thank you for your time due to this fantastic read!!

    I definitely loved every little bit of it and I have you book marked to
    look at new information in your website.

  88. I think this is among the so much important info for me. And i am glad reading your
    article. However want to remark on some general issues, The website style
    is ideal, the articles is in reality great : D.
    Excellent process, cheers

  89. We are a group of volunteers and starting a new scheme in our community.
    Your site provided us with valuable information to work
    on. You have done an impressive job and our entire community will be thankful to you.

  90. Thanks for your personal marvelous posting! I definitely enjoyed
    reading it, you might be a great author.I will make certain to bookmark your blog and will eventually come back
    later in life. I want to encourage you continue your great writing,
    have a nice day!

  91. May I simply say what a relief to uncover someone that truly knows what they are discussing online.
    You actually realize how to bring a problem to light and
    make it important. A lot more people really need to check
    this out and understand this side of your story. It’s
    surprising you’re not more popular given that you certainly possess the gift.

Leave a comment

Your email address will not be published. Required fields are marked *