Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here. |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
03-11-2006, 05:21 PM
|
#1
|
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:
|
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?
|
|
|
03-11-2006, 08:07 PM
|
#2
|
LQ Guru
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870
|
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...
|
|
|
03-12-2006, 01:32 AM
|
#3
|
Senior Member
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802
Rep:
|
Put rc.firewall in /etc/rc.d directory and make it executable then it will start every time you boot up.
|
|
|
03-12-2006, 02:14 AM
|
#4
|
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:
|
sir how will i make it executable? do i just need to copy it at rc.d ?
|
|
|
03-12-2006, 02:25 AM
|
#5
|
LQ Guru
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870
|
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.
|
|
|
03-12-2006, 07:15 PM
|
#6
|
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:
|
sir isnt that chmod +x etc/rc.d/rc.firewall can be used?
thanks for the help.. 
|
|
|
03-12-2006, 07:33 PM
|
#7
|
LQ Guru
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870
|
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.
|
|
|
03-12-2006, 11:33 PM
|
#8
|
HCL Maintainer
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Gentoo on headless; Arch on everything that requires a GUI
Posts: 6,941
Rep: 
|
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.
|
|
|
03-13-2006, 02:38 AM
|
#9
|
LQ Newbie
Registered: Mar 2006
Posts: 2
Rep:
|
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
|
|
|
03-13-2006, 03:08 AM
|
#10
|
LQ Guru
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870
|
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!!
|
|
|
03-13-2006, 05:58 AM
|
#11
|
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:
|
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? ?
|
|
|
03-13-2006, 06:09 AM
|
#12
|
LQ Guru
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870
|
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??
|
|
|
03-13-2006, 05:26 PM
|
#13
|
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:
|
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 
|
|
|
All times are GMT -5. The time now is 03:57 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|