PDA

View Full Version : How to backup to remote server secure like rsync



Fli
05-04-2014, 07:53 PM
How one can backup certain folder to remote linux server while encrypting data so no one can read them at remote server in one fcking command?

----
Duplicity (man page (http://internetlifeforum.com/security-protection/1900-duplicity-full-man-page)) can be used for this purpose.

Official page: http://duplicity.nongnu.org/index.html

Positives: based on rsync, incremental by default, allows pgp encryption on the fly, support scp and ftp
Negatives: epel (redhat) repository is needed on CentOS

Installation:

Option A)

Open http://pkgs.repoforge.org/duplicity/ and copy package url which fits your linux centos version ("uname -a" to get version)

wget packageurl

install rpm

rpm -ivh downloadedpackagename

complaining about Failed dependencies? Try to add option "--nodeps" to rpm command

Option B)

DL & Install EPEL redhat software repository (http://www.rackspace.com/knowledge_center/article/installing-rhel-epel-repo-on-centos-5x-or-6x) which includes Duplicity and then use "yum install duplicity" to install it.

complaining about Failed dependencies? Try to add option "--skip-broken" to yum command

Usage

One time Generate GPG key to use for encryption/decryption

gpg --gen-key
and save it to safe place on your server + on another safe external place

Backup command SCP:

duplicity /home/me scp://[email protected]//usr/backup

Restore command SCP:

duplicity scp://[email protected]//usr/backup restored_dir

Backup command SCP + encryption

duplicity --encrypt-key="YOUR-KEY" /home scp://[email protected]/directory

Restore command SCP + decryption

duplicity --encrypt-key="YOUR-KEY" scp://[email protected]/directory /home

Backup command FTP:

FTP_PASSWORD=mypassword duplicity /home/me ftp://[email protected]/ftp_dir

Duplicity manual page: http://internetlifeforum.com/security-protection/1900-duplicity-full-man-page