Bug#500192: patch based of gentoo's
--
Daniel Black
Cloud Central
Scale Your Data Center In The Cloud
Switch: 1300 144 007
Fax: 02 6173 7339
Email: daniel@cloudcentral.com.au
--- /etc/init.d/ssh.orig 2010-02-11 18:27:46.000000000 +1100
+++ /etc/init.d/ssh 2010-02-11 18:32:16.000000000 +1100
@@ -57,6 +57,17 @@
fi
}
+check_ssh_host_key() {
+ if [ ! -e /etc/ssh/ssh_host_key ]; then
+ /usr/bin/ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_key -N '' || exit 1
+ fi
+ if [ ! -e /etc/ssh/ssh_host_dsa_key ]; then
+ /usr/bin/ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N '' || exit 1
+ fi
+ if [ ! -e /etc/ssh/ssh_host_rsa_key ]; then
+ /usr/bin/ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N '' || exit 1
+ fi
+}
check_privsep_dir() {
# Create the PrivSep empty dir if necessary
if [ ! -d /var/run/sshd ]; then
@@ -75,6 +86,7 @@
case "$1" in
start)
+ check_ssh_host_key
check_privsep_dir
check_for_no_start
check_dev_null
Reply to: