From: Saul Wold <sgw@linux.intel.com>
To: Patches and discussions about the oe-core layer
<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH 1/3] classes/image: Allow openssh empty passwords login.
Date: Tue, 19 Jun 2012 06:57:53 -0700 [thread overview]
Message-ID: <4FE08561.9080604@linux.intel.com> (raw)
In-Reply-To: <c4e1a065c0a9417fb466ab2e23c3dddddfd5000e.1340112263.git.lianhao.lu@intel.com>
On 06/19/2012 06:33 AM, Lianhao Lu wrote:
> Allow empty passwords login so that the default root user can login in
> through openssh.
>
> Signed-off-by: Lianhao Lu<lianhao.lu@intel.com>
> ---
> meta/classes/core-image.bbclass | 2 ++
> meta/classes/image.bbclass | 10 +++++++++-
> 2 files changed, 11 insertions(+), 1 deletions(-)
>
> diff --git a/meta/classes/core-image.bbclass b/meta/classes/core-image.bbclass
> index e2ad0fc..25f5c5a 100644
> --- a/meta/classes/core-image.bbclass
> +++ b/meta/classes/core-image.bbclass
> @@ -69,4 +69,6 @@ ROOTFS_POSTPROCESS_COMMAND += "rootfs_update_timestamp ; "
>
> # Zap the root password if debug-tweaks feature is not enabled
> ROOTFS_POSTPROCESS_COMMAND += '${@base_contains("IMAGE_FEATURES", "debug-tweaks", "", "zap_root_password ; ",d)}'
> +# Allow openssh accept empty password login if both debug-tweaks and ssh-server-openssh are enabled
> +ROOTFS_POSTPROCESS_COMMAND += '${@base_contains("IMAGE_FEATURES", "debug-tweaks ssh-server-openssh", "openssh_allow_empty_password; ", "",d)}'
>
> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> index fb932b9..3f53271 100644
> --- a/meta/classes/image.bbclass
> +++ b/meta/classes/image.bbclass
> @@ -318,6 +318,14 @@ zap_root_password () {
> mv ${IMAGE_ROOTFS}/etc/passwd.new ${IMAGE_ROOTFS}/etc/passwd
> }
>
> +# allow openssh accept login with empty password string
> +openssh_allow_empty_password () {
> + if [ -e ${IMAGE_ROOTFS}${sysconfdir}/ssh/sshd_config ]; then
> + sed 's#.*PermitEmptyPasswords.*#PermitEmptyPasswords yes#' ${IMAGE_ROOTFS}${sysconfdir}/ssh/sshd_config>${IMAGE_ROOTFS}${sysconfdir}/ssh/sshd_config.new
> + mv -f ${IMAGE_ROOTFS}${sysconfdir}/ssh/sshd_config.new ${IMAGE_ROOTFS}${sysconfdir}/ssh/sshd_config
> + fi
Why not use sed -i here?
Sau!
> +}
> +
> # Turn any symbolic /sbin/init link into a file
> remove_init_link () {
> if [ -h ${IMAGE_ROOTFS}/sbin/init ]; then
> @@ -372,7 +380,7 @@ rootfs_trim_schemas () {
> done
> }
>
> -EXPORT_FUNCTIONS zap_root_password remove_init_link do_rootfs make_zimage_symlink_relative set_image_autologin rootfs_update_timestamp rootfs_no_x_startup
> +EXPORT_FUNCTIONS zap_root_password remove_init_link do_rootfs make_zimage_symlink_relative set_image_autologin rootfs_update_timestamp rootfs_no_x_startup openssh_allow_empty_password
>
> do_fetch[noexec] = "1"
> do_unpack[noexec] = "1"
next prev parent reply other threads:[~2012-06-19 14:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-19 13:32 [PATCH 0/3] misc IMAGE_FEATURE fixings Lianhao Lu
2012-06-19 13:33 ` [PATCH 1/3] classes/image: Allow openssh empty passwords login Lianhao Lu
2012-06-19 13:57 ` Saul Wold [this message]
2012-06-19 13:33 ` [PATCH 2/3] image/core-image: Handle conflicting IMAGE_FEATURES Lianhao Lu
2012-06-19 13:33 ` [PATCH 3/3] core-image/misc: Added new IMAGE_FEATURE eclipse-support Lianhao Lu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FE08561.9080604@linux.intel.com \
--to=sgw@linux.intel.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox