Skip to content

Commit 4ffa689

Browse files
committed
mkimage.sh.in: explicitly set 'PermitRootLogin yes' in sshd_config
So far, image generation relied on the config shipped in the openssh package to ensure root login with password, but as this might change in the future, explicitly apply and document this requirement for embedded images here instead. The exception for GCP (disable root login) should still work as intended.
1 parent 95e305c commit 4ffa689

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

mkimage.sh.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,10 @@ if [ -n "$BOOT_UUID" ]; then
247247
echo "UUID=$BOOT_UUID /boot $BOOT_FSTYPE defaults${fstab_args} 0 2" >> "${ROOTFS}/etc/fstab"
248248
fi
249249

250+
# Images are shipped with root as the only user by default, so we need to
251+
# ensure ssh login is possible for headless setups.
252+
sed -i "${ROOTFS}/etc/ssh/sshd_config" -e 's|^#\(PermitRootLogin\) .*|\1 yes|g'
253+
250254
# This section does final configuration on the images. In the case of
251255
# SBCs this writes the bootloader to the image or sets up other
252256
# required binaries to boot. In the case of images destined for a

0 commit comments

Comments
 (0)