From patchwork Sun Jun 20 13:15:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Brice Waegeneire X-Patchwork-Id: 30544 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 2E5B827BC81; Sun, 20 Jun 2021 14:17:40 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id AE71E27BC78 for ; Sun, 20 Jun 2021 14:17:39 +0100 (BST) Received: from localhost ([::1]:53108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1luxKU-00016k-Ku for patchwork@mira.cbaines.net; Sun, 20 Jun 2021 09:17:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36370) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1luxJu-0000jm-JE for guix-patches@gnu.org; Sun, 20 Jun 2021 09:17:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49929) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1luxJu-0007Ks-4U for guix-patches@gnu.org; Sun, 20 Jun 2021 09:17:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1luxJu-0003qI-2R for guix-patches@gnu.org; Sun, 20 Jun 2021 09:17:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49129] [PATCH v2] services: openssh: Replace 'without-password' by 'prohibit-password'. Resent-From: Brice Waegeneire Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 20 Jun 2021 13:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49129 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49129@debbugs.gnu.org Received: via spool by 49129-submit@debbugs.gnu.org id=B49129.162419497314691 (code B ref 49129); Sun, 20 Jun 2021 13:17:02 +0000 Received: (at 49129) by debbugs.gnu.org; 20 Jun 2021 13:16:13 +0000 Received: from localhost ([127.0.0.1]:33238 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1luxJ2-0003oo-Ko for submit@debbugs.gnu.org; Sun, 20 Jun 2021 09:16:13 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:60325) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1luxIy-0003o3-UM for 49129@debbugs.gnu.org; Sun, 20 Jun 2021 09:16:08 -0400 Received: (Authenticated sender: brice@waegenei.re) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 3490EC0002 for <49129@debbugs.gnu.org>; Sun, 20 Jun 2021 13:15:57 +0000 (UTC) From: Brice Waegeneire Date: Sun, 20 Jun 2021 15:15:55 +0200 Message-Id: <20210620131555.7961-1-brice@waegenei.re> X-Mailer: git-send-email 2.31.1 In-Reply-To: <87v968lti2.fsf@nckx> References: <87v968lti2.fsf@nckx> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches For some time, OpenSSH's option 'PermitRootLogin' has deprecated the ambiguous argument 'without-password' with 'prohibit-password'. * doc/guix.texi (Network Services): Replace 'without-password' by 'prohibit-password'. * gnu/machine/digital-ocean.scm (guix-infect): Change system configuration to use 'prohibit-password'. * gnu/services/ssh.scm (openssh-configuration): Change comment to use 'prohibit-password'. (openssh-config-file): Add support for 'prohibit-password' to 'permit-root-login'. * gnu/tests/ganeti.scm (%ganeti-os): Replace 'without-password' by 'prohibit-password'. --- I added a depreciation warning but without the fancy colors as I wasn't able to use the common macros. doc/guix.texi | 6 +++--- gnu/machine/digital-ocean.scm | 3 ++- gnu/services/ssh.scm | 10 ++++++++-- gnu/tests/ganeti.scm | 3 ++- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index efeb176e3d..66c6adc4f5 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -17070,7 +17070,7 @@ shell daemon, @command{sshd}. Its value must be an (service openssh-service-type (openssh-configuration (x11-forwarding? #t) - (permit-root-login 'without-password) + (permit-root-login 'prohibit-password) (authorized-keys `(("alice" ,(local-file "alice.pub")) ("bob" ,(local-file "bob.pub")))))) @@ -17104,7 +17104,7 @@ TCP port on which @command{sshd} listens for incoming connections. @item @code{permit-root-login} (default: @code{#f}) This field determines whether and when to allow logins as root. If @code{#f}, root logins are disallowed; if @code{#t}, they are allowed. -If it's the symbol @code{'without-password}, then root logins are +If it's the symbol @code{'prohibit-password}, then root logins are permitted but not with password-based authentication. @item @code{allow-empty-passwords?} (default: @code{#f}) @@ -29333,7 +29333,7 @@ cluster node that supports multiple storage backends, and installs the ;; Ganeti uses SSH to communicate between nodes. (service openssh-service-type (openssh-configuration - (permit-root-login 'without-password))) + (permit-root-login 'prohibit-password))) (service ganeti-service-type (ganeti-configuration diff --git a/gnu/machine/digital-ocean.scm b/gnu/machine/digital-ocean.scm index 82383a8c7c..d97c300d18 100644 --- a/gnu/machine/digital-ocean.scm +++ b/gnu/machine/digital-ocean.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2019 Jakob L. Kreuze +;;; Copyright © 2020 Brice Waegeneire ;;; ;;; This file is part of GNU Guix. ;;; @@ -256,7 +257,7 @@ cat > /etc/bootstrap-config.scm << EOF (service openssh-service-type (openssh-configuration (log-level 'debug) - (permit-root-login 'without-password)))) + (permit-root-login 'prohibit-password)))) %base-services))) EOF # guix pull diff --git a/gnu/services/ssh.scm b/gnu/services/ssh.scm index 1891db0487..be97c1322f 100644 --- a/gnu/services/ssh.scm +++ b/gnu/services/ssh.scm @@ -6,6 +6,7 @@ ;;; Copyright © 2019 Ricardo Wurmus ;;; Copyright © 2020 pinoaffe ;;; Copyright © 2020 Oleg Pykhalov +;;; Copyright © 2020 Brice Waegeneire ;;; ;;; This file is part of GNU Guix. ;;; @@ -288,7 +289,7 @@ The other options should be self-descriptive." ;; integer (port-number openssh-configuration-port-number (default 22)) - ;; Boolean | 'without-password + ;; Boolean | 'prohibit-password (permit-root-login openssh-configuration-permit-root-login (default #f)) ;; Boolean @@ -441,7 +442,12 @@ of user-name/file-like tuples." #$(match (openssh-configuration-permit-root-login config) (#t "yes") (#f "no") - ('without-password "without-password"))) + ('without-password + (format (current-error-port) "warning: Option \ +'without-password for openssh-configuration-permit-root-login field is \ +deprecated. Please use 'prohibit-password instead.\n") + "prohibit-password") + ('prohibit-password "prohibit-password"))) (format port "PermitEmptyPasswords ~a\n" #$(if (openssh-configuration-allow-empty-passwords? config) "yes" "no")) diff --git a/gnu/tests/ganeti.scm b/gnu/tests/ganeti.scm index ff853a7149..19c26b86dd 100644 --- a/gnu/tests/ganeti.scm +++ b/gnu/tests/ganeti.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2020 Marius Bakke . +;;; Copyright © 2020 Brice Waegeneire ;;; ;;; This file is part of GNU Guix. ;;; @@ -65,7 +66,7 @@ (service openssh-service-type (openssh-configuration - (permit-root-login 'without-password))) + (permit-root-login 'prohibit-password))) (service ganeti-service-type (ganeti-configuration