From: Felix Lechner via <help-guix@gnu.org>
To: Fredrik Salomonsson <plattfot@posteo.net>, help-guix <help-guix@gnu.org>
Subject: Re: Question about PAM service
Date: Mon, 05 Aug 2024 12:26:23 -0700 [thread overview]
Message-ID: <87ttfydb4w.fsf@lease-up.com> (raw)
In-Reply-To: <87zfpu3bwa.fsf@posteo.net>
Hi Fredrik,
On Fri, Aug 02 2024, Fredrik Salomonsson wrote:
> it does not look supertrivial to modify a PAM service.
One way in Linux-PAM would be to skip the pam_unix.so module when the
pam_u2f.so module returned PAM_SUCCESS, like this
auth [success=1 new_authtok_reqd=1 ignore=ignore default=bad] pam_u2f.so
auth required pam_unix.so
The mechanism is described here [1] but I haven't used in a while.
I'd probably do that only for the 'auth' stage, so that a locked or
expired password still prevents logins during the 'account' stage,
although it would be a matter of personal preference.
In Guix, you'll probably end up replacing 'pam-services' in your
operating-system record.
As an aside, I am also the upstream author of Guile-PAM [1] which could
potentially allow you to write something like this:
(lambda (action handle flags options)
(case action
((pam_sm_authenticate)
(if (or (eq? 'PAM_SUCCESS (call-legacy-module "pam_u2f.so"))
(eq? 'PAM_SUCCESS (call-legacy-module "pam_unix.so"))
'PAM_SUCCESS
'PAM_AUTH_DENIED)))
(else
...)))
Guile-PAM is experimental, however, and the code above is untested.
Kind regards
Felix
[1] https://www.chiark.greenend.org.uk/doc/libpam-doc/html/sag-configuration-file.html
[2] https://juix.org/guile-pam/
next prev parent reply other threads:[~2024-08-05 19:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-02 20:31 Question about PAM service Fredrik Salomonsson
2024-08-05 19:26 ` Felix Lechner via [this message]
2024-08-07 23:26 ` Fredrik Salomonsson
2024-09-03 5:11 ` Fredrik Salomonsson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ttfydb4w.fsf@lease-up.com \
--to=help-guix@gnu.org \
--cc=felix.lechner@lease-up.com \
--cc=plattfot@posteo.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.