I am using pure-ftpd with mysql to auth users.
Here is my mysql.conf
MYSQLServer localhost
MYSQLPort 3306
MYSQLSocket /var/run/mysqld/mysqld.sock
MYSQLUser user
MYSQLPassword pwd
MYSQLDatabase my_db
MYSQLCrypt crypt()
MYSQLGetPW SELECT password FROM ftp_users WHERE login="\L"
MYSQLGetUID SELECT u_id FROM ftp_users WHERE login="\L"
MYSQLGetGID SELECT g_id FROM ftp_users WHERE login="\L"
MYSQLGetDir SELECT dir FROM ftp_users WHERE login="\L"
MySQLGetQTAFS SELECT quota_files FROM ftp_users WHERE login="\L"
MySQLGetQTASZ SELECT quota_size FROM ftp_users WHERE login="\L"
MySQLGetRatioUL SELECT ul_ratio FROM ftp_users WHERE login="\L"
MySQLGetRatioDL SELECT dl_ratio FROM ftp_users WHERE login="\L"
MySQLGetBandwidthUL SELECT ul_bandwidth FROM ftp_users WHERE login="\L"
MySQLGetBandwidthDL SELECT dl_bandwidth FROM ftp_users WHERE login="\L"
I then have tried restarting pure-ftpd-mysql and pure-ftpd
My table has a field with the pwd as
password varchar(255)
When I insert a user with a plaintext pwd, I can login fine with both login and password. When I insert a hash with 'lol' such as SHA512 or a BCrypt hash. It doesn't allow me to login with the pwd 'lol'.
BCrypt $2a$06$JrvxpMAvi6MnRSIvZQMMxOffIDLtEP7lrKNe0k0CTsK51v4zujfpS
SHA512 3DD28C5A23F780659D83DD99981E2DCB82BD4C4BDC8D97A7DA50AE84C7A7229A6DC0AE8AE4748640A4CC07CCC2D55DBDC023A99B3EF72BC6CE49E30B84253DAE
However, if I paste in the hash, it successfully logs in as I assume it takes it as a plaintext value.
I have tried changing the mysql.conf to
MYSQLCrypt crypt
But this breaks it completely. There are many sites which say to use crypt, but the comments in my configuration file list crypt() as one of the options.
I have read through many posts and forums but the closest thing I found was this, which doesn't work at all.
https://serverfault.com/a/630806/302696
Here is what pure-ftpd starts with
Starting ftp server: Running: /usr/sbin/pure-ftpd-mysql -l mysql:/etc/pure-ftpd/db/mysql.conf -l puredb:/etc/pure-ftpd/pureftpd.pdb -l puredb:/etc/pure-ftpd/pureftpd.pdb -E -F /etc/pure-ftpd/fortunes.txt -j -H -J ALL:!aNULL:!SSLv3 -u 1000 -8 UTF-8 -A -O clf:/var/log/pure-ftpd/transfer.log -B
So basically it is not using crypt or I am not using it correctly. I though it could handle SHA512 natively with mysql but it doesn't. Other things I can think of is that I need code with the configuration but I can't see why it would require anything.