From: Daniel Lezcano Date: Tue, 1 Jun 2010 16:56:54 +0000 (+0200) Subject: change root passwd for debian template X-Git-Tag: lxc-0.7.0~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=19d618b11317778a6e24e703258fd6c783a79784;p=thirdparty%2Flxc.git change root passwd for debian template Change default root password to 'root' and generate locales automatically Signed-off-by: Daniel Lezcano --- diff --git a/scripts/lxc-busybox.in b/scripts/lxc-busybox.in index 1d4009dc1..40542d537 100644 --- a/scripts/lxc-busybox.in +++ b/scripts/lxc-busybox.in @@ -74,13 +74,6 @@ EOF root:x:0:root EOF - # empty password - cat <> $rootfs/etc/shadow -root:\$1\$NJJLsV0P\$Y/esfSXDNR88G/bZFzgWY1:14595:0:99999:7::: -EOF - - echo "empty password for root, don't forget to change it !" - # mount everything cat <> $rootfs/etc/init.d/rcS #!/bin/sh @@ -214,6 +207,9 @@ configure_busybox() # passwd exec must be setuid chmod +s $rootfs/bin/passwd + echo "root:root" | chroot $rootfs chpasswd + echo "Root password is 'root', please change !" + return 0 } diff --git a/scripts/lxc-debian.in b/scripts/lxc-debian.in index 6ee511d3b..d940b7f50 100755 --- a/scripts/lxc-debian.in +++ b/scripts/lxc-debian.in @@ -49,29 +49,6 @@ EOF mkdir -p $rootfs/selinux echo 0 > $rootfs/selinux/enforce - # by default setup root password with no password - cat < $rootfs/etc/ssh/sshd_config -Port 22 -Protocol 2 -HostKey /etc/ssh/ssh_host_rsa_key -HostKey /etc/ssh/ssh_host_dsa_key -UsePrivilegeSeparation yes -KeyRegenerationInterval 3600 -ServerKeyBits 768 -SyslogFacility AUTH -LogLevel INFO -LoginGraceTime 120 -PermitRootLogin yes -StrictModes yes -RSAAuthentication yes -PubkeyAuthentication yes -IgnoreRhosts yes -RhostsRSAAuthentication no -HostbasedAuthentication no -PermitEmptyPasswords yes -ChallengeResponseAuthentication no -EOF - # configure the network using the dhcp cat < $rootfs/etc/network/interfaces auto lo @@ -87,12 +64,17 @@ $hostname EOF # reconfigure some services - chroot $rootfs /usr/sbin/dpkg-reconfigure locales + chroot $rootfs locale-gen en_US.UTF-8 # remove pointless services in a container chroot $rootfs /usr/sbin/update-rc.d -f umountfs remove chroot $rootfs /usr/sbin/update-rc.d -f hwclock.sh remove chroot $rootfs /usr/sbin/update-rc.d -f hwclockfirst.sh remove + + echo "root:root" | chroot $rootfs chpasswd + echo "Root password is 'root', please change !" + + return 0 } download_debian()