Skip to content

Instantly share code, notes, and snippets.

@erdii
Created May 12, 2017 19:51
Show Gist options
  • Save erdii/ba46fb134a4fd5b15a9f11c928022683 to your computer and use it in GitHub Desktop.
Save erdii/ba46fb134a4fd5b15a9f11c928022683 to your computer and use it in GitHub Desktop.
A crude encrypted backup on s3

encrypted backup to s3

init encfs

  • first time mounting with
    • encfs --reverse /path/to/backup /tmp/encrypted-s3-backup
  • i choose this settings:
    • x - expert mode
    • AES encryption - 256 bit keysize
    • 1024 bytes blocksize
    • Block filename encryption - SECURE??
    • per-file initialization vectors
  • unmount the encrypted view with
    • `fusermount -u /tmp/encrypted-s3-backup
  • important: you need to store your password AND the file .encfs6.xml in /path/to/backup to recover your data!!!

backing up files

  • mount the encrypted view with
    • encfs --reverse /path/to/backup /tmp/encrypted-s3-backup
  • back up the encrypted files with:
    • `s3cmd sync /tmp/encrypted-s3-backup s3://your-bucket-id --exclude ".encfs6.xml"

restoring the backup

  • download the encrypted backup with:
    • s3cmd sync s3://your-bucket-id /tmp/encrypted-s3-backup
  • drop your stored .encfs6.xml into /tmp/encrypted-s3-backup
  • mount the decrypted view with:
    • encfs /tmp/encrypted-s3-backup /tmp/decrypted-s3-backup
  • you can now access the decrypted data in /tmp/decrypted-s3-backup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment