Someone's probably going to insist this isn't possible, but from the research I've done, it clearly is.
So here's what I want to do. Main site is hosted on AWS EC2. Nothing special about that. However, we'd like to give our users the ability to log into an FTP server, upload files, and then have those files be sent to AWS's S3 storage system. The cost to store files there is about 1/3 the price of paying for normal storage, and it's fairly straightforward to link to them.
So I set up the FTP server vsftpd. It seems to be the gold standard for Ubuntu Linux (which I'm using). Now, vsftpd has a feature that allows authentication to be done via PAM, meaning that FTP users don't necessarily have to have a user account in the operating system in order to use the FTP server. I'm using PostgreSQL 9.5 for the database, because I have a lot of experience with it, and nginx for the web server. This has meant a lot of monkeying around with PAM and vsftpd, as well as installing Postgres PAM extensions. One of the more helpful pages I've found has been this one:
https://github.com/pam-pgsql/pam-pgsql
However, I have no idea how phpBB checks to see if a password is correct. The only code I've been able to find that can do this is written in PHP, and everything I need to do is on the backend. I just need to know how to check a password using an SQL query only, in Postgres.
For anyone unfamiliar with PAM, it seems to be a protocol for allowing various services to all use the same authentication system in Linux. I don't really have much experience with it, but I have gotten most of the way towards getting the pieces all working.