LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 03-11-2006, 05:21 PM   #1
ic_torres
Member
 
Registered: Nov 2005
Location: ABAP
Distribution: slackware 12.0, Vector Linux STD 6.0 and 5.8, ZenWalk 4.6.1, OpenBSD 3.9
Posts: 389

Rep: Reputation: 34
rc.firewall to iptables


i would just like to ask, i have a new rc.firewall, i want it to be applied to iptables, how will i do it?
 
Old 03-11-2006, 08:07 PM   #2
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by ic_torres
i would just like to ask, i have a new rc.firewall, i want it to be applied to iptables, how will i do it?
basically, just execute the file...
 
Old 03-12-2006, 01:32 AM   #3
/bin/bash
Senior Member
 
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802

Rep: Reputation: 47
Put rc.firewall in /etc/rc.d directory and make it executable then it will start every time you boot up.
 
Old 03-12-2006, 02:14 AM   #4
ic_torres
Member
 
Registered: Nov 2005
Location: ABAP
Distribution: slackware 12.0, Vector Linux STD 6.0 and 5.8, ZenWalk 4.6.1, OpenBSD 3.9
Posts: 389

Original Poster
Rep: Reputation: 34
sir how will i make it executable? do i just need to copy it at rc.d ?
 
Old 03-12-2006, 02:25 AM   #5
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
to copy the script into /etc/rc.d:
Code:
cp rc.firewall /etc/rc.d/
to set the permissions (make it executable by root, etc):
Code:
chown root:root /etc/rc.d/rc.firewall

chmod 750 /etc/rc.d/rc.firewall
to give regular users permission to see the contents of the file, use a 754 instead:
Code:
chmod 754 /etc/rc.d/rc.firewall
either way, to execute it you could do a:
Code:
/etc/rc.d/rc.firewall
or also a:
Code:
cd /etc/rc.d/

./rc.firewall
but as has been said, slackware is pre-configured to automatically execute any file called /etc/rc.d/rc.firewall at startup...

just my ...

Last edited by win32sux; 03-12-2006 at 02:45 AM.
 
Old 03-12-2006, 07:15 PM   #6
ic_torres
Member
 
Registered: Nov 2005
Location: ABAP
Distribution: slackware 12.0, Vector Linux STD 6.0 and 5.8, ZenWalk 4.6.1, OpenBSD 3.9
Posts: 389

Original Poster
Rep: Reputation: 34
sir isnt that chmod +x etc/rc.d/rc.firewall can be used?

thanks for the help..
 
Old 03-12-2006, 07:33 PM   #7
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by ic_torres
sir isnt that chmod +x etc/rc.d/rc.firewall can be used?
that would make the file executable by any user, which isn't really kosher... yes, i know the iptables/sysctl (assuming that's all you have in there) commands within the script won't work for non-roots, but still - the file is meant to be executed by root - so that's what you should set... to specify that you only want to set executable permission for root (the user that owns the file) do it like:
Code:
chown root:root /etc/rc.d/rc.firewall

chmod u+x /etc/rc.d/rc.firewall
but by using something like (for example):
Code:
chmod 744 /etc/rc.d/rc.firewall
you make sure everything else is fine too (non-root users can only read the file)... either way, you can always check your permissions with a:
Code:
ls -l /etc/rc.d/rc.firewall

Last edited by win32sux; 03-12-2006 at 07:41 PM.
 
Old 03-12-2006, 11:33 PM   #8
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
I don't know where you got your rc.firewall script,
but the most popular one on the internet will NOT
work with Slackware until you make a modification.
Make sure you have the correct path to iptables
(/usr/sbin/iptables) or it won't run at all.
 
Old 03-13-2006, 02:38 AM   #9
rayan
LQ Newbie
 
Registered: Mar 2006
Posts: 2

Rep: Reputation: 0
hi every body

im rayan and this is my first time to joint to this forum,my question is wich disto is best for blocking open port? thanks and good bless
 
Old 03-13-2006, 03:08 AM   #10
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by rayan
hi every body

im rayan and this is my first time to joint to this forum,my question is wich disto is best for blocking open port? thanks and good bless
welcome to LQ...

port blocking is not a distro thing... it's a firewall thing, and all distros come with the same firewall system - netfilter...

please don't jump into ongoing threads to ask your questions unless they are completely related to the thread's original post (this is definitely not a "which distro" thread)... you should open your own thread instead... a good place to open your thread would be here...

good luck!!
 
Old 03-13-2006, 05:58 AM   #11
ic_torres
Member
 
Registered: Nov 2005
Location: ABAP
Distribution: slackware 12.0, Vector Linux STD 6.0 and 5.8, ZenWalk 4.6.1, OpenBSD 3.9
Posts: 389

Original Poster
Rep: Reputation: 34
Quote:
Originally Posted by Chinaman
I don't know where you got your rc.firewall script,
but the most popular one on the internet will NOT
work with Slackware until you make a modification.
Make sure you have the correct path to iptables
(/usr/sbin/iptables) or it won't run at all.

so meaning i have to STILL LINK rc.firewall to iptables before it can function? ?
 
Old 03-13-2006, 06:09 AM   #12
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by ic_torres
so meaning i have to STILL LINK rc.firewall to iptables before it can function? ?
no... it means you open your iptables script (rc.firewall) with a text editor and change anything that says "/sbin/iptables" to "/usr/sbin/iptables"... the reason the "/usr" isn't usually put is because most scripts assume the person using them will be runnig a redhat based distro or something like that... for example, if you spot something like this:
Code:
IPT="/sbin/iptables"
you'd wanna change it to
Code:
IPT="/usr/sbin/iptables"
why don't you just post your script??
 
Old 03-13-2006, 05:26 PM   #13
ic_torres
Member
 
Registered: Nov 2005
Location: ABAP
Distribution: slackware 12.0, Vector Linux STD 6.0 and 5.8, ZenWalk 4.6.1, OpenBSD 3.9
Posts: 389

Original Poster
Rep: Reputation: 34
ok..il be updating you soon.. i have just reinstalled my slack the other day, coz before, rc.firewall is linked to my iptables.. but now, i was told that rc.firewall could just be copied and executed (so i also posted a thread in this forum to verify) il be posting my rc.firewall asap.. thanks
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Iptables with iptables-firewall.conf arno's matt3333 Slackware 16 06-28-2007 07:20 AM
How does my iptables firewall look? gian2oo1 Linux - Security 2 10-20-2005 08:27 PM
iptables firewall ninjaz Linux - Networking 2 10-20-2005 10:19 AM
IPTABLES firewall Vs rc firewall netguy2000 Linux - Security 7 02-28-2004 04:31 AM
Firewall/iptables brentos Linux - Security 14 11-25-2003 05:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 12:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration