From mboxrd@z Thu Jan 1 00:00:00 1970 From: George myglc2 Clemmer Subject: Re: How best to set host key in vm Date: Thu, 15 Feb 2018 10:21:01 -0500 Message-ID: <867ere9t42.fsf@gmail.com> References: <86tvut25uf.fsf@gmail.com> <87eflu2zoc.fsf@gnu.org> <86zi4iqc88.fsf@gmail.com> <87h8qi8fwg.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56189) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emLLP-0001ax-Pe for help-guix@gnu.org; Thu, 15 Feb 2018 10:21:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1emLLM-0005sd-LV for help-guix@gnu.org; Thu, 15 Feb 2018 10:21:07 -0500 In-reply-to: <87h8qi8fwg.fsf@gnu.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: help-guix Hi Ludo’, On 02/15/2018 at 14:51 Ludovic Courtès writes: > George myglc2 Clemmer skribis: > >> On 02/09/2018 at 11:02 Ludovic Courtès writes: >> >>> George myglc2 Clemmer skribis: >>> >>>> I want to set the host key in 'guix system vm-image' so that updating a >>>> VM config does not break that VM's host key entry in my client machine >>>> ~/.ssh/knownhosts files. AFAIK there is no direct way to do this. I >>>> tried this ... >> >>> The recommendation in this case is to use “out-of-band” storage—i.e., >>> have the secrets stored in a place other than the store. >>> >>> For example, you could have an activation snippet that copies secret >>> files directly to /etc, along these lines (untested): >>> >>> (simple-service 'copy-private-key activation-service-type >>> (with-imported-modules '((guix build utils)) >>> #~(begin >>> (use-modules (guix build utils)) >>> (mkdir-p "/etc/ssh") >>> (copy-file "/root/secrets/ssh_host_ed25519_key" >>> "/etc/ssh/ssh_host_ed25519_key')))) >>> >>> That means you have to arrange for /root/secrets/ssh_host_ed25519_key to >>> exist in the first place, but that’s pretty much all we can do. >> >> Thank you. So what is an easily-automated way to populate /root/secrets? > > Guix doesn’t have any helper module/tool for that yet. > > Perhaps ‘guix system vm-image’ could include a ‘--copy’ option that > would copy a file from the host into the image. We’d have to be careful > with the implementation to make sure that it doesn’t end up in the host > store nor in the guest store. How about a '--copy-image=' option that copies the image out of the store? Then the ‘--copy’ could operate on and fail if it isn't specified. - George