Don't delete keys from USB drive

This commit is contained in:
Bob Mottram 2015-07-05 11:56:04 +01:00
parent 1604af36b8
commit 0aa61984b0
1 changed files with 3 additions and 13 deletions

View File

@ -4616,14 +4616,9 @@ function search_for_attached_usb_drive {
cp -r $USB_MOUNT/.gnupg /home/$MY_USERNAME
chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.gnupg
GPG_KEYS_IMPORTED="yes"
if [ -f /home/$MY_USERNAME/.gnupg/secring.gpg ]; then
shred -zu $USB_MOUNT/.gnupg/secring.gpg
shred -zu $USB_MOUNT/.gnupg/random_seed
shred -zu $USB_MOUNT/.gnupg/trustdb.gpg
rm -rf $USB_MOUNT/.gnupg
else
if [ ! -f /home/$MY_USERNAME/.gnupg/secring.gpg ]; then
echo 'GPG files did not copy'
exit 7
exit 73529
fi
fi
@ -4654,12 +4649,7 @@ function search_for_attached_usb_drive {
cp -r $USB_MOUNT/.ssh /home/$MY_USERNAME
chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.ssh
# for security delete the ssh keys from the usb drive
if [ -f /home/$MY_USERNAME/.ssh/id_rsa ]; then
shred -zu $USB_MOUNT/.ssh/id_rsa
shred -zu $USB_MOUNT/.ssh/id_rsa.pub
shred -zu $USB_MOUNT/.ssh/known_hosts
rm -rf $USB_MOUNT/.ssh
else
if [ ! -f /home/$MY_USERNAME/.ssh/id_rsa ]; then
echo 'ssh files did not copy'
exit 8
fi