@@ -11,6 +11,7 @@
require common.inc
+SRC_URI += "file://ssh-permit-root.conf"
DESCRIPTION = "CIP Core image demo & customizations"
do_prepare_build:prepend:qemu-riscv64() {
@@ -20,3 +21,10 @@ do_prepare_build:prepend:qemu-riscv64() {
echo "systemctl mask serial-getty@hvc0.service" >> ${WORKDIR}/postinst
fi
}
+
+do_install[cleandirs] += "${D}/etc/ssh/sshd_config.d/"
+do_install:append () {
+ if [ -f "${WORKDIR}/ssh-permit-root.conf" ]; then
+ install -v -m 644 ${WORKDIR}/ssh-permit-root.conf ${D}/etc/ssh/sshd_config.d/
+ fi
+}
@@ -14,10 +14,6 @@ set -e
echo "CIP Core Demo & Test Image (login: root/root)" > /etc/issue
-if ! grep -e "^PermitRootLogin.*yes" -q /etc/ssh/sshd_config; then
- echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
-fi
-
HOSTNAME="${CUSTOM_HOSTNAME}"
echo "$HOSTNAME" > /etc/hostname
echo "127.0.0.1 $HOSTNAME" >> /etc/hosts
new file mode 100644
@@ -0,0 +1 @@
+PermitRootLogin yes