Salut à tous,
J'essaye de mettre en place une gestion de compte FTP avec Proftpd et MySQL mais je bloque sur un endroit et pas moyen de trouver solution.
La doc de Lea Linux a entre autre été utilisée et j'ai aussi pris en considération d'autres docs (Proftpd ayant subi quelques mise à jour, Ex: SQLHomedirOnDemand ets devenu CreateHome).
J'arrive à me connecter sur mon FTP, il me répond mais il refuse en permanence mes utilisateurs (créé aussi via useradd) : 530 login incorrect.
Voici les versions utilisées : CentOS 5.5, mysql Ver 14.12 Distrib 5.0.77, ProFTPD Version 1.3.3c
Je pense que Proftpd n'arrive pas à se connecter à la base mais je ne vois pas pourquoi car je peux le faire avec ses identifiants via le shell et interroger sa base.
Quand je regarde le log de Proftpd pour la connexion Mysql, je n'ai que ceci pour une tentative de connexion FTP :
Jan 31 11:45:13 mod_sql/4.2.4[4143]: defaulting to 'mysql' backend
Jan 31 11:45:13 mod_sql/4.2.4[4143]: backend module 'mod_sql_mysql/4.0.8'
Jan 31 11:45:13 mod_sql/4.2.4[4143]: backend api 'mod_sql_api_v1'
Jan 31 11:45:13 mod_sql/4.2.4[4143]: >>> sql_sess_init
Jan 31 11:45:13 mod_sql/4.2.4[4143]: entering mysql cmd_defineconnection
Jan 31 11:45:13 mod_sql/4.2.4[4143]: name: 'default'
Jan 31 11:45:13 mod_sql/4.2.4[4143]: user: 'proftpd'
Jan 31 11:45:13 mod_sql/4.2.4[4143]: host: 'localhost'
Jan 31 11:45:13 mod_sql/4.2.4[4143]: db: 'proftpd'
Jan 31 11:45:13 mod_sql/4.2.4[4143]: port: '3306'
Jan 31 11:45:13 mod_sql/4.2.4[4143]: ttl: '0'
Jan 31 11:45:13 mod_sql/4.2.4[4143]: exiting mysql cmd_defineconnection
Jan 31 11:45:13 mod_sql/4.2.4[4143]: mod_sql engine : on
Jan 31 11:45:13 mod_sql/4.2.4[4143]: negative_cache : off
Jan 31 11:45:13 mod_sql/4.2.4[4143]: authenticate : users groups
Jan 31 11:45:13 mod_sql/4.2.4[4143]: usertable : ftpuser
Jan 31 11:45:13 mod_sql/4.2.4[4143]: userid field : userid
Jan 31 11:45:13 mod_sql/4.2.4[4143]: password field : passwd
Jan 31 11:45:13 mod_sql/4.2.4[4143]: UID field : uid
Jan 31 11:45:13 mod_sql/4.2.4[4143]: GID field : gid
Jan 31 11:45:13 mod_sql/4.2.4[4143]: homedir field : homedir
Jan 31 11:45:13 mod_sql/4.2.4[4143]: shell field : shell
Jan 31 11:45:13 mod_sql/4.2.4[4143]: group table : ftpgroup
Jan 31 11:45:13 mod_sql/4.2.4[4143]: groupname field : groupname
Jan 31 11:45:13 mod_sql/4.2.4[4143]: grp GID field : gid
Jan 31 11:45:13 mod_sql/4.2.4[4143]: grp members field : members
Jan 31 11:45:13 mod_sql/4.2.4[4143]: SQLMinUserUID : 999
Jan 31 11:45:13 mod_sql/4.2.4[4143]: SQLMinUserGID : 999
Jan 31 11:45:13 mod_sql/4.2.4[4143]: SQLDefaultUID : 65533
Jan 31 11:45:13 mod_sql/4.2.4[4143]: SQLDefaultGID : 65533
Jan 31 11:45:13 mod_sql/4.2.4[4143]: <<< sql_sess_init
Jan 31 11:45:13 mod_sql/4.2.4[4143]: >>> sql_pre_pass
Jan 31 11:45:13 mod_sql/4.2.4[4143]: <<< sql_pre_pass
Jan 31 11:45:19 mod_sql/4.2.4[4143]: >>> sql_pre_pass
Jan 31 11:45:19 mod_sql/4.2.4[4143]: <<< sql_pre_pass
Jan 31 11:45:25 mod_sql/4.2.4[4143]: entering mysql cmd_exit
Jan 31 11:45:25 mod_sql/4.2.4[4143]: exiting mysql cmd_exit
De ce que j'ai vu sur le web, je devrai aussi voir des requêtes entre les sql_pre_pass. De plus MySQL log tout pour le moment et je n'ai aucune trace de requête.
Voici ma config Proftpd :
ServerName "Hercule server"
ServerIdent on "Hercule FTP Server ready."
ServerAdmin root@localhost
ServerType standalone
DefaultServer on
AccessGrantMsg "User %u logged in."
DeferWelcome off
DefaultRoot ~
AuthPAMConfig proftpd
AuthOrder mod_auth_pam.c* mod_auth_unix.c mod_sql.c
IdentLookups off
UseReverseDNS off
Port 21
Umask 022
ListOptions "-a"
AllowRetrieveRestart on
AllowStoreRestart on
MaxInstances 20
User nobody
Group nobody
UseSendfile no
ScoreboardFile /var/run/proftpd.score
<Global>
AllowOverwrite yes
<Limit ALL SITE_CHMOD>
AllowAll
</Limit>
</Global>
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>
LoadModule mod_quotatab.c
LoadModule mod_quotatab_sql.c
<IfModule mod_sql.c>
SQLBackend mysql
</IfModule>
<IfModule mod_quotatab.c>
QuotaEngine on
</IfModule>
# Mod MySQL
# =========
SQLAuthTypes Crypt
SQLAuthenticate users groups
SQLConnectInfo proftpd@localhost proftpd monmotdepasse
SQLUserInfo ftpuser userid passwd uid gid homedir shell
SQLUserWhereClause "LoginAllowed = 'true'"
SQLGroupInfo ftpgroup groupname gid members
CreateHome on
SQLLog PASS updatecount
SQLNamedQuery updatecount UPDATE "count=count+1, accessed=now() WHERE userid='%u'" ftpuser
SQLLog STOR,RETR modified
SQLNamedQuery modified UPDATE "modified=now() WHERE userid='%u'" ftpuser
# Mod quota
# =========
QuotaDirectoryTally on
QuotaDisplayUnits Mb
QuotaShowQuotas on
SQLNamedQuery get-quota-limit SELECT "name, quota_type, par_session, limit_type, bytes_up_limit, bytes_down_limit, bytes_transfer_limit, files_up_limit, files_down_limit, files_transfer_limit FROM ftpquotalimits WHERE name = '%{0}' AND quota_type = '%{1}'"
SQLNamedQuery get-quota-tally SELECT "name, quota_type, bytes_up_total, bytes_down_total, bytes_transfer_total, files_up_total, files_down_total, files_transfer_total FROM ftpquotatotal WHERE name = '%{0}' AND quota_type = '%{1}'"
SQLNamedQuery update-quota-tally UPDATE "bytes_up_total = bytes_up_total + %{0}, bytes_down_total = bytes_down_total + %{1}, bytes_transfer_total = bytes_transfer_total + %{2}, files_up_total = files_up_total + %{3}, files_down_total = files_down_total + %{4}, files_transfer_total = files_transfer_total + %{5} WHERE name = '%{6}' AND quota_type = '%{7}'" ftpquotatotal
SQLNamedQuery insert-quota-tally INSERT "%{0}, %{1}, %{2}, %{3}, %{4}, %{5}, %{6}, %{7}" ftpquotatotal
QuotaLimitTable sql:/get-quota-limit
QuotaTallyTable sql:/get-quota-tally/update-quota-tally/insert-quota-tally
# Gestion des logs
# ================
SQLLogFile /var/log/proftpd/mysql.log
LogFormat auth "%v [%P] %h %t \"%r\" %s"
ExtendedLog /var/log/proftpd/auth.log AUTH auth
LogFormat write "%h %l %u %t \"%r\" %s %b"
ExtendedLog /var/log/proftpd/access.log WRITE,READ write
RootLogin off
RequireValidShell off
Je suis complétement bloqué depuis plusieurs jours, si vous avez une idée?
Merci.
Echomeme