summaryrefslogtreecommitdiff
path: root/templates/service/ssh/allow-root/node.def
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2008-10-23 20:46:27 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2008-10-23 20:46:27 -0700
commitfd872e43a5eb9b135912d6653a9fc4be97556a31 (patch)
tree16c6563e18871e2e5e4d2f51c3b66cedd46dd1c2 /templates/service/ssh/allow-root/node.def
parent0e1f76414aad46e320ca173c5b5d29faa7f5a87e (diff)
parent556580381ed0008c463aa0dd109f839f140f3443 (diff)
downloadvyatta-cfg-quagga-fd872e43a5eb9b135912d6653a9fc4be97556a31.tar.gz
vyatta-cfg-quagga-fd872e43a5eb9b135912d6653a9fc4be97556a31.zip
Merge branch 'islavista' of suva.vyatta.com:/git/vyatta-cfg-system into islavista
Diffstat (limited to 'templates/service/ssh/allow-root/node.def')
-rw-r--r--templates/service/ssh/allow-root/node.def24
1 files changed, 11 insertions, 13 deletions
diff --git a/templates/service/ssh/allow-root/node.def b/templates/service/ssh/allow-root/node.def
index 9aa98826..25a5a97a 100644
--- a/templates/service/ssh/allow-root/node.def
+++ b/templates/service/ssh/allow-root/node.def
@@ -1,16 +1,14 @@
-type: txt
+type: bool
default: false
help: Enable/disable root login over ssh
-syntax:expression: $VAR(@) in "true", "false" ; "must be true or false"
-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
+update: if [ "$VAR(@)" == "true" ];
+ then regex='/^PermitRootLogin/s/no/yes/'
+ else regex='/^PermitRootLogin/s/yes/no/'
fi
- /bin/true
+ sudo sed -i -e "$regex" /etc/ssh/sshd_config
+
+comp_help: possible completions:
+ true Enable root login over ssh
+ false Disable root login over ssh
+
+allowed: echo "true false"