Browse Source

Fix other passwords

Bob Mottram 8 years ago
parent
commit
27907b5d45

+ 1
- 1
src/freedombone-image View File

@@ -465,7 +465,7 @@ fi
465 465
 
466 466
 if [ ! $PASSWORD ]; then
467 467
     # generate a random password
468
-    PASSWORD="$(openssl rand -base64 30 | cut -c1-${MINIMUM_PASSWORD_LENGTH})"
468
+    PASSWORD=$(openssl rand -base64 32 | tr -dc A-Za-z0-9 | head -c ${MINIMUM_PASSWORD_LENGTH})
469 469
 fi
470 470
 
471 471
 # Move any existing images into a build subdirectory

+ 2
- 2
src/freedombone-image-customise View File

@@ -358,8 +358,8 @@ EOF
358 358
     echo "            dialog --backtitle \"${ENTROPY_MESSAGE1}\" --title \"${ENTROPY_MESSAGE2}\" --msgbox \"${ENTROPY_MESSAGE3}\" 8 50" >> $rootdir/root/.bashrc
359 359
     echo '            exit' >> $rootdir/root/.bashrc
360 360
     echo '        fi' >> $rootdir/root/.bashrc
361
-    echo -n '        NEW_USER_PASSWORD="$(openssl rand -base64 30 | cut -c1-' >> $rootdir/root/.bashrc
362
-    echo "${DEFAULT_PASSWORD_LENGTH})\"" >> $rootdir/root/.bashrc
361
+    echo -n '        NEW_USER_PASSWORD=$(openssl rand -base64 32 | tr -dc A-Za-z0-9 | head -c ' >> $rootdir/root/.bashrc
362
+    echo "${DEFAULT_PASSWORD_LENGTH})" >> $rootdir/root/.bashrc
363 363
     echo '    fi' >> $rootdir/root/.bashrc
364 364
     echo '    echo "${NEW_USER_PASSWORD}" > ~/login.txt' >> $rootdir/root/.bashrc
365 365
 

+ 2
- 1
src/freedombone-image-mesh View File

@@ -356,7 +356,8 @@ function create_tomb {
356 356
         echo "WARNING: ${tomb_name} tomb did not install properly" >> /var/log/${PROJECT_NAME}.log
357 357
         tomb >> /var/log/${PROJECT_NAME}.log
358 358
     fi
359
-    TOMB_TEMP_PASSWORD="$(openssl rand -base64 32 | cut -c1-30)"
359
+    TOMB_TEMP_PASSWORD=$(openssl rand -base64 64 | tr -dc A-Za-z0-9 | head -c 30)
360
+
360 361
     tomb forge /mnt/ramdisk/${tomb_name}.tomb.key --tomb-pwd "${TOMB_TEMP_PASSWORD}" --unsafe
361 362
     tomb lock /tmp/${tomb_name}.tomb -k /mnt/ramdisk/${tomb_name}.tomb.key --tomb-pwd "${TOMB_TEMP_PASSWORD}" --unsafe
362 363
     tomb open /tmp/${tomb_name}.tomb -k /mnt/ramdisk/${tomb_name}.tomb.key --tomb-pwd "${TOMB_TEMP_PASSWORD}" --unsafe

+ 1
- 1
src/freedombone-mirrors View File

@@ -97,7 +97,7 @@ function create_mirrors_user {
97 97
     fi
98 98
 
99 99
     if [ $create_password ]; then
100
-        MY_MIRRORS_PASSWORD="$(openssl rand -base64 20 | cut -c1-18)"
100
+        MY_MIRRORS_PASSWORD=$(openssl rand -base64 64 | tr -dc A-Za-z0-9 | head -c 18)
101 101
     fi
102 102
 
103 103
     chmod 600 /etc/shadow

+ 2
- 1
src/freedombone-pass View File

@@ -255,7 +255,8 @@ if [ ${#MASTER_PASSWORD} -eq 0 ]; then
255 255
         mkdir -p /root/.passwords/root
256 256
     fi
257 257
     if [ ! -f /root/.passwords/root/master ]; then
258
-        echo "$(openssl rand -base64 32 | cut -c1-30)" > /root/.passwords/root/master
258
+        newpass=$(openssl rand -base64 64 | tr -dc A-Za-z0-9 | head -c 30)
259
+        echo "$newpass" > /root/.passwords/root/master
259 260
         chmod 700 /root/.passwords/root/master
260 261
     fi
261 262
     MASTER_PASSWORD=$(cat /root/.passwords/root/master)