From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: Mathieu Othacehe <othacehe@gnu.org>, 52533@debbugs.gnu.org
Subject: bug#52533: guix deploy breaks SSH access with a PAM error
Date: Thu, 13 Jan 2022 11:45:08 -0500 [thread overview]
Message-ID: <87mtjz1t63.fsf@gmail.com> (raw)
In-Reply-To: <87tue77k40.fsf@gnu.org> ("Ludovic Courtès"'s message of "Thu, 13 Jan 2022 16:04:15 +0100")
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
next prev parent reply other threads:[~2022-01-13 16:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-16 4:45 bug#52533: guix deploy breaks SSH access with a PAM error Maxim Cournoyer
2021-12-16 5:27 ` bug#52533: [PATCH] " Maxim Cournoyer
2021-12-16 15:02 ` Ludovic Courtès
2022-01-13 12:31 ` Mathieu Othacehe
2022-01-13 12:38 ` Mathieu Othacehe
2022-01-13 15:04 ` Ludovic Courtès
2022-01-13 16:45 ` Maxim Cournoyer [this message]
2022-01-17 13:25 ` Ludovic Courtès
2022-01-17 15:19 ` Maxim Cournoyer
2022-01-17 16:13 ` Ludovic Courtès
2022-01-18 4:33 ` Maxim Cournoyer
2022-01-18 11:27 ` Ludovic Courtès
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
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mtjz1t63.fsf@gmail.com \
--to=maxim.cournoyer@gmail.com \
--cc=52533@debbugs.gnu.org \
--cc=ludo@gnu.org \
--cc=othacehe@gnu.org \
/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 public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).