Score:0

vsftpd with MySQL 8 - login not working

cn flag

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?

HBruijn avatar
in flag
By default the MySQL daemon doesn't do query logging, right? And when query logging is enabled, MySQLd is designed to at least attempt to prevent clear text passwords from getting logged and you may need to adjust logging to prevent that https://dev.mysql.com/doc/refman/8.0/en/server-options.html#option_mysqld_log-raw and https://dev.mysql.com/doc/refman/8.0/en/query-log.html
netdjw avatar
cn flag
I understand... but my problem is not the query logging. It's just a way I try to debug the problem. My problem is user can't log in via vsftpd using MySQL because MySQL 8 changed the "password()" function.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.