Subject: bug#51487: closed (Re: bug#51487: The openssh service does not allow multiple authorized key files per user)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 16 Nov 2021 09:04:01 +0000

Your bug report

#51487: The openssh service does not allow multiple authorized key files per user

which was filed against the guix package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
51487: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=51487
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#51487: The openssh service does not allow multiple authorized key files per user
From: Ludovic Courtès <[email-masked]>
To: Vivien Kraus <[email-masked]>
Cc: [email-masked]
Date: Tue, 16 Nov 2021 10:03:19 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

Vivien Kraus <[email-masked]> skribis:

> (just fixing the final map function not to forget the user name in the
> alist, and removing "spec")

Oops, indeed.

> From 7bc8abcfd5024f5269c36dc8cb44803eb0ab29ba Mon Sep 17 00:00:00 2001
> From: Vivien Kraus <[email-masked]>
> Date: Fri, 29 Oct 2021 18:25:24 +0200
> Subject: [PATCH] gnu: openssh-service: Collect all keys for all users.
>
> * gnu/services/ssh.scm (extend-openssh-authorized-keys): ensure that no key is forgotten.

I realized we could just use ‘alist->vhash’ instead of (fold …) so I did
that.

Applied, thanks!

Ludo’.

Subject: The openssh service does not allow multiple authorized key files per user
From: Vivien Kraus <[email-masked]>
To: [email-masked]
Date: Fri, 29 Oct 2021 18:15:54 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Dear guix,

The openssh service is configured with a list of authorized keys, as a
list of items, where each item is a list of 2 values, the user name (as
a string) and the public key file (a file-like object). The service can
be extended with new keys.

To have multiple keys per user, we can put them on the same file-like
object, each on its own line. However, if we put two different records,
only the last one is remembered.

This is a problem if we want to extend the service for users that
already have a key. As I am trying to create a service that would
convert GPG keys to SSH keys, I am in this exact situation: the users
may have already defined SSH keys, and I want to add some more without
losing the others.

Best regards,

Vivien