From 14391860ac55c651107798f2679fca30f63faa4c Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Thu, 24 Jun 2021 14:52:58 -0700 Subject: add SSH:HAS-USER-KEY Signed-off-by: Sean Whitton --- src/property/ssh.lisp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/property/ssh.lisp') diff --git a/src/property/ssh.lisp b/src/property/ssh.lisp index df014c3..c6b08d0 100644 --- a/src/property/ssh.lisp +++ b/src/property/ssh.lisp @@ -28,6 +28,16 @@ (:unapply (apply #'file:lacks-lines ".ssh/authorized_keys" keys))) +(defpropspec has-user-key :posix + (type public-key + &key (dest (merge-pathnames (strcat "id_" type) #P".ssh/")) iden1) + "Installs an SSH keypair to DEST, which defaults to ~/.ssh/id_TYPE{,.pub}." + `(eseqprops (file:exists-with-content + ,(strcat (unix-namestring dest) ".pub") ,public-key) + ,(if iden1 + `(file:secret-uploaded ,iden1 ,dest) + `(file:host-secret-uploaded ,dest)))) + (defprop %update-known-hosts :posix (file host &key short-hostname) (:apply (file:map-file-lines -- cgit v1.2.3