Created
November 14, 2016 17:33
-
-
Save t3h2mas/0a98b4148459b8d0f55c91ca31ac634f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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