projects
/
grml-etc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
913dcbf
)
Generate ECDSA key if necessary
author
Ulrich Dangel
<uli@spamt.net>
Wed, 25 May 2011 10:36:58 +0000
(12:36 +0200)
committer
Ulrich Dangel
<uli@spamt.net>
Wed, 25 May 2011 10:36:58 +0000
(12:36 +0200)
etc/init.d/ssh
patch
|
blob
|
history
diff --git
a/etc/init.d/ssh
b/etc/init.d/ssh
index
6fdc08d
..
82af0f1
100755
(executable)
--- a/
etc/init.d/ssh
+++ b/
etc/init.d/ssh
@@
-41,6
+41,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
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() {
# Are we running from init?
run_by_init() {
@@
-108,6
+109,10
@@
case "$1" in
log_action_msg "Generating SSH2 DSA host key..."
$KEYGEN -t dsa -f $DSA_KEY -C '' -N '' || exit 1
fi
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
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