Wieso kann ich meinen SVN-server nicht von ausserhalb erreichen?
Vserver mit Firewall kann nicht von aussen auf port 3690 angesprochen werden. Wie kommt das?
Hallo, Administratoren.
Ich richte gerade einen VServer (Debian Lenny) ein. Auf diesem habe ich Subversion installiert, die svnserve.conf meinen beduerfnissen angepasst und der dienst funktioniert soweit auch, jedoch nur, wenn ich ihn vom server aus ueber localhost anspreche.
Auf dem Server laufen iptables. Ich habe versucht mit dem Command "iptables -A INPUT -m state --state NEW -m tcp -p tcp -dport 3690 -j ACCEPT" den noetigen ACCEPT-eintrag hinzuzufuegen. Leider ohne erfolg.
Ebenfalls habe ich versucht per telnet auf pot 3690 zu verbinden, was per localhost auch klappt, jedoch wieder nicht von aussen, deswegen gehe ich stark davon aus, dass die IPtables den zugriff, den ich brauche einschraenken.
Meine IPtables sehen so aus:
[code]
Chain INPUT (policy DROP)
target prot opt source destination
fail2ban-ssh tcp -- anywhere anywhere multiport dports ssh
LOG all -- anywhere anywhere state INVALID limit: avg 2/sec burst 5 LOG level warning prefix `INPUT INVALID '
DROP all -- anywhere anywhere state INVALID
MY_DROP tcp -- anywhere anywhere tcp flags:FIN,SYN,RST,PSH,ACK,URG/NONE
MY_DROP tcp -- anywhere anywhere tcp flags:FIN,SYN/FIN,SYN
MY_DROP tcp -- anywhere anywhere tcp flags:SYN,RST/SYN,RST
MY_DROP tcp -- anywhere anywhere tcp flags:FIN,RST/FIN,RST
MY_DROP tcp -- anywhere anywhere tcp flags:FIN,ACK/FIN
MY_DROP tcp -- anywhere anywhere tcp flags:PSH,ACK/PSH
MY_DROP tcp -- anywhere anywhere tcp flags:ACK,URG/URG
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT icmp -- anywhere anywhere icmp echo-reply
ACCEPT icmp -- anywhere anywhere icmp destination-unreachable
ACCEPT icmp -- anywhere anywhere icmp source-quench
ACCEPT icmp -- anywhere anywhere icmp echo-request
ACCEPT icmp -- anywhere anywhere icmp time-exceeded
ACCEPT icmp -- anywhere anywhere icmp parameter-problem
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:www
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:https
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:smtp
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssmtp
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:pop3
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:pop3s
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:imap2
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:imaps
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:nntp
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:domain
ACCEPT udp -- anywhere anywhere state NEW udp dpt:domain
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ftp
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:mysql
ACCEPT udp -- anywhere anywhere state NEW udp dpt:ntp
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:6060
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ircd
MY_REJECT all -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:svn
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:3980
Chain FORWARD (policy DROP)
target prot opt source destination
Chain OUTPUT (policy DROP)
target prot opt source destination
LOG all -- anywhere anywhere state INVALID limit: avg 2/sec burst 5 LOG level warning prefix `OUTPUT INVALID '
DROP all -- anywhere anywhere state INVALID
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere state NEW,RELATED,ESTABLISHED
ACCEPT icmp -- anywhere anywhere icmp echo-reply
ACCEPT icmp -- anywhere anywhere icmp destination-unreachable
ACCEPT icmp -- anywhere anywhere icmp echo-request
MY_REJECT all -- anywhere anywhere
Chain MY_DROP (7 references)
target prot opt source destination
LOG all -- anywhere anywhere limit: avg 2/sec burst 5 LOG level warning prefix `PORTSCAN DROP '
DROP all -- anywhere anywhere
Chain MY_REJECT (2 references)
target prot opt source destination
LOG tcp -- anywhere anywhere limit: avg 2/sec burst 5 LOG level warning prefix `REJECT TCP '
REJECT tcp -- anywhere anywhere reject-with tcp-reset
LOG udp -- anywhere anywhere limit: avg 2/sec burst 5 LOG level warning prefix `REJECT UDP '
REJECT udp -- anywhere anywhere reject-with icmp-port-unreachable
LOG icmp -- anywhere anywhere limit: avg 2/sec burst 5 LOG level warning prefix `DROP ICMP '
DROP icmp -- anywhere anywhere
LOG all -- anywhere anywhere limit: avg 2/sec burst 5 LOG level warning prefix `REJECT OTHER '
REJECT all -- anywhere anywhere reject-with icmp-proto-unreachable
Chain fail2ban-ssh (1 references)
target prot opt source destination
RETURN all -- anywhere anywhere
[/code]
Hier noch meine svnserve.conf, an der duerfte aber eigentlich alles passen, da ich einen zweiten rechner habe, der mit der identischen config am netz haengt und funktioniert.
[code]
Visit http://subversion.tigris.org/ for more information.
[general]
password-db = passwd
zigapeda = write
chefkoch = write
aniras = write
kevin = write
[sasl]
Kann mein problem auch noch andere ursachen als iptables haben?
Auf dem Server lauffen ausserdem noch;
Apache2
fail2ban
MySQL
chkrootkit
Wenn IP-Tables: Kann ich diese irgendwie deaktivieren? Beim googeln fand ich einen hinweis drauf, dass es die moeglichkeit gibt per /etc/init.d/iptables stop diese auszuschalten, jedoch existiert dieser daemon in meinem system nicht.
In diesem Sinne schonmal danke an euch alle
grindhold
Hallo, Administratoren.
Ich richte gerade einen VServer (Debian Lenny) ein. Auf diesem habe ich Subversion installiert, die svnserve.conf meinen beduerfnissen angepasst und der dienst funktioniert soweit auch, jedoch nur, wenn ich ihn vom server aus ueber localhost anspreche.
Auf dem Server laufen iptables. Ich habe versucht mit dem Command "iptables -A INPUT -m state --state NEW -m tcp -p tcp -dport 3690 -j ACCEPT" den noetigen ACCEPT-eintrag hinzuzufuegen. Leider ohne erfolg.
Ebenfalls habe ich versucht per telnet auf pot 3690 zu verbinden, was per localhost auch klappt, jedoch wieder nicht von aussen, deswegen gehe ich stark davon aus, dass die IPtables den zugriff, den ich brauche einschraenken.
Meine IPtables sehen so aus:
[code]
Chain INPUT (policy DROP)
target prot opt source destination
fail2ban-ssh tcp -- anywhere anywhere multiport dports ssh
LOG all -- anywhere anywhere state INVALID limit: avg 2/sec burst 5 LOG level warning prefix `INPUT INVALID '
DROP all -- anywhere anywhere state INVALID
MY_DROP tcp -- anywhere anywhere tcp flags:FIN,SYN,RST,PSH,ACK,URG/NONE
MY_DROP tcp -- anywhere anywhere tcp flags:FIN,SYN/FIN,SYN
MY_DROP tcp -- anywhere anywhere tcp flags:SYN,RST/SYN,RST
MY_DROP tcp -- anywhere anywhere tcp flags:FIN,RST/FIN,RST
MY_DROP tcp -- anywhere anywhere tcp flags:FIN,ACK/FIN
MY_DROP tcp -- anywhere anywhere tcp flags:PSH,ACK/PSH
MY_DROP tcp -- anywhere anywhere tcp flags:ACK,URG/URG
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT icmp -- anywhere anywhere icmp echo-reply
ACCEPT icmp -- anywhere anywhere icmp destination-unreachable
ACCEPT icmp -- anywhere anywhere icmp source-quench
ACCEPT icmp -- anywhere anywhere icmp echo-request
ACCEPT icmp -- anywhere anywhere icmp time-exceeded
ACCEPT icmp -- anywhere anywhere icmp parameter-problem
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:www
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:https
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:smtp
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssmtp
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:pop3
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:pop3s
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:imap2
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:imaps
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:nntp
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:domain
ACCEPT udp -- anywhere anywhere state NEW udp dpt:domain
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ftp
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:mysql
ACCEPT udp -- anywhere anywhere state NEW udp dpt:ntp
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:6060
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ircd
MY_REJECT all -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:svn
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:3980
Chain FORWARD (policy DROP)
target prot opt source destination
Chain OUTPUT (policy DROP)
target prot opt source destination
LOG all -- anywhere anywhere state INVALID limit: avg 2/sec burst 5 LOG level warning prefix `OUTPUT INVALID '
DROP all -- anywhere anywhere state INVALID
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere state NEW,RELATED,ESTABLISHED
ACCEPT icmp -- anywhere anywhere icmp echo-reply
ACCEPT icmp -- anywhere anywhere icmp destination-unreachable
ACCEPT icmp -- anywhere anywhere icmp echo-request
MY_REJECT all -- anywhere anywhere
Chain MY_DROP (7 references)
target prot opt source destination
LOG all -- anywhere anywhere limit: avg 2/sec burst 5 LOG level warning prefix `PORTSCAN DROP '
DROP all -- anywhere anywhere
Chain MY_REJECT (2 references)
target prot opt source destination
LOG tcp -- anywhere anywhere limit: avg 2/sec burst 5 LOG level warning prefix `REJECT TCP '
REJECT tcp -- anywhere anywhere reject-with tcp-reset
LOG udp -- anywhere anywhere limit: avg 2/sec burst 5 LOG level warning prefix `REJECT UDP '
REJECT udp -- anywhere anywhere reject-with icmp-port-unreachable
LOG icmp -- anywhere anywhere limit: avg 2/sec burst 5 LOG level warning prefix `DROP ICMP '
DROP icmp -- anywhere anywhere
LOG all -- anywhere anywhere limit: avg 2/sec burst 5 LOG level warning prefix `REJECT OTHER '
REJECT all -- anywhere anywhere reject-with icmp-proto-unreachable
Chain fail2ban-ssh (1 references)
target prot opt source destination
RETURN all -- anywhere anywhere
[/code]
Hier noch meine svnserve.conf, an der duerfte aber eigentlich alles passen, da ich einen zweiten rechner habe, der mit der identischen config am netz haengt und funktioniert.
[code]
[general]
- anon-access = read
password-db = passwd
- authz-db = authz
- realm = My First Repository
zigapeda = write
chefkoch = write
aniras = write
kevin = write
[sasl]
- use-sasl = true
- min-encryption = 0
- max-encryption = 256
Kann mein problem auch noch andere ursachen als iptables haben?
Auf dem Server lauffen ausserdem noch;
Apache2
fail2ban
MySQL
chkrootkit
Wenn IP-Tables: Kann ich diese irgendwie deaktivieren? Beim googeln fand ich einen hinweis drauf, dass es die moeglichkeit gibt per /etc/init.d/iptables stop diese auszuschalten, jedoch existiert dieser daemon in meinem system nicht.
In diesem Sinne schonmal danke an euch alle
grindhold
Bitte markiere auch die Kommentare, die zur Lösung des Beitrags beigetragen haben
Content-ID: 134438
Url: https://administrator.de/forum/wieso-kann-ich-meinen-svn-server-nicht-von-ausserhalb-erreichen-134438.html
Ausgedruckt am: 14.06.2025 um 18:06 Uhr
2 Kommentare
Neuester Kommentar
Hallo,
gib mal bitte eine ausgabe von
iptables -nvL
und poste es diesmal mit < code >
Die Regeln sind verwirrend, da du oben nach TCP Flags filterst und weiter unten mit dem State-Modul arbeitest.
Auch hast du im oberem Dritten ein "ACCEPT all -- anywhere anywhere" stehen. Wenn das auf dem externem Interface liegt, wird hier ALLES ERLAUBT was nicht oben mit den tcpflags geblockt wird. Da du aber -P INPUT DROP verwendest, hat es wenig Sinn explizit zu blocken. Wenn da nicht noch mehr in der accept any any regel steht, sind alle weiteren Regeln inklusive Default-Policy unwirksam.
Die Regeln sollten so angelegt werden, das alles per Default verboten und nur ganz eng eingegrenzt deine Serverdienste erlaubt werden.
eth0=externes Interface
1.2.3.4= externe IP
Wenn du nach diesem Prinzip deine Regeln aufbaust hast du weniger Ärger.
gib mal bitte eine ausgabe von
iptables -nvL
und poste es diesmal mit < code >
Die Regeln sind verwirrend, da du oben nach TCP Flags filterst und weiter unten mit dem State-Modul arbeitest.
Auch hast du im oberem Dritten ein "ACCEPT all -- anywhere anywhere" stehen. Wenn das auf dem externem Interface liegt, wird hier ALLES ERLAUBT was nicht oben mit den tcpflags geblockt wird. Da du aber -P INPUT DROP verwendest, hat es wenig Sinn explizit zu blocken. Wenn da nicht noch mehr in der accept any any regel steht, sind alle weiteren Regeln inklusive Default-Policy unwirksam.
Die Regeln sollten so angelegt werden, das alles per Default verboten und nur ganz eng eingegrenzt deine Serverdienste erlaubt werden.
eth0=externes Interface
1.2.3.4= externe IP
iptables -N ext-in
iptables -N avd-in-check
iptables -N icmp-ext
ipables -P INPUT DROP
iptables -A INPUT -i eth0 -d 1.2.3.4 -j ext-in
iptables -A INPUT -p icmp -j icmp-ext
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptabkes -A ext-in -p tcp --dport 3690 -m state --state NEW,ESTABLISHED -j adv-in-check
iptables -A ext-in -p udp --dport 3690 -m state --state RELATED,ESTABLISHED -j adv-in-check
iptables -A ext-in -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j adv-in-check
iptables -A adv-in-check -m state --state NEW -j LOG --log-prefix "NEW-CON: "
... weitere erweiterte Prüfungen für eingehende Verbindungen, z.B. L7, ascii usw..
... jede regel enthält ein explizites ACCEPT. Alles andere wird verworfen.
iptables -A icmp-ext -i eth0 -p icmp --icmp-type echo-rewuest -j ACCEPT
und ausgehend das selbe
iptables -N ext-out
iptables -A OUTPUT -o eth0 -s 1.2.3.4 -j ext-out
iptables -A OURPUT -p icmp -j icmp-ext
iptables -A ext-out -p tcp --sport 3690 -m state --state ESTABLISHED -j adv-out-check
iptables -A adv-out-check -m owner --uid-owner svn -j ACCEPT
iptables -A ext-out -p udp --sport 3690 -m state --state ESTABLISHED,RELATED -j adv-out-check
Wenn du nach diesem Prinzip deine Regeln aufbaust hast du weniger Ärger.