summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrice Waegeneire <brice@waegenei.re>2021-06-20 15:15:55 +0200
committerTobias Geerinckx-Rice <me@tobias.gr>2021-06-20 16:44:08 +0200
commitef3f38ea0027f48feb6a29df131ac58bfbb46b7d (patch)
tree07d2cc7cd3f0e2115cf92f477ec0d8e0c6b3999b
parenta211078f992bc5a26eaf787c6b01caa41de67597 (diff)
services: openssh: Replace 'without-password' by 'prohibit-password'.
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'. Warn about deprecated 'without-password usage. * gnu/tests/ganeti.scm (%ganeti-os): Replace 'without-password by 'prohibit-password. Signed-off-by: Tobias Geerinckx-Rice <me@tobias.gr>
-rw-r--r--doc/guix.texi6
-rw-r--r--gnu/machine/digital-ocean.scm3
-rw-r--r--gnu/services/ssh.scm11
-rw-r--r--gnu/tests/ganeti.scm3
4 files changed, 16 insertions, 7 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index efeb176e3dd..66c6adc4f50 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -17070,7 +17070,7 @@ shell daemon, @command{sshd}. Its value must be an
17070(service openssh-service-type 17070(service openssh-service-type
17071 (openssh-configuration 17071 (openssh-configuration
17072 (x11-forwarding? #t) 17072 (x11-forwarding? #t)
17073 (permit-root-login 'without-password) 17073 (permit-root-login 'prohibit-password)
17074 (authorized-keys 17074 (authorized-keys
17075 `(("alice" ,(local-file "alice.pub")) 17075 `(("alice" ,(local-file "alice.pub"))
17076 ("bob" ,(local-file "bob.pub")))))) 17076 ("bob" ,(local-file "bob.pub"))))))
@@ -17104,7 +17104,7 @@ TCP port on which @command{sshd} listens for incoming connections.
17104@item @code{permit-root-login} (default: @code{#f}) 17104@item @code{permit-root-login} (default: @code{#f})
17105This field determines whether and when to allow logins as root. If 17105This field determines whether and when to allow logins as root. If
17106@code{#f}, root logins are disallowed; if @code{#t}, they are allowed. 17106@code{#f}, root logins are disallowed; if @code{#t}, they are allowed.
17107If it's the symbol @code{'without-password}, then root logins are 17107If it's the symbol @code{'prohibit-password}, then root logins are
17108permitted but not with password-based authentication. 17108permitted but not with password-based authentication.
17109 17109
17110@item @code{allow-empty-passwords?} (default: @code{#f}) 17110@item @code{allow-empty-passwords?} (default: @code{#f})
@@ -29333,7 +29333,7 @@ cluster node that supports multiple storage backends, and installs the
29333 ;; Ganeti uses SSH to communicate between nodes. 29333 ;; Ganeti uses SSH to communicate between nodes.
29334 (service openssh-service-type 29334 (service openssh-service-type
29335 (openssh-configuration 29335 (openssh-configuration
29336 (permit-root-login 'without-password))) 29336 (permit-root-login 'prohibit-password)))
29337 29337
29338 (service ganeti-service-type 29338 (service ganeti-service-type
29339 (ganeti-configuration 29339 (ganeti-configuration
diff --git a/gnu/machine/digital-ocean.scm b/gnu/machine/digital-ocean.scm
index 82383a8c7c2..d97c300d18a 100644
--- a/gnu/machine/digital-ocean.scm
+++ b/gnu/machine/digital-ocean.scm
@@ -1,5 +1,6 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2019 Jakob L. Kreuze <zerodaysfordays@sdf.org> 2;;; Copyright © 2019 Jakob L. Kreuze <zerodaysfordays@sdf.org>
3;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
3;;; 4;;;
4;;; This file is part of GNU Guix. 5;;; This file is part of GNU Guix.
5;;; 6;;;
@@ -256,7 +257,7 @@ cat > /etc/bootstrap-config.scm << EOF
256 (service openssh-service-type 257 (service openssh-service-type
257 (openssh-configuration 258 (openssh-configuration
258 (log-level 'debug) 259 (log-level 'debug)
259 (permit-root-login 'without-password)))) 260 (permit-root-login 'prohibit-password))))
260 %base-services))) 261 %base-services)))
261EOF 262EOF
262# guix pull 263# guix pull
diff --git a/gnu/services/ssh.scm b/gnu/services/ssh.scm
index 1891db04876..a018052eeba 100644
--- a/gnu/services/ssh.scm
+++ b/gnu/services/ssh.scm
@@ -6,6 +6,8 @@
6;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net> 6;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
7;;; Copyright © 2020 pinoaffe <pinoaffe@airmail.cc> 7;;; Copyright © 2020 pinoaffe <pinoaffe@airmail.cc>
8;;; Copyright © 2020 Oleg Pykhalov <go.wigust@gmail.com> 8;;; Copyright © 2020 Oleg Pykhalov <go.wigust@gmail.com>
9;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
10;;; Copyright © 2021 Tobias Geerinckx-Rice <me@tobias.gr>
9;;; 11;;;
10;;; This file is part of GNU Guix. 12;;; This file is part of GNU Guix.
11;;; 13;;;
@@ -30,6 +32,7 @@
30 #:use-module (gnu services web) 32 #:use-module (gnu services web)
31 #:use-module (gnu system pam) 33 #:use-module (gnu system pam)
32 #:use-module (gnu system shadow) 34 #:use-module (gnu system shadow)
35 #:use-module (guix deprecation)
33 #:use-module (guix gexp) 36 #:use-module (guix gexp)
34 #:use-module (guix records) 37 #:use-module (guix records)
35 #:use-module (guix modules) 38 #:use-module (guix modules)
@@ -288,7 +291,7 @@ The other options should be self-descriptive."
288 ;; integer 291 ;; integer
289 (port-number openssh-configuration-port-number 292 (port-number openssh-configuration-port-number
290 (default 22)) 293 (default 22))
291 ;; Boolean | 'without-password 294 ;; Boolean | 'prohibit-password
292 (permit-root-login openssh-configuration-permit-root-login 295 (permit-root-login openssh-configuration-permit-root-login
293 (default #f)) 296 (default #f))
294 ;; Boolean 297 ;; Boolean
@@ -441,7 +444,11 @@ of user-name/file-like tuples."
441 #$(match (openssh-configuration-permit-root-login config) 444 #$(match (openssh-configuration-permit-root-login config)
442 (#t "yes") 445 (#t "yes")
443 (#f "no") 446 (#f "no")
444 ('without-password "without-password"))) 447 ('without-password (warn-about-deprecation
448 'without-password #f
449 #:replacement 'prohibit-password)
450 "prohibit-password")
451 ('prohibit-password "prohibit-password")))
445 (format port "PermitEmptyPasswords ~a\n" 452 (format port "PermitEmptyPasswords ~a\n"
446 #$(if (openssh-configuration-allow-empty-passwords? config) 453 #$(if (openssh-configuration-allow-empty-passwords? config)
447 "yes" "no")) 454 "yes" "no"))
diff --git a/gnu/tests/ganeti.scm b/gnu/tests/ganeti.scm
index ff853a71499..19c26b86dd1 100644
--- a/gnu/tests/ganeti.scm
+++ b/gnu/tests/ganeti.scm
@@ -1,5 +1,6 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2020 Marius Bakke <marius@gnu.org>. 2;;; Copyright © 2020 Marius Bakke <marius@gnu.org>.
3;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
3;;; 4;;;
4;;; This file is part of GNU Guix. 5;;; This file is part of GNU Guix.
5;;; 6;;;
@@ -65,7 +66,7 @@
65 66
66 (service openssh-service-type 67 (service openssh-service-type
67 (openssh-configuration 68 (openssh-configuration
68 (permit-root-login 'without-password))) 69 (permit-root-login 'prohibit-password)))
69 70
70 (service ganeti-service-type 71 (service ganeti-service-type
71 (ganeti-configuration 72 (ganeti-configuration