summaryrefslogtreecommitdiff
path: root/scripts/install-system
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2008-06-18 10:25:00 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2008-06-18 10:25:00 -0700
commitfd96bf680d36b5c2694dc57658597332e6e96cc0 (patch)
treeefa10230fc5a64a2979a96671298f9a4cf2a5935 /scripts/install-system
parent02334d1cf220aaca11f734a3646d2f099ad016ca (diff)
downloadvyatta-cfg-system-fd96bf680d36b5c2694dc57658597332e6e96cc0.tar.gz
vyatta-cfg-system-fd96bf680d36b5c2694dc57658597332e6e96cc0.zip
Prompt for vyatta and root password
Bugfix: 2900 During install give user option of setting root and vyatta password. Don't leave systems open to attack.
Diffstat (limited to 'scripts/install-system')
-rwxr-xr-xscripts/install-system30
1 files changed, 30 insertions, 0 deletions
diff --git a/scripts/install-system b/scripts/install-system
index 3df0e0ca..1259af3b 100755
--- a/scripts/install-system
+++ b/scripts/install-system
@@ -535,6 +535,30 @@ copy_config () {
fi
}
+change_password() {
+ local user=$1
+ local pwd
+ read pwd
+ local epwd=$(mkpasswd -H md5 $pwd)
+
+ sed -i \
+ -e "/ user $user {/,/}/s/encrypted-password:.*\$/encrypted-password: \"$epwd\"/" \
+ $rootfsdir$ofrconfdir/config.boot
+}
+
+system_setup () {
+ echo -n "Would you like to set the passwords for system users (Yes/No) [Yes]: "
+ local response=$(get_response "Yes" "Yes No Y N")
+
+ if [ "$response" == "yes" ] || [ "$response" == "y" ]; then
+ echo -n 'System adminstrator (root) password: '
+ change_password root
+ echo -n 'Router adminstrator (vyatta) password: '
+ change_password vyatta
+ fi
+}
+
+
# setup grub on the boot sector of a user queried drive
install_grub () {
orig_install_drive="$INSTALL_DRIVE"
@@ -956,6 +980,12 @@ install_root_filesystem "$ROOT_PARTITION"
# Copy the config files
copy_config "$CONFIG_PARTITION"
+# Modify config to match system
+# Assume user wants to keep password from old config
+if [ ! -d /mnt/config ]; then
+ system_setup
+fi
+
# check for xen part images in /var/xen
setup_xen_partition_images