www.ProFTPD.de

ProFTPD => ProFTPD - English => Thema gestartet von: PPPeter am 21. Juni 2004, 13:36:22



Titel: ProFTPD user logging.
Beitrag von: PPPeter am 21. Juni 2004, 13:36:22
I have this situation:
- 1 server
- 75 user accounts all connection true ftp.host.ext

Is there a way to log each user activity to make stats of them.
Like:
User a transfered something and that would be written in xferlog-a.log
User b transfered something and that would be written in xferlog-b.log
User c transfered samething and that would be written in xferlog-c.log
....

xferlog-a,b,c may be something else, doesn't has to be the exact same logname.

This without using virtual host, because our clients only know 1 host to connect.

I hope someone knows if that's possible, i already searched on proftpd.org but nothing found.

With kind regards,

Bert Verslegers


Titel: ProFTPD user logging.
Beitrag von: Wörsty am 21. Juni 2004, 19:37:58
I think yes. In several ways.
I would prefer MySQL logs in this case.
Something like this:

 
Code:
SQLAuthenticate users*
  SQLAuthTypes Backend
  SQLConnectInfo bla@localhost:3306 ftp ftp PERSESSION
  SQLDefaultGID 502
  SQLDefaultUID 502
  SQLHomedirOnDemand On
  SQLLog PASS  updatecount
  SQLLog PASS  letzter_zugriff
  SQLLog DELE  delfile
  SQLLog RETR  getfile
  SQLLog *  history
  SQLLOG ERR_* history_err
  SQLNamedQuery updatecount     UPDATE "ftp_login_count=ftp_login_count+1 WHERE loginname='%u'" users
  SQLNamedQuery letzter_zugriff UPDATE "last_ftp_login = now() where loginname = '%u'" users
  SQLNamedQuery delfile         UPDATE "deleted ='ja' where loginname = '%u' and dateiname = '%F'" ftp_query
  SQLNamedQuery getfile         UPDATE "downloadcount = downloadcount + 1, last_download = now() where fullpath = '%f' and loginname = '%u'" ftp_query
  SQLNamedQuery history         INSERT "'%U', '%u', '%f', '%b', '%h', '%a', '%m', '%T', now(), 'ok', NULL" ftp_history
  SQLNamedQuery history_err     INSERT "'%U', '%u', '%f', '%b', '%h', '%a', '%m', '%T', now(), 'nicht ok', NULL" ftp_history
  SQLUserInfo users loginname   passwort users_id NULL concat('/www/vhosts/ftp/121/',loginname) NULL