diff --git a/src/freedombone b/src/freedombone index 288b730f..084bbccf 100755 --- a/src/freedombone +++ b/src/freedombone @@ -35,6 +35,9 @@ PROJECT_NAME='freedombone' export TEXTDOMAIN=$PROJECT_NAME export TEXTDOMAINDIR="/usr/share/locale" +# username created by default within a debian image +GENERIC_IMAGE_USERNAME='fbone' + # Web site FREEDOMBONE_WEBSITE="http://freedombone.uk.to" diff --git a/src/freedombone-config b/src/freedombone-config index 82bfd1fe..b5cef14d 100755 --- a/src/freedombone-config +++ b/src/freedombone-config @@ -48,6 +48,9 @@ FREEDOMBONE_BITMESSAGE="BM-2cWuhmBvVdfrHhLoZTdspCkKeiTorUesSL" # Minimum number of characters in a password MINIMUM_PASSWORD_LENGTH=10 +# file containing new password +IMAGE_PASSWORD_FILE=/root/login.txt + # Different system variants which may be specified within # the SYSTEM_TYPE option VARIANT_FULL="full" @@ -654,6 +657,10 @@ function interactive_configuration { fi if [ -d /home/$GENERIC_IMAGE_USERNAME ]; then + if [ ! -f $IMAGE_PASSWORD_FILE ]; then + echo 'Cannot find the password file for the admin user' + exit 62753 + fi # when installing from an image which comes with a known default user account selected_username= while [ ! $selected_username ] @@ -675,8 +682,7 @@ function interactive_configuration { if [ ${#possible_username} -gt 1 ]; then if [[ $possible_username != $GENERIC_IMAGE_USERNAME ]]; then MY_USERNAME=$(cat $data) - usermod -l $MY_USERNAME $GENERIC_IMAGE_USERNAME - usermod -d /home/$MY_USERNAME -m $MY_USERNAME + useradd -m -p "$IMAGE_PASSWORD_FILE" -s /bin/bash $MY_USERNAME break fi fi