summary refs log tree commit diff
path: root/gnu/machine
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-12-03 21:59:09 +0100
committerLudovic Courtès <ludo@gnu.org>2019-12-04 18:16:08 +0100
commited15dfcf31ec35c58f5a44d1d8adf5048da67ea6 (patch)
tree1d1903d786ee2186b99e8873fe7fef22d1fe1b27 /gnu/machine
parent2b8682841d0f1b7a054f864fd1657c3963b64348 (diff)
downloadguix-ed15dfcf31ec35c58f5a44d1d8adf5048da67ea6.tar.gz
machine: ssh: <machine-ssh-configuration> can include the host key.
* gnu/machine/ssh.scm (<machine-ssh-configuration>)[host-key]: New field.
(machine-ssh-session): Pass #:host-key to 'open-ssh-session'.
* doc/guix.texi (Invoking guix deploy): Document it.
Diffstat (limited to 'gnu/machine')
-rw-r--r--gnu/machine/ssh.scm9
1 files changed, 7 insertions, 2 deletions
diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm
index 6e3ed0e092..23ae917b79 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -54,6 +54,7 @@
             machine-ssh-configuration-authorize?
             machine-ssh-configuration-port
             machine-ssh-configuration-user
+            machine-ssh-configuration-host-key
             machine-ssh-configuration-session))
 
 ;;; Commentary:
@@ -87,6 +88,8 @@
   (identity       machine-ssh-configuration-identity       ; path to a private key
                   (default #f))
   (session        machine-ssh-configuration-session        ; session
+                  (default #f))
+  (host-key       machine-ssh-configuration-host-key       ; #f | string
                   (default #f)))
 
 (define (machine-ssh-session machine)
@@ -98,11 +101,13 @@ one from the configuration's parameters if one was not provided."
         (let ((host-name (machine-ssh-configuration-host-name config))
               (user (machine-ssh-configuration-user config))
               (port (machine-ssh-configuration-port config))
-              (identity (machine-ssh-configuration-identity config)))
+              (identity (machine-ssh-configuration-identity config))
+              (host-key (machine-ssh-configuration-host-key config)))
           (open-ssh-session host-name
                             #:user user
                             #:port port
-                            #:identity identity)))))
+                            #:identity identity
+                            #:host-key host-key)))))
 
 
 ;;;