Commit 19d618b1 by Daniel Lezcano Committed by Daniel Lezcano

change root passwd for debian template

Change default root password to 'root' and generate locales automatically Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent 3a3ba44a
......@@ -74,13 +74,6 @@ EOF
root:x:0:root
EOF
# empty password
cat <<EOF >> $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 <<EOF >> $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
}
......
......@@ -49,29 +49,6 @@ EOF
mkdir -p $rootfs/selinux
echo 0 > $rootfs/selinux/enforce
# by default setup root password with no password
cat <<EOF > $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 <<EOF > $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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment