Index: src/scripts/mod_for_test_scripts/300changePassword |
diff --git a/src/scripts/mod_for_test_scripts/300changePassword b/src/scripts/mod_for_test_scripts/300changePassword |
index 44f08c3d7e98c8039bf67389f2e88679aacefd15..5e5b6d080db4f523e006edf61a20a2a8d8596615 100755 |
--- a/src/scripts/mod_for_test_scripts/300changePassword |
+++ b/src/scripts/mod_for_test_scripts/300changePassword |
@@ -4,11 +4,11 @@ |
# Use of this source code is governed by a BSD-style license that can be |
# found in the LICENSE file. |
-# reset password for root and shared user account. |
- |
-LOCAL_ACCOUNT="chronos" |
-echo "Reset password for root." |
-passwd root < test_account.passwd 2> /dev/null |
-echo "Reset password for ${LOCAL_ACCOUNT}." |
-passwd ${LOCAL_ACCOUNT} < test_account.passwd 2> /dev/null |
+# reset root password to test0000 (4 zeroes). |
+TEMP_SHADOWFILE=${ROOT_FS_DIR}/etc/newshadow |
+CRYPTED_PASSWD="$(echo "test0000" | openssl passwd -1 -stdin)" |
+echo "root:${CRYPTED_PASSWD}:14500:0:::::" > ${TEMP_SHADOWFILE} |
+echo "chronos:${CRYPTED_PASSWD}:14500:0:99999::::" > ${TEMP_SHADOWFILE} |
+sed '/^root/ d;/^chronos/ d' ${ROOT_FS_DIR}/etc/shadow >> ${TEMP_SHADOWFILE} |
+mv -f ${TEMP_SHADOWFILE} ${ROOT_FS_DIR}/etc/shadow |