1

In trying to set up vsftpd to use virtual users I hit this problem.

I created a database file:

db_load -T -t hash -f users.txt /etc/vsftpd/users.db

And /etc/pam.d/vsftpd:

session optional pam_keyinit.so force revoke
auth    required pam_userdb.so db=/etc/vsftpd/users.db
account required pam_userdb.so db=/etc/vsftpd/users.db

But despite the database being readable by the vsftpd process, I end up with this in /var/log/auth.log

pam_userdb(vsftpd:auth): user_lookup: could not open database `/etc/vsftpd/users.db': No such file or directory

asktyagi
  • 2,860
  • 2
  • 8
  • 25
OrangeDog
  • 569
  • 4
  • 20

1 Answers1

1

The key is that pam_userdb silently adds .db to the path, so you need this config instead

session optional pam_keyinit.so force revoke
auth    required pam_userdb.so db=/etc/vsftpd/users
account required pam_userdb.so db=/etc/vsftpd/users

This isn't mentioned in the man page, and in fact the example given incorrectly uses /etc/dbtest.db instead of /etc/dbtest.

OrangeDog
  • 569
  • 4
  • 20