[SCM] live-config branch, debian-next, updated. debian/3.0_a37-1-3-ge366c37

Daniel Baumann daniel at debian.org
Sat May 5 18:54:34 UTC 2012


The following commit has been merged in the debian-next branch:
commit e366c37479b32ab9955be94729a36961d9a21ae5
Author: Daniel Baumann <daniel at debian.org>
Date:   Sat May 5 20:54:29 2012 +0200

    Improving on-demand creation of ssh host keys in openssh-server script.

diff --git a/scripts/config/118-openssh-server b/scripts/config/118-openssh-server
index 0e44525..f6d253a 100755
--- a/scripts/config/118-openssh-server
+++ b/scripts/config/118-openssh-server
@@ -24,27 +24,16 @@ Openssh_server ()
 
 Configure_openssh_server ()
 {
-	if [ ! -e /etc/ssh/ssh_host_rsa_key ]
-	then
-		ssh-keygen -q -f /etc/ssh/ssh_host_rsa_key -N "" -t rsa
-
-		_SSH="true"
-	fi
-
-	if [ ! -e /etc/ssh/ssh_host_dsa_key ]
-	then
-		ssh-keygen -q -f /etc/ssh/ssh_host_dsa_key -N "" -t dsa
-
-		_SSH="true"
-	fi
-
-	if [ -e /run ] && [ ! -e /etc/ssh/ssh_host_ecdsa_key ]
-	then
-		# FIXME: use some better >= wheezy detection than existence of /run
-		ssh-keygen -q -f /etc/ssh/ssh_host_ecdsa_key -N "" -t ecdsa
-
-		_SSH="true"
-	fi
+	for _PROTOCOL in dsa rsa ecdsa
+	do
+		if [ ! -e /etc/ssh/ssh_host_${_PROTOCOL}_key ] &&
+		   grep -qs ssh_host_${_PROTOCOL}_key /etc/ssh/sshd_config
+		then
+			ssh-keygen -q -f /etc/ssh/ssh_host_${_PROTOCOL}_key -N "" -t ${_PROTOCOL}
+
+			_SSH="true"
+		fi
+	done
 
 	if [ "${_SSH}" = "true" ]
 	then

-- 
live-config



More information about the debian-live-changes mailing list