Quantcast

Firewall for Linux users

Apparently Linux is now cool. Discuss it here!

Moderators: [SCUM] FeRoL, [SCUM] OUTLAW

Firewall for Linux users

Postby [SCUM] McPhil » 02 Mar 2009, 18:34

================================
Linux has a built in firewall called IPTABLES

To find it in your installation, open a shell and type:

#locate iptables

You'll probably get a long scrolling list, but the firewall settings can usually be found at:

/etc/sysconfig/iptables

etc - pronounced "et-see" has many system files within. Careful modding any file in the etc folder while logged in as root.

Once you identify the iptables location, you can look at or even edit the file through the shell. There are many ways to edit files in Linux. The oldest being vi, but the commands in vi can be troublesome for beginning linux users. I would recommend using pico or nano to look at your files for now. Try nano first as most of the commands you need to exit, save and exit, search files will be at the bottom of the shell window.

[root@bob ~]# nano /etc/sysconfig/iptables
[root@bob ~]# nano /etc/sysconfig/iptables-config
[root@bob ~]# nano /etc/sysconfig/iptables.save

Don't touch any settings, just have a look and see what ports are open. Feel free to change port 80 to port 81 and then save and exit (commands are at the bottom of the shell - in my environment Ctrl + x will save and exit). Then try to open a browser to access the web. It won't. nano in to the file again by hitting the up arrow on your keyboard (you can see a history of all your work and typed commands by doing this). Change the port back to 80, save then exit. Try your browser. You should be able to access the internets again.

There are third-party apps to make tweaking your firewall/iptables through an application, but if you're hell bent on learning Linux, then you need to learn it the proper way - through a shell.
User avatar
[SCUM] McPhil
Super Admin
Super Admin
 
Posts: 2190
Joined: 06 Jul 2006, 18:33

Re: Firewall for Linux users

Postby [SCUM]-Herbs » 04 Mar 2009, 17:34

nice one
User avatar
[SCUM]-Herbs
Administrator
Administrator
 
Posts: 1167
Joined: 07 Jul 2006, 10:09
Location: Kent

Re: Firewall for Linux users

Postby [SCUM] Leroy » 04 Mar 2009, 19:18

Thanks for the info McPhil. I really like the terminal - so many possibilities - directly download Java for one
User avatar
[SCUM] Leroy
Super Admin
Super Admin
 
Posts: 403
Joined: 06 Jul 2006, 22:27
Location: Up a tree


Return to Linux Related Stuff

cron