From d4e70f30421c5c48b256e0e272c91c7b6db2aa86 Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Mon, 22 Oct 2007 10:33:59 -0700 Subject: add service/ssh configuration. --- templates/service/ssh/node.def | 14 ++++++++++++++ templates/service/ssh/port/node.def | 3 +++ templates/service/ssh/protocol-version/node.def | 3 +++ 3 files changed, 20 insertions(+) create mode 100644 templates/service/ssh/node.def create mode 100644 templates/service/ssh/port/node.def create mode 100644 templates/service/ssh/protocol-version/node.def (limited to 'templates/service/ssh') diff --git a/templates/service/ssh/node.def b/templates/service/ssh/node.def new file mode 100644 index 00000000..df868743 --- /dev/null +++ b/templates/service/ssh/node.def @@ -0,0 +1,14 @@ +help: "Enable/disable SSH protocol" +delete: "/usr/sbin/invoke-rc.d ssh stop; echo 'SSHD_OPTS=' > /etc/default/ssh" +end: "if [ -z \"$(port/@)\" ]; then exit 0; fi; \ + [ -f /etc/ssh/ssh_host_key ] \ + || ssh-keygen -t rsa1 -N '' -f /etc/ssh/ssh_host_key; \ + case \"$(protocol-version/@)\" in \ + v2) VER=2;; \ + v1) VER=1;; \ + all) VER=\"1,2\";; \ + *) VER=2;; \ + esac; \ + echo 'SSHD_OPTS=\"-p $(port/@) -o HostKey=/etc/ssh/ssh_host_key \ +-o Protocol='\\\$VER\\\" > /etc/default/ssh; \ + /usr/sbin/invoke-rc.d ssh restart" diff --git a/templates/service/ssh/port/node.def b/templates/service/ssh/port/node.def new file mode 100644 index 00000000..ae388cc9 --- /dev/null +++ b/templates/service/ssh/port/node.def @@ -0,0 +1,3 @@ +type: u32 +default: 22 +help: "Port for SSH service" diff --git a/templates/service/ssh/protocol-version/node.def b/templates/service/ssh/protocol-version/node.def new file mode 100644 index 00000000..ccf98c74 --- /dev/null +++ b/templates/service/ssh/protocol-version/node.def @@ -0,0 +1,3 @@ +type: txt +default: "v2" +help: "SSH version" -- cgit v1.2.3