services: openssh: Collect all keys for all users.
Fixes <https://issues.guix.gnu.org/51487> * gnu/services/ssh.scm (extend-openssh-authorized-keys): ensure that no key is forgotten. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
b2f8186590
commit
b4b2bbf4fb
@ -39,6 +39,7 @@
|
|||||||
#:use-module (srfi srfi-1)
|
#:use-module (srfi srfi-1)
|
||||||
#:use-module (srfi srfi-26)
|
#:use-module (srfi srfi-26)
|
||||||
#:use-module (ice-9 match)
|
#:use-module (ice-9 match)
|
||||||
|
#:use-module (ice-9 vlist)
|
||||||
#:export (lsh-configuration
|
#:export (lsh-configuration
|
||||||
lsh-configuration?
|
lsh-configuration?
|
||||||
lsh-service
|
lsh-service
|
||||||
@ -535,7 +536,15 @@ of user-name/file-like tuples."
|
|||||||
(openssh-configuration
|
(openssh-configuration
|
||||||
(inherit config)
|
(inherit config)
|
||||||
(authorized-keys
|
(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
|
(define openssh-service-type
|
||||||
(service-type (name 'openssh)
|
(service-type (name 'openssh)
|
||||||
|
Loading…
Reference in New Issue
Block a user