diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-02-26 16:25:06 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-02-26 16:25:06 -0800 |
commit | b8300c77e22acb1569e15a4977be20ef3a7d5cfe (patch) | |
tree | 3fe15230c6c548c1575305d155ce9d21451a1fbf | |
parent | 3f90953b7705a59dbb41019bd69f924541607238 (diff) | |
download | vyatta-cfg-system-b8300c77e22acb1569e15a4977be20ef3a7d5cfe.tar.gz vyatta-cfg-system-b8300c77e22acb1569e15a4977be20ef3a7d5cfe.zip |
add option to disable root login over ssh
See: https://bugzilla.vyatta.com/show_bug.cgi?id=2798 and
https://bugzilla.vyatta.com/show_bug.cgi?id=2806
-rw-r--r-- | templates/service/ssh/root-allowed/node.def | 19 |
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 |