Enter your email address:

Delivered by FeedBurner

Using scp and duplicity for full security back up


StumbleUpon Toolbar

To be almost 100% that your data is secure, and I said almost because you are never 100% secure!
Ok, Here we will see how to use together ssh (scp) and duplicity to encrypt your backed up data and to copy it to another server using an encrypted tunnel.


Pre-requisites


Your will need:

- gpg
- duplicity
- ssh keys on the backing server http://linux.go2linux.org/node/16


Installing the software


This is tested on Debian and Ubuntu, but should be distro independent
To install duplicity run:

apt-get duplicity


Generating the key

To generate the key you will use for encrypt your backup run:

gpg --gen-key

Enter all the info it asks, and the passphrase, (Do not forget the passphrase or you will never be able to recover your data)


Backup your files to another server

In this example I will back up my home directory into a second server

First we need to see the available keys

gpg --list-key

This could be the output
pub 1024D/87819492 2007-03-18
uid Name Last_Name (Comment)
sub 2048g/2DBF4EB5 2007-03-18

Now export the passphrase to an enviroment variable

export PASSPHRASE=your_passphrase

and run the command to backup

duplicity --encrypt-key "87819492" --sign-key "87819492" /home/user/ scp://user@other.server//home/user/backup/

Restore the backup

duplicity --encrypt-key "87819492" --sign-key "87819492" scp://user@other.server//home/user/backup/ /home/user/

You are done, all your back is secured.

Do not forget the passphrase

Trackback URL for this post:

http://www.go2linux.org/trackback/41
StumbleUpon Toolbar

 If you like this article, subscribe to our full rss

If this article was somehow useful for you, you can leave something in the tip's jar

Please post your question in our forum and use comments only to leave your comments about the article, thanks.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Captcha
This question is for testing whether you are a human visitor and to prevent automated spam submissions.

This site is proudly hosted at Bluefur Hosting