Kan ikke køre iptables script
Hej,Jeg har lige hentet den nyeste Ubuntu og installeret den som "server".
Jeg har fundet et script til iptables, men jeg kan simpelthen ikke få det kørt.
Jeg har lagt det her: /home/jonas/firewall indholdet af firewall er pastet i bunden.
Når jeg prøvet at køre det siger den:
jonas@jonasl:~$ sudo ./firewall
sudo: ./firewall: command not found
#!/bin/bash
# Flushing all tables
iptables -F
### filter
# I only filter INPUT OUTPUT and FORWARD are accepted by default
iptables -t filter -P INPUT DROP
iptables -t filter -P OUTPUT ACCEPT
iptables -t filter -P FORWARD ACCEPT
# allow local loopback connections
iptables -t filter -A INPUT -i lo -j ACCEPT
# drop INVALID connections
iptables -t filter -A INPUT -m state --state INVALID -j DROP
iptables -t filter -A OUTPUT -m state --state INVALID -j DROP
iptables -t filter -A FORWARD -m state --state INVALID -j DROP
# allow all established and related
iptables -t filter -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -t filter -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -t filter -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
# the only ICMP that's accepted is ping but there's a rate limit to prevent DDOS
iptables -t filter -A INPUT -p icmp --icmp-type echo-request -m limit --limit 10/sec -j ACCEPT
#open ports 22 = ssh, 80 = WEB
iptables -t filter -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
iptables -t filter -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
# log all other attempted in going connections
iptables -t filter -A INPUT -j LOG
