Random initial image password
This commit is contained in:
parent
a4aca5ddbc
commit
2294979689
|
@ -186,16 +186,16 @@ admin_user_sudo() {
|
||||||
|
|
||||||
create_generic_image() {
|
create_generic_image() {
|
||||||
if [[ $GENERIC_IMAGE == "no" ]]; then
|
if [[ $GENERIC_IMAGE == "no" ]]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
# Don't install any configuration. This will be a base system
|
# Don't install any configuration. This will be a base system
|
||||||
CONFIG_FILENAME=
|
CONFIG_FILENAME=
|
||||||
# The presence of this file indicates that the initial
|
# The presence of this file indicates that the initial
|
||||||
# setup has not yet been completed
|
# setup has not yet been completed
|
||||||
touch $rootdir/home/$MY_USERNAME/.initial_setup
|
touch $rootdir/home/$MY_USERNAME/.initial_setup
|
||||||
touch $rootdir/home/root/.bashrc
|
touch $rootdir/home/root/.bashrc
|
||||||
|
|
||||||
cat >> $rootdir/home/$MY_USERNAME/.bashrc <<EOF
|
cat >> $rootdir/home/$MY_USERNAME/.bashrc <<EOF
|
||||||
# initial setup of the system
|
# initial setup of the system
|
||||||
if [ -f ~/.initial_setup ]; then
|
if [ -f ~/.initial_setup ]; then
|
||||||
clear
|
clear
|
||||||
|
@ -213,7 +213,7 @@ if [ -f ~/.initial_setup ]; then
|
||||||
echo ''
|
echo ''
|
||||||
|
|
||||||
NEW_USER_PASSWORD="$(openssl rand -base64 12 | cut -c1-10)"
|
NEW_USER_PASSWORD="$(openssl rand -base64 12 | cut -c1-10)"
|
||||||
echo "${USER}:${NEW_USER_PASSWORD}"|chpasswd
|
echo "${NEW_USER_PASSWORD}" > ~/login.txt
|
||||||
echo " $NEW_USER_PASSWORD"
|
echo " $NEW_USER_PASSWORD"
|
||||||
|
|
||||||
echo ''
|
echo ''
|
||||||
|
@ -226,11 +226,19 @@ if [ -f ~/.initial_setup ]; then
|
||||||
fi
|
fi
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat >> $rootdir/home/root/.bashrc <<EOF
|
cat >> $rootdir/home/root/.bashrc <<EOF
|
||||||
# initial setup of the system
|
# initial setup of the system
|
||||||
if [ -f ~/.initial_setup ]; then
|
if [ -f ~/.initial_setup ]; then
|
||||||
|
EOF
|
||||||
|
echo -n " echo \"${MY_USERNAME}:" >> /home/root/.bashrc
|
||||||
|
echo -n '$(cat /home/' >> /home/root/.bashrc
|
||||||
|
echo "${MY_USERNAME}/login.txt)\"|chpasswd" >> /home/root/.bashrc
|
||||||
|
cat >> $rootdir/home/root/.bashrc <<EOF
|
||||||
freedombone menuconfig
|
freedombone menuconfig
|
||||||
rm ~/.initial_setup
|
rm ~/.initial_setup
|
||||||
|
EOF
|
||||||
|
echo " shred -zu /home/${MY_USERNAME}/login.txt" >> $rootdir/home/root/.bashrc
|
||||||
|
cat >> $rootdir/home/root/.bashrc <<EOF
|
||||||
fi
|
fi
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue