LinuxQuestions.org
Visit Jeremy's Blog.
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 05-02-2001, 06:47 PM   #1
spanky5125
LQ Newbie
 
Registered: Apr 2001
Location: Washington State
Posts: 7

Rep: Reputation: 0
Exclamation


I have Redhat for dummies.... I.E. Me..
I want to create a firewall, and in the book that came with my redhat, it just makes statements that I don't understand.

It says... "Create a script called, "ipfilter.eth0" in the /usr/local/etc directory" ???????? HOW.....
and also.. do I type the symbol "#" when I type the lines???

any help would be great.. thanks
 
Old 05-03-2001, 04:56 AM   #2
raz
Member
 
Registered: Apr 2001
Location: London
Posts: 408

Rep: Reputation: 31
hummm.
Like DOS you can create batch files in Linux called scripts.
But due to the permissions you have to tell the file its an executable.

to create and empty script file in Linux type this:
# (this is the prompt you should have when your root)
$ su - root
password:
# echo '#!/bin/sh' > /usr/local/etc/ipfilter.eth0

this has made the start of a shell script in the directory you said.

now you have to tell the system you want it executable.

# chmod 700 /usr/local/etc/ipfilter.eth0

Now you just have to learn how to write shell scripts and run the file with your program in it.

/Raz
 
Old 01-04-2002, 08:46 AM   #3
Osz
LQ Newbie
 
Registered: Jan 2002
Posts: 1

Rep: Reputation: 0
Question Here's what I didn't understand...

This is what I did, not sure what to make of it:

1) Copied the files ipfilter.rules and ipfilter.release from CD3 into the /usr/local/etc/ directory

2) Did a search and replace for ppp0 to eth0 on ipfilter.rules

3) Saved ipfilter.rules as ipfilter.eth0

4) Did a chmod 770 /usr/local/etc/ipfilter.*

5) Tried to execute the ipfilter.eth0 file, with no joy. Tried again, rinse, lather, repeat, no joy.

6) Read this post

7) Deleted both files, and did the "# echo '#!/bin/sh' > /usr/local/etc/ipfilter.eth0" command, which created the new ipfilter.eth0 file

8) Opened the file from the CD, copied the contents, and pasted it into the new ipfilter.eth0 file. Searched, Replaced, Saved. Did the same steps to create and past into the ipfilter.release.

9) Did the same chmod command, chmod 770 /usr/local/etc/ipfilter.*

10) They executed and worked as designed

Here's my question... why did the file(s) on the CD not execute after the chmod, but when I first created the file locally then pasted the same contents, it worked w/o a problem?

Thanks! Newbie here
 
Old 01-04-2002, 08:58 AM   #4
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
As far as I can see the second time you added the first line, which said '#!/bin/sh'. This line the shell which program should run the script. If you don't include that file it won't run unless you specifically tell it to run with that program. Like 'sh scriptfile'.
 
Old 01-04-2002, 09:46 AM   #5
bluecadet
Member
 
Registered: Oct 2001
Distribution: MD81 RH71
Posts: 555

Rep: Reputation: 30
well, you don't HAVE to specify the shell to run it in. if you don't include #!/bin/sh then it'll just drop the commands to the chell you are currently using, e.g. bash or sh. you have to specify perl or awk tho, as those commands mean nothign to sh
 
Old 01-08-2002, 10:22 AM   #6
browny_amiga
Member
 
Registered: Dec 2001
Location: /mnt/UNV/Mlkway/Earth/USA/California/Silicon Valley
Distribution: Kubuntu, Debian Buster Stable, Windoze 7
Posts: 684

Rep: Reputation: 56
Thanks, you saved my day!

I had the same problem, a script that just would not run.

Your post was really helpful, thanks!!!

Keep up the great spirit, Linux is getting into my heart more and more!!! ;-)

Thanks

Markus
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
help with writing a script jedimastermopar Linux - General 10 05-02-2005 02:34 PM
help writing script willinusf Programming 7 07-20-2004 12:37 PM
Help writing a rm script VisionZ Linux - Newbie 17 03-24-2004 08:15 AM
Help Writing a script. teeth44 Programming 2 10-14-2003 01:00 PM
Writing a Script Nyc0n Linux - General 2 05-27-2002 08:21 PM

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

All times are GMT -5. The time now is 02:15 PM.

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