From 5eca99d9a836c1cc35bacc33aca3414fb0a482e9 Mon Sep 17 00:00:00 2001 From: Robert Bays Date: Mon, 13 Oct 2008 13:30:16 -0400 Subject: fix ssh keygen on startup --- scripts/rl-system.init | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'scripts') diff --git a/scripts/rl-system.init b/scripts/rl-system.init index 0f6957ad..5391d409 100755 --- a/scripts/rl-system.init +++ b/scripts/rl-system.init @@ -134,8 +134,25 @@ udev_rescan () done } +create_ssh_host_keys () { + if [ ! -f "/etc/ssh/ssh_host_rsa_key" ]; then + syslog "Creating ssh v2 rsa host key." + ssh-keygen -q -N '' -t rsa -f /etc/ssh/ssh_host_rsa_key + fi; + if [ ! -f "/etc/ssh/ssh_host_dsa_key" ]; then + syslog "Creating ssh v2 dsa host key." + ssh-keygen -q -N '' -t dsa -f /etc/ssh/ssh_host_dsa_key + fi; + if [ ! -f "/etc/ssh/ssh_host_key" ]; then + syslog "Creating ssh v1 host key." + ssh-keygen -q -N '' -t rsa1 -f /etc/ssh/ssh_host_key + fi; +} + start () { udev_rescan + create_ssh_host_keys || \ + log_failure_msg "can't initialize ssh host keys" clear_or_override_config_files || \ log_failure_msg "can\'t reset config files" set_reboot_on_panic || \ -- cgit v1.2.3