[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
22/24: doc: Give an example showing how to add an account in the childhu
From: |
guix-commits |
Subject: |
22/24: doc: Give an example showing how to add an account in the childhurd. |
Date: |
Fri, 29 Sep 2023 06:10:56 -0400 (EDT) |
janneke pushed a commit to branch hurd-team
in repository guix.
commit 31a3921e828661e4fa3db5d3d1982710ee9d9b3c
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Fri Sep 22 14:54:12 2023 +0200
doc: Give an example showing how to add an account in the childhurd.
* 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 04d2ad0a69..e03840aa16 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -35731,6 +35731,57 @@ initialize ``secrets'' inside the VM: SSH host keys,
authorized
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
- 03/24: system: hurd: Add swap-services to hurd-default-essential-services., (continued)
- 03/24: system: hurd: Add swap-services to hurd-default-essential-services., guix-commits, 2023/09/29
- 11/24: Revert "system: bare-hurd.tmpl: Include glibc-2.33 locales in cross-build.", guix-commits, 2023/09/29
- 08/24: DRAFT daemon: Support chroot builds on GNU/Hurd., guix-commits, 2023/09/29
- 09/24: Revert "DRAFT daemon: Support chroot builds on GNU/Hurd.", guix-commits, 2023/09/29
- 10/24: system: bare-hurd.tmpl: Include glibc-2.33 locales in cross-build., guix-commits, 2023/09/29
- 17/24: services: guix: Support declarative offloading setup., guix-commits, 2023/09/29
- 18/24: services: childhurd: Authorize the childhurd’s key on the host., guix-commits, 2023/09/29
- 19/24: services: hurd-vm: ‘image’ field has to be an <image> record., guix-commits, 2023/09/29
- 20/24: tests: hurd-vm: Remove custom disk image configuration., guix-commits, 2023/09/29
- 21/24: services: hurd-vm: Disable password-based authentication for root., guix-commits, 2023/09/29
- 22/24: doc: Give an example showing how to add an account in the childhurd.,
guix-commits <=
- 16/24: services: guix: Use the right locale package on GNU/Hurd., guix-commits, 2023/09/29
- 23/24: services: hurd-vm: Implement zero-configuration offloading., guix-commits, 2023/09/29
- 24/24: gnu: guix: Update to 1.4.0-12.449ed59b54., guix-commits, 2023/09/29