Basic firewall config (just port 80 and ssh 22)

Support for security such as Firewalls and securing linux
Post Reply
greenmug
Posts: 5
Joined: 2012/07/30 10:52:16

Basic firewall config (just port 80 and ssh 22)

Post by greenmug » 2012/08/01 15:26:15

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

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Basic firewall config (just port 80 and ssh 22)

Post by gerald_clark » 2012/08/01 15:30:02

system-config-firewall

greenmug
Posts: 5
Joined: 2012/07/30 10:52:16

Re: Basic firewall config (just port 80 and ssh 22)

Post by greenmug » 2012/08/01 15:36:12

command not found.

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Basic firewall config (just port 80 and ssh 22)

Post by gerald_clark » 2012/08/01 16:03:09

man yum

User avatar
vonskippy
Posts: 839
Joined: 2006/12/30 03:00:04
Location: Western Slope Colorado

Re: Basic firewall config (just port 80 and ssh 22)

Post by vonskippy » 2012/08/01 17:19:56

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).

Post Reply