Hi
I have CentOS 6 installed.
If I wanted to clear out the iptables firewall and just allow port 80 for web and 22 for ssh, is there a quick command to clear out and add in the appropriate rules and ensure it starts each reboot? Everything else to the server should be dropped as all I need it a web server delivering simple html pages and a few other files, and ssh to log on remotely.
kind regards
Basic firewall config (just port 80 and ssh 22)
-
- Posts: 10642
- Joined: 2005/08/05 15:19:54
- Location: Northern Illinois, USA
Basic firewall config (just port 80 and ssh 22)
system-config-firewall
Re: Basic firewall config (just port 80 and ssh 22)
command not found.
-
- Posts: 10642
- Joined: 2005/08/05 15:19:54
- Location: Northern Illinois, USA
Re: Basic firewall config (just port 80 and ssh 22)
Just setup and config your firewall via the Command Line using Nano (instead of the more complex VIM).
If nano isn't installed, run 'yum install nano' and it there you go.
Here's a good "getting started" tutorial on setting up IPTABLES on CentOS.
http://www.cyberciti.biz/faq/rhel-fedorta-linux-iptables-firewall-configuration-tutorial/
Don't forget to config ssh NOT to allow 'root' access (i.e. login as a user then su up if needed), and unless you want a ton of log spam, set ssh to use something other then TCP22 (or just restrict access to ssh via IPTABLES and a trusted IP).
If nano isn't installed, run 'yum install nano' and it there you go.
Here's a good "getting started" tutorial on setting up IPTABLES on CentOS.
http://www.cyberciti.biz/faq/rhel-fedorta-linux-iptables-firewall-configuration-tutorial/
Don't forget to config ssh NOT to allow 'root' access (i.e. login as a user then su up if needed), and unless you want a ton of log spam, set ssh to use something other then TCP22 (or just restrict access to ssh via IPTABLES and a trusted IP).