• This forum has a zero tolerance policy regarding spam. If you register here to publish advertising, your user account will be deleted without further questions.

Plesk / Proftpd / Nat-Virtualbox

biertragl

Member
Servus. Habe folgendes Problem:

Habe Windows Server 2012 Standard r2 als Hostsystem, darauf installiert eine Virtualbox mit Debian 8.4 als Gast (ich kann nur NAT-Netzwerk machen, da nur 1x IP-Adresse vorhanden :-( ). Dort ist Plesk installiert und es läuft auch alles zufriedenstellend, nur der FTP stellt sich quer. Habe schon einiges durchprobiert, komme aber nicht weiter.

das sind die Sachen die ich schon probiert habe:

-Filezilla umstellen aktiv / passiv
-Masquerading an / aus
-Defaultaddress von Proftpd von 127.0.0.1 auf 10.0.2.15 umgestellt
-Firewall in Plesk eingestellt

Er kommt bis zur Verzeichnis-/Dateianzeige, dann meckert er über timeout und
versucht es erneut...
Ich kann mich erinnern, dass es früher (ohne Plesk / anderer Rootserver jedoch gleiche Konstellation) schonmal funktioniert hat. Scheint also Config-Sache zu sein.

Meine proftpd.conf: (passive-portrange wird im config-verzeichnis extra festgelegt, daher hier auskommentiert. Die Ports 20,21,990,65530-65534 sind in Virtualbox alle weitergeleitet und in der Windows-Firewall auch freigegeben.
Code:
#
# To have more informations about Proftpd configuration
# look at : http://www.proftpd.org/
#

# This is a basic ProFTPD configuration file (rename it to 
# 'proftpd.conf' for actual use.  It establishes a single server
# and a single anonymous login.  It assumes that you have a user/group
# "nobody" and "ftp" for normal operation and anon.

ServerName			"ProFTPD"
ServerType			standalone
#ServerType			inetd
DefaultServer			on
DefaultAddress			10.0.2.15

#MasqueradeAddress	gs-server.de
MasqueradeAddress	89.163.166.194
#PassivePorts		65530 65534

<VirtualHost 89.163.166.194>
	DefaultRoot	~
	AllowOverwrite	on
	Umask		002
</VirtualHost>

<Global>
#RequireValidShell on

DefaultRoot	~		psacln
AllowOverwrite		on
<IfModule mod_tls.c>
	# common settings for all virtual hosts
	TLSEngine on
	TLSRequired off

	TLSLog /var/log/plesk/ftp_tls.log

	TLSRSACertificateFile /opt/psa/admin/conf/httpsd.pem
	TLSRSACertificateKeyFile /opt/psa/admin/conf/httpsd.pem

	# Authenticate clients that want to use FTP over TLS?
	TLSVerifyClient off

	# Allow SSL/TLS renegotiations when the client requests them, but
	# do not force the renegotations.  Some clients do not support
	# SSL/TLS renegotiations; when mod_tls forces a renegotiation, these
	# clients will close the data connection, or there will be a timeout
	# on an idle data connection.
	TLSRenegotiate none

	# As of ProFTPD 1.3.3rc1, mod_tls only accepts SSL/TLS data connections 
	# that reuse the SSL session of the control connection, as a security measure.
	# Unfortunately, there are some clients (e.g. curl) which do not reuse SSL sessions. 
	TLSOptions NoSessionReuseRequired
</IfModule>
</Global>

DefaultTransferMode	binary
UseFtpUsers			on

TimesGMT			off
SetEnv TZ :/etc/localtime
# Port 21 is the standard FTP port.
Port				21
# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask				022

# To prevent DoS attacks, set the maximum number of child processes
# to 30.  If you need to allow more than 30 concurrent connections
# at once, simply increase this value.  Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd)
MaxInstances			30

#Following part of this config file were generate by PSA automatically
#Any changes in this part will be overwritten by next manipulation 
#with Anonymous FTP feature in PSA control panel.

#Include directive should point to place where FTP Virtual Hosts configurations
#preserved

ScoreboardFile /var/run/proftpd.scoreboard

# Primary log file mest be outside of system logrotate province

TransferLog /var/log/plesk/xferlog

LogFormat default "%h %l %u %t \"%r\" %s %b"
LogFormat auth    "%v [%P] %h %t \"%r\" %s"
LogFormat write   "%h %l %u %t \"%r\" %s %b"

<Global>
ExtendedLog		/var/spool/syslog/proftpd/access.log WRITE,READ write
ExtendedLog		/var/spool/syslog/proftpd/auth.log AUTH auth
ExtendedLog		/var/spool/syslog/proftpd/paranoid.log ALL default
</Global>

#Change default group for new files and directories in vhosts dir to psacln

<Directory /var/www/vhosts>
	GroupOwner	psacln
</Directory>

# Enable PAM authentication
AuthPAM on
AuthPAMConfig proftpd

IdentLookups off
UseReverseDNS off

AuthGroupFile	/etc/group

Include /etc/proftpd.d/*.conf
Anbei mal der "Verbindungslog von Filezilla":

Code:
Status:	Auflösen der IP-Adresse für gs-server.de
Status:	Verbinde mit 89.163.166.194:21...
Status:	Verbindung hergestellt, warte auf Willkommensnachricht...
Trace:	CFtpControlSocket::OnReceive()
Antwort:	220 ProFTPD 1.3.5a Server (ProFTPD) [89.163.166.194]
Trace:	CFtpControlSocket::SendNextCommand()
Befehl:	USER gsclanpage
Trace:	CFtpControlSocket::OnReceive()
Antwort:	331 Password required for gsclanpage
Trace:	CFtpControlSocket::SendNextCommand()
Befehl:	PASS ********************
Trace:	CFtpControlSocket::OnReceive()
Antwort:	230 User gsclanpage logged in
Trace:	CFtpControlSocket::SendNextCommand()
Befehl:	SYST
Trace:	CFtpControlSocket::OnReceive()
Antwort:	215 UNIX Type: L8
Trace:	CFtpControlSocket::SendNextCommand()
Befehl:	FEAT
Trace:	CFtpControlSocket::OnReceive()
Antwort:	211-Features:
Antwort:	 MDTM
Antwort:	 SSCN
Antwort:	 TVFS
Antwort:	 MFMT
Antwort:	 SIZE
Antwort:	 PROT
Antwort:	 LANG de-DE.UTF-8*
Antwort:	 CCC
Antwort:	 PBSZ
Antwort:	 AUTH TLS
Antwort:	 MFF modify;UNIX.group;UNIX.mode;
Antwort:	 REST STREAM
Antwort:	 MLST modify*;perm*;size*;type*;unique*;UNIX.group*;UNIX.mode*;UNIX.owner*;
Antwort:	 UTF8
Antwort:	 EPRT
Antwort:	 EPSV
Trace:	CFtpControlSocket::OnReceive()
Antwort:	211 End
Trace:	CFtpControlSocket::SendNextCommand()
Befehl:	OPTS UTF8 ON
Trace:	CFtpControlSocket::OnReceive()
Antwort:	200 UTF8 set to on
Status:	Angemeldet
Trace:	CFtpControlSocket::ResetOperation(0)
Trace:	CControlSocket::ResetOperation(0)
Trace:	CFileZillaEnginePrivate::ResetOperation(0)
Trace:	Measured latency of 33 ms
Status:	Empfange Verzeichnisinhalt...
Trace:	CFtpControlSocket::SendNextCommand()
Trace:	CFtpControlSocket::ChangeDirSend()
Befehl:	PWD
Trace:	CFtpControlSocket::OnReceive()
Antwort:	257 "/" is the current directory
Trace:	CFtpControlSocket::ResetOperation(0)
Trace:	CControlSocket::ResetOperation(0)
Trace:	CFtpControlSocket::ParseSubcommandResult(0)
Trace:	CFtpControlSocket::ListSubcommandResult()
Trace:	  state = 1
Trace:	CFtpControlSocket::SendNextCommand()
Trace:	CFtpControlSocket::TransferSend()
Trace:	  state = 1
Befehl:	TYPE I
Trace:	CFtpControlSocket::OnReceive()
Antwort:	200 Type set to I
Trace:	CFtpControlSocket::TransferParseResponse()
Trace:	  code = 2
Trace:	  state = 1
Trace:	CFtpControlSocket::SendNextCommand()
Trace:	CFtpControlSocket::TransferSend()
Trace:	  state = 2
Befehl:	PASV
Trace:	CFtpControlSocket::OnReceive()
Antwort:	227 Entering Passive Mode (89,163,166,194,255,251).
Trace:	CFtpControlSocket::TransferParseResponse()
Trace:	  code = 2
Trace:	  state = 2
Trace:	CFtpControlSocket::SendNextCommand()
Trace:	CFtpControlSocket::TransferSend()
Trace:	  state = 4
Trace:	Binding data connection source IP to control connection source IP 192.168.178.6
Befehl:	MLSD
Trace:	CTransferSocket::OnConnect
Fehler:	Zeitüberschreitung der Verbindung nach 20 Sekunden Inaktivität
Trace:	CControlSocket::DoClose(2050)
Trace:	CFtpControlSocket::ResetOperation(2114)
Trace:	CControlSocket::ResetOperation(2114)
Trace:	CFtpControlSocket::ResetOperation(2114)
Trace:	CControlSocket::ResetOperation(2114)
Fehler:	Verzeichnisinhalt konnte nicht empfangen werden
Trace:	CFileZillaEnginePrivate::ResetOperation(2114)
Status:	Verbindung zum Server getrennt
Trace:	CControlSocket::DoClose(64)
Trace:	CControlSocket::DoClose(64)
Trace:	CControlSocket::DoClose(64)
Trace:	CFileZillaEnginePrivate::ResetOperation(0)
 
Last edited by a moderator:
Ein FTP-Server, der hinter einem NAT-Router hängt, ist problematisch. Das Problem bei FTP ist, dass eine Verbindung für die Befehle und so Sachen wie das Directory-Listing verwendet wird und eine zweite für die Übertragung der eigentlichen Datei. Das Problem mit NAT hat die c't z.B. hier beschrieben.
Die einfachst Lösung ist, SFTP zu verwenden (FTP über SSH) - da hast du diese Probleme nicht.
 
dsa mit dem SFTP bekomme ich aber Joomla z.b. nicht beigebracht, da wird ja
reiner FTP genutzt. Wie gesagt das hat schonmal funktioniert, nur jetzt krieg ich das einfach nicht hin... schade..:(
 
habe das Problem selbst lösen können.. War leider ganz banal, der Port 990 (FTPS) war in der verdammten Plesk-Firewall -> iptables nicht freigegeben :(

Aber jetzt läuft FTP hinter NAT, ich habe die Ports 65330-65334 freigegeben für Passiv, das reicht für meine Zwecke. Evtl. hilft das jemandem :)
 
Ich möchte bezweifeln, dass das das Problem war. Über Port 990 geht die implizite FTPS Control-Verbindung, d.h. du wärst gar nicht erst bis zum Login durchgekommen.

Gruss
 
seit ich den Port freigegeben habe, klappt es jedoch. Hatte vorher mit einer Basic-CFG probiert, hatte das gleiche Problem. Port freigeschaltet und tada, es funktioniert.
 
Back
Top