homeserver.html 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  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-04 Mon 18:33 -->
  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. 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.
  180. </p>
  181. <div class="org-src-container">
  182. <pre class="src src-bash">freedombone-client
  183. </pre>
  184. </div>
  185. <div class="figure">
  186. <p><img src="images/tor_onion.jpg" alt="tor_onion.jpg" width="80%" align="center" />
  187. </p>
  188. </div>
  189. <p>
  190. 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>.
  191. </p>
  192. <p>
  193. 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>).
  194. </p>
  195. <p>
  196. 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>.
  197. </p>
  198. <div class="figure">
  199. <p><img src="images/beaglebone_black9.jpg" alt="beaglebone_black9.jpg" width="80%" align="center" />
  200. </p>
  201. </div>
  202. <p>
  203. 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.
  204. </p>
  205. <p>
  206. List what drives are on your system with:
  207. </p>
  208. <div class="org-src-container">
  209. <pre class="src src-bash">ls /dev/sd*
  210. </pre>
  211. </div>
  212. <p>
  213. Now plug in the USB thumb drive, and do the same again. Notice which drive letter gets added.
  214. </p>
  215. <p>
  216. 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>).
  217. </p>
  218. <div class="org-src-container">
  219. <pre class="src src-bash">dd if=/dev/zero of=/dev/sdX bs=32M count=8
  220. dd bs=32M if=myimagefile.img of=/dev/sdX conv=fdatasync,sync,noerror
  221. </pre>
  222. </div>
  223. <p>
  224. 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.
  225. </p>
  226. <p>
  227. As the system boots for the first time the login is:
  228. </p>
  229. <div class="org-src-container">
  230. <pre class="src src-bash">username: fbone
  231. password: freedombone
  232. </pre>
  233. </div>
  234. <p>
  235. 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:
  236. </p>
  237. <div class="org-src-container">
  238. <pre class="src src-bash">ssh fbone@freedombone.local -p 2222
  239. </pre>
  240. </div>
  241. <p>
  242. Using the initial password "<i>freedombone</i>".
  243. </p>
  244. <p>
  245. 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.
  246. </p>
  247. <p>
  248. 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.
  249. </p>
  250. <p>
  251. When it's installed on your local system open a terminal and verify the ssh server key hash with:
  252. </p>
  253. <div class="org-src-container">
  254. <pre class="src src-bash">freedombone-client --verify
  255. </pre>
  256. </div>
  257. <p>
  258. This will show the hash code for the public ssh key of the Freedombone system.
  259. </p>
  260. <div class="figure">
  261. <p><img src="images/ssh_key_verify.jpg" alt="ssh_key_verify.jpg" width="80%" align="center" />
  262. </p>
  263. </div>
  264. <p>
  265. Open another terminal window then run:
  266. </p>
  267. <div class="org-src-container">
  268. <pre class="src src-bash">freedombone-client
  269. ssh myusername@freedombone.local -p 2222
  270. </pre>
  271. </div>
  272. <p>
  273. Use the password you wrote down earlier to log in. Select the <b>administrator control panel</b> with up and down cursor keys, space bar and enter key. You should see something like this, and you might need to re-enter your password.
  274. </p>
  275. <div class="figure">
  276. <p><img src="images/controlpanel/control_panel.jpg" alt="control_panel.jpg" width="80%" align="center" />
  277. </p>
  278. </div>
  279. <p>
  280. Then select <b>About</b>. You'll see a list of sites and their onion addresses.
  281. </p>
  282. <div class="figure">
  283. <p><img src="images/controlpanel/control_panel_about.jpg" alt="control_panel_about.jpg" width="100%" align="center" />
  284. </p>
  285. </div>
  286. <p>
  287. 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.
  288. </p>
  289. <p>
  290. 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.
  291. </p>
  292. <p>
  293. 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>.
  294. </p>
  295. <div class="figure">
  296. <p><img src="images/controlpanel/control_panel_apps.jpg" alt="control_panel_apps.jpg" width="80%" align="center" />
  297. </p>
  298. </div>
  299. <p>
  300. 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>.
  301. </p>
  302. <p>
  303. <b>Congratulations! You have now become a citizen of the free internet.</b>
  304. </p>
  305. <p>
  306. <b>Use your new powers wisely.</b>
  307. </p>
  308. <p>
  309. 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:
  310. </p>
  311. <div class="org-src-container">
  312. <pre class="src src-bash">man freedombone-image
  313. </pre>
  314. </div>
  315. <div class="figure">
  316. <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>
  317. </p>
  318. </div>
  319. </div>
  320. </div>
  321. </div>
  322. <div id="postamble" class="status">
  323. <style type="text/css">
  324. .back-to-top {
  325. position: fixed;
  326. bottom: 2em;
  327. right: 0px;
  328. text-decoration: none;
  329. color: #000000;
  330. background-color: rgba(235, 235, 235, 0.80);
  331. font-size: 12px;
  332. padding: 1em;
  333. display: none;
  334. }
  335. .back-to-top:hover {
  336. background-color: rgba(135, 135, 135, 0.50);
  337. }
  338. </style>
  339. <div class="back-to-top">
  340. <a href="#top">Back to top</a> | <a href="mailto:bob@freedombone.net">E-mail me</a>
  341. </div>
  342. </div>
  343. </body>
  344. </html>