[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#38478] [PATCH 4/4] machine: ssh: <machine-ssh-configuration> can in
From: |
Ludovic Courtès |
Subject: |
[bug#38478] [PATCH 4/4] machine: ssh: <machine-ssh-configuration> can include the host key. |
Date: |
Tue, 3 Dec 2019 22:15:57 +0100 |
* 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.
---
doc/guix.texi | 12 ++++++++++++
gnu/machine/ssh.scm | 9 +++++++--
2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index 2da1ecd64c..e6e015ad3e 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -26412,6 +26412,18 @@ keyring.
@item @code{identity} (default: @code{#f})
If specified, the path to the SSH private key to use to authenticate with the
remote host.
+
+@item @code{host-key} (default: @code{#f})
+This should be the SSH host key of the machine, which looks like this:
+
+@example
+ssh-ed25519 AAAAC3Nz@dots{} root@@example.org
+@end example
+
+When @code{host-key} is @code{#f}, the server is authenticated against
+the @file{~/.ssh/known_hosts} file, just like the OpenSSH @command{ssh}
+client does.
+
@end table
@end deftp
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)))))
;;;
--
2.24.0
- [bug#38478] [PATCH 0/4] "guix deploy" authenticates SSH servers [security], Ludovic Courtès, 2019/12/03
- [bug#38478] [PATCH 1/4] ssh: Add 'authenticate-server*' and use it for offloading., Ludovic Courtès, 2019/12/03
- [bug#38478] [PATCH 2/4] ssh: Always authenticate the server [security fix]., Ludovic Courtès, 2019/12/03
- [bug#38478] [PATCH 3/4] ssh: 'open-ssh-session' can be passed the expected host key., Ludovic Courtès, 2019/12/03
- [bug#38478] [PATCH 4/4] machine: ssh: <machine-ssh-configuration> can include the host key.,
Ludovic Courtès <=
- [bug#38478] [PATCH 4/4] machine: ssh: <machine-ssh-configuration> can include the host key., Jakob L. Kreuze, 2019/12/04
- [bug#38478] [PATCH 4/4] machine: ssh: <machine-ssh-configuration> can include the host key., Ludovic Courtès, 2019/12/04
- [bug#38478] [PATCH 4/4] machine: ssh: <machine-ssh-configuration> can include the host key., Jakob L. Kreuze, 2019/12/05
- [bug#38478] [PATCH 4/4] machine: ssh: <machine-ssh-configuration> can include the host key., Ludovic Courtès, 2019/12/06
- [bug#38478] [PATCH 4/4] machine: ssh: <machine-ssh-configuration> can include the host key., Ludovic Courtès, 2019/12/06