[0/2] Dropbear service take two.

Message ID 20160713161312.20282-1-david@craven.ch
State New

Commit Message

David Craven July 13, 2016, 4:13 p.m. UTC
  Changes from previous version:
* Service initialization is reduced to just creating the "/etc/dropbear"
* The initialize and host-key options are removed.
* The -R flag has been added to dropbear.

Example service file:
(use-modules (gnu))
(use-service-modules base networking ssh)

  (host-name "test")
  (timezone "Europe/Zurich")
  (locale "en_US.UTF-8")

  (bootloader (grub-configuration (device "/dev/vda")))

  (file-systems (cons
      (device "/dev/vda1")
      (mount-point "/")
      (type "ext4"))

  (users (cons
      (name "test")
      (group "users")
      (supplementary-groups '("wheel"))
      (home-directory "/home/test")
      (password "sa5JEXtYx/rm6")) ;; password pass

  (packages %base-packages)

  (services (cons*
      #:port-number 22
      #:allow-empty-passwords? #t
      #:root-login? #t
      #:syslog-output? #t
      #:pid-file "/var/run/dropbear.pid"
      #:password-authentication? #t)

Additional information:

This patch is needed, just adding -net user,hostfwd=tcp::10022-:22 at the end
didn't work for me.


You can use this command to connect to dropbear:

ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no test@localhost -p 10022

I'm currently having an issue with all guix operations after commit 4ee96a7 but I
tested it with previous commits. I'm assuming that the problem is related to nixos
and that it shouldn't affect people using guixsd.

David Craven (2):
  gnu: lsh: Move to (gnu packages ssh)
  services: Add 'dropbear-service'.

 doc/guix.texi        |  18 +++++-
 gnu/local.mk         |   1 -
 gnu/packages/lsh.scm | 159 ---------------------------------------------------
 gnu/packages/ssh.scm | 158 ++++++++++++++++++++++++++++++++++++++++++++++----
 gnu/services/ssh.scm |  83 +++++++++++++++++++++++++--
 5 files changed, 242 insertions(+), 177 deletions(-)
 delete mode 100644 gnu/packages/lsh.scm



diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 676e89d..68aab5d 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -468,7 +468,7 @@  with '-virtfs' options for the host file systems listed in SHARED-FS."
      " -no-reboot -net nic,model=virtio \
   " #$@(map virtfs-option shared-fs) " \
-  -net user \
+  -net user,hostfwd=tcp::10022-:22 \
   -vga std \
   -drive file=" #$image
   ",if=virtio,cache=writeback,werror=report,readonly \