hola,

stavo abilitando l'autenticazione di sistema sulla mia configurazione di proftpd che funziona lavorando con mod_sql (mod_sql_mysql)

Ho fatto un pozzo di prove, disabilitando anche il supporto a mod_sql, ma purtroppo non riesco a far funzionare l'autenticazione con gli utenti di sistema e sinceramente non capisco perché :\

Qui c'è il file di configurazione
codice:
ServerName                              "xxx.xxx.it"
ServerIdent                             on "FTP Server ready."
ServerAdmin                             root
ServerType                              standalone
DefaultServer                   on
AccessGrantMsg                  "User %u logged in."
DeferWelcome                    off
#RequireValidShell              off
TimeoutIdle                     900

#DisplayConnect                 /etc/ftpissue
#DisplayLogin                   /etc/ftpmotd
#DisplayGoAway                  /etc/ftpgoaway

DefaultRoot                             ~ !admin
IdentLookups                    off
UseReverseDNS                   off
Port                                    21
Umask                                   002
ListOptions                             "-a"

# See Configuration.html for these (here are the default values)
#MultilineRFC2228               off
#RootLogin                              off
#LoginPasswordPrompt    on
MaxLoginAttempts                3
MaxClientsPerHost               3
#AllowForeignAddress    off     # For FXP

AllowRetrieveRestart    on
AllowStoreRestart               on

MaxInstances                    20

User                                    nobody
Group                                   nobody

UseSendfile                             yes

ScoreboardFile                  /var/run/proftpd.score

# Normally, we want users to do a few things.
<Global>
  AllowOverwrite                yes

  ExtendedLog                   /var/log/proftpd/access.log WRITE,READ default
  ExtendedLog                   /var/log/proftpd/auth.log AUTH auth

  <Limit ALL SITE_CHMOD>
    AllowAll
  </Limit>
</Global>

# Define the log formats
LogFormat                       default "%h %l %u %t \"%r\" %s %b"
LogFormat                       auth    "%v [%P] %h %t \"%r\" %s"

<IfModule mod_dso.c>
        LoadModule mod_sql.c
        LoadModule mod_sql_mysql.c
</IfModule>

# Use pam to authenticate (default) and be authoritative
AuthPAM                         no
AuthOrder                       mod_auth_unix.c mod_sql.c

SQLAuthTypes                    Plaintext
SQLAuthenticate                 users
SQLConnectInfo                  xxx@xxx xxx xxx
SQLDefaultGID                   65534
SQLDefaultUID                   65534
SQLMinUserGID                   500
SQLMinUserUID                   500
#SQLOptions                     useNormalizedGroupSchema

# Query per gestire la lettura degli utenti e gruppi
SQLNamedQuery                   sql_users                       SELECT "xxxxxxxxxxx"
#SQLNamedQuery                  sql_groups                      SELECT "xxxxxxxxxxx"

SQLUserInfo                     custom:/sql_users
#SQLGroupInfo                   custom:/sql_groups
Qui c'è l'output di proftpd lanciato con -n -d10 (ergo gira in foregroup con il livello di debug a 10)
codice:
[root@xxx proftpd]# proftpd -n -d10
 - mod_tls/2.1.2: using OpenSSL 0.9.8b 04 May 2006
 - retrieved UID 99 for user 'nobody'
 - retrieved GID 99 for group 'nobody'
 - <IfModule>: using 'mod_dso.c' section at line 60
xxx.xxx.it -
xxx.xxx.it - Config for xxx.xxx.it:
xxx.xxx.it - ServerIdent
xxx.xxx.it - DefaultServer
xxx.xxx.it - AccessGrantMsg
xxx.xxx.it - DeferWelcome
xxx.xxx.it - TimeoutIdle
xxx.xxx.it - DefaultRoot
xxx.xxx.it - IdentLookups
xxx.xxx.it - Umask
xxx.xxx.it - ListOptions
xxx.xxx.it - MaxLoginAttempts
xxx.xxx.it - MaxClientsPerHost
xxx.xxx.it - AllowRetrieveRestart
xxx.xxx.it - AllowStoreRestart
xxx.xxx.it - UserID
xxx.xxx.it - UserName
xxx.xxx.it - GroupID
xxx.xxx.it - GroupName
xxx.xxx.it - UseSendfile
xxx.xxx.it - AuthPAM
xxx.xxx.it - AuthOrder
xxx.xxx.it - SQLAuthTypes
xxx.xxx.it - SQLAuthenticate
xxx.xxx.it - SQLConnectInfo
xxx.xxx.it - SQLDefaultGID
xxx.xxx.it - SQLDefaultUID
xxx.xxx.it - SQLMinUserGID
xxx.xxx.it - SQLMinUserUID
xxx.xxx.it - SQLNamedQuery_sql_users
xxx.xxx.it - SQLCustomUserInfo
xxx.xxx.it - Limit
xxx.xxx.it -  AllowAll
xxx.xxx.it - AllowOverwrite
xxx.xxx.it - ExtendedLog
xxx.xxx.it - ExtendedLog
xxx.xxx.it - ROOT PRIVS at mod_delay.c:307
xxx.xxx.it - RELINQUISH PRIVS at mod_delay.c:309
xxx.xxx.it - ROOT PRIVS at mod_ctrls.c:1618
xxx.xxx.it - RELINQUISH PRIVS at mod_ctrls.c:1620
xxx.xxx.it - retrieved group ID: 99
xxx.xxx.it - setting group ID: 99
xxx.xxx.it - SETUP PRIVS at main.c:2849
xxx.xxx.it - ROOT PRIVS at main.c:1926
xxx.xxx.it - RELINQUISH PRIVS at main.c:1933
xxx.xxx.it - ROOT PRIVS at main.c:2257
xxx.xxx.it - opening scoreboard '/var/run/proftpd.score'
xxx.xxx.it - RELINQUISH PRIVS at main.c:2283
xxx.xxx.it - ROOT PRIVS at inet.c:343
xxx.xxx.it - RELINQUISH PRIVS at inet.c:406
xxx.xxx.it - ProFTPD 1.3.1 (stable) (built Sun Feb 3 12:40:39 EST 2008) standalone mode STARTUP
xxx.xxx.it - ROOT PRIVS at pidfile.c:42
xxx.xxx.it - RELINQUISH PRIVS at pidfile.c:44
xxx.xxx.it - ROOT PRIVS at main.c:1054
xxx.xxx.it - RELINQUISH PRIVS at main.c:1058
xxx.xxx.it - no matching vhost found for ::ffff:91.195.3.10#21, using DefaultServer 'xxx.xxx.it'
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - ROOT PRIVS at main.c:903
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - SETUP PRIVS at main.c:908
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - FTP session requested from unknown class
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - performing module session initializations
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - mod_sql/4.2.2: defaulting to 'mysql' backend
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - ROOT PRIVS at mod_delay.c:1232
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - RELINQUISH PRIVS at mod_delay.c:1234
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - mod_log: opening ExtendedLog '/var/log/proftpd/auth.log'
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - ROOT PRIVS at mod_log.c:1218
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - RELINQUISH PRIVS at mod_log.c:1220
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - mod_log: opening ExtendedLog '/var/log/proftpd/access.log'
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - ROOT PRIVS at mod_log.c:1218
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - RELINQUISH PRIVS at mod_log.c:1220
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - ROOT PRIVS at mod_auth.c:151
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - opening scoreboard '/var/run/proftpd.score'
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - RELINQUISH PRIVS at mod_auth.c:153
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - AuthOrder in effect, resetting auth module order
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - ident lookup disabled
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - connected - local  : ::ffff:91.195.3.10:21
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - connected - remote : ::ffff:79.15.88.52:56766
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - FTP session opened.
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - dispatching PRE_CMD command 'USER NOME_UTENTE' to mod_tls
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - dispatching PRE_CMD command 'USER NOME_UTENTE' to mod_core
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - dispatching PRE_CMD command 'USER NOME_UTENTE' to mod_core
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - dispatching PRE_CMD command 'USER NOME_UTENTE' to mod_delay
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - dispatching PRE_CMD command 'USER NOME_UTENTE' to mod_auth
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - dispatching CMD command 'USER NOME_UTENTE' to mod_auth
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - retrieved group ID: 514
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - retrieved group name: NOME_GRUPPO_UTENTE
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - dispatching POST_CMD command 'USER NOME_UTENTE' to mod_sql
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - dispatching POST_CMD command 'USER NOME_UTENTE' to mod_delay
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - dispatching LOG_CMD command 'USER NOME_UTENTE' to mod_sql
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - dispatching LOG_CMD command 'USER NOME_UTENTE' to mod_log
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - dispatching PRE_CMD command 'PASS (hidden)' to mod_tls
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - dispatching PRE_CMD command 'PASS (hidden)' to mod_core
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - dispatching PRE_CMD command 'PASS (hidden)' to mod_core
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - dispatching PRE_CMD command 'PASS (hidden)' to mod_sql
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - retrieved group ID: 514
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - retrieved group name: NOME_GRUPPO_UTENTE
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - dispatching PRE_CMD command 'PASS (hidden)' to mod_delay
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - dispatching PRE_CMD command 'PASS (hidden)' to mod_auth
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - dispatching CMD command 'PASS (hidden)' to mod_auth
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - retrieved UID 586 for user 'NOME_UTENTE'
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - ROOT PRIVS at mod_auth_unix.c:515
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - RELINQUISH PRIVS at mod_auth_unix.c:596
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - USER NOME_UTENTE (Login failed): Incorrect password.
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - dispatching POST_CMD_ERR command 'PASS (hidden)' to mod_sql
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - dispatching POST_CMD_ERR command 'PASS (hidden)' to mod_delay
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - dispatching LOG_CMD_ERR command 'PASS (hidden)' to mod_sql
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - dispatching LOG_CMD_ERR command 'PASS (hidden)' to mod_log
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - dispatching LOG_CMD_ERR command 'PASS (hidden)' to mod_auth
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - FTP session closed.
Nell'output viene riportato lo startup e poi il fallimento del login. Ho evidenziato le righe rigaurdanti il login

La riga
xxx.xxx.it (::ffff:79.15.88.52[::ffff:79.15.88.52]) - USER NOME_UTENTE (Login failed): Incorrect password.

riporta l'errore password errata ... ma la password, ovviamente, non è errata ... ho fatto svariati controlli per assicurarmi che i permessi alla cartella dell'utente fossero corretti, che la password fosse corretta (per sicurezza ho pure messo 123 come password ... non si sa mai fossi io idiota)

la cosa molto strana è che lui l'utente lo legge, il gid e l'uid sono corretti ... ma mi da password errata

l'auth log riporta
codice:
xxx.xxx.it [376] ::ffff:79.15.88.52 [02/Nov/2008:17:07:28 +0100] "USER NOME_UTENTE" 331
xxx.xxx.it [376] ::ffff:79.15.88.52 [02/Nov/2008:17:07:28 +0100] "PASS (hidden)" 530
Qui c'è la riga dell'utente sul passwd
NOME_UTENTE:x:586:514:Account FTP per lo spazio web xxx:/percorso/alla/root/dell_utente:/sbin/nologin

Nel dubbio fosse problema di shell ho pure cambiato il /sbin/nologin in /bin/bash ... giusto per fare la prova anche se ci sta RequireValidShell su off

Sinceramente non riesco a capire qual'è il problema :\

Ho cercato su google ... magari poteva essere qualche incompatibilità ma nada

Abilitando le pam (AuthPAM yes) e commentando AuthOrder non va comunque, e la cosa sinceramente mi sta stranizzando troppo

La versione di proftpd è l'ultima che c'è per la fc8
codice:
[root@xxx proftpd]# proftpd -v
 - ProFTPD Version 1.3.1
[root@xxx proftpd]# rpm -q proftpd
proftpd-1.3.1-3.fc8