2

I need ProFTPd to connect to few databases/tables and authorize users by data from them.

I have ftp login data in db/tables:

db1 / ftp

db2 / ftp

db2 / users

db2 / ftp_vip

db3 / data

Can you give me right proftp.conf and/or sql.conf for that? I tried multiple solutions with SQLNamedQuery and SQLNamedConnectInfo but it won't work or work only for db1 / ftp and igonres other settings.

I wonna to do it only by ProFTPd modules without any external soft.

PS. Proftpd version: 1.3.3a or 1.3.4rc2 (no matter for me)

//EDIT: db3 is on another machine, so view will not make it.

Misiek
  • 51
  • 4
  • Using [`SQLNamedConnectInfo`](http://www.proftpd.org/docs/contrib/mod_sql.html#SQLNamedConnectInfo) should do what you want. Could you provide examples of what you tried when using that, and how exactly it didn't work? Or maybe just show us the `mod_sql` config you're using (without sensitive username/password information)? – Castaglia Jan 09 '16 at 18:20
  • @Castaglia I've already fixed this using aggreator and Redis database (secured of course) to make this work. I left this question open, because maybe there will be new feature in future implemented in ProFTPd to support multiple databases. – Misiek Apr 19 '16 at 20:08
  • the `SQLNamedConnectInfo` directive I mentioned does allow ProFTPD to support multiple databases. – Castaglia Apr 19 '16 at 20:12
  • @Castaglia yes, but if I understand docs correctly it doesn't allow to specify different table names for each db. There is one schema that must be exactly the same in all databases. – Misiek Apr 19 '16 at 22:19
  • That's incorrect; the schema can be different in the different databases. It is the `SQLNamedQuery` which indicates which schema, in which database, is needed. – Castaglia Apr 19 '16 at 22:24
  • @Castaglia I mean't different column names. They are defined in SQLUserInfo and can't be various for different databases. I know I can make views, but the main point was to do it without any changes into database. Now I switched to different solution (http), but additionally ftp-side is now custom-made. – Misiek Apr 28 '16 at 13:47

1 Answers1

1

One solution would be to aggregate all the mysql data together using views.

http://dev.mysql.com/doc/refman/5.6/en/create-view.html

http://dev.mysql.com/doc/refman/5.6/en/views.html

dmourati
  • 25,540
  • 2
  • 42
  • 72