sahara-image-elements/elements/root-passwd/post-install.d/99-setup
Pino Toscano c8cbe25f1b Start switching to declarative package-installs
Make use of the package-installs element to declare in yaml format the
packages to be installed at the beginning of a phase.

Other than reducing the amont of explicit 'install-packages pkg1 ...'
invocations, they can also be installed just once per-phase.

Change-Id: I1f1acfb2bd74fed5cf4c0b48bc739f7f75c35d83
2015-04-15 00:44:54 +08:00

18 lines
510 B
Bash
Executable File

#!/bin/bash
if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
if [ -z "$DIB_PASSWORD" ]; then
echo "Error during setup password for root"
exit 1
fi
sed -i "s/disable_root: true/disable_root: false/" /etc/cloud/cloud.cfg
augtool -s set /files/etc/ssh/sshd_config/PasswordAuthentication yes
augtool -s set /files/etc/ssh/sshd_config/PermitRootLogin yes
augtool -s set /files/etc/ssh/ssh_config/PasswordAuthentication yes
echo -e "$DIB_PASSWORD\n$DIB_PASSWORD\n" | passwd