From 0691ab67797ff94daf73bc816a46ae507775d0e2 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 10 Mar 2022 22:33:58 +0100 Subject: services: openssh: Add 'generate-host-keys?' field. * gnu/services/ssh.scm ()[generate-host-keys?]: New field. (openssh-activation): Honor it. * doc/guix.texi (Networking Services): Document it. --- gnu/services/ssh.scm | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'gnu') diff --git a/gnu/services/ssh.scm b/gnu/services/ssh.scm index 97f74a00f7..433a0e8f91 100644 --- a/gnu/services/ssh.scm +++ b/gnu/services/ssh.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2014-2019, 2022 Ludovic Courtès ;;; Copyright © 2016 David Craven ;;; Copyright © 2016 Julien Lepiller ;;; Copyright © 2017 Clément Lassieur @@ -351,6 +351,10 @@ The other options should be self-descriptive." (authorized-keys openssh-authorized-keys (default '())) + ;; Boolean + (generate-host-keys? openssh-configuration-generate-host-keys? + (default #t)) + ;; Boolean ;; XXX: This should really be handled in an orthogonal way, for instance as ;; proposed in . Keep it internal/undocumented @@ -402,9 +406,10 @@ The other options should be self-descriptive." (unless (file-exists? lastlog) (touch lastlog)))) - ;; Generate missing host keys. - (system* (string-append #$(openssh-configuration-openssh config) - "/bin/ssh-keygen") "-A")))) + (when #$(openssh-configuration-generate-host-keys? config) + ;; Generate missing host keys. + (system* (string-append #$(openssh-configuration-openssh config) + "/bin/ssh-keygen") "-A"))))) (define (authorized-key-directory keys) "Return a directory containing the authorized keys specified in KEYS, a list -- cgit v1.2.3