Remember that you should have backups for your servers or web site. If a disaster strikes you can restore the data quickly and easily – you should keep the backup files SAFE, because backup usually includes system configuration, users, passwords and various other very important data. And by safe we mean that none except you can access it. We usually keep backup files on a remote server(s) to make sure no data backups are kept in one physical location.
For extra security we do encrypt backup files using gpg (Gnu Privacy Guard) a Linux command line software in our case. Gpg provides very high security level and encryption.
You can encrypt file using GPG:
gpg -c filename.tar
<enter password 2 x times>
If you are running gpg command first time a key may be generated before you can enter the password.
File unencryption can be done by:
gpg -c filename.tar.gpg
There you go
For folks who want to encrypt backup files or any other files using automated scripts use the following command:
echo PASSWORD_HERE | gpg –passphrase-fd 0 -c FILENAME_HERE
Filed under: Tips by Linux Admin