From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id b45RKLECtGZcEgAAqHPOHw:P1 (envelope-from ) for ; Wed, 07 Aug 2024 23:26:41 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id b45RKLECtGZcEgAAqHPOHw (envelope-from ) for ; Thu, 08 Aug 2024 01:26:41 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=dPospucD; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1723073201; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=xM2ToS7Y0jLQCbeu7ca3T+C04kr5ytretY40ti+bfhU=; b=CTgQRhrIfYaJewLIbOJmvFTW0K53t1kWbiFH6nax5dj8tgcO7d5Qu/RWk+5vfI5A73QtXH StZmvDtvAwqGvgVLIM0Gx7j/SEE4CevZtYGvkWzIGqlbZyhVtZDLB+/OolF+F13C1cxfAu 9TieNg7moYhUPj5fonly2sJ+ZznOB+AwYLmV0QIQFX0t91Up42kGKvyGLSRQvvSG5tUhx6 KShgXj7zHKtRBXGtGi+yu48vvfqiasPx6yRJN2pgi88E/c0KwLqrCIHdWeH0Ymo6f68p3x ecdhqCnGFfGOBslR7H4X/UBrNHbMzKmJkJrto1oo8U29j6FL8uS+6tXqscp8kw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1723073201; a=rsa-sha256; cv=none; b=d47OP0I1rsM4UQTOpOWd4x8/w4P9/n0y5bb4QlpLSBE4ap04WGUUIQMnX/AtXDYYUXjL4U R3AdIEWR5QgcoGML8mBUSv2ucayVRwmrDYFlQ39H2rq4PD9UqusXG+TkjSESM7PimDPfBK ZBCauBji/UO0pdl0RxmpnDV0LR5mbe6LKZ/2IcbCaMRjVAW14Deez1TARkEnZH9xYlH5ew 2S9xjzgtlR9lchTLkkAYumPy3H5k6b2Jr0zfclzNyZPIXn6VdkzQXdGA1SLrZ50U24JiGh rbFuWh1/riAy+zewXgpL6lz9mY3DCV9bho8aKE/lbUMYJ1tR4g3ncgJJAaVdOw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=dPospucD; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 4BB0362513 for ; Thu, 08 Aug 2024 01:26:41 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbq2p-0003YJ-S3; Wed, 07 Aug 2024 19:26:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbq2o-0003X6-9X for help-guix@gnu.org; Wed, 07 Aug 2024 19:26:14 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbq2l-0005A2-Ot for help-guix@gnu.org; Wed, 07 Aug 2024 19:26:13 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 9DB21240101 for ; Thu, 8 Aug 2024 01:26:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1723073167; bh=wC6mfuYaa7dWueB+Ftq0KcNtwYQlq+3z/MYiOwqPii4=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=dPospucDlllgr1XCtCADZouefX0CZLpGbpLPROX5R49QaRfiA5MGcfkIAsEM8x3Z9 crrvBOG9xRY0RYeS2U8HwaGPQfDodZC+H2jv38OHPiYTZ5E9s0qnqoMCzWKdlfV5xf TtOv0HSEW17KfWBEX0Nm/dNIHyoA5jBaZMSNunpIA6molJf7033daQB7x7QA2s8+GE yL8ODoqXq0CJy64XlaDz3pMex6lFU/pTw1f9XV32k02qM+lRVZZsUPznwcTqhriRpc hkdGCNvazb1w1yE26Gy97M/dC3sCYpxhdQfRB0A/gyApRrokJ8Oej2T9ow1NqbBLUP 3XrJHxYKjVHyw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4WfRBQ5VTWz9rxB; Thu, 8 Aug 2024 01:26:06 +0200 (CEST) From: Fredrik Salomonsson To: Felix Lechner , help-guix Subject: Re: Question about PAM service In-Reply-To: <87ttfydb4w.fsf@lease-up.com> References: <87zfpu3bwa.fsf@posteo.net> <87ttfydb4w.fsf@lease-up.com> Date: Wed, 07 Aug 2024 23:26:04 +0000 Message-ID: <877ccrc3ub.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=plattfot@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: help-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -7.16 X-Spam-Score: -7.16 X-Migadu-Queue-Id: 4BB0362513 X-Migadu-Scanner: mx11.migadu.com X-TUID: BdM/o98jLe2h Hi Felix, Felix Lechner writes: >> 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. Thanks! I'll try that ones I get some time I can sit down and tinker with this. > 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. Yeah, my idea is to just have this for swaylock i.e. when the screensaver kicks in. And let the rest be guarded by a password. > 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. Interesting. I would not mind testing this out. But I think I'll do this in stages. First get things working with plain old Linux-PAM then I might test out Guile-PAM. Is it packaged for Guix? > [1] https://www.chiark.greenend.org.uk/doc/libpam-doc/html/sag-configuration-file.html > [2] https://juix.org/guile-pam/ -- s/Fred[re]+i[ck]+/Fredrik/g