summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Bays <rbays@cartagena.vyatta.com>2008-10-13 13:30:16 -0400
committerAn-Cheng Huang <ancheng@vyatta.com>2008-10-14 08:26:23 -0700
commit1fa9bf825f3dfa51a71d87ffb08a64ad52dde61a (patch)
tree93fc34b50eab9bb56b1460baadf6d11cdd778f4b
parent81c8c9f28dff67e7ff3208278790f3381bc879dc (diff)
downloadvyatta-cfg-system-1fa9bf825f3dfa51a71d87ffb08a64ad52dde61a.tar.gz
vyatta-cfg-system-1fa9bf825f3dfa51a71d87ffb08a64ad52dde61a.zip
fix ssh keygen on startup
-rwxr-xr-xscripts/rl-system.init17
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/rl-system.init b/scripts/rl-system.init
index 23d67d12..36a4f64f 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 || \