Browse Source

added option for fixed passwords

toastie89 3 months ago
parent
commit
e120767d96
2 changed files with 6 additions and 3 deletions
  1. 4 3
      bootstrap-bullseye.sh
  2. 2 0
      config.sh.template

+ 4 - 3
bootstrap-bullseye.sh

@@ -136,13 +136,14 @@ apt-get autoremove --yes
 apt-get clean --yes
 
 # Setup users and passwords
-pass=`pwgen --capitalize --numerals --ambiguous 12 1`
+[ -z $pwdAdmin ] && pwdAdmin=`pwgen --capitalize --numerals --ambiguous 12 1`
 useradd admin --create-home --shell /bin/bash
-echo "admin:$pass" | chpasswd
+echo "admin:$pwdAdmin" | chpasswd
 usermod -a -G sudo admin
 echo -e "\e[1;33;4;44mPassword for the user admin: $pass\e[0m"
 pass=`pwgen --capitalize --numerals --ambiguous 12 1`
-echo 'root:$pass'     | chpasswd
+[ -z $pwdRoot ] && pwdRoot=`pwgen --capitalize --numerals --ambiguous 12 1`
+echo "root:$pwdRoot"   | chpasswd
 echo -e "\e[1;33;4;44mPassword for the user root: $pass\e[0m"
 
 # Harden SSHD

+ 2 - 0
config.sh.template

@@ -10,3 +10,5 @@ netBroadcast="203.0.113.255"
 netDNS1="192.0.2.10"
 netDNS2="198.51.100.10"
 netNTP="pool.ntp.org"
+pwdAdmin=""                  # "" blank for auto-generation
+pwdRoot=""                   # "" blank for auto-generation