summaryrefslogtreecommitdiff
path: root/templates/service/ssh/node.def
blob: df8687438b6e3ad367c1186a4dcb89660c0e8527 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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"