X-Git-Url: http://git.grml.org/?a=blobdiff_plain;ds=sidebyside;f=etc%2Finit.d%2Fssh;h=d632833701d2d76fcbec8eb1d4a1fcf891f20e6a;hb=76727a73b4c94aac58b170ec9c71cc55689834b0;hp=6fdc08deb8c7020cdb5c87cb9d2bd7f96aa4c536;hpb=913dcbf0e054931ce93568a4b87971601d6d1745;p=grml-etc.git diff --git a/etc/init.d/ssh b/etc/init.d/ssh index 6fdc08d..d632833 100755 --- a/etc/init.d/ssh +++ b/etc/init.d/ssh @@ -1,11 +1,11 @@ -#!/bin/sh +#! /bin/sh ### BEGIN INIT INFO # Provides: sshd # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Default-Start: 2 3 4 5 -# Default-Stop: 1 +# Default-Stop: # Short-Description: OpenBSD Secure Shell server ### END INIT INFO @@ -19,17 +19,12 @@ set -e test -x /usr/sbin/sshd || exit 0 ( /usr/sbin/sshd -\? 2>&1 | grep -q OpenSSH ) 2>/dev/null || exit 0 -export SSHD_OOM_ADJUST=-17 +umask 022 + if test -f /etc/default/ssh; then . /etc/default/ssh fi -# Are we in a virtual environment that doesn't support modifying -# /proc/self/oom_adj? -if grep -q 'envID:.*[1-9]' /proc/self/status; then - unset SSHD_OOM_ADJUST -fi - . /lib/lsb/init-functions if [ -n "$2" ]; then @@ -41,6 +36,7 @@ KEYGEN=/usr/bin/ssh-keygen RSA1_KEY=/etc/ssh/ssh_host_key RSA_KEY=/etc/ssh/ssh_host_rsa_key DSA_KEY=/etc/ssh/ssh_host_dsa_key +ECDSA_KEY=/etc/ssh/ssh_host_ecdsa_key # Are we running from init? run_by_init() { @@ -100,7 +96,7 @@ case "$1" in fi if ! test -f $RSA_KEY ; then - log_action_msg "Generating SSH RSA host key..." + log_action_msg "Generating SSH2 RSA host key..." $KEYGEN -t rsa -f $RSA_KEY -C '' -N '' || exit 1 fi @@ -108,6 +104,10 @@ case "$1" in log_action_msg "Generating SSH2 DSA host key..." $KEYGEN -t dsa -f $DSA_KEY -C '' -N '' || exit 1 fi + if ! test -f "$ECDSA_KEY" && grep -q "$ECDSA_KEY" /etc/ssh/sshd_config ; then + log_action_msg "Generating SSH2 ECDSA host key..." + $KEYGEN -t ecdsa -f "$ECDSA_KEY" -C '' -N '' || exit 1 + fi log_daemon_msg "Starting OpenBSD Secure Shell server" "sshd" if start-stop-daemon --start --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS; then