Create a master password for root

This commit is contained in:
Bob Mottram 2016-12-04 10:09:41 +00:00
parent ca7b84be97
commit 4f752ec349
1 changed files with 12 additions and 0 deletions

View File

@ -277,6 +277,18 @@ if [ ! -d /home/$CURR_USERNAME ]; then
fi
fi
if [[ "$CURR_USERNAME" == "root" ]]; then
if [ ! -d /root/.passwords/root ]; then
mkdir -p /root/.passwords/root
fi
if [ ! -f /root/.passwords/root/master ]; then
MASTER_PASSWORD=$(openssl rand -base64 32 | cut -c1-30)
echo "$MASTER_PASSWORD" > /root/.passwords/root/master
chmod 700 /root/.passwords/root/master
fi
MASTER_PASSWORD=$(cat /root/.passwords/root/master)
fi
if [ ${REMOVE_APP} ]; then
if [ -d ~/.passwords/${CURR_USERNAME}/${REMOVE_APP} ]; then
shred -zu ~/.passwords/${CURR_USERNAME}/${REMOVE_APP}