GNU bug report logs

#52533 guix deploy breaks SSH access with a PAM error

PackageSource(s)Maintainer(s)
guix PTS Buildd Popcon
Full log

Message #25 received at 52533@debbugs.gnu.org (full text, mbox, reply):

Received: (at 52533) by debbugs.gnu.org; 13 Jan 2022 16:45:23 +0000
From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 13 11:45:23 2022
Received: from localhost ([127.0.0.1]:34369 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
	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 <maxim.cournoyer@gmail.com>) 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 <maxim.cournoyer@gmail.com>
To: Ludovic Courtès <ludo@gnu.org>
Subject: Re: bug#52533: guix deploy breaks SSH access with a PAM error
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 Courtès"'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-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 52533
Cc: Mathieu Othacehe <othacehe@gnu.org>, 52533@debbugs.gnu.org
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request@debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit@debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request@debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request@debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
X-Spam-Score: -1.0 (-)
Hello,

Ludovic Courtès <ludo@gnu.org> writes:

> Hi,
>
> Mathieu Othacehe <othacehe@gnu.org> 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 ‘guix deploy’ now opens a single SSH session, starting 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’t really help; consider these two scenario:
>
>   • You do ‘guix system reconfigure && herd restart term-tty1’.  In that
>     case, all is good: ‘term-tty1’, will run the new ‘mingetty’ process
>     (post-glibc upgrade, thanks to service chain-loading) and ‘login’
>     will happily load the .so files listed in /etc/pam.d/login (also
>     post-glibc upgrade).
>
>   • You run ‘guix system reconfigure’ but do not restart ‘term-tty1’,
>     ‘sshd’, 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’s valid 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=710275

> 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… but how would we get the PAM_DIRECTORY value for the 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’d be started on-demand, so the second scenario above
> would be unlikely.  But getting there is quite a bit of work…

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




Send a report that this bug log contains spam.


debbugs.gnu.org maintainers <help-debbugs@gnu.org>. Last modified: Tue Sep 9 23:37:25 2025; Machine Name: wallace-server

GNU bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.