Sie sind nicht angemeldet.

Lieber Besucher, herzlich willkommen bei: GentooForum.de. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.

1

02.11.2010, 10:01

Proftpd und mysql - es funktioniert nicht richtig

Vorgeschichte:
============

Ich hatte mal einen Suse-Server eingerichtet mit ProFTPD als Ftp-Server. (Auf dem Rechner wollte ich ursprünglich Gentoo installieren, aber weil die Netzwerkkarten nicht gefunden wurden, hatte ich Suse dann gewählt).
ProFTPD hatte ich gewählt, weil es Datenbanken unterstützte - Benutzerverwaltung und Protokollierung über Datenbanken (MySQL). Ein PHP-Frontend-Skript für die Administration per Browser gibt es auch... und ich hatte einen Cron-Job entwickelt, der bei neuen Uploads E-Mail-Benachrichtigungen verschickt, Samba-Zugriff auf die Dateien...

Nun sollte ich das ganze auf einem neuen Server (Gentoo diesmal) übertragen. Doch ProFTPD funktioniert da nicht mehr richtig. Die SQL-Datenbank und hatte ich kopiert, sowie die proftpd.conf. Aber da buggt der ftp-daemon:
Ein Login funktioniert, damit auch die Datenbank-Verbindung. Aber gebe ich nur mehrmals "dir" an, kommt jedesmal eine andere Meldung:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
schmid@serversuse:~> ftp vmlinux
Connected to mydns.vmlinux
220 ProFTPD 1.3.3a Server (FTPServer) [::ffff:172.16.194.98]
Name (vmlinux:schmid): testuser
331 Password required for testuser
Password:
230 User testuser logged in
Remote system type is Last.
ftp> dir
257 "/" is the current directory
parse error!
ftp> dir
229 Entering Extended Passive Mode (|||6199|)
229 Entering Extended Passive Mode (|||59860|)
200 EPRT command successful
ftp> dir
425 Unable to build data connection: Invalid argument
200 EPRT command successful
200 PORT command successful
ftp> dir
425 Unable to build data connection: Connection refused
ftp> dir
200 PORT command successful
200 PORT command successful


Die proftpd.conf:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
ServerName "FTPServer"
ServerType standalone
DefaultServer on
RequireValidShell off
AuthPAM off
AuthPAMConfig ftp
Port 21
Umask 022
MaxInstances 30
User ftp
Group daten
DefaultRoot ~
AllowOverwrite on
<Limit SITE_CHMOD>
  DenyAll
</Limit>
<Anonymous ~ftp>
  User ftp
  Group ftp
  UserAlias anonymous ftp
  MaxClients 10
  <Limit WRITE>
	DenyAll
  </Limit>
</Anonymous>
TransferLog                 	/var/log/proftpd/xferlog
ExtendedLog                 	/var/log/proftpd/access_log	WRITE,READ
ExtendedLog                 	/var/log/proftpd/auth_log  	AUTH
ExtendedLog                 	/var/log/proftpd/paranoid_log  ALL
SQLLogFile                  	/var/log/proftpd/mysql
AuthOrder                   	mod_sql.c
SQLAuthTypes                	Backend
SQLConnectInfo              	proftpd@localhost username password
SQLUserInfo                 	usertable userid passwd uid gid homedir shell 
SQLGroupInfo                	grouptable groupname gid members 
SQLUserWhereClause          	"disabled=0 and (NOW()<=expiration or expiration=-1 or expiration=0)"
SQLLog PASS counter
SQLNamedQuery counter UPDATE "lastlogin=now(), count=count+1 WHERE userid='%u'" usertable
SQLLog EXIT time_logout
SQLNamedQuery time_logout UPDATE "lastlogout=now() WHERE userid='%u'" usertable
SQLNamedQuery login_time SELECT "lastlogin from usertable where userid='%u'"
SQLShowInfo PASS "230" "Last login was: %{login_time}"
SQLLog RETR,STOR transfer1
SQLNamedQuery  transfer1 INSERT "'%u', '%f', '%b', '%h', '%a', '%m', '%T', now(), 'c', '', 0" xfer_stat
SQLLOG ERR_RETR,ERR_STOR transfer2
SQLNamedQuery  transfer2 INSERT "'%u', '%f', '%b', '%h', '%a', '%m', '%T', now(), 'i', '', 0" xfer_stat


Lasse ich die SQL-Direktiven weg, funktioniert der ProFTPD, ohne Datenbank.

"eix -s proftpd" gibt aus:

Quellcode

1
2
3
4
5
[I] net-ftp/proftpd
 	Available versions:  1.3.2d ~1.3.2e ~1.3.3 ~1.3.3-r1 1.3.3a ~1.3.3b {acl authfile ban +caps case clamav +ctrls deflate doc exec hardened ident ifsession ipv6 kerberos ldap mysql ncurses nls noauthunix opensslcrypt pam postgres radius ratio readme rewrite selinux sftp shaper sitemisc softquota ssl tcpd trace vroot xinetd}
 	Installed versions:  1.3.3a(15:58:31 10/18/10)(acl caps ctrls doc hardened ipv6 kerberos ldap mysql ncurses nls pam selinux ssl tcpd -authfile -ban -case -clamav -deflate -exec -ident -ifsession -postgres -radius -ratio -readme -rewrite -sftp -shaper -sitemisc -softquota -trace -vroot -xinetd)
 	Homepage:        	http://www.proftpd.org/ http://www.castaglia.org/proftpd/ http://www.thrallingpenguin.com/resources/mod_clamav.htm http://gssmod.sourceforge.net/
 	Description:     	An advanced and very configurable FTP server.


Version 1.3.3a ist installiert, auf dem Suse-Rechner war es 1.3.3rc2.
Kann es sein, dass proftpd unter 64Bit nicht richtig läuft, oder hat jemand eine Ahnung, wo der Fehler sein könnte?

Grüße

Egon Schmid

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »JavaBar« (06.01.2011, 11:41)


2

04.11.2010, 08:33

Stoppe mal den proftp service und starte proftp auf der Shell per hand mit -n. Und einem Debuglevel deiner Wahl (bsp. 7) Etwa so

Quellcode

1
# proftpd -n -d 7
Wenn du dann deine Eingaben machst ... was kommt da?
http://www.dyle.org
IM-Account (Jabber!) sind auf meiner HP ...
There is no place like /home

http://www.gentooforum.de
http://www.gentoofreunde.org

<div>how to annoy a web developer?</span>

3

04.11.2010, 16:07

Ein Upload ("put") funktioniert jetzt, da stimmte was mit den Berechtigungen nicht, das konnte ich lösen.

Aber bei "dir" verhält es sich immer noch seltsam:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
--- Shell 1 ---
ftp> dir
215 UNIX Type: L8
200 PORT command successful
--- Shell 2 ---
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching PRE_CMD command 'PORT 172,16,194,98,189,97' to mod_tls
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching PRE_CMD command 'PORT 172,16,194,98,189,97' to mod_gss
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching PRE_CMD command 'PORT 172,16,194,98,189,97' to mod_core
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching PRE_CMD command 'PORT 172,16,194,98,189,97' to mod_core
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching CMD command 'PORT 172,16,194,98,189,97' to mod_core
vmlinux (vmlinux[::ffff:172.16.194.98]) - in dir_check_full(): path = '/', fullpath = '/var/daten/ftp/testuser/'.
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching POST_CMD command 'PORT 172,16,194,98,189,97' to mod_sql
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching LOG_CMD command 'PORT 172,16,194,98,189,97' to mod_sql
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching LOG_CMD command 'PORT 172,16,194,98,189,97' to mod_log
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching PRE_CMD command 'LIST' to mod_tls
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching PRE_CMD command 'LIST' to mod_gss
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching PRE_CMD command 'LIST' to mod_core
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching PRE_CMD command 'LIST' to mod_core
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching CMD command 'LIST' to mod_ls
vmlinux (vmlinux[::ffff:172.16.194.98]) - ROOT PRIVS at inet.c:348
vmlinux (vmlinux[::ffff:172.16.194.98]) - ROOT PRIVS: ID switching disabled
vmlinux (vmlinux[::ffff:172.16.194.98]) - RELINQUISH PRIVS at inet.c:411
vmlinux (vmlinux[::ffff:172.16.194.98]) - RELINQUISH PRIVS: ID switching disabled
vmlinux (vmlinux[::ffff:172.16.194.98]) - active data connection opened - local  : ::ffff:172.16.194.98:20
vmlinux (vmlinux[::ffff:172.16.194.98]) - active data connection opened - remote : ::ffff:172.16.194.98:48481
vmlinux (vmlinux[::ffff:172.16.194.98]) - in dir_check_full(): path = '/', fullpath = '/var/daten/ftp/testuser/'.
vmlinux (vmlinux[::ffff:172.16.194.98]) - in dir_check_full(): path = '/testfile', fullpath = '/var/daten/ftp/testuser/testfile'.
--- Shell 1 ---
ftp> dir
150 Opening ASCII mode data connection for file list
--- Shell 2 ---
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching POST_CMD command 'LIST' to mod_sql
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching LOG_CMD command 'LIST' to mod_sql
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching LOG_CMD command 'LIST' to mod_log
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching LOG_CMD command 'LIST' to mod_ls
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching PRE_CMD command 'PORT 172,16,194,98,207,11' to mod_tls
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching PRE_CMD command 'PORT 172,16,194,98,207,11' to mod_gss
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching PRE_CMD command 'PORT 172,16,194,98,207,11' to mod_core
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching PRE_CMD command 'PORT 172,16,194,98,207,11' to mod_core
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching CMD command 'PORT 172,16,194,98,207,11' to mod_core
vmlinux (vmlinux[::ffff:172.16.194.98]) - in dir_check_full(): path = '/', fullpath = '/var/daten/ftp/testuser/'.
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching POST_CMD command 'PORT 172,16,194,98,207,11' to mod_sql
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching LOG_CMD command 'PORT 172,16,194,98,207,11' to mod_sql
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching LOG_CMD command 'PORT 172,16,194,98,207,11' to mod_log
--- Shell 1 ---
ftp> dir
226 Transfer complete
200 PORT command successful
--- Shell 2 ---
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching PRE_CMD command 'PORT 172,16,194,98,201,131' to mod_tls
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching PRE_CMD command 'PORT 172,16,194,98,201,131' to mod_gss
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching PRE_CMD command 'PORT 172,16,194,98,201,131' to mod_core
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching PRE_CMD command 'PORT 172,16,194,98,201,131' to mod_core
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching CMD command 'PORT 172,16,194,98,201,131' to mod_core
vmlinux (vmlinux[::ffff:172.16.194.98]) - in dir_check_full(): path = '/', fullpath = '/var/daten/ftp/testuser/'.
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching POST_CMD command 'PORT 172,16,194,98,201,131' to mod_sql
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching LOG_CMD command 'PORT 172,16,194,98,201,131' to mod_sql
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching LOG_CMD command 'PORT 172,16,194,98,201,131' to mod_log
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching PRE_CMD command 'LIST' to mod_tls
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching PRE_CMD command 'LIST' to mod_gss
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching PRE_CMD command 'LIST' to mod_core
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching PRE_CMD command 'LIST' to mod_core
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching CMD command 'LIST' to mod_ls
vmlinux (vmlinux[::ffff:172.16.194.98]) - ROOT PRIVS at inet.c:348
vmlinux (vmlinux[::ffff:172.16.194.98]) - RELINQUISH PRIVS at inet.c:411
vmlinux (vmlinux[::ffff:172.16.194.98]) - RELINQUISH PRIVS: ID switching disabled
vmlinux (vmlinux[::ffff:172.16.194.98]) - active data connection opened - local  : ::ffff:172.16.194.98:20
vmlinux (vmlinux[::ffff:172.16.194.98]) - active data connection opened - remote : ::ffff:172.16.194.98:51587
vmlinux (vmlinux[::ffff:172.16.194.98]) - in dir_check_full(): path = '/', fullpath = '/var/daten/ftp/testuser/'.
vmlinux (vmlinux[::ffff:172.16.194.98]) - in dir_check_full(): path = '/testfile', fullpath = '/var/daten/ftp/testuser/testfile'.
--- Shell 1 ---
ftp> dir
200 PORT command successful
150 Opening ASCII mode data connection for file list
-rw-r--r--   1 21   	daten     	112 Oct 18 14:29 testfile
226 Transfer complete
--- Shell 2 ---
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching PRE_CMD command 'PORT 172,16,194,98,203,0' to mod_tls
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching PRE_CMD command 'PORT 172,16,194,98,203,0' to mod_gss
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching PRE_CMD command 'PORT 172,16,194,98,203,0' to mod_core
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching PRE_CMD command 'PORT 172,16,194,98,203,0' to mod_core
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching CMD command 'PORT 172,16,194,98,203,0' to mod_core
vmlinux (vmlinux[::ffff:172.16.194.98]) - in dir_check_full(): path = '/', fullpath = '/var/daten/ftp/testuser/'.
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching POST_CMD command 'PORT 172,16,194,98,203,0' to mod_sql
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching LOG_CMD command 'PORT 172,16,194,98,203,0' to mod_sql
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching LOG_CMD command 'PORT 172,16,194,98,203,0' to mod_log
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching PRE_CMD command 'LIST' to mod_tls
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching PRE_CMD command 'LIST' to mod_gss
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching PRE_CMD command 'LIST' to mod_core
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching PRE_CMD command 'LIST' to mod_core
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching CMD command 'LIST' to mod_ls
vmlinux (vmlinux[::ffff:172.16.194.98]) - ROOT PRIVS at inet.c:348
vmlinux (vmlinux[::ffff:172.16.194.98]) - RELINQUISH PRIVS at inet.c:411
vmlinux (vmlinux[::ffff:172.16.194.98]) - RELINQUISH PRIVS: ID switching disabled
vmlinux (vmlinux[::ffff:172.16.194.98]) - active data connection opened - local  : ::ffff:172.16.194.98:20
vmlinux (vmlinux[::ffff:172.16.194.98]) - active data connection opened - remote : ::ffff:172.16.194.98:51968
vmlinux (vmlinux[::ffff:172.16.194.98]) - in dir_check_full(): path = '/', fullpath = '/var/daten/ftp/testuser/'.
vmlinux (vmlinux[::ffff:172.16.194.98]) - in dir_check_full(): path = '/testfile', fullpath = '/var/daten/ftp/testuser/testfile'.
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching POST_CMD command 'LIST' to mod_sql
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching LOG_CMD command 'LIST' to mod_sql
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching LOG_CMD command 'LIST' to mod_log
vmlinux (vmlinux[::ffff:172.16.194.98]) - dispatching LOG_CMD command 'LIST' to mod_ls


Unter "--- Shell 1 ---" steht die Ein/Ausgabe beim FTP-Client, unter "--- Shell 2 ---" sieht man die Debug-Ausgabe von ProFTPD, Debug-Level 10.

Erst ab dem 4. "dir" stimmt die Ausgabe.

Falls jemand den Fehler sieht, ich wär sehr dankbar, falls nicht, es gibt auch ein englisches proftpd-Forum.
Es gab auch mal ein deutsches, aber das gibt's nicht mehr:

Zitat

das deutschsprachige ProFTPD Forum ist aufgrund der Rechtssprechung in Deutschland geschlossen worden.


Grüße

Egon Schmid

4

06.11.2010, 07:25

Wenn ich das richtig sehe, dann sind ja alle 4 Versuche gleich, bloss das beim 4. Mal das Ganze schlußendlich klappt. Es sieht so aus als würde vorher der Client jedesmal abbrechen ... kurios.

Kannst du mal a) deinen FTP-Client im Passiv-Mode nutzen bzw. b) am FTP-Client den Debug hochschrauben. Gib auch das proftpd.log (und SQL log) hier rauf.

... und du sagst: sobald du den mysql-support andrehst, funkt alles anstandslos? Vlt. braucht einfach dein SQL viel zu lange, weshalb irgendeiner der Partner ins Timeout läuft und abbricht. Wiederholtes anfragen, läßt zwangsläufig die SQL-Query schneller werden und so bekommst du beim 4. Mal endlich die passende Antwort.

Diese Theorie ist aber ziemlich hanebüchen ...
http://www.dyle.org
IM-Account (Jabber!) sind auf meiner HP ...
There is no place like /home

http://www.gentooforum.de
http://www.gentoofreunde.org

<div>how to annoy a web developer?</span>

5

06.01.2011, 11:39

Das Problem konnte gelöst werden, ich musste die Option "SQLShowInfo" auskommentieren.

Danke an @Icebreaker vom ProFTPD-Forum.

Der Thread kann hier (in englisch) nachgelesen werden:
http://forums.proftpd.org/smf/index.php/topic,5148.0.html

Viele Grüße

Egon