]> git.proxmox.com Git - mirror_lxc.git/commitdiff
do not set insecure passwords
authorEvgeni Golov <evgeni@debian.org>
Thu, 15 Dec 2016 18:52:50 +0000 (19:52 +0100)
committerEvgeni Golov <evgeni@debian.org>
Thu, 15 Dec 2016 19:04:15 +0000 (20:04 +0100)
Signed-off-by: Evgeni Golov <evgeni@debian.org>
templates/lxc-busybox.in
templates/lxc-opensuse.in
templates/lxc-oracle.in
templates/lxc-plamo.in
templates/lxc-slackware.in
templates/lxc-sparclinux.in

index 336fa12e7da2de8e6451d329fb1eb14f43c1e528..0d8db3358b54ca643a04c3f073da23d98454f678 100644 (file)
@@ -330,35 +330,6 @@ configure_busybox()
     chmod +s $rootfs/bin/passwd
     touch $rootfs/etc/shadow
 
-    # setting passwd for root
-    CHPASSWD_FILE=$rootfs/root/chpasswd.sh
-
-    cat <<EOF >$CHPASSWD_FILE
-echo "setting root password to \"root\""
-
-mount -n --bind /lib $rootfs/lib
-if [ \$? -ne 0 ]; then
-    echo "Failed bind-mounting /lib at $rootfs/lib"
-    exit 1
-fi
-
-chroot $rootfs chpasswd <<EOFF 2>/dev/null
-root:root
-EOFF
-
-
-if [ \$? -ne 0 ]; then
-    echo "Failed to change root password"
-    exit 1
-fi
-
-umount $rootfs/lib
-
-EOF
-
-    lxc-unshare -s MOUNT -- /bin/sh < $CHPASSWD_FILE
-    rm $CHPASSWD_FILE
-
     return 0
 }
 
index 07743976a3ae20ad1870d90f0e74cae9d292ce5d..292f26db1c7e840f3f229312968942e0eab3b8dc 100644 (file)
@@ -116,7 +116,6 @@ EOF
     touch $rootfs/etc/sysconfig/kernel
 
     echo "Please change root-password !"
-    echo "root:root" | chpasswd -R $rootfs
 
     return 0
 }
index 20c212b0011ba44d72cbd2af88c6d4ca9ac5e54f..19fe91235584752bf1e18fee67dc2223ef380d64 100644 (file)
@@ -462,12 +462,10 @@ EOF
         fi
     fi
 
-    # add oracle user, set root password
+    # add oracle user
     chroot $container_rootfs useradd -m -s /bin/bash oracle
-    echo "oracle:oracle" | chroot $container_rootfs chpasswd
-    echo "root:root" | chroot $container_rootfs chpasswd
-    printf "Added container user:\033[1moracle\033[0m password:\033[1moracle\033[0m\n"
-    printf "Added container user:\033[1mroot\033[0m password:\033[1mroot\033[0m\n"
+    printf "Added container user:\033[1moracle\033[0m\n"
+    printf "Added container user:\033[1mroot\033[0m\n"
 }
 
 # create the container's lxc config file
index 009fa4f861e20c51b4192df14eb737460fab5e6c..c96e23e11a715fd396ce6c55859805a8f29e1d9c 100644 (file)
@@ -186,9 +186,6 @@ configure_plamo() {
   # glibc configure
   mv $rootfs/etc/ld.so.conf{.new,}
   chroot $rootfs ldconfig
-  # root password
-  echo "Setting root password to 'root'..."
-  echo "root:root" | chroot $rootfs chpasswd
   echo "Please change root password!"
   ed - $rootfs/etc/rc.d/rc.S <<- "EOF"
        /^mount -w -n -t proc/;/^mkdir \/dev\/shm/-1d
index 5005918407999a9cb7920c9da1761e5c3383a7aa..216c7a72432703ff47da5c360c1e8d0ec2401a03 100644 (file)
@@ -471,10 +471,6 @@ sed -i 's/.*genpowerfail.*//' $rootfs/etc/inittab
 # add a message to rc.local that confirms successful container startup
 echo "echo ; echo \"* container $name started. *\" ; echo" >> $rootfs/etc/rc.d/rc.local
 
-# set a default combination for the luggage
-echo "root:root" | chroot $rootfs chpasswd
-echo "Root default password is 'root', please change it!"
-
 # borrow the time configuration from the local machine
 cp -a /etc/localtime $rootfs/etc/localtime
 
index 70616ba86e6fc15cd4ceac9d28c1190810181f0d..124c50b668186058aa76aa1fb3d9624963c91500 100644 (file)
@@ -296,12 +296,10 @@ EOF
         echo "Timezone in container is not configured. Adjust it manually."
     fi
 
-    # add oracle user, set root password
+    # add oracle user
     chroot $container_rootfs useradd -m -s /bin/bash oracle
-    echo "oracle:oracle" | chroot $container_rootfs chpasswd
-    echo "root:root" | chroot $container_rootfs chpasswd
-    printf "Added container user:\033[1moracle\033[0m password:\033[1moracle\033[0m\n"
-    printf "Added container user:\033[1mroot\033[0m password:\033[1mroot\033[0m\n"
+    printf "Added container user:\033[1moracle\033[0m\n"
+    printf "Added container user:\033[1mroot\033[0m\n"
 }
 
 # create the container's lxc config file