]> git.proxmox.com Git - mirror_lxc.git/commitdiff
lxc-ubuntu: Replace the hostname in ssh pubkey
authorStéphane Graber <stgraber@ubuntu.com>
Tue, 3 Dec 2013 20:15:41 +0000 (15:15 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Tue, 3 Dec 2013 21:47:48 +0000 (16:47 -0500)
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge Hallyn <serge.hallyn@ubuntu.com>
templates/lxc-ubuntu.in

index 18cacf686b81cab6cf5ff172acde71562df8c8be..e20a874c4314b4361a2952af4a73f84259018e1d 100644 (file)
@@ -106,6 +106,8 @@ EOF
         DPKG_MAINTSCRIPT_PACKAGE=openssh DPKG_MAINTSCRIPT_NAME=postinst chroot $rootfs $LOCALSTATEDIR/lib/dpkg/info/openssh-server.postinst configure
         mv $rootfs/etc/init/ssh.conf.disabled $rootfs/etc/init/ssh.conf
 
+        sed -i "s/root@$(hostname)/root@$hostname/g" $rootfs/etc/ssh/ssh_host_*.pub
+
         rm -f $rootfs/usr/sbin/policy-rc.d
     fi