From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id MJbpNoZX4GEl0AAAgWs5BA (envelope-from ) for ; Thu, 13 Jan 2022 17:47:02 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id YO2bL4ZX4GGJTwAAG6o9tA (envelope-from ) for ; Thu, 13 Jan 2022 17:47:02 +0100 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 7399C1C44B for ; Thu, 13 Jan 2022 17:47:02 +0100 (CET) Received: from localhost ([::1]:51736 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n83Fd-00060M-K4 for larch@yhetil.org; Thu, 13 Jan 2022 11:47:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45518) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n83Eg-0004ZY-Jh for bug-guix@gnu.org; Thu, 13 Jan 2022 11:46:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:41466) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n83Eg-0003RY-9x for bug-guix@gnu.org; Thu, 13 Jan 2022 11:46:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n83Eg-00018P-5k for bug-guix@gnu.org; Thu, 13 Jan 2022 11:46:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#52533: guix deploy breaks SSH access with a PAM error Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 13 Jan 2022 16:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52533 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 52533-submit@debbugs.gnu.org id=B52533.16420923234245 (code B ref 52533); Thu, 13 Jan 2022 16:46:02 +0000 Received: (at 52533) by debbugs.gnu.org; 13 Jan 2022 16:45:23 +0000 Received: from localhost ([127.0.0.1]:34369 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n83E2-00016O-La for submit@debbugs.gnu.org; Thu, 13 Jan 2022 11:45:23 -0500 Received: from mail-io1-f53.google.com ([209.85.166.53]:40940) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n83Dy-000167-Ns for 52533@debbugs.gnu.org; Thu, 13 Jan 2022 11:45:20 -0500 Received: by mail-io1-f53.google.com with SMTP id k14so5185262ion.7 for <52533@debbugs.gnu.org>; Thu, 13 Jan 2022 08:45:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=FYuwf660M4XEi7+BUzoGlZcew9ds06t8ExkLPvy33ak=; b=dB6qCH5JG24V3q1Sh5YL+RYCNCxMvb1lCpcfEIKnc281bCVyZ9hTnF/vsxn1yUqQry /wNXb8m78993C1/qzzyfgPOdSJ4VGa5Xi1JTI+rCo9hpGJ79prnabBfnvTIvufYSMnqv iM6LadZQJUpPd4fHpCzl69jxef+BjzoBPxDjBzKPyPXoYtSk1UmoxYwE21ZcQH9HonvK yXHOsWrUezcqgV2QvcdoiRuBbWtTNzrfeH8ipqRzWOmElsiSDmPALZA/9+eJ7tB5gYv+ Lq8FZffUD8yY7XOJthSu2JRHzr0Y1RgdC25b8AR9DWGGXrPyC71bOYqFGUJ0uQy5EOEl SsZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=FYuwf660M4XEi7+BUzoGlZcew9ds06t8ExkLPvy33ak=; b=KrlUtpGXTOkefTSFqkoMh1Di+BCWZWvoTb3h2r1fDfo4ig2H2w61+JxTKE+YWaNkFs Ih+tRCE9MkPPyVcTynYAPk8LebKkcN5m9ZSLRvg6jRLK/sFCjYDbAHUOn97+Jbe/pZS2 luqllEoOxndKsQD7WJsLNhBuesvl4ylhOTFTcUTAkwjMRkVuyZAUIVFIdTnIi1J0RIJR oHRQm5V1av4kgJ1gg7GeYViwu9TBeHLljPOlXTZGZQlQ4AGZT7sj0Fv51GaXxzid92ue amz6JZCaB1s7gVzmjYvwzyLV5QByFzU3ttxxHM9zKmGn9vquJ3YUziYmYhkzUaMzxh7p zrVA== X-Gm-Message-State: AOAM530Vwg2ZcUONLU7wlCoS3KaaDLY/9+5jQ0hwt+CMqiUbo6nZqnet NdwLlqCTmarQWdeXH3qQrxCZocO3HM0= X-Google-Smtp-Source: ABdhPJwes/80y6aozi3GZ72+23tnUI6ntHX2klr5NBngsGrPxl/M2fZsnP/YtzkDVApjIhX7EZ4JIA== X-Received: by 2002:a6b:fd04:: with SMTP id c4mr2509230ioi.200.1642092312803; Thu, 13 Jan 2022 08:45:12 -0800 (PST) Received: from hurd (dsl-152-155.b2b2c.ca. [66.158.152.155]) by smtp.gmail.com with ESMTPSA id ay25sm3405129iob.37.2022.01.13.08.45.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jan 2022 08:45:12 -0800 (PST) From: Maxim Cournoyer References: <87czlx88ez.fsf@gmail.com> <87ilvor3sn.fsf@gnu.org> <87r19bom0r.fsf@gnu.org> <87tue77k40.fsf@gnu.org> Date: Thu, 13 Jan 2022 11:45:08 -0500 In-Reply-To: <87tue77k40.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Thu, 13 Jan 2022 16:04:15 +0100") Message-ID: <87mtjz1t63.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mathieu Othacehe , 52533@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1642092422; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=FYuwf660M4XEi7+BUzoGlZcew9ds06t8ExkLPvy33ak=; b=cDzOFvAlHRyAucr1rrbabmgvmQosGGpkGRNzzvI1QjjEhtYDvFmJ8N1t+El0wz4uAWwOQN fiMCYq3odqn5pQ0iIaD0VdXcpDJcacLyTiElc5F2eWJeaGFU01crKY0fINbBresBTdekUu 7VRKE7ATwk+ECQU95EbcuNbAHqCzOC66PbdzfW+qQtt1TxVrGusPTfDJOHrqSsCZ2D+bNZ S5KZdOEOnyMVH9Np0if8KIpcFKIqYdnznBi3p48kyXO2rSofT/bK6Q/N2PpOLAQEK+L+kw NFKzHhE0N2wsSdbaBUQ7XfilBSdfJ7TIDrazDyA7YB+5WJQ7L19PS64vuEv0dw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1642092422; a=rsa-sha256; cv=none; b=jMfjME972qeKUjv217N6ofhba8YOLYvWXnp3qERSIeIOxcaso6s7MJ6zsYrePto5wXQxl2 kzr/iyEDlOyTzcmwhiGyU94sqsmbMRjPfRooi2vruJ+T/BUjWtZiJeg4UHSZlH6KqKWIwP gHj4TNUJtV9sr8qFHcapkSM8Bj3kXo28Yx2DYUM9o8tJb25HBK9LRw5F96jP6JCSxelIs6 h5umxexJ5GutYFsdv1LmP72J0M0kDYCFTb/YydZ7NmkaUNeDNcweP0OcNQwzryNaEPOqoS 6S+HFmjYPphSpCIWiJOJRllhgiNONsbaPuSgWkz1rO7ZjCxeNRj9G1mCUAmEaw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=dB6qCH5J; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.82 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=dB6qCH5J; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 7399C1C44B X-Spam-Score: -2.82 X-Migadu-Scanner: scn0.migadu.com X-TUID: t9MGqhRLTj8J Hello, Ludovic Court=C3=A8s writes: > Hi, > > Mathieu Othacehe skribis: > >>> This sounds a lot like this: >>> >>> https://issues.guix.gnu.org/32182#1 >> >> I was just kicked out of my own server due to this PAM/SSH issue. It >> happens quite frequently here. Time for a fix :). Not a meaningful contribution to the discussion, but my workaround is to disable PAM; as it is not enabled in OpenSSH by default, perhaps we should also leave it off unless requested? What are the advantages of having it on? > Note that =E2=80=98guix deploy=E2=80=99 now opens a single SSH session, s= tarting from > 7f20e59a13a6acc3331e04185b8f1ed2538dcd0a, which might help mitigate the > problem. > >> Regarding the two potential solutions that you proposed in 2018, are >> they still actual? If yes, I could maybe try to implement the second >> suggestion: introducing service chain-loading. > > Service chain-loading was implemented in the Shepherd a few years ago. > However, it doesn=E2=80=99t really help; consider these two scenario: > > =E2=80=A2 You do =E2=80=98guix system reconfigure && herd restart term-= tty1=E2=80=99. In that > case, all is good: =E2=80=98term-tty1=E2=80=99, will run the new =E2= =80=98mingetty=E2=80=99 process > (post-glibc upgrade, thanks to service chain-loading) and =E2=80=98lo= gin=E2=80=99 > will happily load the .so files listed in /etc/pam.d/login (also > post-glibc upgrade). > > =E2=80=A2 You run =E2=80=98guix system reconfigure=E2=80=99 but do not = restart =E2=80=98term-tty1=E2=80=99, > =E2=80=98sshd=E2=80=99, and all the other services that depend on PAM= : these > pre-glibc upgrade programs will try dlopening the post-glibc upgrade > PAM plugins, which will break. > > The crux of the problem rather is the global /etc/pam.d: it=E2=80=99s val= id for > pre-glibc upgrade programs, or for post-glibc upgrade programs, but not > both. > > FHS distros have a similar problem though; how do they handle it? Do > they force services to be restarted when glibc is upgraded, or something > along these lines? I just asked this question in Debian's OFTC channel: "how does debian handle glibc updates? are services restarted when it happens? Or does it postpone updating glibc until the next reboot?" And got for answer: "there is no magic postponing of updates"; the external needrestart [0] program was also mentioned. Researching some more, it seems this may be handled on Debian by the use of postinst scripts (which is an arbitrary shell script run after a package is installed); so the libc package of Debian for example restarts the postgres service to avoid problems: [0] https://github.com/liske/needrestart [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=3D710275 > In our case, suppose libpam honors $PAM_DIRECTORY; we could tweak each > PAM-using Shepherd service (login, sshd, etc.) so that it sets > PAM_DIRECTORY=E2=80=A6 but how would we get the PAM_DIRECTORY value for t= he OS > being configured? Tricky! Good question, but that seems a good path to pursue; old services would be using their own old pam modules, allowing them to continue running unimpacted, while new ones would get the updated pam modules. > We could maybe sidestep the issue altogether with socket-activated > services: they=E2=80=99d be started on-demand, so the second scenario abo= ve > would be unlikely. But getting there is quite a bit of work=E2=80=A6 I fail to see how this would be a solution for openssh, which would typically already be running unless you've never login ounce since the machine was up (or am I missing something?). Also, it seems to me inetd can already do "socket activation", if this was somehow useful. Thanks, Maxim