diff options
author | Lianhao Lu <lianhao.lu@intel.com> | 2012-06-11 16:51:51 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-06-28 16:26:42 +0100 |
commit | 41ed2e653237e70e73be233af7e2d0a34eb96fe5 (patch) | |
tree | db3c6a445de358b56f3af1851876c082248eebbe | |
parent | 2fa7732840c9d70303650c61a437f6b02e1984a6 (diff) | |
download | poky-41ed2e653237e70e73be233af7e2d0a34eb96fe5.tar.gz |
classes/image: Allow openssh empty passwords login.
Allow empty passwords login so that the default root user can login in
through openssh.
(From OE-Core rev: 39ef0a705ca059f9a7c68aa1710c81411fb7c762)
Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/core-image.bbclass | 2 | ||||
-rw-r--r-- | meta/classes/image.bbclass | 7 |
2 files changed, 9 insertions, 0 deletions
diff --git a/meta/classes/core-image.bbclass b/meta/classes/core-image.bbclass index e2ad0fcf31..25f5c5a8dc 100644 --- a/meta/classes/core-image.bbclass +++ b/meta/classes/core-image.bbclass | |||
@@ -69,4 +69,6 @@ ROOTFS_POSTPROCESS_COMMAND += "rootfs_update_timestamp ; " | |||
69 | 69 | ||
70 | # Zap the root password if debug-tweaks feature is not enabled | 70 | # Zap the root password if debug-tweaks feature is not enabled |
71 | ROOTFS_POSTPROCESS_COMMAND += '${@base_contains("IMAGE_FEATURES", "debug-tweaks", "", "zap_root_password ; ",d)}' | 71 | ROOTFS_POSTPROCESS_COMMAND += '${@base_contains("IMAGE_FEATURES", "debug-tweaks", "", "zap_root_password ; ",d)}' |
72 | # Allow openssh accept empty password login if both debug-tweaks and ssh-server-openssh are enabled | ||
73 | ROOTFS_POSTPROCESS_COMMAND += '${@base_contains("IMAGE_FEATURES", "debug-tweaks ssh-server-openssh", "openssh_allow_empty_password; ", "",d)}' | ||
72 | 74 | ||
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index fb932b9d66..0772363f18 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass | |||
@@ -318,6 +318,13 @@ zap_root_password () { | |||
318 | mv ${IMAGE_ROOTFS}/etc/passwd.new ${IMAGE_ROOTFS}/etc/passwd | 318 | mv ${IMAGE_ROOTFS}/etc/passwd.new ${IMAGE_ROOTFS}/etc/passwd |
319 | } | 319 | } |
320 | 320 | ||
321 | # allow openssh accept login with empty password string | ||
322 | openssh_allow_empty_password () { | ||
323 | if [ -e ${IMAGE_ROOTFS}${sysconfdir}/ssh/sshd_config ]; then | ||
324 | sed -i 's#.*PermitEmptyPasswords.*#PermitEmptyPasswords yes#' ${IMAGE_ROOTFS}${sysconfdir}/ssh/sshd_config | ||
325 | fi | ||
326 | } | ||
327 | |||
321 | # Turn any symbolic /sbin/init link into a file | 328 | # Turn any symbolic /sbin/init link into a file |
322 | remove_init_link () { | 329 | remove_init_link () { |
323 | if [ -h ${IMAGE_ROOTFS}/sbin/init ]; then | 330 | if [ -h ${IMAGE_ROOTFS}/sbin/init ]; then |