Remove keys in a safer way

This commit is contained in:
Bob Mottram 2016-05-07 16:50:00 +01:00
parent 2a9f449460
commit 7ca018673b
1 changed files with 43 additions and 33 deletions

View File

@ -115,6 +115,16 @@ if [ -d /etc/turnserver ]; then
sed -i "/${MY_USERNAME}:/d" /etc/turnserver/turnusers.txt sed -i "/${MY_USERNAME}:/d" /etc/turnserver/turnusers.txt
fi fi
# remove gpg keys
if [ -d /home/$MY_USERNAME/.gnupg ]; then
shred -u /home/$MY_USERNAME/.gnupg/*
fi
# remove ssh keys
if [ -d /home/$MY_USERNAME/.ssh ]; then
shred -u /home/$MY_USERNAME/.ssh/*
fi
userdel -r $MY_USERNAME userdel -r $MY_USERNAME
if [ -d /home/$MY_USERNAME ]; then if [ -d /home/$MY_USERNAME ]; then