encrypted_trisquel.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <style type="text/css">
  7. @import url('../css/main.css');
  8. </style>
  9. <title>Installing Trisquel GNU/Linux with full disk encryption (including /boot)</title>
  10. </head>
  11. <body>
  12. <div class="section">
  13. <h1>Installing Trisquel GNU/Linux with full disk encryption (including /boot)</h1>
  14. <p>
  15. Libreboot uses the GRUB <a href="http://www.coreboot.org/Payloads#GRUB_2">payload</a>
  16. by default, which means that the GRUB configuration file
  17. (where your GRUB menu comes from) is stored directly alongside libreboot
  18. and its GRUB payload executable, inside
  19. the flash chip. In context, this means that installing distributions and managing them
  20. is handled slightly differently compared to traditional BIOS systems.
  21. </p>
  22. <p>
  23. On most systems, the /boot partition has to be left unencrypted while the others are encrypted.
  24. This is so that GRUB, and therefore the kernel, can be loaded and executed since the firmware
  25. can't open a LUKS volume. Not so with libreboot! Since GRUB is already included directly as a
  26. payload, even /boot can be encrypted. This protects /boot from tampering by someone with physical
  27. access to the machine.
  28. </p>
  29. <p>
  30. This works in Trisquel 7, and probably Trisquel 6. Boot the 'net installer' (Install Trisquel in Text Mode).
  31. <a href="grub_boot_installer.html">How to boot a GNU/Linux installer</a>.
  32. </p>
  33. <p><a href="index.html">Back to previous index</a></p>
  34. </div>
  35. <div class="section">
  36. <p>
  37. Set a strong user password (lots of lowercase/uppercase, numbers and symbols).
  38. </p>
  39. <p>
  40. when the installer asks you to set up
  41. encryption (ecryptfs) for your home directory, select 'Yes' if you want to: <b>LUKS is already secure and performs well. Having ecryptfs on top of it
  42. will add noticeable performance penalty, for little security gain in most use cases. This is therefore optional, and not recommended.
  43. Choose 'no'.</b>
  44. </p>
  45. <p>
  46. <b>
  47. Your user password should be different from the LUKS password which you will set later on.
  48. Your LUKS password should, like the user password, be secure.
  49. </b>
  50. </p>
  51. </div>
  52. <div class="section">
  53. <h1>Partitioning</h1>
  54. <p>Choose 'Manual' partitioning:</p>
  55. <ul>
  56. <li>Select drive and create new partition table</li>
  57. <li>
  58. Single large partition. The following are mostly defaults:
  59. <ul>
  60. <li>Use as: physical volume for encryption</li>
  61. <li>Encryption: aes</li>
  62. <li>key size: 256</li>
  63. <li>IV algorithm: xts-plain64</li>
  64. <li>Encryption key: passphrase</li>
  65. <li>erase data: Yes (only choose 'No' if it's a new drive that doesn't contain your private data)</li>
  66. </ul>
  67. </li>
  68. <li>
  69. Select 'configure encrypted volumes'
  70. <ul>
  71. <li>Create encrypted volumes</li>
  72. <li>Select your partition</li>
  73. <li>Finish</li>
  74. <li>Really erase: Yes</li>
  75. <li>(erase will take a long time. be patient)</li>
  76. <li>(if your old system was encrypted, just let this run for about a minute to
  77. make sure that the LUKS header is wiped out)</li>
  78. </ul>
  79. </li>
  80. <li>
  81. Select encrypted space:
  82. <ul>
  83. <li>use as: physical volume for LVM</li>
  84. <li>Choose 'done setting up the partition'</li>
  85. </ul>
  86. </li>
  87. <li>
  88. Configure the logical volume manager:
  89. <ul>
  90. <li>Keep settings: Yes</li>
  91. </ul>
  92. </li>
  93. <li>
  94. Create volume group:
  95. <ul>
  96. <li>Name: <b>grubcrypt</b> (you can use whatever you want here, this is just an example)</li>
  97. <li>Select crypto partition</li>
  98. </ul>
  99. </li>
  100. <li>
  101. Create logical volume
  102. <ul>
  103. <li>select <b>grubcrypt</b> (or whatever you named it before)</li>
  104. <li>name: <b>trisquel</b> (you can use whatever you want here, this is just an example)</li>
  105. <li>size: default, minus 2048 MB</li>
  106. </ul>
  107. </li>
  108. <li>
  109. Create logical volume
  110. <ul>
  111. <li>select <b>grubcrypt</b> (or whatever you named it before)</li>
  112. <li>name: <b>swap</b> (you can use whatever you want here, this is just an example)</li>
  113. <li>size: press enter</li>
  114. </ul>
  115. </li>
  116. </ul>
  117. </div>
  118. <div class="section">
  119. <h1>Further partitioning</h1>
  120. <p>
  121. Now you are back at the main partitioning screen. You will simply set mountpoints and filesystems to use.
  122. </p>
  123. <ul>
  124. <li>
  125. LVM LV trisquel
  126. <ul>
  127. <li>use as: ext4</li>
  128. <li>mount point: /</li>
  129. <li>done setting up partition</li>
  130. </ul>
  131. </li>
  132. <li>
  133. LVM LV swap
  134. <ul>
  135. <li>use as: swap area</li>
  136. <li>done setting up partition</li>
  137. </ul>
  138. </li>
  139. <li>Now you select 'Finished partitioning and write changes to disk'.</li>
  140. </ul>
  141. </div>
  142. <div class="section">
  143. <h1>Kernel</h1>
  144. <p>
  145. Installation will ask what kernel you want to use. linux-generic is fine.
  146. </p>
  147. </div>
  148. <div class="section">
  149. <h1>Tasksel</h1>
  150. <p>
  151. Choose <i>&quot;Trisquel Desktop Environment&quot;</i> if you want GNOME,
  152. <i>&quot;Trisquel-mini Desktop Environment&quot;</i> if you
  153. want LXDE or <i>&quot;Triskel Desktop Environment&quot;</i> if you want KDE.
  154. If you want to have no desktop (just a basic shell)
  155. when you boot or if you want to create your own custom setup, then choose nothing here (don't select anything).
  156. You might also want to choose some of the other package groups; it's up to you.
  157. </p>
  158. </div>
  159. <div class="section">
  160. <h1>Postfix configuration</h1>
  161. <p>
  162. If asked, choose <i>&quot;No Configuration&quot;</i> here (or maybe you want to select something else. It's up to you.)
  163. </p>
  164. </div>
  165. <div class="section">
  166. <h1>Install the GRUB boot loader to the master boot record</h1>
  167. <p>
  168. Choose 'Yes'. It will fail, but don't worry. Then at the main menu, choose 'Continue without a bootloader'.
  169. You could also choose 'No'. Choice is irrelevant here.
  170. </p>
  171. <p>
  172. <i>You do not need to install GRUB at all, since in libreboot you are using the GRUB payload (for libreboot) to boot your system directly.</i>
  173. </p>
  174. </div>
  175. <div class="section">
  176. <h1>Clock UTC</h1>
  177. <p>
  178. Just say 'Yes'.
  179. </p>
  180. </div>
  181. <div class="section">
  182. <h1>
  183. Booting your system
  184. </h1>
  185. <p>
  186. At this point, you will have finished the installation. At your GRUB payload, press C to get to the command line.
  187. </p>
  188. <p>
  189. Do that:<br/>
  190. grub&gt; <b>cryptomount -a (ahci0,msdos1)</b><br/>
  191. grub&gt; <b>set root='lvm/grubcrypt-trisquel'</b><br/>
  192. grub&gt; <b>linux /vmlinuz root=/dev/mapper/grubcrypt-trisquel cryptdevice=/dev/mapper/grubcrypt-trisquel:root</b><br/>
  193. grub&gt; <b>initrd /initrd.img</b><br/>
  194. grub&gt; <b>boot</b>
  195. </p>
  196. </div>
  197. <div class="section">
  198. <h1>
  199. ecryptfs
  200. </h1>
  201. <p>
  202. If you didn't encrypt your home directory, then you can safely ignore this section.
  203. </p>
  204. <p>
  205. Immediately after logging in, do that:<br/>
  206. $ <b>sudo ecryptfs-unwrap-passphrase</b>
  207. </p>
  208. <p>
  209. This will be needed in the future if you ever need to recover your home directory from another system, so write it down and keep the note
  210. somewhere secret. Ideally, you should memorize it and then burn the note (or not even write it down, and memorize it still)>
  211. </p>
  212. </div>
  213. <div class="section">
  214. <h1>
  215. Modify grub.cfg (CBFS)
  216. </h1>
  217. <p>
  218. Now you need to set it up so that the system will automatically boot, without having to type a bunch of commands.
  219. </p>
  220. <p>
  221. Modify your grub.cfg (in the firmware) <a href="grub_cbfs.html">using this tutorial</a>;
  222. just change the default menu entry 'Load Operating System' to say this inside:
  223. </p>
  224. <p>
  225. <b>cryptomount -a (ahci0,msdos1)</b><br/>
  226. <b>set root='lvm/grubcrypt-trisquel'</b><br/>
  227. <b>linux /vmlinuz root=/dev/mapper/grubcrypt-trisquel cryptdevice=/dev/mapper/grubcrypt-trisquel:root</b><br/>
  228. <b>initrd /initrd.img</b>
  229. </p>
  230. <p>
  231. Additionally, you should set a GRUB password. This is not your LUKS password, but it's a password that you have to enter to see
  232. GRUB. This protects your system from an attacker simply booting a live USB and re-flashing your firmware. <b>This should be different than your LUKS passphrase and user password.</b>
  233. </p>
  234. <p>
  235. The GRUB utility can be used like so:<br/>
  236. $ <b>grub-mkpasswd-pbkdf2</b>
  237. </p>
  238. <p>
  239. Give it a password (remember, it has to be secure) and it'll output something like:<br/>
  240. <b>grub.pbkdf2.sha512.10000.711F186347156BC105CD83A2ED7AF1EB971AA2B1EB2640172F34B0DEFFC97E654AF48E5F0C3B7622502B76458DA494270CC0EA6504411D676E6752FD1651E749.8DD11178EB8D1F633308FD8FCC64D0B243F949B9B99CCEADE2ECA11657A757D22025986B0FA116F1D5191E0A22677674C994EDBFADE62240E9D161688266A711</b>
  241. </p>
  242. <p>
  243. Put that in the grub.cfg (the one for CBFS inside the ROM) before the 'Load Operating System' menu entry like so (example):<br/>
  244. </p>
  245. <pre>
  246. <b>set superusers=&quot;root&quot;</b>
  247. <b>password_pbkdf2 root grub.pbkdf2.sha512.10000.711F186347156BC105CD83A2ED7AF1EB971AA2B1EB2640172F34B0DEFFC97E654AF48E5F0C3B7622502B76458DA494270CC0EA6504411D676E6752FD1651E749.8DD11178EB8D1F633308FD8FCC64D0B243F949B9B99CCEADE2ECA11657A757D22025986B0FA116F1D5191E0A22677674C994EDBFADE62240E9D161688266A711</b>
  248. </pre>
  249. <p>
  250. Obviously, replace it with the correct hash that you actually got for the password that you entered. Meaning, not the hash that you see above!
  251. </p>
  252. <p>
  253. After this, you will have a modified ROM with the menu entry for cryptomount, and the entry before that for the GRUB password. Flash the modified ROM
  254. using <a href="../install/index.html#flashrom">this tutorial</a>.
  255. </p>
  256. </div>
  257. <div class="section">
  258. <p>
  259. Copyright &copy; 2014, 2015 Francis Rowe &lt;info@gluglug.org.uk&gt;<br/>
  260. This document is released under the Creative Commons Attribution-ShareAlike 4.0 International Public License and all future versions.
  261. A copy of the license can be found at <a href="../cc-by-sa-4.txt">../cc-by-sa-4.txt</a>.
  262. </p>
  263. <p>
  264. This document is distributed in the hope that it will be useful,
  265. but WITHOUT ANY WARRANTY; without even the implied warranty of
  266. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See <a href="../cc-by-sa-4.txt">../cc-by-sa-4.txt</a> for more information.
  267. </p>
  268. </div>
  269. </body>
  270. </html>