projects
/
grml-etc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bump Standards-Version to 3.9.6
[grml-etc.git]
/
etc
/
init.d
/
ssh
diff --git
a/etc/init.d/ssh
b/etc/init.d/ssh
index
f832b71
..
8554fc4
100755
(executable)
--- a/
etc/init.d/ssh
+++ b/
etc/init.d/ssh
@@
-14,10
+14,10
@@
# Configurable options:
KEYGEN=/usr/bin/ssh-keygen
# Configurable options:
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
RSA_KEY=/etc/ssh/ssh_host_rsa_key
DSA_KEY=/etc/ssh/ssh_host_dsa_key
ECDSA_KEY=/etc/ssh/ssh_host_ecdsa_key
+ED25519_KEY=/etc/ssh/ssh_host_ed25519_key
set -e
set -e
@@
-43,6
+43,12
@@
run_by_init() {
([ "$previous" ] && [ "$runlevel" ]) || [ "$runlevel" = S ]
}
([ "$previous" ] && [ "$runlevel" ]) || [ "$runlevel" = S ]
}
+check_for_upstart() {
+ if init_is_upstart; then
+ exit $1
+ fi
+}
+
check_for_no_start() {
# forget it if we're trying to start, and /etc/ssh/sshd_not_to_be_run exists
if [ -e /etc/ssh/sshd_not_to_be_run ]; then
check_for_no_start() {
# forget it if we're trying to start, and /etc/ssh/sshd_not_to_be_run exists
if [ -e /etc/ssh/sshd_not_to_be_run ]; then
@@
-84,11
+90,6
@@
check_config() {
generate_ssh_keys() {
generate_ssh_keys() {
- if ! test -f $RSA1_KEY ; then
- log_action_msg "Generating SSH1 RSA host key..."
- $KEYGEN -t rsa1 -f $RSA1_KEY -C '' -N '' || exit 1
- fi
-
if ! test -f $RSA_KEY ; then
log_action_msg "Generating SSH2 RSA host key..."
$KEYGEN -t rsa -f $RSA_KEY -C '' -N '' || exit 1
if ! test -f $RSA_KEY ; then
log_action_msg "Generating SSH2 RSA host key..."
$KEYGEN -t rsa -f $RSA_KEY -C '' -N '' || exit 1
@@
-103,12
+104,18
@@
generate_ssh_keys() {
log_action_msg "Generating SSH2 ECDSA host key..."
$KEYGEN -t ecdsa -f "$ECDSA_KEY" -C '' -N '' || exit 1
fi
log_action_msg "Generating SSH2 ECDSA host key..."
$KEYGEN -t ecdsa -f "$ECDSA_KEY" -C '' -N '' || exit 1
fi
+
+ if ! test -f "$ED25519_KEY" && grep -q "$ED25519_KEY" /etc/ssh/sshd_config ; then
+ log_action_msg "Generating SSH2 ED25519 host key..."
+ $KEYGEN -t ed25519 -f "$ED25519_KEY" -C '' -N '' || exit 1
+ fi
}
export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
case "$1" in
start)
}
export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
case "$1" in
start)
+ check_for_upstart 1
check_privsep_dir
check_for_no_start
check_dev_null
check_privsep_dir
check_for_no_start
check_dev_null
@@
-121,6
+128,7
@@
case "$1" in
fi
;;
stop)
fi
;;
stop)
+ check_for_upstart 0
log_daemon_msg "Stopping OpenBSD Secure Shell server" "sshd" || true
if start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/sshd.pid; then
log_end_msg 0 || true
log_daemon_msg "Stopping OpenBSD Secure Shell server" "sshd" || true
if start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/sshd.pid; then
log_end_msg 0 || true
@@
-130,6
+138,7
@@
case "$1" in
;;
reload|force-reload)
;;
reload|force-reload)
+ check_for_upstart 1
check_for_no_start
check_config
generate_ssh_keys
check_for_no_start
check_config
generate_ssh_keys
@@
-142,6
+151,7
@@
case "$1" in
;;
restart)
;;
restart)
+ check_for_upstart 1
check_privsep_dir
check_config
generate_ssh_keys
check_privsep_dir
check_config
generate_ssh_keys
@@
-157,6
+167,7
@@
case "$1" in
;;
try-restart)
;;
try-restart)
+ check_for_upstart 1
check_privsep_dir
check_config
generate_ssh_keys
check_privsep_dir
check_config
generate_ssh_keys
@@
-188,6
+199,7
@@
case "$1" in
;;
status)
;;
status)
+ check_for_upstart 1
status_of_proc -p /var/run/sshd.pid /usr/sbin/sshd sshd && exit 0 || exit $?
;;
status_of_proc -p /var/run/sshd.pid /usr/sbin/sshd sshd && exit 0 || exit $?
;;