summaryrefslogtreecommitdiff
path: root/templates/service/ssh/root-allowed
diff options
context:
space:
mode:
Diffstat (limited to 'templates/service/ssh/root-allowed')
-rw-r--r--templates/service/ssh/root-allowed/node.def19
1 files changed, 19 insertions, 0 deletions
diff --git a/templates/service/ssh/root-allowed/node.def b/templates/service/ssh/root-allowed/node.def
new file mode 100644
index 00000000..8c5a6fd9
--- /dev/null
+++ b/templates/service/ssh/root-allowed/node.def
@@ -0,0 +1,19 @@
+type: bool
+help: Allow root login over ssh
+default: false
+help: Enable/disable root login
+update: if [ \"$VAR(@)\" == \"true\" ]; then
+ sudo ed - /etc/ssh/sshd_config <<-"EOF"
+ /^PermitRootLogin/s/no/yes/
+ wq
+ EOF
+ else
+ sudo ed - /etc/ssh/sshd_config <<-"EOF"
+ /^PermitRootLogin/s/yes/no/
+ wq
+ EOF
+ fi
+delete: sudo ed - /etc/ssh/sshd_config <<-"EOF"
+ /^PermitRootLogin/s/yes/no/
+ wq
+ EOF