freedomboneeee/doc/EN/backups.org

120 lines
5.2 KiB
Org Mode
Raw Normal View History

2014-10-29 20:02:34 +01:00
#+TITLE:
#+AUTHOR: Bob Mottram
#+EMAIL: bob@robotics.uk.to
#+KEYWORDS: freedombox, debian, beaglebone, red matrix, email, web server, home server, internet, censorship, surveillance, social network, irc, jabber
#+DESCRIPTION: Turn the Beaglebone Black into a personal communications server
2015-07-05 20:58:40 +02:00
#+OPTIONS: ^:nil toc:nil
2014-10-29 20:02:34 +01:00
#+BEGIN_CENTER
[[./images/logo.png]]
#+END_CENTER
#+BEGIN_CENTER
#+ATTR_HTML: :border -1
2014-10-29 20:05:44 +01:00
| [[file:index.html][Home]] |
| [[Backup to USB]] |
| [[Restore from USB]] |
| [[Distributed backups]] |
| [[Restore from a friend]] |
2014-10-29 20:02:34 +01:00
#+END_CENTER
* Backup to USB
2015-07-05 21:33:45 +02:00
First and foremost - *encrypt your USB drives*! Even if you think you have "/nothing to hide/" if you accidentally lose a USB thumb drive (it's easy to lose small objects) and it's not encrypted then potentially someone might be able to obtain enough information about you to commit identity fraud, take out loans, open bank accounts, etc. Use LUKS encryption. In Ubuntu you can do this using the /Disk Utility/ application. Some instructions [[https://help.ubuntu.com/community/EncryptedFilesystemsOnRemovableStorage][can be found here]].
2014-10-29 20:02:34 +01:00
Insert a USB thumb drive into the front socket of the Beaglebone Black.
Log into the system and become the root user, then run the /backup/ command.
#+BEGIN_SRC bash
2015-03-02 14:19:02 +01:00
ssh username@domainname -p 2222
2014-10-29 20:02:34 +01:00
su
backup
#+END_SRC
2015-07-05 21:33:45 +02:00
Type in the password for the USB drive, then if this is the first time that you've made a backup then you will be prompted for your GPG key passphrase.
2014-10-29 20:02:34 +01:00
When the backup ends remove the USB drive and keep it somewhere safe. Even if it gets lost or falls into the wrong hands the content is encrypted and so is unlikely to become a source of leaks.
* Restore from USB
Insert the USB thumb drive containing your backup into the front socket of the Beaglebone Black.
Log into the system and become the root user, then run the /restore/ command.
#+BEGIN_SRC bash
2015-03-02 14:19:02 +01:00
ssh username@domainname -p 2222
2014-10-29 20:02:34 +01:00
su
restore
#+END_SRC
2015-07-05 21:33:45 +02:00
Enter the password for the USB drive, then you will be prompted to enter your GPG key passphrase. When the restore is complete you can remove the USB drive.
2014-10-29 20:02:34 +01:00
* Distributed backups
Distributed backups are a better way of ensuring the persistence of your data, such that even if your system gets stolen or destroyed then the data will still be recoverable from your friends. Since the backups are encrypted your friends (or anyone else with access to their systems) won't be able to read your backed up content even if their systems are subsequently compromised.
Firstly you will need to have a user account on one or more of your friends servers. They don't necessarily need to be using Freedombone, just some version of GNU/Linux with ssh access. They can create a user account for you with the *adduser <username>* command when logged in as root and then give you the username and password via a secure method, such as on paper or via an encrypted email or via an XMPP chat using OTR. Make sure that the password used is a strong one - preferably a long random string stored in a password manager - so that dictionary attacks will fail. Also for maximum resilience put your password manager file onto a USB thumb drive and carry it with you.
#+BEGIN_SRC bash
ssh username@domainname -p 2222
2015-04-10 13:56:51 +02:00
freedombone-remote
2014-10-29 20:02:34 +01:00
#+END_SRC
2015-04-10 14:06:07 +02:00
You can then enter the usernames, domains and ssh logins for one or more remote servers. The system will try to backup to these remote locations once per day.
2014-10-29 20:02:34 +01:00
2015-04-10 14:43:45 +02:00
Very important is to take a copy of the contents of *backup.key*.
2014-10-29 20:02:34 +01:00
#+BEGIN_SRC bash
2015-04-10 14:43:45 +02:00
su
cat /etc/ssl/private/backup.key
2014-10-29 20:02:34 +01:00
#+END_SRC
2015-04-10 14:51:33 +02:00
If the backup key doesn't yet exist then you can manually create it with:
#+BEGIN_SRC bash
freedombone-addcert -h backup
#+END_SRC
2015-04-10 14:43:45 +02:00
Store it within a password manager on a USB drive which you carry with you. In the worst case scenario you'll be able to restore your system on completely new hardware if you have this key, so long as at least one of your friends servers is accessable via ssh.
* Restore from a friend
** With a completely new Freedombone installation
This is the ultimate disaster recovery scenario in which you are beginning completely from scratch with new hardware and a new Freedombone installation (configured with the same username and domain names). It is assumed that the old hardware was destroyed, but that you have the backup key stored within a password manager on a USB thumb drive.
First log in and if you don't already have one then create a new friends list:
2014-10-29 20:02:34 +01:00
#+BEGIN_SRC bash
2015-04-10 14:43:45 +02:00
ssh username@domainname -p 2222
freedombone-remote
2014-10-29 20:02:34 +01:00
#+END_SRC
2015-04-10 14:43:45 +02:00
Configure the remote server login details.
2014-10-29 20:02:34 +01:00
2015-04-10 14:43:45 +02:00
Now log in as root and restore the backup key which you have in your password manager.
2014-10-29 20:02:34 +01:00
#+BEGIN_SRC bash
su
2015-04-10 14:43:45 +02:00
editor /etc/ssl/private/backup.key
2014-10-29 20:02:34 +01:00
#+END_SRC
2015-04-10 14:43:45 +02:00
Paste in the backup key, then save and exit.
2014-10-29 20:02:34 +01:00
2015-04-10 14:43:45 +02:00
#+BEGIN_SRC bash
chmod 600 /etc/ssl/private/backup.key
#+END_SRC
2014-10-29 20:02:34 +01:00
Then use the command:
#+BEGIN_SRC bash
restorefromfriend <friends server domain name>
#+END_SRC
** On an existing Freedombone installation
This is for more common situations in which maybe some data became corrupted and you want to restore it.
Log in as root:
#+BEGIN_SRC bash
ssh username@domainname -p 2222
su
#+END_SRC
Then use the command:
#+BEGIN_SRC bash
restorefromfriend <friends server domain name>
#+END_SRC