How to quickly test / assess and set up firewalld?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to quickly test / assess and set up firewalld?
I have the latest release of CentOS7, and I did yum install firewalld earlier today. I've been entering some commands, but nothing advanced, and I would say that like 90-100 of it should be good.
I had some issues with sftp connection, but it was not related to firewalld. At this point it looks like firewalld is blocking httpd, as when it is turn on websites dont show, and when I turn it off they load almost right away.
I want to use this Linux installation for Apache web server, sftp connection (vsftpd), email (probably, I have not installed it yet, so this does not even count), and nothing else.
How would I make sure that firewalld settings are correct for this (unchanged, possibly only in the minimal way), and that everything works as it should, especially the httpd...
This is probably like two or three commands, and it is done. I just dont have that general understanding and perspective of how this works. I read quite a lot about it, but still I am not sure if I have it where it needs to be, settings-wise, at this point.
I mean, default zone - public, ssh enabled to there, in order for httpd to work - do this. What else would be good to do or check here?
Last edited by AdultFoundry; 10-31-2015 at 03:02 PM.
Try firewall-cmd. To see what ports are open, use firewall-cmd --list-ports. To open port 80, firewall-cmd --add-port 80/tcp.
This is to the point, and it makes sense. I added the 80 and the websites work. I will make it --permanent, and so on, I read about that... I use sftp, ssh, and Apache web server, so I guess I need these two ports open, and nothing else.
Would I just leave it as is, and move on, or would there be any other settings / configurations that I could check... Like I said, I am particular about these things, as I want to figure out the best way to go with all the aspects of configuring these things, make notes, and based the further work on this. I want it to be 100% good / correct, so to speak, understand as much as I need to, before moving on to the next step.
This is to the point, and it makes sense. I added the 80 and the websites work. I will make it --permanent, and so on, I read about that... I use sftp, ssh, and Apache web server, so I guess I need these two ports open, and nothing else.
Yes, I forgot about the --permanent option. Great that you found it.
Quote:
Would I just leave it as is, and move on, or would there be any other settings / configurations that I could check... Like I said, I am particular about these things, as I want to figure out the best way to go with all the aspects of configuring these things, make notes, and based the further work on this. I want it to be 100% good / correct, so to speak, understand as much as I need to, before moving on to the next step.
Centos has a very tight firewall; by default, it only opens the ssh port and allows ICMP packets (i.e., ping). This is for a good reason, as you can imagine.
Only open the ports you must. If you run a web server, open the http and (if your web server also features secure http) https ports. If you run a mail server, the SMTP port. Set up your firewall for ftp if you have an ftp server. And so on. Don't open ports because you think you might need them some time; as you could see, it's almost trivial to open them at the moment you need them. Keep your system as locked up as possible.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.