[Clfs-commits] commit: r47 - /trunk/standard/cblfs/init.d/sshd

svn at cross-lfs.org svn at cross-lfs.org
Sat Jun 13 17:32:12 PDT 2009


Author: jciccone
Date: Sun Jun 14 00:32:11 2009
New Revision: 47

Log:
Generate the ssh host keys when the service starts if they dont already exist. This helps cross-compiling.

Modified:
    trunk/standard/cblfs/init.d/sshd

Modified: trunk/standard/cblfs/init.d/sshd
==============================================================================
--- trunk/standard/cblfs/init.d/sshd (original)
+++ trunk/standard/cblfs/init.d/sshd Sun Jun 14 00:32:11 2009
@@ -14,6 +14,22 @@
 
 case "$1" in
     start)
+        if [ ! -f /etc/ssh/ssh_host_key ]; then
+          boot_mesg "Generating /etc/ssh/ssh_host_key"
+          ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_key -N ""
+          evaluate_retval
+        fi
+        if [ ! -f /etc/ssh/ssh_host_dsa_key ]; then
+          boot_mesg "Generating /etc/ssh/ssh_host_dsa_key"
+          ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ""
+          evaluate_retval
+        fi
+        if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then
+          boot_mesg "Generating /etc/ssh/ssh_host_rsa_key"
+          ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ""
+          evaluate_retval
+        fi
+
         boot_mesg "Starting SSH Server..."
         # Also prevent ssh from being killed by out of memory conditions
         loadproc -p $pidfile /usr/sbin/sshd 




More information about the Clfs-commits mailing list