Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(214)

Side by Side Diff: set_shared_user_password.sh

Issue 6534003: set_shared_user_password.sh updates /etc/shared_user_passwd.txt (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/crosutils.git@master
Patch Set: switch to a file Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 # Script to set the password for the shared user account. Stores the 7 # Script to set the password for the shared user account. Stores the
8 # MD5crypt'd password to a file, for use by customize_rootfs.sh. 8 # MD5crypt'd password to a file, for use by customize_rootfs.sh.
9 9
10 # --- BEGIN COMMON.SH BOILERPLATE --- 10 # --- BEGIN COMMON.SH BOILERPLATE ---
(...skipping 25 matching lines...) Expand all
36 # Parse command line 36 # Parse command line
37 FLAGS "$@" || exit 1 37 FLAGS "$@" || exit 1
38 eval set -- "${FLAGS_ARGV}" 38 eval set -- "${FLAGS_ARGV}"
39 39
40 # Die on any errors. 40 # Die on any errors.
41 set -e 41 set -e
42 42
43 # Get password 43 # Get password
44 read -p "Enter password for shared user account: " PASSWORD 44 read -p "Enter password for shared user account: " PASSWORD
45 45
46 CRYPTED_PASSWD_FILE=$SCRIPTS_DIR/shared_user_passwd.txt
47 CRYPTED_PASSWD="$(echo "$PASSWORD" | openssl passwd -1 -stdin)" 46 CRYPTED_PASSWD="$(echo "$PASSWORD" | openssl passwd -1 -stdin)"
48 PASSWORD="gone now" 47 PASSWORD="gone now"
49 48
50 echo "$CRYPTED_PASSWD" > $CRYPTED_PASSWD_FILE 49 CRYPTED_PASSWD_FILE="${SCRIPTS_DIR}/shared_user_passwd.txt"
50 echo "${CRYPTED_PASSWD}" > "${CRYPTED_PASSWD_FILE}"
51 51
52 echo "Shared user password set in $CRYPTED_PASSWD_FILE" 52 SHARED_USER_PASSWD_FILE="/etc/shared_user_passwd.txt"
53 echo "${CRYPTED_PASSWD}" | sudo_clobber "${SHARED_USER_PASSWD_FILE}"
54
55 echo "Password set in ${CRYPTED_PASSWD_FILE} and ${SHARED_USER_PASSWD_FILE}"
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698