Skip to content

Control the order of auth sufficient in pam #335

Open

Description

@LecrisUT

For example: I have a yubikey and fingerprint, both as auth sufficient in /etc/pam.d/system-auth. Setting it up with authselect enable-feature with-fingerprint with-pam-u2f I get the following config file no matter what order I specify it with:

auth        sufficient                                   pam_fprintd.so
auth        sufficient                                   pam_u2f.so cue

But this does not make sense, because it will wait for the fingerprint even though the yubikey is plugged in. The actual order should be:

auth        sufficient                                   pam_u2f.so cue
auth        sufficient                                   pam_fprintd.so

So will it be plausible to make authselect control the order of the auth sufficient depending either on the order of enable-feature or a new function that can re-order them?

Activity

  1. changed the title [-]Control the order in pam[/-] [+]Control the order of `auth sufficient` in `pam`[/+] on Mar 23, 2023
  2. pbrezina commented on Oct 9, 2024

    @pbrezina
    Member

    Hi, thank you for opening this issue. This is an interesting use case, it's not going to happen any time soon and I don't make any promise. But I will consider it for some future release.

  3. austin2118ace commented on May 19, 2026

    @austin2118ace

    Hi just wanted to ping this issue, is it still on the radar? I have the exact same issue :)

  4. Ferenc- commented on May 20, 2026

    @Ferenc-

    @pbrezina Just out of curiousity, would PRs fort his be accepted if someone works on it?

  5. asakure commented on May 31, 2026

    @asakure
    Contributor

    Hi @pbrezina, Would it make sense to just change the default order in system-auth file from

    auth        sufficient                                   pam_fprintd.so                                         {include if "with-fingerprint"}
    auth        sufficient                                   pam_u2f.so cue                                         {include if "with-pam-u2f"}
    auth        required                                     pam_u2f.so cue {if not "without-pam-u2f-nouserok":nouserok} {include if "with-pam-u2f-2fa"}
    

    to:

    auth        sufficient                                   pam_u2f.so cue                                         {include if "with-pam-u2f"}
    auth        required                                     pam_u2f.so cue {if not "without-pam-u2f-nouserok":nouserok} {include if "with-pam-u2f-2fa"}
    auth        sufficient                                   pam_fprintd.so                                         {include if "with-fingerprint"}
    

    Or shall we introduce an additional feature/option to make this change(if needed by admin)?

  6. pbrezina commented on Jun 2, 2026

    @pbrezina
    Member

    Hi, I do not plan this. But I will accept PR with a switch.

  7. asakure commented on Jun 2, 2026

    @asakure
    Contributor

    Hi, I do not plan this. But I will accept PR with a switch.

    Thanks for the inputs. I will try to create a PR & submit for review soon.

  8. LecrisUT commented on Jun 2, 2026

    @LecrisUT
    Author

    #336 worth considering the stuff in there. Don't remember why it didn't go anywhere

  9. asakure commented on Jun 3, 2026

    @asakure
    Contributor

    Hi @pbrezina I have created PR which add an optional feature with-pam-u2f-priority to change order of pam_u2f module & keep it before pam_fprintd. For now, I just touched sssd profile keeping nis & winbind as it is (for testing purpose).
    I tested it on RHEL 9.6 with authselect-1.2.6-3 & it worked well for me. Does it look good to you?

  10. pbrezina commented on Aug 12, 2026

    @pbrezina
    Member

    Hi, what happens if pam_u2f is before pam_frintd and the yubikey is not present? I assume the authentication will be waiting for a yubikey? I can't test it myself as I currently do not have yubikey nor fingerprint hardware.

  11. asakure commented on Aug 13, 2026

    @asakure
    Contributor

    Hi @pbrezina thank you for checking this. I will see feasibility to test this locally as I have one yubikey & share my observations with you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions