aboutsummaryrefslogtreecommitdiff
path: root/src/property/ssh.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-04-01 23:28:48 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-04-01 23:33:13 -0700
commite736bb553d404ba03c4e2d4cc58d8d1db9b6a85e (patch)
tree5b8311edfbff8771db5c8555c08d419bba26fbb0 /src/property/ssh.lisp
parent2797bf6f6190e2937c43c238f98dc51348054c90 (diff)
downloadconsfigurator-e736bb553d404ba03c4e2d4cc58d8d1db9b6a85e.tar.gz
add SSH:AUTHORIZED-KEYS
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/property/ssh.lisp')
-rw-r--r--src/property/ssh.lisp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/property/ssh.lisp b/src/property/ssh.lisp
new file mode 100644
index 0000000..08b7b32
--- /dev/null
+++ b/src/property/ssh.lisp
@@ -0,0 +1,29 @@
+;;; Consfigurator -- Lisp declarative configuration management system
+
+;;; Copyright (C) 2021 Sean Whitton <spwhitton@spwhitton.name>
+
+;;; This file is free software; you can redistribute it and/or modify
+;;; it under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3, or (at your option)
+;;; any later version.
+
+;;; This file is distributed in the hope that it will be useful,
+;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+
+;;; You should have received a copy of the GNU General Public License
+;;; along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+(in-package :consfigurator.property.ssh)
+(named-readtables:in-readtable :consfigurator)
+
+(defprop authorized-keys :posix (&rest keys)
+ "Permits using KEYS to SSH in as the current user."
+ (:desc (declare (ignore keys))
+ (strcat (get-user) " has authorized_keys"))
+ (:apply
+ (file:directory-exists ".ssh")
+ (apply #'file:contains-lines ".ssh/authorized_keys" keys))
+ (:unapply
+ (apply #'file:lacks-lines ".ssh/authorized_keys" keys)))