• Willkommen im Linux Club - dem deutschsprachigen Supportforum für GNU/Linux. Registriere dich kostenlos, um alle Inhalte zu sehen und Fragen zu stellen.

vsftpd-Server: Keine Verbindung!

Ich versuche einen vsftpd-Server aufzusetzen und habe mittlerweile alles durch, was ich gefunden habe. Hatte den Server schon einmal am Laufen, aber nachdem ich das System neu aufgesetzt habe, funktioniert es nicht mehr.

1. Habe YAST2-FTP-Server installiert + vsftpd
2. über YAST alles eingestellt: Passiv, als Dämon aktiviert, Ports freigegeben
3. netstat -tulpen

Aktive Internetverbindungen (Nur Server)
Proto Recv-Q Send-Q Local Address Foreign Address State Benutzer Inode PID/Program name
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 0 6233 2301/portmap
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 0 15247 4390/vsftpd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 0 6856 2423/cupsd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 0 7166 2535/master
tcp 0 0 :::7634 :::* LISTEN 0 6813 2427/hddtemp
tcp 0 0 ::1:25 :::* LISTEN 0 7168 2535/master
udp 0 0 0.0.0.0:68 0.0.0.0:* 0 9798 3054/dhclient
udp 0 0 0.0.0.0:44118 0.0.0.0:* 102 6587 2361/avahi-daemon:
udp 0 0 0.0.0.0:5353 0.0.0.0:* 102 6586 2361/avahi-daemon:
udp 0 0 0.0.0.0:111 0.0.0.0:* 0 6228 2301/portmap
udp 0 0 0.0.0.0:631 0.0.0.0:* 0 6866 2423/cupsd

4. meine /etc/vsftpd.conf und /etc/vsftpd/vsftpd.conf

#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
#
dirmessage_enable=YES
# Uncomment to put local users in a chroot() jail in their home directory
# after login.
#
#chroot_local_user=YES
#
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
#
#chroot_list_enable=YES
#
# (default follows)
#
#chroot_list_file=/etc/vsftpd.chroot_list
#
# The maximum data transfer rate permitted, in bytes per second, for
# local authenticated users. The default is 0 (unlimited).
#
#local_max_rate=7200


# Anonymus FTP user Settings
#
# Allow anonymous FTP?
#
anonymous_enable=NO
#
# Anonymous users will only be allowed to download files which are
# world readable.
#
anon_world_readable_only=YES
#
# Activate logging of uploads/downloads.
#
xferlog_enable=YES
#
# You may override where the log file goes if you like. The default is shown
# below.
#
#vsftpd_log_file=/var/log/vsftpd.log
#
# If you want, you can have your log file in standard ftpd xferlog format.
# Note: This disables the normal logging unless you enable dual_log_enable below.
#
#xferlog_std_format=YES
#
# You may override where the log file goes if you like. The default is shown
# below.
#
#xferlog_file=/var/log/xferlog
#
# Enable this to have booth logfiles. Standard xferlog and vsftpd's own style log.
#
#dual_log_enable=YES
#
# Uncomment this to enable session status information in the system process listing.
#
#setproctitle_enable=YES

# Transfer Settings
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
#
connect_from_port_20=YES
#
# You may change the default value for timing out an idle session.
#
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#
#data_connection_timeout=120
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that turning on ascii_download_enable enables malicious remote parties
# to consume your I/O resources, by issuing the command "SIZE /big/file" in
# ASCII mode.
# These ASCII options are split into upload and download because you may wish
# to enable ASCII uploads (to prevent uploaded scripts etc. from breaking),
# without the DoS risk of SIZE and ASCII downloads. ASCII mangling should be
# on the client anyway..
#
#ascii_upload_enable=YES
#ascii_download_enable=YES
#
# Set to NO if you want to disallow the PASV method of obtaining a data
# connection.
#
pasv_enable=NO

# PAM setting. Do NOT change this unless you know what you do!
#
pam_service_name=vsftpd

# Set listen=YES if you want vsftpd to run standalone
#
listen=YES

# Set to ssl_enable=YES if you want to enable SSL
ssl_enable=NO
anon_mkdir_write_enable=NO
anon_upload_enable=NO
chroot_local_user=NO
ftpd_banner=Willkommen bei Motan!
idle_session_timeout=900
local_enable=YES
local_root=/home/moritz/
log_ftp_protocol=NO
max_clients=10
max_per_ip=3
pasv_enable=YES
pasv_max_port=40500
pasv_min_port=40000
ssl_sslv2=NO
ssl_sslv3=NO
ssl_tlsv1=YES
write_enable=YES
#listen_ipv6=YES
tcp_wrappers=YES
listen=YES

5. bei vsftpd

500 OOPS: could not bind listening IPv4 socket

6. ftp 192.168.178.20 oder ftp [öffentliche IP]

ftp: connect: No route to host

7. in SuSEfirewall2 habe ich den LOAD_MODULES-Eintrag schon um das ftp-Modul erweitert

8. Ports sind in Fritz-Box und Firewall freigegeben

Wer kann mir helfen, komm nicht mehr weiter! Vielen Dank im Voraus, Moritz.
 
OP
M

moritzhaaf

Member
Kann mir bei diesem Problem keiner helfen?

Wie gesagt, hatte das schon mal konfiguriert. Sehe aber nicht, wo jetzt der Fehler ist. :???:
 

Tooltime

Advanced Hacker
Da ich keine Angaben sehe, gehe ich mal von openSUSE 11.0 aus.

zu 1)
Klingt gut.

zu 2)
Klingt auch gut, dann funktioniert es bei mir auf Anhieb, vorrausgesetzt du hast wirklich nur Einstellungen im YaST-Modul "FTP-Server" geändert und nicht manuell die Firewall manipuliert.

zu 3)
OK, der Dienst läuft.

zu 4)
bei mir gibt es nur /etc/vsftpd.conf, woher kommt /etc/vsftpd/vsftpd.conf?

zu 5)
Wo läuft die Meldung auf?
Zwei Konfigurationsdateien, Meldung Port kann nicht geöffnet werden, laufen da zwei Instanzen von vsftpd mit unterschiedlicher config?

zu 6)
Wo läuft die Meldung auf?
Sieht nach einem Problem auf den Client aus.

zu 7)
In welcher Datei hast du genau was wie eingetragen oder verändert. Wie soll man sonst abschätzen ob das richtig oder falsch ist?

zu 8)
Die Ports müssen nicht freigegen werden, sonder weitergeleitet. Ich würde aber beides abschalten, damit man zu Testzwecken die Firewall des Servers gefahrlos abschalten kann.

Allgemeine Vorgehensweise:
  • Verbindung direkt auf dem Server über localhost testen.
    Firewall abschalten, Verbindung mit lokalen Client testen.
    Firewall aktivieren, Verbindung mit lokalen Client testen.
    Portforwarding aktivieren, Verbindung mit externen Client testen.
 
OP
M

moritzhaaf

Member
5) Die Meldung läuft auf, wenn ich als root in der Konsole vsftpd eingebe.

6) Dieser Fehler läuft auf, wenn ich mich über die Textkonsole mit "ftp" verbinden will

Verbindung direkt auf dem Server über localhost testen
--> Das funktioniert wunderbar.
Firewall abschalten, Verbindung mit lokalen Client testen
--> Hier hört es dann schon wieder auf. Bekomme wieder die Fehlermeldung "No route to host" wenn ich "ftp 192.168.178.20" eingebe.

Vielen Dank für deine Hilfe bisher.
 

Tooltime

Advanced Hacker
Wenn die Verbindung über localhost klappt, dann funktioniert der Dienst schon einmal. Das ganze klingt jetzt eher wie ein grundsätzliches Problem der Netzwerkkonfiguration. Beschreibe einmal den Netzaufbau näher, gibt es Router, Switche, wie ist halt was verbunden.

Versuch mal mit ping 192.168.178.20 den Server zu erreichen, sicherheitshalber sollte dabei die Firewall auf dem Server deaktiviert sein. Interessant wären auch die Ausgaben von ifconfig und route -n auf Client und Server.

Man sollte bei Diensten grundsätzlich nicht versuchen per Hand das Binäry zu starten. Dafür gibt es schöne Scripte, in diesen Fall ist es rcvsftpd, das man mit den Optionen status, start und stop aufrufen kann.
 
OP
M

moritzhaaf

Member
Also, ich surfe über eine FritzBox (192.168.178.1) mit WLAN. Einen Server habe ich nicht bzw. zumindest keinen eigenständigen. Will nur die Daten meines PCs per FTP zugänglich machen.

Die Ergebnisse deiner Tipps:

Code:
moritz@motan:~> ping 192.168.178.20
PING 192.168.178.20 (192.168.178.20) 56(84) bytes of data.
From 192.168.178.25: icmp_seq=1 Destination Host Unreachable
From 192.168.178.25 icmp_seq=1 Destination Host Unreachable
From 192.168.178.25 icmp_seq=2 Destination Host Unreachable
From 192.168.178.25 icmp_seq=3 Destination Host Unreachable
From 192.168.178.25 icmp_seq=5 Destination Host Unreachable
From 192.168.178.25 icmp_seq=6 Destination Host Unreachable
From 192.168.178.25 icmp_seq=7 Destination Host Unreachable
From 192.168.178.25 icmp_seq=9 Destination Host Unreachable
From 192.168.178.25 icmp_seq=10 Destination Host Unreachable
From 192.168.178.25 icmp_seq=11 Destination Host Unreachable
^C
--- 192.168.178.20 ping statistics ---
13 packets transmitted, 0 received, +10 errors, 100% packet loss, time 12025ms
, pipe 3

Die Ergebnisse von ping 192.168.178.1 (FritzBox) und ping 192.168.178.25:

motan:/home/moritz # ping 192.168.178.1
PING 192.168.178.1 (192.168.178.1) 56(84) bytes of data.
64 bytes from 192.168.178.1: icmp_seq=1 ttl=64 time=2.35 ms
64 bytes from 192.168.178.1: icmp_seq=2 ttl=64 time=2.16 ms
64 bytes from 192.168.178.1: icmp_seq=3 ttl=64 time=1.92 ms
64 bytes from 192.168.178.1: icmp_seq=4 ttl=64 time=1.93 ms
64 bytes from 192.168.178.1: icmp_seq=5 ttl=64 time=1.89 ms
64 bytes from 192.168.178.1: icmp_seq=6 ttl=64 time=1.89 ms
64 bytes from 192.168.178.1: icmp_seq=7 ttl=64 time=2.12 ms
64 bytes from 192.168.178.1: icmp_seq=8 ttl=64 time=1.91 ms
64 bytes from 192.168.178.1: icmp_seq=9 ttl=64 time=1.99 ms
^C
--- 192.168.178.1 ping statistics ---
9 packets transmitted, 9 received, 0% packet loss, time 8031ms
rtt min/avg/max/mdev = 1.895/2.022/2.350/0.149 ms
motan:/home/moritz # ping 192.168.178.25
PING 192.168.178.25 (192.168.178.25) 56(84) bytes of data.
64 bytes from 192.168.178.25: icmp_seq=1 ttl=64 time=0.103 ms
64 bytes from 192.168.178.25: icmp_seq=2 ttl=64 time=0.095 ms
64 bytes from 192.168.178.25: icmp_seq=3 ttl=64 time=0.098 ms
64 bytes from 192.168.178.25: icmp_seq=4 ttl=64 time=0.099 ms
64 bytes from 192.168.178.25: icmp_seq=5 ttl=64 time=0.099 ms
64 bytes from 192.168.178.25: icmp_seq=6 ttl=64 time=0.097 ms
^C
--- 192.168.178.25 ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5002ms
rtt min/avg/max/mdev = 0.095/0.098/0.103/0.010 ms

motan:/home/moritz # ifconfig
eth0 Link encap:Ethernet Hardware Adresse 00:16:D3:60:10:95
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 Sendewarteschlangenlänge:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:18 Basisadresse:0x4000

lo Link encap:Lokale Schleife
inet Adresse:127.0.0.1 Maske:255.0.0.0
inet6 Adresse: ::1/128 Gültigkeitsbereich:Maschine
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1998 errors:0 dropped:0 overruns:0 frame:0
TX packets:1998 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 Sendewarteschlangenlänge:0
RX bytes:120708 (117.8 Kb) TX bytes:120708 (117.8 Kb)

wlan0 Link encap:Ethernet Hardware Adresse 00:60:B3:61:44:D4
inet Adresse:192.168.178.25 Bcast:192.168.178.255 Maske:255.255.255.0
inet6 Adresse: fe80::260:b3ff:fe61:44d4/64 Gültigkeitsbereich:Verbindung
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4916 errors:0 dropped:0 overruns:0 frame:0
TX packets:3741 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 Sendewarteschlangenlänge:1000
RX bytes:5111010 (4.8 Mb) TX bytes:519342 (507.1 Kb)

wmaster0 Link encap:UNSPEC Hardware Adresse 00-60-B3-61-44-D4-00-00-00-00-00-00-00-00-00-00
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 Sendewarteschlangenlänge:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

motan:/home/moritz # route -n
Kernel IP Routentabelle
Ziel Router Genmask Flags Metric Ref Use Iface
192.168.178.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.178.1 0.0.0.0 UG 0 0 0 wlan0

Vielen Dank nochmal für deine Hilfe. Ich hoffe, meine Angaben helfen uns weiter.
 

pft

Advanced Hacker
Da hast Du wohl ein Netzwerkproblem, dass erst mal nichts mit ftp zu tun hat.

Was soll hinter der IP 192.168.178.20 denn stecken?

Löse Dein Netzwerkproblem (notfalls in entsprechendem Unter-Forum passenden Post loslassen) und wenn dann vsftp immer noch nicht geht dann melde dich wieder.
 
OP
M

moritzhaaf

Member
Ich habe den Fehler gefunden:

Bis jetzt war 192.168.178.20 immer die lokale IP meines PC, der auch FTP-Server sein soll. Für diese IP waren auch die Freigaben in der FritzBox (Router) eingestellt.

Jetzt ist die IP aber 192.168.178.25 und nachdem ich die Portfreigabe im Router angepasst habe. Funktionierts wieder :eek:ps: .

Weiß einer von euch woran das liegen kann, dass die IP im Router sich ändert.
 

Tooltime

Advanced Hacker
Das Stichwort heißt DHCP. Grundsätzlich muss man bei DHCP rechnen, das jedesmal beim Rechnerstart neue Adressen vergeben werden. Es sollte aber die Möglichkeit bestehen, den Router so zu konfigurieren das er an eine bestimmte MAC-Adresse immer die gleiche IP vergibt. Alternativ wird oft ein Adressenbereich reserviert mit denen bestimmte Rechner eine fixe Netzkonfiguration erhalten können. Mehr dazu sollte im Handbuch des Routers stehen.
 
Oben