/etc/ganeti/instance-debootstrap/hooks/clear-root-password is in ganeti-instance-debootstrap 0.11-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | #!/bin/sh
set -e
# Make sure we're not working on the root directory
if [ -z "$TARGET" -o "$TARGET" = "/" ]; then
echo "Invalid target directory '$TARGET', aborting." 1>&2
exit 1
fi
if [ "$(mountpoint -d /)" = "$(mountpoint -d "$TARGET")" ]; then
echo "The target directory seems to be the root dir, aborting." 1>&2
exit 1
fi
# Disable root's password, as the switch to enable shadow by default
# has left root with a disabled password, preventing the initial login
echo "Disabling root's password"
chroot "$TARGET" passwd -d root
exit 0
|