Add config file for password hashes

This commit is contained in:
Thomas Cole 2021-07-13 08:35:52 -04:00
parent 6266870c3d
commit fe3b1ce399
4 changed files with 14 additions and 2 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.passwd.cfg
preseed.cfg

View File

@ -40,13 +40,13 @@ d-i mirror/http/proxy string
### Account setup ### Account setup
# Root password # Root password
d-i passwd/root-password-crypted password $CRYPT3HASH d-i passwd/root-password-crypted password @ROOTHASH
# To create a normal user account. # To create a normal user account.
d-i passwd/user-fullname string CLC User d-i passwd/user-fullname string CLC User
d-i passwd/username string clc d-i passwd/username string clc
# Normal user's password # Normal user's password
d-i passwd/user-password-crypted password $CRYPT3HASH d-i passwd/user-password-crypted password @USERHASH
### Clock and time zone setup ### Clock and time zone setup
# Controls whether or not the hardware clock is set to UTC. # Controls whether or not the hardware clock is set to UTC.

3
passwd.cfg Normal file
View File

@ -0,0 +1,3 @@
#EXAMPLE PASSWD config file
rootpassword=notarealpassword
userpasswort=12345

View File

@ -7,6 +7,13 @@ fi
LOCALIP=$(hostname -I) LOCALIP=$(hostname -I)
. .passwd.cfg
#copy the pre-preseed file and update the passwords from the .passwd.cfg file
cp input.cfg preseed.cfg
sed -i "s/@ROOTHASH/$roothash/g" preseed.cfg
sed -i "s/@USERHASH/$userhash/g" preseed.cfg
echo "Starting server. Press CTRL+C to stop." echo "Starting server. Press CTRL+C to stop."
echo -e "Local IP address: \e[32m$LOCALIP\e[0m" echo -e "Local IP address: \e[32m$LOCALIP\e[0m"