]> code.ossystems Code Review - openembedded-core.git/commitdiff
core-image: allow root login when debug-tweaks is enabled
authorSaul Wold <sgw@linux.intel.com>
Fri, 7 Sep 2012 22:18:36 +0000 (15:18 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 10 Sep 2012 11:09:14 +0000 (12:09 +0100)
This allows root to login over ssh with an empty password just like
dropbear when the debug-tweaks are enabled, it's important to disable
debug-tweaks for a production system as this will leave open a security
hole!

Thanks to Marc for the settings.
Cc: Marc Ferland <marc.ferland@gmail.com>
[Yocto #3078]

Signed-off-by: Saul Wold <sgw@linux.intel.com>
meta/classes/image.bbclass

index 2e95556011928d6dcde0715467f111d4d85b724a..9af67e73845e819ceca5875e799ba9d6ab5f3bf6 100644 (file)
@@ -369,6 +369,7 @@ zap_root_password () {
 # allow openssh accept login with empty password string
 openssh_allow_empty_password () {
        if [ -e ${IMAGE_ROOTFS}${sysconfdir}/ssh/sshd_config ]; then
+               sed -i 's#.*PermitRootLogin.*#PermitRootLogin yes#' ${IMAGE_ROOTFS}${sysconfdir}/ssh/sshd_config
                sed -i 's#.*PermitEmptyPasswords.*#PermitEmptyPasswords yes#' ${IMAGE_ROOTFS}${sysconfdir}/ssh/sshd_config
        fi
 }