]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/commitdiff
For first start of ssh generate ssh keys
authorManiacikarus <maniacikarus@ipfire.org>
Wed, 5 Nov 2008 18:44:08 +0000 (19:44 +0100)
committerManiacikarus <maniacikarus@ipfire.org>
Wed, 5 Nov 2008 18:44:08 +0000 (19:44 +0100)
src/initscripts/init.d/sshd

index eff98a9f2a3f2d6391cc8b27c5e7979c15207f8e..1bd23460a89cff6de8d8e30576bf80d25cc0deba 100644 (file)
 
 case "$1" in
     start)
-               [ -e "/var/ipfire/remote/enablessh" ] || exit 0 # SSH is not enabled
+    if [ ! -e /etc/ssh/ssh_host_rsa_key ]; then
+       echo "Generating SSH Keys"
+       ssh-keygen -qf /etc/ssh/ssh_host_rsa_key -N ''
+       ssh-keygen -qf /etc/ssh/ssh_host_key -N '' -t rsa1
+       ssh-keygen -qf /etc/ssh/ssh_host_dsa_key -N '' -t dsa
+    fi
+
+        [ -e "/var/ipfire/remote/enablessh" ] || exit 0 # SSH is not enabled
         boot_mesg "Starting SSH Server..."
         # Also prevent ssh from being killed by out of memory conditions
         loadproc /usr/sbin/sshd