Repository navigation
Description
Nixpkgs version
- Unstable (26.05)
Describe the bug
As of #420889, my attempts to log in to a vsftpd server have started failing. I suspect the issue is that I have services.vsftpd.localUsers configured, and that PR changed the authentication behaviour. I have a reasonably minimal repro below.
Steps to reproduce
I have a minimal repro repository at https://github.com/me-and/nixos-minimal-vm/tree/vsftpd. This sets up a temporary virtual machine with vsftpd running that demonstrates the problem.
If you have flakes set up, you can do the following:
- Run
nix run github:me-and/nixos-minimal-vm/vsftpdin one terminal, and wait for the VM to boot up.- Add
--override-input nixpkgs github:NixOS/nixpkgs?rev=5aa9012bb3fa2d27aea25623ce8b05837cf0633ato test the commit that merges the PR that created the regression. - Add
--override-input nixpkgs github:NixOS/nixpkgs?rev=d88899eec9a8bdaac81c97f6d2f695390337be13for the commit immediately before the PR is merged.
- Add
- In another terminal, run
curl -v --user vsftpdtest:12345 ftp://127.0.0.1:2121.
In both the old and new cases, the curl command will fail. However, the failure should be because the test VM doesn't have its network set up for a the PASV connection to succeed, and the curl output will include 230 Login successful. In the failing case, the login fails with the message 530 Login incorrect..
Expected behaviour
Users can log in to the vsftpd server using their password. Or, in the case of the minimal test VM, the FTP connection doesn't fail until the user's password has been accepted.
Screenshots
No response
Relevant log output
Additional context
No response
System metadata
- system:
"x86_64-linux" - host os:
Linux 6.6.87.2-microsoft-standard-WSL2, NixOS, 26.05 (Yarara), 26.05.20260427.1c3fe55 - multi-user?:
yes - sandbox:
relaxed - version:
nix-env (Nix) 2.34.6 - nixpkgs:
/nix/store/l61vfkyy0qrnz9bmgx84fa7z3bjzhyp4-source
Notify maintainers
Key folk involved in #420889: @Majiir @phaer
vsftpd maintainer: @peterhoeg
Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)
I assert that this issue is relevant for Nixpkgs
- I assert that this is a bug and not a support request.
- I assert that this is not a duplicate of an existing issue.
- I assert that I have read the NixOS Code of Conduct and agree to abide by it.
Is this issue important to you?
Add a 👍 reaction to issues you find important.
Activity
Majiir commentedon May 2, 2026
This is happening because #420889 fixed a bug where the
vsftpdPAM service was being created with a set of default rules when it was supposed to be disabled entirely.The
services.vsftpdmodule only tries to create thevsftpdPAM service whencfg.enableVirtualUsers && cfg.userDbPath != null, which is false in your config because those options are not set. You need to configure these if you want to usepam_userdb. (That's not new - it's howservices.vsftpdis intended to work.)But because of the bug, the older nixpkgs commit results in a default
vsftpdPAM service with the wrong rules. The fix results in thevsftpdPAM service going away in your example config.If you want to use a
vsftpdPAM service but without usingservices.vsftpd.enableVirtualUsers, then you need to configuresecurity.pam.services.vsftpdyourself.me-and commentedon May 3, 2026
@Majiir This might be how
services.vsftpdwas intended to work, but I disagree that this change of behaviour isn't new and isn't a functional regression.I had intended to use vsftpd with local system user accounts. It isn't obvious to me, either from the NixOS option documentation or the vsftpd.conf documentation that this should require
cfg.enableVirtualUsersandcfg.userDbPathto both be set. I don't think my use case is particularly unusual.Further, I've tested as far back as NixOS 22.11, and my configuration worked as expected there, so this change of behaviour very much is new. I only stopped at 22.11 because 22.05 had some unrelated evaluation errors I didn't want to spend too much time debugging, not because the vsftpd module worked as it was apparently designed there.
I think we need to do one of:
localUsers = trueworks without needing to also setenableVirtualUsersanduserDbPath.localUserswithoutenableVirtualUsers.Majiir commentedon May 4, 2026
In the previous state, the
vsftpdPAM service was not explicitly configured anywhere; it was using the defaults that are applied to all PAM services in NixOS. (Those defaults are themselves not really a documented feature, and more of an artifact of howpam.nixworks.) That strikes me as an unsafe behavior and not something that should be restored.Someone more familiar with
vsftpdshould fix the module. A release note sounds fine in the meantime.I'm not sure that setting
enableVirtualUsersis the right workaround, since thevsftpdPAM service will only have thepam_userdbrules created by the module, and nothing else. To restore the defaults as before, configure:wigust commentedon May 15, 2026
The test suite currently fails without @Majiir fix:
nixos/vsftpd: release note PAM regression
mdaniels5757 commentedon May 25, 2026
I just merged release notes in #517011/#524166, feel free to make a PR to refine them if needed.
I've also merged a fix for the tests in #520930/#524171.
nixos/vsftpd: release note PAM regression
nixos/vsftpd: release note PAM regression
nixos/vsftpd: release note PAM regression
phaer commentedon May 30, 2026
My understanding here is that changes were intentional and that the changed behavior is now properly documented in the release notes.
So closing this, feel free to re-open if needed.