ProFTPD User über MySQL abfragen

0
1665

Einträge für die /etc/proftpd.conf
Geändert wird nur diese Zeile

SQLConnectInfo vhcs2@localhost root xxxxxxx
SQLConnectInfo [DB-Name]@[DB Host] [DB User] [DB Passwort]

Beispiel
:
#
# VHCS2 Managment;
#

SQLAuthTypes Crypt
SQLAuthenticate on
SQLConnectInfo vhcs2@localhost root hermann
SQLUserInfo ftp_users userid passwd uid gid homedir shell
SQLGroupInfo ftp_group groupname gid members
SQLMinID 2000

#
# VHCS2 Quota management;
#

QuotaEngine on
QuotaShowQuotas on
QuotaDisplayUnits Mb

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 quotalimits 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 quotatallies 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}'“ quotatallies
SQLNamedQuery insert-quota-tally INSERT „%{0}, %{1}, %{2}, %{3}, %{4}, %{5}, %{6}, %{7}“ quotatallies
QuotaLock /var/run/proftpd/tally.lock
QuotaLimitTable sql:/get-quota-limit
QuotaTallyTable sql:/get-quota-tally/update-quota-tally/insert-quota-tally

DirFakeGroup off
DirFakeUser off

HINTERLASSEN SIE EINE ANTWORT