aboutsummaryrefslogtreecommitdiff
path: root/gnu/services/ssh.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2021-11-17 23:24:42 +0100
committerLudovic Courtès <ludo@gnu.org>2021-11-17 23:43:14 +0100
commit3a317f7476f8c6012e166ff9f340f861938721c9 (patch)
tree946e398c37912cfc03be7306951ae87bfeb130fa /gnu/services/ssh.scm
parente55547bf70384691712047912c793c517debd2ec (diff)
parent62e707d67caf1dab2af411a69ff8cec4b2dc686e (diff)
downloadguix-3a317f7476f8c6012e166ff9f340f861938721c9.tar
guix-3a317f7476f8c6012e166ff9f340f861938721c9.tar.gz
Merge branch 'master' into core-updates-frozen
Diffstat (limited to 'gnu/services/ssh.scm')
-rw-r--r--gnu/services/ssh.scm11
1 files changed, 10 insertions, 1 deletions
diff --git a/gnu/services/ssh.scm b/gnu/services/ssh.scm
index a018052eeb..e7bc6100f6 100644
--- a/gnu/services/ssh.scm
+++ b/gnu/services/ssh.scm
@@ -39,6 +39,7 @@
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-26)
#:use-module (ice-9 match)
+ #:use-module (ice-9 vlist)
#:export (lsh-configuration
lsh-configuration?
lsh-service
@@ -535,7 +536,15 @@ of user-name/file-like tuples."
(openssh-configuration
(inherit config)
(authorized-keys
- (append (openssh-authorized-keys config) keys))))
+ (match (openssh-authorized-keys config)
+ (((users _ ...) ...)
+ ;; Build a user/key-list mapping.
+ (let ((user-keys (alist->vhash (openssh-authorized-keys config))))
+ ;; Coalesce the key lists associated with each user.
+ (map (lambda (user)
+ `(,user
+ ,@(concatenate (vhash-fold* cons '() user user-keys))))
+ users)))))))
(define openssh-service-type
(service-type (name 'openssh)