LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 02-11-2005, 11:36 PM   #31
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 379Reputation: 379Reputation: 379Reputation: 379

actually, you don't really need to be root for the chmod... only for executing the file (because all the commands in the file require root permission)...

remember to do the "service iptables save" thing after you execute the script - before you reboot...


Last edited by win32sux; 02-11-2005 at 11:38 PM.
 
Old 02-11-2005, 11:40 PM   #32
wardialer
Member
 
Registered: Sep 2004
Distribution: SUSE Linux Pro 9.3
Posts: 375

Original Poster
Rep: Reputation: 30
So just to recap for you what I did:

1. I Pasted your script into Kedit
2. Saved it as 'iptables.txt' into the /home/username/documents/iptables.txt

Should I execute the file first before I chmod +x iptables.txt???

What do I have to do in order???


Then what should I do??? I still have to remove the old script from the rc.local

Last edited by wardialer; 02-11-2005 at 11:42 PM.
 
Old 02-11-2005, 11:44 PM   #33
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 379Reputation: 379Reputation: 379Reputation: 379
Quote:
Originally posted by wardialer
So just to recap for you what I did:

1. I Pasted your script into Kedit
2. Saved it as 'iptables.txt' into the /home/username/documents/iptables.txt


Then what should I do??? I still have to remove the old script from the rc.local
yes, make sure you delete all the iptables stuff you had put in your rc.local before you reboot... it's VERY important to do that... if you don't then all of this is pointless...

okay, after saving the file as /home/username/documents/iptables.txt you'd do this:


Code:
cd /home/username/documents

chmod +x iptables.txt
or with one line like this:

Code:
chmod +x /home/username/documents/iptables.txt
(it's the same effect)


then you become root (su) and do this:

Code:
cd /home/username/documents

./iptables.txt

service iptables save

reboot

Last edited by win32sux; 02-11-2005 at 11:49 PM.
 
Old 02-11-2005, 11:45 PM   #34
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 379Reputation: 379Reputation: 379Reputation: 379
Quote:
Originally posted by wardialer
Should I execute the file first before I chmod +x iptables.txt???
ummm... how can you execute the file before you've made it executable??

=)
 
Old 02-11-2005, 11:49 PM   #35
wardialer
Member
 
Registered: Sep 2004
Distribution: SUSE Linux Pro 9.3
Posts: 375

Original Poster
Rep: Reputation: 30
Ok I got it.

I will post (after I reboot) the output of the iptables -L

So stick around for me.
 
Old 02-11-2005, 11:52 PM   #36
wardialer
Member
 
Registered: Sep 2004
Distribution: SUSE Linux Pro 9.3
Posts: 375

Original Poster
Rep: Reputation: 30
The only problem is, that I dont see the TXT extension on the iptables. Should I enter the TXT when I do an execute command??? Or leave it blank as just iptables??
 
Old 02-11-2005, 11:55 PM   #37
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 379Reputation: 379Reputation: 379Reputation: 379
Quote:
Originally posted by wardialer
The only problem is, that I dont see the TXT extension on the iptables. Should I enter the TXT when I do an execute command??? Or leave it blank as just iptables??
you're talking about the script, right??

do an "ls -l" and it will show you the name and permissions of the file:

Code:
cd /home/username/documents

ls -l
the permissions for it should look like this: -rwxr-xr-x


Last edited by win32sux; 02-11-2005 at 11:58 PM.
 
Old 02-11-2005, 11:59 PM   #38
wardialer
Member
 
Registered: Sep 2004
Distribution: SUSE Linux Pro 9.3
Posts: 375

Original Poster
Rep: Reputation: 30
rw-rw-r-- 1 vin001 vin001 5346 Oct 31 19:12 0,14179,2822483,00_print.html
-rw-rw-r-- 1 vin001 vin001 1943956 Nov 7 20:18 best_ibm.pdf
drwxrwxr-x 3 vin001 vin001 4096 Jan 31 10:15 Desktop/
drwxrwxr-x 3 vin001 vin001 4096 Aug 22 20:34 doc/
drwxrw---- 14 vin001 vin001 4096 Feb 11 13:55 Documents/
drwx------ 8 vin001 vin001 4096 Jan 29 15:55 evolution/
drwxr-xr-x 12 vin001 vin001 4096 Oct 14 12:53 firefox-installer/
-rw-rw-r-- 1 vin001 vin001 1131065 Nov 9 21:45 firewall-1_datasheet.pdf
drwxr-xr-x 3 vin001 vin001 4096 Aug 12 2004 GNUstep/
-rw-rw-r-- 1 vin001 vin001 75888 Oct 18 08:44 HP-UX_11i_datasheet.pdf
-rw-rw-r-- 1 vin001 vin001 321049 Nov 2 17:19 hp-ux 11i v2 for Itanium-based and PA-RISC systems
-rw-rw-r-- 1 vin001 vin001 2419047 Nov 2 17:23 HP-UX 11i Version 2 Installation and Update Guide
-rw-rw-r-- 1 vin001 vin001 3277510 Oct 15 15:39 HP-UX Host Intrusion Detection System Admin Guide
drwxr-xr-x 2 vin001 vin001 4096 May 20 2004 install_flash_player_7_linux/
-rw-rw-r-- 1 vin001 vin001 4150680 Nov 2 19:00 Installing and Updating HP-UX 10.x HP 9000

Am i done yet???? Please tell me what I have to do??? It saved it as a Shell-script.
drwx------ 7 vin001 vin001 4096 Oct 27 12:28 Mail/
-rw-rw-r-- 1 vin001 vin001 3361 Oct 26 09:29 openbsd_pb.gif
-rw-rw-r-- 1 vin001 vin001 36427 Oct 25 08:43 orig00002468.jpg
-rw-rw-r-- 1 vin001 vin001 8999064 Nov 14 03:38 pspf.exe
drwxrwxr-x 8 vin001 vin001 4096 Oct 17 09:15 thunderbird/
drwx------ 2 vin001 vin001 4096 Oct 23 23:48 tmp/
lrwxrwxrwx 1 root root 10 Dec 31 12:21 ttyS2 -> /dev/ttyS2
drwxr-xr-x 2 vin001 vin001 4096 Oct 25 08:50 user.php_files/
-rw-rw-r-- 1 vin001 vin001 22068 Oct 25 08:50 user.php.html

Last edited by wardialer; 02-12-2005 at 12:00 AM.
 
Old 02-12-2005, 12:00 AM   #39
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 379Reputation: 379Reputation: 379Reputation: 379
make sure that you type the ./ in front of the filename to execute it...

Code:
./example.txt
being that it's a shell script, you could also execute it like this:

Code:
sh example.txt

Last edited by win32sux; 02-12-2005 at 12:01 AM.
 
Old 02-12-2005, 12:04 AM   #40
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 379Reputation: 379Reputation: 379Reputation: 379
i think you did the "-ls -l" in the wrong folder... you said you put the file in /home/username/documents but what you just posted looks like /home/username
 
Old 02-12-2005, 12:04 AM   #41
wardialer
Member
 
Registered: Sep 2004
Distribution: SUSE Linux Pro 9.3
Posts: 375

Original Poster
Rep: Reputation: 30
I am very very very LOST and I wont be done with this till midnight.

I Saved it as 'Firewall' but the file Type is a Shell Script.

Please tell me what to do???????!!!!!!!! PLEASE. List the commands in order. I am getting really frusterated here.

Quote:
being that it's a shell script, you could also execute it like this:
Quote:
sh example.txt
Ok, like again, yuor giving me all different commands here. This is why its confusing. Please stop giving me different commands here. Please....

Now what should I do. Because Im lost again. Im afraid so.

Last edited by wardialer; 02-12-2005 at 12:08 AM.
 
Old 02-12-2005, 12:09 AM   #42
wardialer
Member
 
Registered: Sep 2004
Distribution: SUSE Linux Pro 9.3
Posts: 375

Original Poster
Rep: Reputation: 30
cd /home/username/documents

./iptables.txt

sh example.txt

service iptables save

reboot


Is this OK or not????
 
Old 02-12-2005, 12:09 AM   #43
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 379Reputation: 379Reputation: 379Reputation: 379
Quote:
Originally posted by wardialer
I Saved it as 'Firewall' but the file Type is a Shell Script.
first you said you saved it as firewall.txt, then it was iptables.txt, now it's Firewall... which is it??

i don't see any file with those names in the "ls -l" you have posted... i think you were in the wrong folder when you did that... try changing to the folder called "Documents" and then look in there...

Code:
cd Documents

ls -l
i'm sorry that you're frustrated but i'm doing my best to help you...
 
Old 02-12-2005, 12:10 AM   #44
wardialer
Member
 
Registered: Sep 2004
Distribution: SUSE Linux Pro 9.3
Posts: 375

Original Poster
Rep: Reputation: 30
cd /home/username/documents

./iptables.txt

sh example.txt

service iptables save

reboot

Is this OK or not????


If this is not OK, then I dont know what to do. I dont know what to say beyond this point...

I save it in /home/myusername/documents/firewall

Last edited by wardialer; 02-12-2005 at 12:12 AM.
 
Old 02-12-2005, 12:12 AM   #45
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 379Reputation: 379Reputation: 379Reputation: 379
Quote:
Originally posted by wardialer
Ok, like again, yuor giving me all different commands here. This is why its confusing. Please stop giving me different commands here. Please....
so now you're blaming the guy that's trying to help you?? it's not like i ONLY put the two commands, i also provided an explanation as to WHY you could use either one... in linux there always more than one way to do things - GET USED TO IT...
 
  


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
Firewall script simcox1 Linux - Security 7 11-13-2005 12:08 PM
slackware's /etc/rc.d/rc.firewall equivalent ||| firewall script startup win32sux Debian 1 03-06-2004 09:15 PM
Firewall script help!!!! cirkut5732 Linux - Newbie 8 04-17-2003 06:09 PM
Could you look over my firewall script please... Grim Reaper Linux - Networking 8 03-26-2003 03:33 AM
Firewall script help jfall Linux - Networking 6 10-23-2002 03:46 AM

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

All times are GMT -5. The time now is 07:16 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration