I try to set up vsftpd using MySQL database for login users via pam.d
I have this config in /etc/pam.d/vsftpd:
# Standard behaviour for ftpd(8).
auth required pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed
# Note: vsftpd handles anonymous logins on its own. Do not enable pam_ftp.so.
# Standard pam includes
@include common-account
@include common-session
@include common-auth
auth required pam_shells.so
auth required pam_mysql.so user=vsftpd passwd=ftpdpass-X43544 host=localhost db=vsftpd table=accounts usercolumn=username passwdcolumn=pass crypt=2
account required pam_mysql.so user=vsftpd passwd=ftpdpass-X43544 host=localhost db=vsftpd table=accounts usercolumn=username passwdcolumn=pass crypt=2
A tried to use query parameter to set up custom sql query, and see what's happening in MySQL log, but I didn't see anything. Like the SQL query doesn't run.
I tried crypt=0 option too and save password as plain text in database, but nothing changed.
The vsftpd say:
pam_unix(vsftpd:auth): check pass; user unknown
pam_unix(vsftpd:auth): authentication failure; logname= uid=0 euid=0 tty=ftp ruser=myuser rhost=myipaddress
While the MySQL changed the behavior of PASSWORD() built-in function I can't create a working password for my user. But I absolutely don't understand why not logged any SQL query when a login happening.
Any idea what I miss?