aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-05-31 15:54:11 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-05-31 15:54:11 -0700
commit4b8a1de146cc41b69e4a11ad6179587628c3b79f (patch)
treee28fa81f6a6509e65e90bce92964ff59df9f4b1d
parent3781191a87bb3ef02515e8d6ef761246c6d1d43f (diff)
downloadconsfigurator-4b8a1de146cc41b69e4a11ad6179587628c3b79f.tar.gz
add SSH:PARENT-IS-GLOBALLY-KNOWN-HOST
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r--src/package.lisp3
-rw-r--r--src/property/ssh.lisp9
2 files changed, 11 insertions, 1 deletions
diff --git a/src/package.lisp b/src/package.lisp
index ff25076..9050493 100644
--- a/src/package.lisp
+++ b/src/package.lisp
@@ -507,7 +507,8 @@
(#:sshd #:consfigurator.property.sshd))
(:export #:authorized-keys
#:known-host
- #:globally-known-host))
+ #:globally-known-host
+ #:parent-is-globally-known-host))
(defpackage :consfigurator.property.locale
(:use #:cl #:consfigurator)
diff --git a/src/property/ssh.lisp b/src/property/ssh.lisp
index 76935d0..df014c3 100644
--- a/src/property/ssh.lisp
+++ b/src/property/ssh.lisp
@@ -72,3 +72,12 @@ identifying HOST, to simplify refreshing keys."
(:desc #?"${(get-hostname host)} is globally known host to ssh client")
(%update-known-hosts
"/etc/ssh/ssh_known_hosts" host :short-hostname short-hostname))
+
+(defproplist parent-is-globally-known-host :posix (&key short-hostname)
+ "Ensures that the SSH host keys of the parent host are stored in
+/etc/ssh/ssh_known_hosts; SHORT-HOSTNAME is as for SSH:GLOBALLY-KNOWN-HOST."
+ (:desc "Parent host is globally known host to ssh client")
+ (%update-known-hosts
+ "/etc/ssh/ssh_known_hosts" (make-host :hostattrs
+ (get-hostattrs :parent-hostattrs))
+ :short-hostname short-hostname))