From patchwork Fri Sep 22 12:54:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 54158 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4F41527BBEC; Fri, 22 Sep 2023 13:56:33 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id D1B2127BBE2 for ; Fri, 22 Sep 2023 13:56:28 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qjfhL-0001PU-7P; Fri, 22 Sep 2023 08:55:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjfhJ-0001O1-I5 for guix-patches@gnu.org; Fri, 22 Sep 2023 08:55:53 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qjfhJ-0008BM-9r for guix-patches@gnu.org; Fri, 22 Sep 2023 08:55:53 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qjfhT-0005jN-Ro for guix-patches@gnu.org; Fri, 22 Sep 2023 08:56:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#66156] [PATCH 11/12] doc: Give an example showing how to add an account in the childhurd. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 22 Sep 2023 12:56:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66156 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 66156@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 66156-submit@debbugs.gnu.org id=B66156.169538732921947 (code B ref 66156); Fri, 22 Sep 2023 12:56:03 +0000 Received: (at 66156) by debbugs.gnu.org; 22 Sep 2023 12:55:29 +0000 Received: from localhost ([127.0.0.1]:35597 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qjfgu-0005ho-IU for submit@debbugs.gnu.org; Fri, 22 Sep 2023 08:55:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50940) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qjfgP-0005el-Rh for 66156@debbugs.gnu.org; Fri, 22 Sep 2023 08:54:58 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjfg9-0007oT-Tj; Fri, 22 Sep 2023 08:54:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=pUjrXJUX9eKGtGm587eZct8sK4fKXFTJ2Xtdr9fLHro=; b=RkZADcjAvy/8WGhG2FXe EwR9lUuCLcH3RYFJOW8MMZw7NNcmbqwYrmyQ4riSCaQtZhubpGXM5f6HHP1Myf2IaSnz/cxsYrrze 3LWpoyDUlFPSXMugrmtcpURTsN3wJJTZMyOlljFoLQSFCaXNQeqFvAgyJ+g3D2DIHlWcxHpvwfU8r rW2EVu9xJ5LygRyMGxozkkcZDxBM5qUzXNPQmTiw84fWwuFFiUy3y9OLbqVodriIO2MA9DGV6Pgpz 3aQQGo0dAuUtfkurdX3JyorVtRDzqYup3CFmqe3yCgON3/V8X3Y+VH5mWjrNBm6Wm+zF2VjLecJGf 194M3ZN5hBueNg==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Fri, 22 Sep 2023 14:54:12 +0200 Message-ID: <1968705cf32f300e0874c69284c8222386d9dbc4.1695386493.git.ludo@gnu.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * doc/guix.texi (Virtualization Services): Give an example showing how to add an account. --- doc/guix.texi | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index 95f29a2d19..53b0ebd1db 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -35727,6 +35727,57 @@ Virtualization Services substitute keys, and so on---see the explanation of @code{secret-root} below. +You will probably find it useful to create an account for you in the +GNU/Hurd virtual machine and to authorize logins with your SSH key. To +do that, you can define the GNU/Hurd system in the usual way +(@pxref{Using the Configuration System}), and then pass that operating +system as the @code{os} field of @code{hurd-vm-configuration}, as in +this example: + +@lisp +(define childhurd-os + ;; Definition of my GNU/Hurd system, derived from the default one. + (operating-system + (inherit %hurd-vm-operating-system) + + ;; Add a user account. + (users (cons (user-account + (name "charlie") + (comment "This is me!") + (group "users") + (supplementary-groups '("wheel"))) ;for 'sudo' + %base-user-accounts)) + + (services + ;; Modify the SSH configuration to allow login as "root" + ;; and as "charlie" using public key authentication. + (modify-services (operating-system-user-services + %hurd-vm-operating-system) + (openssh-service-type + config => (openssh-configuration + (inherit config) + (authorized-keys + `(("root" + ,(local-file + "/home/charlie/.ssh/id_rsa.pub")) + ("charlie" + ,(local-file + "/home/charlie/.ssh/id_rsa.pub")))))))))) + +(operating-system + ;; @dots{} + (services + ;; Add the 'hurd-vm' service, configured to use the + ;; operating system configuration above. + (append (list (service hurd-vm-service-type + (hurd-vm-configuration + (os %childhurd-os)))) + %base-services))) +@end lisp + +That's it! The remainder of this section provides the reference of the +service configuration. + @defvar hurd-vm-service-type This is the type of the Hurd in a Virtual Machine service. Its value must be a @code{hurd-vm-configuration} object, which specifies the