Create a master password for root
This commit is contained in:
parent
ca7b84be97
commit
4f752ec349
|
@ -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}
|
||||
|
|
Loading…
Reference in New Issue