backups.html 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  3. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  5. <head>
  6. <title></title>
  7. <!-- 2018-04-12 Thu 12:47 -->
  8. <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
  9. <meta name="generator" content="Org-mode" />
  10. <meta name="author" content="Bob Mottram" />
  11. <meta name="description" content="How to make backups on Freedombone"
  12. />
  13. <meta name="keywords" content="freedombone, backup" />
  14. <style type="text/css">
  15. <!--/*--><![CDATA[/*><!--*/
  16. .title { text-align: center; }
  17. .todo { font-family: monospace; color: red; }
  18. .done { color: green; }
  19. .tag { background-color: #eee; font-family: monospace;
  20. padding: 2px; font-size: 80%; font-weight: normal; }
  21. .timestamp { color: #bebebe; }
  22. .timestamp-kwd { color: #5f9ea0; }
  23. .right { margin-left: auto; margin-right: 0px; text-align: right; }
  24. .left { margin-left: 0px; margin-right: auto; text-align: left; }
  25. .center { margin-left: auto; margin-right: auto; text-align: center; }
  26. .underline { text-decoration: underline; }
  27. #postamble p, #preamble p { font-size: 90%; margin: .2em; }
  28. p.verse { margin-left: 3%; }
  29. pre {
  30. border: 1px solid #ccc;
  31. box-shadow: 3px 3px 3px #eee;
  32. padding: 8pt;
  33. font-family: monospace;
  34. overflow: auto;
  35. margin: 1.2em;
  36. }
  37. pre.src {
  38. position: relative;
  39. overflow: visible;
  40. padding-top: 1.2em;
  41. }
  42. pre.src:before {
  43. display: none;
  44. position: absolute;
  45. background-color: white;
  46. top: -10px;
  47. right: 10px;
  48. padding: 3px;
  49. border: 1px solid black;
  50. }
  51. pre.src:hover:before { display: inline;}
  52. pre.src-sh:before { content: 'sh'; }
  53. pre.src-bash:before { content: 'sh'; }
  54. pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
  55. pre.src-R:before { content: 'R'; }
  56. pre.src-perl:before { content: 'Perl'; }
  57. pre.src-java:before { content: 'Java'; }
  58. pre.src-sql:before { content: 'SQL'; }
  59. table { border-collapse:collapse; }
  60. caption.t-above { caption-side: top; }
  61. caption.t-bottom { caption-side: bottom; }
  62. td, th { vertical-align:top; }
  63. th.right { text-align: center; }
  64. th.left { text-align: center; }
  65. th.center { text-align: center; }
  66. td.right { text-align: right; }
  67. td.left { text-align: left; }
  68. td.center { text-align: center; }
  69. dt { font-weight: bold; }
  70. .footpara:nth-child(2) { display: inline; }
  71. .footpara { display: block; }
  72. .footdef { margin-bottom: 1em; }
  73. .figure { padding: 1em; }
  74. .figure p { text-align: center; }
  75. .inlinetask {
  76. padding: 10px;
  77. border: 2px solid gray;
  78. margin: 10px;
  79. background: #ffffcc;
  80. }
  81. #org-div-home-and-up
  82. { text-align: right; font-size: 70%; white-space: nowrap; }
  83. textarea { overflow-x: auto; }
  84. .linenr { font-size: smaller }
  85. .code-highlighted { background-color: #ffff00; }
  86. .org-info-js_info-navigation { border-style: none; }
  87. #org-info-js_console-label
  88. { font-size: 10px; font-weight: bold; white-space: nowrap; }
  89. .org-info-js_search-highlight
  90. { background-color: #ffff00; color: #000000; font-weight: bold; }
  91. /*]]>*/-->
  92. </style>
  93. <link rel="stylesheet" type="text/css" href="freedombone.css" />
  94. <script type="text/javascript">
  95. /*
  96. @licstart The following is the entire license notice for the
  97. JavaScript code in this tag.
  98. Copyright (C) 2012-2013 Free Software Foundation, Inc.
  99. The JavaScript code in this tag is free software: you can
  100. redistribute it and/or modify it under the terms of the GNU
  101. General Public License (GNU GPL) as published by the Free Software
  102. Foundation, either version 3 of the License, or (at your option)
  103. any later version. The code is distributed WITHOUT ANY WARRANTY;
  104. without even the implied warranty of MERCHANTABILITY or FITNESS
  105. FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
  106. As additional permission under GNU GPL version 3 section 7, you
  107. may distribute non-source (e.g., minimized or compacted) forms of
  108. that code without the copy of the GNU GPL normally required by
  109. section 4, provided you include this license notice and a URL
  110. through which recipients can access the Corresponding Source.
  111. @licend The above is the entire license notice
  112. for the JavaScript code in this tag.
  113. */
  114. <!--/*--><![CDATA[/*><!--*/
  115. function CodeHighlightOn(elem, id)
  116. {
  117. var target = document.getElementById(id);
  118. if(null != target) {
  119. elem.cacheClassElem = elem.className;
  120. elem.cacheClassTarget = target.className;
  121. target.className = "code-highlighted";
  122. elem.className = "code-highlighted";
  123. }
  124. }
  125. function CodeHighlightOff(elem, id)
  126. {
  127. var target = document.getElementById(id);
  128. if(elem.cacheClassElem)
  129. elem.className = elem.cacheClassElem;
  130. if(elem.cacheClassTarget)
  131. target.className = elem.cacheClassTarget;
  132. }
  133. /*]]>*///-->
  134. </script>
  135. </head>
  136. <body>
  137. <div id="preamble" class="status">
  138. <a name="top" id="top"></a>
  139. </div>
  140. <div id="content">
  141. <h1 class="title"></h1>
  142. <div class="figure">
  143. <p><img src="images/logo.png" alt="logo.png" width="80%" height="10%" align="center" />
  144. </p>
  145. </div>
  146. <div id="outline-container-sec-1" class="outline-2">
  147. <h2 id="sec-1">Backups</h2>
  148. <div class="outline-text-2" id="text-1">
  149. <div class="center">
  150. <table border="-1" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
  151. <colgroup>
  152. <col class="left" />
  153. </colgroup>
  154. <tbody>
  155. <tr>
  156. <td class="left"><a href="#sec-2">Backup keys</a></td>
  157. </tr>
  158. <tr>
  159. <td class="left"><a href="#sec-3">Backup to USB</a></td>
  160. </tr>
  161. <tr>
  162. <td class="left"><a href="#sec-4">Restore from USB</a></td>
  163. </tr>
  164. <tr>
  165. <td class="left"><a href="#sec-5">Distributed/remote backups</a></td>
  166. </tr>
  167. <tr>
  168. <td class="left"><a href="#sec-6">Restore from a friend</a></td>
  169. </tr>
  170. </tbody>
  171. </table>
  172. </div>
  173. </div>
  174. </div>
  175. <div id="outline-container-sec-2" class="outline-2">
  176. <h2 id="sec-2">Backup keys</h2>
  177. <div class="outline-text-2" id="text-2">
  178. <p>
  179. As part of the Freedombone installation the GPG key used to encrypt backups will have been added to the <i>.gnupg</i> keyring in your home directory. Ensure that you have a copy of all your keys by plugging in a LUKS encrypted USB drive and then running the commands:
  180. </p>
  181. <div class="org-src-container">
  182. <pre class="src src-bash">ssh username@domainname -p 2222
  183. </pre>
  184. </div>
  185. <p>
  186. Select <i>Administrator controls</i> then <i>Backup and Restore</i> then <i>Backup GPG key to USB drive (master keydrive)</i>.
  187. </p>
  188. <p>
  189. Keep this USB drive in some safe place, since it will enable you to restore from previous backups.
  190. </p>
  191. <p>
  192. A pro-tip for the best possible security is to create multiple USB drives containing key fragments (fragment keydrive), and then to distribute them amongst your friends. In the worst case just ask for the drives back and you'll be able to reconstruct the backup key. You can do this by selecting <i>fragment keydrive</i> and then repeating the process with a number of different USB drives (typically 4 or more).
  193. </p>
  194. </div>
  195. </div>
  196. <div id="outline-container-sec-3" class="outline-2">
  197. <h2 id="sec-3">Backup to USB</h2>
  198. <div class="outline-text-2" id="text-3">
  199. <p>
  200. First and foremost - <b>encrypt your USB drives</b>! Even if you think you have "<i>nothing to hide</i>" 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 <i>Disk Utility</i> application. Some instructions <a href="https://help.ubuntu.com/community/EncryptedFilesystemsOnRemovableStorage">can be found here</a>.
  201. </p>
  202. <p>
  203. Insert a USB thumb drive into the front socket of the Beaglebone Black.
  204. </p>
  205. <p>
  206. Log into the system and become the root user, then run the <i>backup</i> command.
  207. </p>
  208. <div class="org-src-container">
  209. <pre class="src src-bash">ssh username@domainname -p 2222
  210. </pre>
  211. </div>
  212. <p>
  213. Select <i>Administrator controls</i> then <i>Backup and Restore</i> and then <i>Backup data to USB drive</i>.
  214. </p>
  215. <p>
  216. Type in the LUKS password for the USB drive, then the backup will begin.
  217. </p>
  218. <p>
  219. 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.
  220. </p>
  221. </div>
  222. </div>
  223. <div id="outline-container-sec-4" class="outline-2">
  224. <h2 id="sec-4">Restore from USB</h2>
  225. <div class="outline-text-2" id="text-4">
  226. <p>
  227. Log into the system and become the root user:
  228. </p>
  229. <div class="org-src-container">
  230. <pre class="src src-bash">ssh username@domainname -p 2222
  231. </pre>
  232. </div>
  233. <p>
  234. Select <i>Administrator controls</i> then if this is a new Freedombone installation then you will first need to restore your backup keys. That can be done by selecting <i>Backup and Restore</i> then <i>Restore GPG key from USB keydrive</i>. When that's done remove the keydrive and plug in the backup drive.
  235. </p>
  236. <p>
  237. Select <i>Backup and Restore</i> then <i>Restore data from USB drive</i>.
  238. </p>
  239. <p>
  240. Enter the LUKS password for the USB drive. When the restore is complete you can remove the USB drive.
  241. </p>
  242. </div>
  243. </div>
  244. <div id="outline-container-sec-5" class="outline-2">
  245. <h2 id="sec-5">Distributed/remote backups</h2>
  246. <div class="outline-text-2" id="text-5">
  247. <p>
  248. 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.
  249. </p>
  250. <p>
  251. 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 control panel on a Freedombone system or with the <b>adduser &lt;username&gt;</b> command on any other system when logged in as root and then give you the username and password via a secure method, such as on paper, via an encrypted email, Tox or via an XMPP chat using OpenPGP/OMEMO. 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 not be easy. Also for maximum resilience put your password manager file onto a USB thumb drive and carry it with you.
  252. </p>
  253. <div class="org-src-container">
  254. <pre class="src src-bash">ssh username@domainname -p 2222
  255. </pre>
  256. </div>
  257. <p>
  258. Select <i>Administrator controls</i> then <i>Backup and Restore</i> then <i>Configure remote backups</i>.
  259. </p>
  260. <p>
  261. 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.
  262. </p>
  263. </div>
  264. </div>
  265. <div id="outline-container-sec-6" class="outline-2">
  266. <h2 id="sec-6">Restore from a friend</h2>
  267. <div class="outline-text-2" id="text-6">
  268. </div><div id="outline-container-sec-6-1" class="outline-3">
  269. <h3 id="sec-6-1">With a completely new Freedombone installation</h3>
  270. <div class="outline-text-3" id="text-6-1">
  271. <p>
  272. 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 on a USB thumb drive.
  273. </p>
  274. <p>
  275. First log in and if you don't already have one then create a new friends list:
  276. </p>
  277. <div class="org-src-container">
  278. <pre class="src src-bash">ssh username@domainname -p 2222
  279. </pre>
  280. </div>
  281. <p>
  282. Select <i>Administrator controls</i> then <i>Backup and Restore</i> then <i>Restore GPG key from USB (master keydrive)</i>. Select the username then plug in your keydrive and restore the key.
  283. </p>
  284. <p>
  285. Now select <i>Configure remote backups</i> and configure the locations and logins for the remote server.
  286. </p>
  287. <p>
  288. Finally select <i>Restore from remote backup</i> and enter the domain name of the remote server that you wish to restore from.
  289. </p>
  290. </div>
  291. </div>
  292. <div id="outline-container-sec-6-2" class="outline-3">
  293. <h3 id="sec-6-2">On an existing Freedombone installation</h3>
  294. <div class="outline-text-3" id="text-6-2">
  295. <p>
  296. This is for more common situations in which maybe some data became corrupted and you want to restore it.
  297. </p>
  298. <p>
  299. Log in as root:
  300. </p>
  301. <div class="org-src-container">
  302. <pre class="src src-bash">ssh username@domainname -p 2222
  303. </pre>
  304. </div>
  305. <p>
  306. Select <i>Administrator controls</i> then <i>Backup and Restore</i> then <i>Restore from remote backup</i> and enter the domain name of the remote server that you wish to restore from.
  307. </p>
  308. <div class="export">
  309. <p>
  310. &lt;center&gt;
  311. Return to the &lt;a href="index.html"&gt;home page&lt;/a&gt;
  312. &lt;/center&gt;
  313. </p>
  314. </div>
  315. </div>
  316. </div>
  317. </div>
  318. </div>
  319. <div id="postamble" class="status">
  320. <style type="text/css">
  321. .back-to-top {
  322. position: fixed;
  323. bottom: 2em;
  324. right: 0px;
  325. text-decoration: none;
  326. color: #000000;
  327. background-color: rgba(235, 235, 235, 0.80);
  328. font-size: 12px;
  329. padding: 1em;
  330. display: none;
  331. }
  332. .back-to-top:hover {
  333. background-color: rgba(135, 135, 135, 0.50);
  334. }
  335. </style>
  336. <div class="back-to-top">
  337. <a href="#top">Back to top</a> | <a href="mailto:bob@freedombone.net">E-mail me</a>
  338. </div>
  339. </div>
  340. </body>
  341. </html>