LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-25-2004, 11:29 AM   #1
ciberrust
Member
 
Registered: Dec 2003
Location: AUS
Distribution: CentOs, OpenSuse, Ubuntu, Leopard :D
Posts: 97

Rep: Reputation: 15
Unhappy : bad interpreter: No such file or directory


hi... i was wondering if someone else had this problem runing
"./rc.firewall"
?

any help?

i already check the file with vim to see if there are any characters using ^M or something like but don't so i'm kind of scared here... i have to get this job done by today... it was working god i restarted the os and try to run the rcfirewall and got that error....

i also have the "sh" file under bin...

Last edited by ciberrust; 11-25-2004 at 11:33 AM.
 
Old 11-25-2004, 12:41 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Can you post the contents of the file.
 
Old 11-25-2004, 12:54 PM   #3
ciberrust
Member
 
Registered: Dec 2003
Location: AUS
Distribution: CentOs, OpenSuse, Ubuntu, Leopard :D
Posts: 97

Original Poster
Rep: Reputation: 15
#!/bin/sh
#DHCP Internet and Connection Sharing Script

# Use Ports as 22 [ssh]
/sbin/iptables -A INPUT -p tcp --dport 21 -j ACCEPT
/sbin/iptables -A INPUT -p tcp --dport 22 -j ACCEPT
/sbin/iptables -A INPUT -p tcp --dport 1400 -j ACCEPT
/sbin/iptables -A PREROUTING -t nat -p tcp -i eth0 --dport 555 -j DNAT --to 192.168.1.2:555
/sbin/iptables -A PREROUTING -t nat -p udp -i eth0 --dport 555 -j DNAT --to 192.168.1.2:555

/sbin/iptables -A FORWARD -p tcp --destination-port 555 -j ACCEPT
/sbin/iptables -A PREROUTING -t nat -p tcp -i eth0 --dport 411 -j DNAT --to 192.168.1.2:411
/sbin/iptables -A FORWARD -p tcp --destination-port 411 -j ACCEPT

#localhost 127.0.0.1 and icmp
/sbin/iptables -A INPUT -s 127.0.0.1 -d 127.0.0.1 -j ACCEPT
/sbin/iptables -A FORWARD -s 127.0.0.1 -d 127.0.0.1 -j ACCEPT
/sbin/iptables -A OUTPUT -s 127.0.0.1 -d 127.0.0.1 -j ACCEPT

/sbin/iptables -A INPUT -p icmp -m state --state RELATED,ESTABLISHED -j ACCEPT
/sbin/iptables -A OUTPUT -p icmp -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT

#Net Sharing
modprobe iptable_nat
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
/sbin/iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
/sbin/iptables -A INPUT -i lo -j ACCEPT
/sbin/iptables -A INPUT -j LOG --log-level 4 --log-prefix "ATTACK"
/sbin/iptables -A INPUT -i eth0 -j DROP
#Add your additional rule here
/sbin/iptables -t nat -A POSTROUTING -s 192.168.1.1/24 -j MASQUERADE

Last edited by ciberrust; 11-25-2004 at 12:55 PM.
 
Old 11-25-2004, 01:20 PM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
It does seem a bit odd. Have you tried changing the shebang line to "#!/bin/bash"
 
Old 11-25-2004, 01:46 PM   #5
ciberrust
Member
 
Registered: Dec 2003
Location: AUS
Distribution: CentOs, OpenSuse, Ubuntu, Leopard :D
Posts: 97

Original Poster
Rep: Reputation: 15
yes

know i change everithing to the original file and i get
"bash: ./rc.firewall: Permission denied"

i don't know what to do
 
Old 11-25-2004, 01:50 PM   #6
ciberrust
Member
 
Registered: Dec 2003
Location: AUS
Distribution: CentOs, OpenSuse, Ubuntu, Leopard :D
Posts: 97

Original Poster
Rep: Reputation: 15
when i do the chmod u+x command i get now the same error

no such file...
 
Old 11-25-2004, 01:50 PM   #7
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
What are the permissions on the file:
ls -l rc.firewall
 
Old 11-25-2004, 01:51 PM   #8
ciberrust
Member
 
Registered: Dec 2003
Location: AUS
Distribution: CentOs, OpenSuse, Ubuntu, Leopard :D
Posts: 97

Original Poster
Rep: Reputation: 15
-rwxr--r-- 1 root root 1138 Nov 25 14:46 rc.firewall
 
Old 11-25-2004, 02:04 PM   #9
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Something odd is going on if you can't even chmod another file.

Can you open up another terminal ok? If so, what happens if you create a simple bash script and run that?
 
Old 11-25-2004, 02:09 PM   #10
ciberrust
Member
 
Registered: Dec 2003
Location: AUS
Distribution: CentOs, OpenSuse, Ubuntu, Leopard :D
Posts: 97

Original Poster
Rep: Reputation: 15
i can run without problems "rc.local"

so i copy the star of this file and put it on the rcfirewall header... but nothing

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
modprobe ip_nat_ftp
modprobe ip_conntrack_ftp
modprobe iptable_nat
modprobe ip_conntrack
 
Old 09-09-2010, 06:51 AM   #11
aneeshk_k
LQ Newbie
 
Registered: Oct 2004
Posts: 17

Rep: Reputation: 1
Looks like the file is a DOS file. Use dos2unix command.

Usage: dos2unix file.sh
 
  


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
bad interpreter: No such file or directory EcLip$e Linux - General 34 10-07-2013 03:11 AM
"bad interpreter : no such file or directory" when configure "flex" acer_peri Linux - Software 10 11-10-2010 01:19 AM
: bad interpreter: No such file or directory lnx8 Linux - General 4 04-29-2004 02:56 AM
bash: ./fam_mirror: bad interpreter: No such file or directory linuxboy69 Linux - Software 5 12-22-2003 11:35 AM
bash: ./myscript: bad interpreter: No such file or directory Stefangeelen Linux - Newbie 3 09-05-2002 01:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:30 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