homeserver.html 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  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-06-16 Sat 21:53 -->
  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="Freedombone home server setup"
  12. />
  13. <meta name="keywords" content="freedombone, home server" />
  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">Home Server</h2>
  148. <div class="outline-text-2" id="text-1">
  149. <p>
  150. The quickest way to get started is as follows. You will need to be running a Debian based system (version 8 or later), have an old but still working laptop or netbook which you can use as a server, and 8GB or larger USB thumb drive and an ethernet cable to connect the laptop to your internet router.
  151. </p>
  152. <p>
  153. First install freedombone onto your local system (not the target hardware that you want to run Freedombone on). On a debian based distro:
  154. </p>
  155. <div class="org-src-container">
  156. <pre class="src src-bash">sudo apt-get install git dialog build-essential
  157. git clone https://code.freedombone.net/bashrc/freedombone
  158. cd freedombone
  159. git checkout stretch
  160. sudo make install
  161. freedombone-image --setup debian
  162. freedombone-image -t i386 --onion-addresses-only yes
  163. </pre>
  164. </div>
  165. <p>
  166. Or on Arch/Parabola:
  167. </p>
  168. <div class="org-src-container">
  169. <pre class="src src-bash">sudo pacman -S git dialog
  170. git clone https://code.freedombone.net/bashrc/freedombone
  171. cd freedombone
  172. git checkout stretch
  173. sudo make install
  174. freedombone-image --setup parabola
  175. freedombone-image -t i386 --onion-addresses-only yes
  176. </pre>
  177. </div>
  178. <p>
  179. If you can't obtain a copy of the source code from <b>code.freedombone.net</b> (maybe the server is down) then you may still be able to obtain it with:
  180. </p>
  181. <div class="org-src-container">
  182. <pre class="src src-bash">dat clone dat://e9cbf606e55cdaa85199f4e6ec25ff7456775389979a668b3faf33e057493f8e/
  183. cd e9cbf606e55cdaa85199f4e6ec25ff7456775389979a668b3faf33e057493f8e
  184. tar -xzvf freedombone.tar.gz
  185. cd freedombone
  186. git checkout stretch
  187. </pre>
  188. </div>
  189. <p>
  190. Now prepare your local system to talk to the freedombone by running the following command. This will set up avahi and create ssh keys if necessary.
  191. </p>
  192. <div class="org-src-container">
  193. <pre class="src src-bash">freedombone-client
  194. </pre>
  195. </div>
  196. <div class="figure">
  197. <p><img src="images/tor_onion.jpg" alt="tor_onion.jpg" width="80%" align="center" />
  198. </p>
  199. </div>
  200. <p>
  201. The version in which sites are available only via onion addresses is the easiest to get started with, since you can evaluate the system without committing to buying an ICANN domain name or needing to get involved with SSL/TLS certificates at all. However, if you do want your sites to be available typically as subdomains of a domain name which you own then remove the <b>&#x2013;onion-addresses-only yes</b> option from the last command shown above. Also see the <a href="./domains.html">guide on setting up an ICANN domain name</a>.
  202. </p>
  203. <p>
  204. The <b>onion-addresses-only</b> option <b>does not</b> mean that everything gets routed through Tor. It's intended to provide accessible web apps with minimum fuss and without needing to buy a clearnet domain name or mess with forwarding ports. Using apps via their onion addresses may provide some degree of anonymity but it may not be perfect and anonymity isn't the aim of this system (if you want that then use <a href="https://tails.boum.org/">TAILS</a>).
  205. </p>
  206. <p>
  207. If you want to create images for microSD cards used within various single board computers then replace the <b>i386</b> with <b>beaglebone</b> / <b>cubieboard2</b> / <b>cubietruck</b> / <b>a20-olinuxino-lime</b> / <b>a20-olinuxino-lime2</b> / <b>a20-olinuxino-micro</b> or <b>apu</b>.
  208. </p>
  209. <div class="figure">
  210. <p><img src="images/beaglebone_black9.jpg" alt="beaglebone_black9.jpg" width="80%" align="center" />
  211. </p>
  212. </div>
  213. <p>
  214. This takes a while. Maybe an hour or so, depending on the speed of your system and the internets. The good news though is that once created you can use the resulting image any number of times, and you don't need to trust some pre-built image.
  215. </p>
  216. <p>
  217. List what drives are on your system with:
  218. </p>
  219. <div class="org-src-container">
  220. <pre class="src src-bash">ls /dev/sd*
  221. </pre>
  222. </div>
  223. <p>
  224. Now plug in the USB thumb drive, and do the same again. Notice which drive letter gets added.
  225. </p>
  226. <p>
  227. You can now copy the image to the USB thumb drive, replacing <b>sdX</b> with the identifier of the USB thumb drive. Don't include any numbers (so for example use <b>sdc</b> instead of <b>sdc1</b>).
  228. </p>
  229. <div class="org-src-container">
  230. <pre class="src src-bash">dd if=/dev/zero of=/dev/sdX bs=32M count=8
  231. dd bs=32M if=myimagefile.img of=/dev/sdX conv=fdatasync,sync,noerror
  232. </pre>
  233. </div>
  234. <p>
  235. And wait. Again it will take a while to copy over. When that's done plug it into the laptop or netbook which you want to use as a server, power on and set the BIOS to boot from the USB stick.
  236. </p>
  237. <p>
  238. As the system boots for the first time the login is:
  239. </p>
  240. <div class="org-src-container">
  241. <pre class="src src-bash">username: fbone
  242. password: freedombone
  243. </pre>
  244. </div>
  245. <p>
  246. If you're installing from a microSD card on a single board computer without a screen and keyboard attached then you can ssh into it with:
  247. </p>
  248. <div class="org-src-container">
  249. <pre class="src src-bash">ssh fbone@freedombone.local -p 2222
  250. </pre>
  251. </div>
  252. <p>
  253. Using the initial password "<i>freedombone</i>".
  254. </p>
  255. <p>
  256. You will then be shown a new randomly generated password. It's <b>very important</b> that you write this down somewhere before going further, because you'll need this to log in later.
  257. </p>
  258. <p>
  259. You'll be asked to set a username and a "real" name (or nickname), then the rest of the installation will be automatic. Again, it takes a while, so go and do something less boring instead. At the end of the base install you can also choose to install specific apps, but if you want to do that later then just press Enter.
  260. </p>
  261. <p>
  262. When it's installed on your local system open a terminal and verify the ssh server key hash with:
  263. </p>
  264. <div class="org-src-container">
  265. <pre class="src src-bash">freedombone-client --verify
  266. </pre>
  267. </div>
  268. <p>
  269. This will show the hash code for the public ssh key of the Freedombone system.
  270. </p>
  271. <div class="figure">
  272. <p><img src="images/ssh_key_verify.jpg" alt="ssh_key_verify.jpg" width="80%" align="center" />
  273. </p>
  274. </div>
  275. <p>
  276. Open another terminal window then run:
  277. </p>
  278. <div class="org-src-container">
  279. <pre class="src src-bash">freedombone-client
  280. ssh myusername@freedombone.local -p 2222
  281. </pre>
  282. </div>
  283. <p>
  284. Use the password you wrote down earlier to log in. Select the <b>administrator control panel</b> with up and down cursor keys and enter key. You should see something like this, and you might need to re-enter your password.
  285. </p>
  286. <div class="figure">
  287. <p><img src="images/controlpanel/control_panel.jpg" alt="control_panel.jpg" width="80%" align="center" />
  288. </p>
  289. </div>
  290. <p>
  291. Then select <b>About</b>. You'll see a list of sites and their onion addresses.
  292. </p>
  293. <div class="figure">
  294. <p><img src="images/controlpanel/control_panel_about.jpg" alt="control_panel_about.jpg" width="100%" align="center" />
  295. </p>
  296. </div>
  297. <p>
  298. The About screen contains the ssh server public key hashes and you can compare the relevant one with the previous terminal window to verify that they're the same. If they're not then you might have a <i>machine-in-the-middle</i> snooping on you.
  299. </p>
  300. <p>
  301. You have now confirmed a secure connection. Probably. If you're still sceptical then you can power off the system, remove the microSD card and manually check the public keys within the /etc/ssh directory on the drive.
  302. </p>
  303. <p>
  304. Press any key to exit from the About screen. You can then select <b>Add/Remove apps</b> and add whatever applications you wish to run. Note that some apps will only run on x86 systems, but most will install and run on ARM single board computers. More details on particular apps can be <a href="./apps.html">found here</a>.
  305. </p>
  306. <div class="figure">
  307. <p><img src="images/controlpanel/control_panel_apps.jpg" alt="control_panel_apps.jpg" width="80%" align="center" />
  308. </p>
  309. </div>
  310. <p>
  311. Once your apps have installed you can go back to the About screen, pick an onion address and try it within a Tor compatible browser. You'll need to know the login passwords and those can be found within the <i>Passwords</i> section of the administrator control panel. An axiom of the Freedombone system is that <i>if given the choice users will usually use insecure passwords</i>, so on this system passwords are generated randomly. If you need to then you can transfer the passwords into your favourite password manager and remove them from the server by going to the <b>Security Settings</b> section of the administrator control panel and choosing <b>Export passwords</b> and <b>Password storage</b>.
  312. </p>
  313. <p>
  314. <b>Congratulations! You have now become a citizen of the free internet.</b>
  315. </p>
  316. <p>
  317. <b>Use your new powers wisely.</b>
  318. </p>
  319. <p>
  320. Of course, this is just one way in which you can install the Freedombone system. If you have a single board computer (SBC) such as a <a href="./beaglebone.html">BeagleBone Black</a> or OLinuxino you can make disk images for those too. You can even create clearnet sites if you have your own domain name. ARM boards with closed proprietary boot blobs are not supported. For more details run:
  321. </p>
  322. <div class="org-src-container">
  323. <pre class="src src-bash">man freedombone-image
  324. </pre>
  325. </div>
  326. <div class="figure">
  327. <p><a href="fdl-1.3.txt" width="10%" height="2%" align="center"><img src="images/gfdl.png" alt="gfdl.png" width="10%" height="2%" align="center" /></a>
  328. </p>
  329. </div>
  330. </div>
  331. </div>
  332. </div>
  333. <div id="postamble" class="status">
  334. <style type="text/css">
  335. .back-to-top {
  336. position: fixed;
  337. bottom: 2em;
  338. right: 0px;
  339. text-decoration: none;
  340. color: #000000;
  341. background-color: rgba(235, 235, 235, 0.80);
  342. font-size: 12px;
  343. padding: 1em;
  344. display: none;
  345. }
  346. .back-to-top:hover {
  347. background-color: rgba(135, 135, 135, 0.50);
  348. }
  349. </style>
  350. <div class="back-to-top">
  351. <a href="#top">Back to top</a> | <a href="mailto:bob@freedombone.net">E-mail me</a>
  352. </div>
  353. </div>
  354. </body>
  355. </html>