aboutsummaryrefslogtreecommitdiff
path: root/src/property/ssh.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'src/property/ssh.lisp')
-rw-r--r--src/property/ssh.lisp10
1 files changed, 10 insertions, 0 deletions
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