Skip to content

Instantly share code, notes, and snippets.

@t3h2mas
Created November 14, 2016 17:33
Show Gist options
  • Save t3h2mas/0a98b4148459b8d0f55c91ca31ac634f to your computer and use it in GitHub Desktop.
Save t3h2mas/0a98b4148459b8d0f55c91ca31ac634f to your computer and use it in GitHub Desktop.
#!/bin/sh
BACKUP_NAME=dot-ssh-$(date +%Y-%m-%d).tar.gz
echo "[*] compressing ~/.ssh/ to ./$BACKUP_NAME"
tar czf $BACKUP_NAME ~/.ssh
echo "[*] the following files were backed up"
tar -tvf $BACKUP_NAME
echo "[*] encrypting the archive using des3"
openssl enc -des3 -in $BACKUP_NAME -out $BACKUP_NAME.enc
echo "[*] removing unencrypted archive"
rm -v $BACKUP_NAME
echo "[*] take note: use the following command to decrypt the file"
echo "openssl enc -des3 -d -in $BACKUP_NAME.enc > $BACKUP_NAME"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment