GNU bug report logs

#55661 /etc/ssh/authorized_keys.d contains keys that have been removed

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

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

Received: (at submit) by debbugs.gnu.org; 26 May 2022 15:02:13 +0000
From debbugs-submit-bounces@debbugs.gnu.org Thu May 26 11:02:13 2022
Received: from localhost ([127.0.0.1]:59739 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
	id 1nuF08-0007D6-V5
	for submit@debbugs.gnu.org; Thu, 26 May 2022 11:02:13 -0400
Received: from lists.gnu.org ([209.51.188.17]:35322)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@gnu.org>) id 1nuF06-0007Cw-Cv
 for submit@debbugs.gnu.org; Thu, 26 May 2022 11:02:12 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:46540)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@gnu.org>) id 1nuF02-0001qi-QB
 for bug-guix@gnu.org; Thu, 26 May 2022 11:02:08 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:36620)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@gnu.org>) id 1nuF02-0000W5-GG
 for bug-guix@gnu.org; Thu, 26 May 2022 11:02:06 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to:
 references; bh=VW/widbNm4ImkcZX8WKWW80PUreFImlDrnKBrYqKhos=; b=B2ixEdx7wZ8YnY
 ucZHtPAwMVwWocwRABJ2so9q//nRYcyOyp4+8K2qL776mI48CWwfWX+JEfyHJQ6oQYBk2hHkNrlt3
 f857DS5Jzvre+/XrE1sYPJVS0ox2jO9aADmTMmydV8WxopQ4JPdQBZNNU2GXsJmG2aVn/YxwAQcWk
 bALq4GecFu7YgWjWdbSiBKgLtHlPYTzUIXCc1+FbAB4kuCYbOw7bsdKA8CqowncTU9LtYFRaSrOJN
 Isi+pBNQVLMePn5Sr/PxK6G8tsNuiwYxwhiSEnEMUsEsQv5jNwuz7ZCDSUKyIvBHgXJEGRiiVmu1A
 eLBb857YcDlobbdUSCHQ==;
Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:60198
 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@gnu.org>) id 1nuEzy-0002EO-MA
 for bug-guix@gnu.org; Thu, 26 May 2022 11:02:04 -0400
From: Ludovic Courtès <ludo@gnu.org>
To: bug-guix@gnu.org
Subject: /etc/ssh/authorized_keys.d contains keys that have been removed
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 7 Prairial an 230 de la Révolution
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Thu, 26 May 2022 17:02:00 +0200
Message-ID: <875ylsfic7.fsf@inria.fr>
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: -2.3 (--)
X-Debbugs-Envelope-To: submit
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: -3.3 (---)
In the wake of <https://issues.guix.gnu.org/55359#3>, I realized that
/etc/ssh/authorized_keys.d is stateful: we copy files from the
authorized-key directory there, but files already present remain.
IOW, keys remain authorized.

Why are we copying that directory instead of making a symlink to the
directory computed by ‘authorized-key-directory’ that’s in /gnu/store?

This is explained in ‘openssh-activation’:

        ;; 'sshd' complains if the authorized-key directory and its parents
        ;; are group-writable, which rules out /gnu/store.  Thus we copy the
        ;; authorized-key directory to /etc.

Anyway, that code does intend remove the directory before copying it,
but there’s a typo:

  (delete-file-recursively "/etc/authorized_keys.d")

Can you spot it?

Ludo’.




Send a report that this bug log contains spam.


debbugs.gnu.org maintainers <help-debbugs@gnu.org>. Last modified: Sun Dec 22 12:09:14 2024; 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.