There are a few options to consider, the best depends on the scope of your project. is it a pet project used by you and a few others, or some serious stuff publicly accessible?
Text File
From the looks of it, a (text) file is the best option. Use a proper cryptographic hash (SHA256
or better) to hash the passwords and store those in the text file with the username.
On login, check the hashed password from the login-form with the one in the text-file.
Depending on the situation, you might wanna look at bcrypt/scrypt for password hashing.
Assure the text file is outside the root-dir of your webpage, and only to be read/modifed/written by the process that needs it.
Tiny Database
Or you can use a database anyway. Sqlite is very low-overhead. Instead of writing to text, you're writing to a database that is still 1 file large.
The code needed to open and update text files is probably as large as a sqlite connection.
If you use a framework of some sort, there's a possibly an ORM which features the needs for a Sqlite connection. Ideal if you ever want to upgrade to a larger database.