OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 # reset password for root and shared user account. | 7 # reset root password to test0000 (4 zeroes). |
| 8 TEMP_SHADOWFILE=${ROOT_FS_DIR}/etc/newshadow |
| 9 CRYPTED_PASSWD="$(echo "test0000" | openssl passwd -1 -stdin)" |
| 10 echo "root:${CRYPTED_PASSWD}:14500:0:::::" > ${TEMP_SHADOWFILE} |
| 11 echo "chronos:${CRYPTED_PASSWD}:14500:0:99999::::" > ${TEMP_SHADOWFILE} |
| 12 sed '/^root/ d;/^chronos/ d' ${ROOT_FS_DIR}/etc/shadow >> ${TEMP_SHADOWFILE} |
| 13 mv -f ${TEMP_SHADOWFILE} ${ROOT_FS_DIR}/etc/shadow |
8 | 14 |
9 LOCAL_ACCOUNT="chronos" | |
10 echo "Reset password for root." | |
11 passwd root < test_account.passwd 2> /dev/null | |
12 echo "Reset password for ${LOCAL_ACCOUNT}." | |
13 passwd ${LOCAL_ACCOUNT} < test_account.passwd 2> /dev/null | |
14 | |
OLD | NEW |