Bug#500192: openssh-server: patch implementing this feature
Package: openssh-server
Version: 1:5.1p1-6
Severity: normal
I know that redhat and the upstream both have separate
implementations of this feature and now I need it also because I
have some tarball images for virtual machines that should create
the ssh host keys on boot. Since the debian procedure for
creating the host key is already implemented in the postinst
file, I just called dpkg-reconfigure from the init script, but I
don't know if this is really the best thing to do, I will
appreciate any advice. The patch is below. Thanks.
-- System Information:
Debian Release: squeeze/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.18-6-xen-amd64 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages openssh-server depends on:
ii adduser 3.110 add and remove users and groups
ii debconf [debconf-2.0] 1.5.27 Debian configuration management sy
ii dpkg 1.15.3.1 Debian package management system
ii libc6 2.9-21 GNU C Library: Shared libraries
ii libcomerr2 1.41.8-1 common error description library
ii libgssapi-krb5-2 1.7dfsg~beta3-1 MIT Kerberos runtime libraries - k
ii libk5crypto3 1.7dfsg~beta3-1 MIT Kerberos runtime libraries - C
ii libkrb5-3 1.7dfsg~beta3-1 MIT Kerberos runtime libraries
ii libpam-modules 1.0.1-9 Pluggable Authentication Modules f
ii libpam-runtime 1.0.1-9 Runtime support for the PAM librar
ii libpam0g 1.0.1-9 Pluggable Authentication Modules l
ii libselinux1 2.0.82-1 SELinux shared libraries
ii libssl0.9.8 0.9.8k-3 SSL shared libraries
ii libwrap0 7.6.q-18 Wietse Venema's TCP wrappers libra
ii lsb-base 3.2-22 Linux Standard Base 3.2 init scrip
ii openssh-blacklist 0.4.1 list of default blacklisted OpenSS
ii openssh-client 1:5.1p1-6 secure shell client, an rlogin/rsh
ii procps 1:3.2.8-1 /proc file system utilities
ii zlib1g 1:1.2.3.3.dfsg-14 compression library - runtime
Versions of packages openssh-server recommends:
ii openssh-blacklist-extra 0.4.1 list of non-default blacklisted Op
ii xauth 1:1.0.3-2 X authentication utility
Versions of packages openssh-server suggests:
pn molly-guard <none> (no description available)
pn rssh <none> (no description available)
pn ssh-askpass <none> (no description available)
pn ufw <none> (no description available)
-- debconf information excluded
*** /home/nick/debian/opensshinitchecksshhostkey.patch
--- etc/init.d/ssh 2009-01-13 17:07:15.000000000 -0800
+++ opensshinitscriptwithkeygen 2009-07-19 15:27:28.000000000 -0700
@@ -71,10 +71,15 @@
fi
}
+check_ssh_host_key() {
+ ls /etc/ssh/ssh_host_* &> /dev/null || /usr/sbin/dpkg-reconfigure openssh-server
+}
+
export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
case "$1" in
start)
+ check_ssh_host_key
check_privsep_dir
check_for_no_start
check_dev_null
Reply to: