Linux · 2023年8月9日

如何修改密码,禁用登陆[9X07]

Question: What’s the default root password and how to change password or disable for MDM product
Answer:

the default password for root is oelinux123

  1. to disable username and password on MDM Edit following file. mdm/oe-core/meta-msm/recipes/sysvinit/sysvinit-inittab-2.88dsf/inittab — S:2345:respawn:/sbin/getty -L ttyHSL0 115200 console
    ++S:2345:respawn:/bin/login -f root
  2. To disable password on MDM 1) On loaded build. 2). Open file /etc/shadow in edit mode 3). Make below change -root:C98ULvDZe7zQ2:0:0:root:/home/root:/bin/sh +root::root:/home/root:/bin/sh</code></pre>If you want to disable password from the build level then a. For 9x50/9x07 , apply this patch.
    diff --git a/recipes/base-passwd/base-passwd_3.5.29.bbappend b/recipes/base-passwd/base-passwd_3.5.29.bbappend
    index 17354c5..0469703 100644
    --- a/recipes/base-passwd/base-passwd_3.5.29.bbappend
    +++ b/recipes/base-passwd/base-passwd_3.5.29.bbappend
    @@ -1,10 +1,9 @@
    FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:" SRC_URI += "file://root-home.patch \
  • file://add-hash.patch \
    file://add-diag-user.patch \
    file://add-sdcard-diag-groups.patch \
    file://add-reboot-daemon-group.patch \

-PR = “r1”
+PR = “r2”
diff –git a/recipes/images/mdm-bootimg.inc b/recipes/images/mdm-bootimg.inc
index 9540ad3..b2d9f78 100644
— a/recipes/images/mdm-bootimg.inc
+++ b/recipes/images/mdm-bootimg.inc
@@ -20,4 +20,6 @@ gen_buildprop() {
mkdir -p ${IMAGE_ROOTFS}/cache
echo ro.build.version.release=cat ${IMAGE_ROOTFS}/etc/version >> ${IMAGE_ROOTFS}/build.prop
echo ${MACHINE} >> ${IMAGE_ROOTFS}/target

  • sed -i ‘s%^root:*:%root::%’ ${IMAGE_ROOTFS}/etc/shadow
  • sed -i ‘s%^root:\x:%root::%’ ${IMAGE_ROOTFS}/etc/passwd

}

1.8.2.1
b. For 9×40 target,

diff –git a/recipes/base-passwd/base-passwd_3.5.22.bb b/recipes/base-passwd/base-passwd_3.5.22.bb
index a669194..5071235 100644
— a/recipes/base-passwd/base-passwd_3.5.22.bb
+++ b/recipes/base-passwd/base-passwd_3.5.22.bb
@@ -1,14 +1,13 @@
SUMMARY = “Base system master password/group files.”
DESCRIPTION = “The master copies of the user database files (/etc/passwd and /etc/group). The update-passwd tool is also provided to keep the system databases synchronized with these master files.”
SECTION = “base”
-PR = “r10”
+PR = “r11”
LICENSE = “GPLv2+”
LIC_FILES_CHKSUM = “file://COPYING;md5=eb723b61539feef013de476e68b5c50a”

SRC_URI = “${DEBIAN_MIRROR}/main/b/base-passwd/base-passwd_${PV}.tar.gz \
file://nobash.patch \
file://root-home.patch \

  • file://add-hash.patch \
    file://add-diag-user.patch \
    file://add-sdcard-diag-groups.patch \
    file://add-reboot-daemon-group.patch \
  1. To change password to 123456 Edit below file on the source mdm/oe-core/meta-msm/recipes/base-passwd/base-passwd-3.5.29/add-hash.patch -root:C98ULvDZe7zQ2:0:0:root:/home/root:/bin/sh +root:​$1$ibSEJqlu$jSIUJngFAVB9flW7cV6uo.:0:0:root:/home/root:/bin/sh​ you can do the above on the target as well. To find a hash value of a new password run passwd command on the target and provide a new password which you want to keep. You can check the hash value of the new password in /etc/shadow
    and use the same in mdm/oe-core/meta-msm/recipes/base-passwd/base-passwd-3.5.29/add-hash.patch and rebuild.
打赏作者