proFTPd virtualisierung MySQL...

hoi, öhm joa...

Ich bin grad verzweifelt am versuchen meinem proFTPd-Server beizubringen, dass er die User aus einer MySQL-Datenbank auslesen soll, aber das klappt irgendwie net so richtig...

System:
- Ubuntu 6.06 LTS Server-Edition
- proFTPd 1.3.0
- MySQL 5.0.24

Ich hab dieses Tutorial und dieses Tutorial befolgt.
Es ist zwar für Sarge geschrieben, jedoch sollte sich (wie auch der Autor schreibt) an der Config des proFTPd nichts ändern.

Ich habe alles exakt so gemacht wie es in dem Tut beschrieben ist, jedoch bekomme ich immer einen 530er (invalider login) zurück wenn ich auf den FTP verbinden will...
Die Logindaten stimmen mit den aus der Datenbank überein.

In der Errorlog steht dann dass der User nicht existieren würde...
 
Was sagt die Log-Datei beim Starten und bei einem Login-Versuch?
 
Naja Starten nur Standard-Einträge.
und rumgemecker wegen IPv6...Aber das is ja egel, brauch eh keiner ^^

und Beim Login wie oben beschrieben, dass der User nicht existieren würde...
 
Dann mach doch einfach mal IPv6 aus (UseIPv6 off) und setze das Log-Level höher, damit du mal siehst welche Queries an die DB gesendet werden und diese mal händisch testen zu können. Stelle außerdem sicher, daß 'SQLBackend mysql' in der Konfiguration steht (seit Version 1.3 notwendig).
 
ich hab das SQLBackend mysql mal eingetragen leider hat das nichts geändert...

Code:
May 07 21:35:18 chucknorris proftpd[6021] chucknorris: error setting IPV6_V6ONLY: Protocol not available
May 07 21:35:18 chucknorris proftpd[6021] chucknorris: ProFTPD 1.3.0 (stable) (built Wed Nov 29 02:01:20 UTC 2006) standalone mode STARTUP
May 07 21:35:33 chucknorris proftpd[6028] chucknorris (::ffff:192.168.100.1[::ffff:192.168.100.1]): error setting IPV6_V6ONLY: Protocol not available
May 07 21:35:33 chucknorris proftpd[6028] chucknorris (::ffff:192.168.100.1[::ffff:192.168.100.1]): FTP session opened.
May 07 21:35:33 chucknorris proftpd[6028] chucknorris (::ffff:192.168.100.1[::ffff:192.168.100.1]): mod_delay/0.5: delaying for 4087 usecs
May 07 21:35:33 chucknorris proftpd[6028] chucknorris (::ffff:192.168.100.1[::ffff:192.168.100.1]): no such user 'exampleuser'
May 07 21:35:33 chucknorris proftpd[6028] chucknorris (::ffff:192.168.100.1[::ffff:192.168.100.1]): USER exampleuser: no such user found from ::ffff:192.168.100.1 [::ffff:192.168.100.1] to ::ffff:192.168.100.128:21
May 07 21:35:33 chucknorris proftpd[6028] chucknorris (::ffff:192.168.100.1[::ffff:192.168.100.1]): mod_delay/0.5: delaying for 157 usecs
May 07 21:35:33 chucknorris proftpd[6028] chucknorris (::ffff:192.168.100.1[::ffff:192.168.100.1]): FTP session closed.

btw: IPv6 lässt sich nicht abschalten, da er " UseIPv6 off " nicht kennt...
 
Ich werde jetzt also mal mein Ubuntu downgraden um zu sehen wie bei 6.06 die Standard-Konfig aussah, mir dann die Howtos durchlesen nur um dir bei deiner Fehlersuche zu helfen... :rolleyes: Mal LogLevel hochgestellt und ExtendedLogs eingetragen?
 
Code:
#
# /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file.
# To really apply changes reload proftpd after modifications.
#

# Includes DSO modules
Include /etc/proftpd/modules.conf

ServerName                      "Debian"
ServerType                      standalone
DeferWelcome                    off

MultilineRFC2228                on
DefaultServer                   on
ShowSymlinks                    on

TimeoutNoTransfer               600
TimeoutStalled                  600
TimeoutIdle                     1200

DisplayLogin                    welcome.msg
DisplayFirstChdir               .message
ListOptions                     "-l"

DenyFilter                      \*.*/

# Port 21 is the standard FTP port.
Port                            21

# In some cases you have to specify passive ports range to by-pass
# firewall limitations. Ephemeral ports can be used for that, but
# feel free to use a more narrow range.
# PassivePorts                    49152 65534

# 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

# Set the user and group that the server normally runs at.
User                            proftpd
Group                           nogroup

# Umask 022 is a good standard umask to prevent new files and dirs
# (second parm) from being group and world writable.
Umask                           022  022
# Normally, we want files to be overwriteable.
AllowOverwrite                  on

# Uncomment this if you are using NIS or LDAP to retrieve passwords:
# PersistentPasswd              off

# Be warned: use of this directive impacts CPU average load!
#
# Uncomment this if you like to see progress and transfer rate with ftpwho
# in downloads. That is not needed for uploads rates.
# UseSendFile                   off

TransferLog /var/log/proftpd/xferlog
SystemLog   /var/log/proftpd/proftpd.log

<IfModule mod_tls.c>
TLSEngine off
</IfModule>

<IfModule mod_quota.c>
QuotaEngine on
</IfModule>

<IfModule mod_ratio.c>
Ratios on
</IfModule>


# Delay engine reduces impact of the so-called Timing Attack described in
# http://security.lss.hr/index.php?page=details&ID=LSS-2004-10-02
# It is on by default.
<IfModule mod_delay.c>
DelayEngine on
</IfModule>

<IfModule mod_ctrls.c>
ControlsEngine        on
ControlsMaxClients    2
ControlsLog           /var/log/proftpd/controls.log
ControlsInterval      5
ControlsSocket        /var/run/proftpd/proftpd.sock
</IfModule>

<IfModule mod_ctrls_admin.c>
AdminControlsEngine on
</IfModule>

# A basic anonymous configuration, no upload directories.

# <Anonymous ~ftp>
#   User                                ftp
#   Group                               nogroup
#   # We want clients to be able to login with "anonymous" as well as "ftp"
#   UserAlias                   anonymous ftp
#   # Cosmetic changes, all files belongs to ftp user
#   DirFakeUser on ftp
#   DirFakeGroup on ftp
#
#   RequireValidShell           off
#
#   # Limit the maximum number of anonymous logins
#   MaxClients                  10
#
#   # We want 'welcome.msg' displayed at login, and '.message' displayed
#   # in each newly chdired directory.
#   DisplayLogin                        welcome.msg
#   DisplayFirstChdir           .message
#
#   # Limit WRITE everywhere in the anonymous chroot
#   <Directory *>
#     <Limit WRITE>
#       DenyAll
#     </Limit>
#   </Directory>
#
#   # Uncomment this if you're brave.
#   # <Directory incoming>
#   #   # Umask 022 is a good standard umask to prevent new files and dirs
#   #   # (second parm) from being group and world writable.
#   #   Umask                           022  022
#   #            <Limit READ WRITE>
#   #            DenyAll
#   #            </Limit>
#   #            <Limit STOR>
#   #            AllowAll
#   #            </Limit>
#   # </Directory>
#
# </Anonymous>

############################################

DefaultRoot ~


# The passwords in MySQL are encrypted using CRYPT
SQLAuthTypes            Plaintext Crypt
SQLAuthenticate         users* groups*

SQLBackend mysql

# used to connect to the database
# databasename@host database_user user_password
SQLConnectInfo  ftp@localhost proftpd password


# Here we tell ProFTPd the names of the database columns in the "usertable"
# we want it to interact with. Match the names with those in the db
SQLUserInfo     ftpuser userid passwd uid gid homedir shell

# Here we tell ProFTPd the names of the database columns in the "grouptable"
# we want it to interact with. Again the names match with those in the db
SQLGroupInfo    ftpgroup groupname gid members

# set min UID and GID - otherwise these are 999 each
SQLMinID        500

# create a user's home directory on demand if it doesn't exist
SQLHomedirOnDemand on

# Update count every time user logs in
SQLLog PASS updatecount
SQLNamedQuery updatecount UPDATE "count=count+1, accessed=now() WHERE userid='%u'" ftpuser

# Update modified everytime user uploads or deletes a file
SQLLog  STOR,DELE modified
SQLNamedQuery modified UPDATE "modified=now() WHERE userid='%u'" ftpuser

# User quotas
# ===========
QuotaEngine on
QuotaDirectoryTally on
QuotaDisplayUnits Mb
QuotaShowQuotas on

SQLNamedQuery get-quota-limit SELECT "name, quota_type, per_session, limit_type, bytes_in_avail, bytes_out_avail, bytes_xfer_avail, files_in_avail, files_out_avail, files_xfer_avail FROM ftpquotalimits WHERE name = '%{0}' AND quota_type = '%{1}'"

SQLNamedQuery get-quota-tally SELECT "name, quota_type, bytes_in_used, bytes_out_used, bytes_xfer_used, files_in_used, files_out_used, files_xfer_used FROM ftpquotatallies WHERE name = '%{0}' AND quota_type = '%{1}'"

SQLNamedQuery update-quota-tally UPDATE "bytes_in_used = bytes_in_used + %{0}, bytes_out_used = bytes_out_used + %{1}, bytes_xfer_used = bytes_xfer_used + %{2}, files_in_used = files_in_used + %{3}, files_out_used = files_out_used + %{4}, files_xfer_used = files_xfer_used + %{5} WHERE name = '%{6}' AND quota_type = '%{7}'" ftpquotatallies

SQLNamedQuery insert-quota-tally INSERT "%{0}, %{1}, %{2}, %{3}, %{4}, %{5}, %{6}, %{7}" ftpquotatallies

QuotaLimitTable sql:/get-quota-limit
QuotaTallyTable sql:/get-quota-tally/update-quota-tally/insert-quota-tally

RootLogin off
RequireValidShell off

SyslogLevel Debug
ExtendedLog /var/log/proftpd/proftpd.log
Code:
May 07 22:16:55 chucknorris proftpd[6060] chucknorris: ProFTPD killed (signal 15)
May 07 22:16:55 chucknorris proftpd[6060] chucknorris: ProFTPD 1.3.0 standalone mode SHUTDOWN
May 07 22:16:55 chucknorris proftpd[6136] chucknorris (::ffff:192.168.100.1[::ffff:192.168.100.1]): FTP session closed.
May 07 22:16:57 chucknorris proftpd[6186] chucknorris: error setting IPV6_V6ONLY: Protocol not available
May 07 22:16:57 chucknorris proftpd[6186] chucknorris: ProFTPD 1.3.0 (stable) (built Wed Nov 29 02:01:20 UTC 2006) standalone mode STARTUP
May 07 22:17:01 chucknorris proftpd[6193] chucknorris (::ffff:192.168.100.1[::ffff:192.168.100.1]): error setting IPV6_V6ONLY: Protocol not available
May 07 22:17:01 chucknorris proftpd[6193] chucknorris (::ffff:192.168.100.1[::ffff:192.168.100.1]): FTP session opened.
May 07 22:17:01 chucknorris proftpd[6193] chucknorris (::ffff:192.168.100.1[::ffff:192.168.100.1]): mod_delay/0.5: delaying for 14018 usecs
::ffff:192.168.100.1 UNKNOWN proftpd [07/May/2007:22:17:01 +0200] "USER exampleuser" 331 -
May 07 22:17:01 chucknorris proftpd[6193] chucknorris (::ffff:192.168.100.1[::ffff:192.168.100.1]): USER exampleuser: Login successful.
May 07 22:17:01 chucknorris proftpd[6193] chucknorris (::ffff:192.168.100.1[::ffff:192.168.100.1]): Preparing to chroot to directory '/home/www.example.com'
May 07 22:17:01 chucknorris proftpd[6193] chucknorris (::ffff:192.168.100.1[::ffff:192.168.100.1]): mod_cap/1.0: cap_set_proc failed: Operation not permitted
May 07 22:17:01 chucknorris proftpd[6193] chucknorris (::ffff:192.168.100.1[::ffff:192.168.100.1]): mod_cap/1.0: attempt to configure capabilities failed, reverting to normal operation
May 07 22:17:01 chucknorris proftpd[6193] chucknorris (::ffff:192.168.100.1[::ffff:192.168.100.1]): mod_delay/0.5: delaying for 9864 usecs
::ffff:192.168.100.1 UNKNOWN exampleuser [07/May/2007:22:17:01 +0200] "PASS (hidden)" 230 -
::ffff:192.168.100.1 UNKNOWN exampleuser [07/May/2007:22:17:01 +0200] "SYST" 215 -
::ffff:192.168.100.1 UNKNOWN exampleuser [07/May/2007:22:17:01 +0200] "FEAT" 211 -
May 07 22:17:07 chucknorris proftpd[6193] chucknorris (::ffff:192.168.100.1[::ffff:192.168.100.1]): FTP session closed.
May 07 22:17:07 chucknorris proftpd[6194] chucknorris (::ffff:192.168.100.1[::ffff:192.168.100.1]): error setting IPV6_V6ONLY: Protocol not available
May 07 22:17:07 chucknorris proftpd[6194] chucknorris (::ffff:192.168.100.1[::ffff:192.168.100.1]): FTP session opened.
May 07 22:17:07 chucknorris proftpd[6194] chucknorris (::ffff:192.168.100.1[::ffff:192.168.100.1]): mod_delay/0.5: delaying for 11950 usecs
::ffff:192.168.100.1 UNKNOWN proftpd [07/May/2007:22:17:07 +0200] "USER exampleuserXXX" 331 -
May 07 22:17:07 chucknorris proftpd[6194] chucknorris (::ffff:192.168.100.1[::ffff:192.168.100.1]): no such user 'exampleuser'
May 07 22:17:07 chucknorris proftpd[6194] chucknorris (::ffff:192.168.100.1[::ffff:192.168.100.1]): USER exampleuser: no such user found from ::ffff:192.168.100.1 [::ffff:192.168.100.1] to ::ffff:192.168.100.128:21
May 07 22:17:07 chucknorris proftpd[6194] chucknorris (::ffff:192.168.100.1[::ffff:192.168.100.1]): mod_delay/0.5: delaying for 10731 usecs
::ffff:192.168.100.1 UNKNOWN proftpd [07/May/2007:22:17:07 +0200] "PASS (hidden)" 530 -
May 07 22:17:07 chucknorris proftpd[6194] chucknorris (::ffff:192.168.100.1[::ffff:192.168.100.1]): FTP session closed.
Code:
-- phpMyAdmin SQL Dump
-- version 2.8.2-Debian-0.2
-- http://www.phpmyadmin.net
-- 
-- Host: localhost
-- Generation Time: May 07, 2007 at 10:20 PM
-- Server version: 5.0.24
-- PHP Version: 5.1.6
-- 
-- Database: `ftp`
-- 

-- --------------------------------------------------------

-- 
-- Table structure for table `ftpgroup`
-- 

CREATE TABLE `ftpgroup` (
  `groupname` varchar(16) NOT NULL default '',
  `gid` smallint(6) NOT NULL default '5500',
  `members` varchar(16) NOT NULL default '',
  KEY `groupname` (`groupname`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='ProFTP group table';

-- 
-- Dumping data for table `ftpgroup`
-- 

INSERT INTO `ftpgroup` (`groupname`, `gid`, `members`) VALUES ('ftpgroup', 2001, 'ftpuser');

-- --------------------------------------------------------

-- 
-- Table structure for table `ftpquotalimits`
-- 

CREATE TABLE `ftpquotalimits` (
  `name` varchar(30) default NULL,
  `quota_type` enum('user','group','class','all') NOT NULL default 'user',
  `per_session` enum('false','true') NOT NULL default 'false',
  `limit_type` enum('soft','hard') NOT NULL default 'soft',
  `bytes_in_avail` int(10) unsigned NOT NULL default '0',
  `bytes_out_avail` int(10) unsigned NOT NULL default '0',
  `bytes_xfer_avail` int(10) unsigned NOT NULL default '0',
  `files_in_avail` int(10) unsigned NOT NULL default '0',
  `files_out_avail` int(10) unsigned NOT NULL default '0',
  `files_xfer_avail` int(10) unsigned NOT NULL default '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- 
-- Dumping data for table `ftpquotalimits`
-- 

INSERT INTO `ftpquotalimits` (`name`, `quota_type`, `per_session`, `limit_type`, `bytes_in_avail`, `bytes_out_avail`, `bytes_xfer_avail`, `files_in_avail`, `files_out_avail`, `files_xfer_avail`) VALUES ('exampleuser', 'user', 'true', 'hard', 15728640, 0, 0, 0, 0, 0);

-- --------------------------------------------------------

-- 
-- Table structure for table `ftpquotatallies`
-- 

CREATE TABLE `ftpquotatallies` (
  `name` varchar(30) NOT NULL default '',
  `quota_type` enum('user','group','class','all') NOT NULL default 'user',
  `bytes_in_used` int(10) unsigned NOT NULL default '0',
  `bytes_out_used` int(10) unsigned NOT NULL default '0',
  `bytes_xfer_used` int(10) unsigned NOT NULL default '0',
  `files_in_used` int(10) unsigned NOT NULL default '0',
  `files_out_used` int(10) unsigned NOT NULL default '0',
  `files_xfer_used` int(10) unsigned NOT NULL default '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- 
-- Dumping data for table `ftpquotatallies`
-- 

INSERT INTO `ftpquotatallies` (`name`, `quota_type`, `bytes_in_used`, `bytes_out_used`, `bytes_xfer_used`, `files_in_used`, `files_out_used`, `files_xfer_used`) VALUES ('exampleuser', 'user', 0, 0, 0, 0, 0, 0);

-- --------------------------------------------------------

-- 
-- Table structure for table `ftpuser`
-- 

CREATE TABLE `ftpuser` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `userid` varchar(32) NOT NULL default '',
  `passwd` varchar(32) NOT NULL default '',
  `uid` smallint(6) NOT NULL default '5500',
  `gid` smallint(6) NOT NULL default '5500',
  `homedir` varchar(255) NOT NULL default '',
  `shell` varchar(16) NOT NULL default '/sbin/nologin',
  `count` int(11) NOT NULL default '0',
  `accessed` datetime NOT NULL default '0000-00-00 00:00:00',
  `modified` datetime NOT NULL default '0000-00-00 00:00:00',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `userid` (`userid`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 COMMENT='ProFTP user table' AUTO_INCREMENT=2 ;

-- 
-- Dumping data for table `ftpuser`
-- 

INSERT INTO `ftpuser` (`id`, `userid`, `passwd`, `uid`, `gid`, `homedir`, `shell`, `count`, `accessed`, `modified`) VALUES (1, 'exampleuser', 'secret', 2001, 2001, '/home/www.example.com', '/sbin/nologin', 5, '0000-00-00 00:00:00', '0000-00-00 00:00:00');
Code:
root@chucknorris:/# ls -lah | grep home
drwxr-xr-x   6 root root 4.0K 2007-05-07 20:22 home
root@chucknorris:/home# ls -lah | grep www.example.com
drwxr-xr-x  2 ftpuser      ftpgroup    4.0K 2007-05-07 20:22 www.example.com
 
Also hast du offenbar noch kein ExtendedLog versucht. Schau dir mal http://www.proftpd.de/HowTo-Logging.31.0.html an und laß dir mal ein paar Details mehr mitloggen, wie z.B. die SQL-Anfragen (z.B. SQLLogFile /var/log/proftpd/sql.log), die der proftpd an den DB-Server sendet und schau nach, ob du diese auch direkt an die SQL-DB senden kannst und ein gültiges Ergebnis zurück bekommst. Näheres dazu findet sich auch unter http://www.proftpd.de/SQL-Anleitung.30.0.html
Außerdem solltest du mal überprüfen ob proftpd-mysql überhaupt installiert ist und ob es in der /etc/proftpd/modules.conf auch geladen wird. Im Normalfall sollte man die SQL-Sachen auch entsprechend "klammern" (<IfModule mod_sql.c>).
 
Zurück
Oben