From 0f31afee2b72a3817b46b41bbaf918de430c6e10 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Fri, 15 Sep 2023 00:30:24 +0100 Subject: [PATCH] hellonet: set password for root otherwise incoming ssh gets a bit fraught --- doc/new.rst | 6 +++--- examples/hellonet.nix | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/new.rst b/doc/new.rst index 1b095b5..d0cf06b 100644 --- a/doc/new.rst +++ b/doc/new.rst @@ -77,9 +77,9 @@ stdin/stdout. Use ^P (not ^A) to switch to the monitor. You should now see Linux boot messages and after a few seconds be presented with a login prompt. You can login on the console as -``root`` (no password) and poke around to see what processes are -running. Run ``shutdown`` to shut it down cleanly, or press ^P then -type ``exit`` at the monitor to stop it suddenly. +``root`` (password is "secret") and poke around to see what processes are +running. To kill the emulator, press ^P (Control P) then c to enter the +"QEMU Monitor", then type ``quit`` at the ``(qemu)`` prompt. To see that it running an ssh service we need to connect to its emulated network. Start the machine again, if you had stopped it, diff --git a/examples/hellonet.nix b/examples/hellonet.nix index 33f7d65..45c496c 100644 --- a/examples/hellonet.nix +++ b/examples/hellonet.nix @@ -19,7 +19,9 @@ in rec { services.sshd = svc.ssh.build { }; users.root = { - passwd = ""; + # the password is "secret". Use mkpasswd -m sha512crypt to + # create this hashed password string + passwd = "$6$y7WZ5hM6l5nriLmo$5AJlmzQZ6WA.7uBC7S8L4o19ESR28Dg25v64/vDvvCN01Ms9QoHeGByj8lGlJ4/b.dbwR9Hq2KXurSnLigt1W1"; }; services.dns =