encrypted_trisquel.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499
  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 on x86 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 system.
  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>
  34. <b>This guide is *only* for the GRUB payload. If you use the depthcharge payload, ignore this section entirely.</b>
  35. </p>
  36. <p>
  37. Note: on some thinkpads, a faulty DVD drive can cause the cryptomount -a step during boot to fail. If this happens to you, try removing the drive.
  38. </p>
  39. <p><a href="index.html">Back to previous index</a></p>
  40. </div>
  41. <div class="section">
  42. <p>
  43. Set a strong user password (lots of lowercase/uppercase, numbers and symbols).
  44. </p>
  45. <p>
  46. Use of the <i>diceware method</i> is recommended, for generating secure passphrases (instead of passwords).
  47. </p>
  48. <p>
  49. when the installer asks you to set up
  50. 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
  51. will add noticeable performance penalty, for little security gain in most use cases. This is therefore optional, and not recommended.
  52. Choose 'no'.</b>
  53. </p>
  54. <p>
  55. <b>
  56. Your user password should be different from the LUKS password which you will set later on.
  57. Your LUKS password should, like the user password, be secure.
  58. </b>
  59. </p>
  60. </div>
  61. <div class="section">
  62. <h1>Partitioning</h1>
  63. <p>Choose 'Manual' partitioning:</p>
  64. <ul>
  65. <li>Select drive and create new partition table</li>
  66. <li>
  67. Single large partition. The following are mostly defaults:
  68. <ul>
  69. <li>Use as: physical volume for encryption</li>
  70. <li>Encryption: aes</li>
  71. <li>key size: 256</li>
  72. <li>IV algorithm: xts-plain64</li>
  73. <li>Encryption key: passphrase</li> (<i>diceware method</i> recommended for choosing password)
  74. <li>erase data: Yes (only choose 'No' if it's a new drive that doesn't contain your private data)</li>
  75. </ul>
  76. </li>
  77. <li>
  78. Select 'configure encrypted volumes'
  79. <ul>
  80. <li>Create encrypted volumes</li>
  81. <li>Select your partition</li>
  82. <li>Finish</li>
  83. <li>Really erase: Yes</li>
  84. <li>(erase will take a long time. be patient)</li>
  85. <li>(if your old system was encrypted, just let this run for about a minute to
  86. make sure that the LUKS header is wiped out)</li>
  87. </ul>
  88. </li>
  89. <li>
  90. Select encrypted space:
  91. <ul>
  92. <li>use as: physical volume for LVM</li>
  93. <li>Choose 'done setting up the partition'</li>
  94. </ul>
  95. </li>
  96. <li>
  97. Configure the logical volume manager:
  98. <ul>
  99. <li>Keep settings: Yes</li>
  100. </ul>
  101. </li>
  102. <li>
  103. Create volume group:
  104. <ul>
  105. <li>Name: <b>matrix</b> (you can use whatever you want here, this is just an example)</li>
  106. <li>Select crypto partition</li>
  107. </ul>
  108. </li>
  109. <li>
  110. Create logical volume
  111. <ul>
  112. <li>select <b>matrix</b> (or whatever you named it before)</li>
  113. <li>name: <b>root</b> (you can use whatever you want here, this is just an example)</li>
  114. <li>size: default, minus 2048 MB</li>
  115. </ul>
  116. </li>
  117. <li>
  118. Create logical volume
  119. <ul>
  120. <li>select <b>matrix</b> (or whatever you named it before)</li>
  121. <li>name: <b>swap</b> (you can use whatever you want here, this is just an example)</li>
  122. <li>size: press enter</li>
  123. </ul>
  124. </li>
  125. </ul>
  126. </div>
  127. <div class="section">
  128. <h1>Further partitioning</h1>
  129. <p>
  130. Now you are back at the main partitioning screen. You will simply set mountpoints and filesystems to use.
  131. </p>
  132. <ul>
  133. <li>
  134. LVM LV root
  135. <ul>
  136. <li>use as: ext4</li>
  137. <li>mount point: /</li>
  138. <li>done setting up partition</li>
  139. </ul>
  140. </li>
  141. <li>
  142. LVM LV swap
  143. <ul>
  144. <li>use as: swap area</li>
  145. <li>done setting up partition</li>
  146. </ul>
  147. </li>
  148. <li>Now you select 'Finished partitioning and write changes to disk'.</li>
  149. </ul>
  150. </div>
  151. <div class="section">
  152. <h1>Kernel</h1>
  153. <p>
  154. Installation will ask what kernel you want to use. linux-generic is fine.
  155. </p>
  156. </div>
  157. <div class="section">
  158. <h1>Tasksel</h1>
  159. <p>
  160. Choose <i>&quot;Trisquel Desktop Environment&quot;</i> if you want GNOME,
  161. <i>&quot;Trisquel-mini Desktop Environment&quot;</i> if you
  162. want LXDE or <i>&quot;Triskel Desktop Environment&quot;</i> if you want KDE.
  163. If you want to have no desktop (just a basic shell)
  164. when you boot or if you want to create your own custom setup, then choose nothing here (don't select anything).
  165. You might also want to choose some of the other package groups; it's up to you.
  166. </p>
  167. </div>
  168. <div class="section">
  169. <h1>Postfix configuration</h1>
  170. <p>
  171. If asked, choose <i>&quot;No Configuration&quot;</i> here (or maybe you want to select something else. It's up to you.)
  172. </p>
  173. </div>
  174. <div class="section">
  175. <h1>Install the GRUB boot loader to the master boot record</h1>
  176. <p>
  177. Choose 'Yes'. It will fail, but don't worry. Then at the main menu, choose 'Continue without a bootloader'.
  178. You could also choose 'No'. Choice is irrelevant here.
  179. </p>
  180. <p>
  181. <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>
  182. </p>
  183. </div>
  184. <div class="section">
  185. <h1>Clock UTC</h1>
  186. <p>
  187. Just say 'Yes'.
  188. </p>
  189. </div>
  190. <div class="section">
  191. <h1>
  192. Booting your system
  193. </h1>
  194. <p>
  195. At this point, you will have finished the installation. At your GRUB payload, press C to get to the command line.
  196. </p>
  197. <p>
  198. Do that:<br/>
  199. grub&gt; <b>cryptomount -a</b><br/>
  200. grub&gt; <b>set root='lvm/matrix-root'</b><br/>
  201. grub&gt; <b>linux /vmlinuz root=/dev/mapper/matrix-root cryptdevice=/dev/mapper/matrix-root:root</b><br/>
  202. grub&gt; <b>initrd /initrd.img</b><br/>
  203. grub&gt; <b>boot</b>
  204. </p>
  205. </div>
  206. <div class="section">
  207. <h1>
  208. ecryptfs
  209. </h1>
  210. <p>
  211. If you didn't encrypt your home directory, then you can safely ignore this section.
  212. </p>
  213. <p>
  214. Immediately after logging in, do that:<br/>
  215. $ <b>sudo ecryptfs-unwrap-passphrase</b>
  216. </p>
  217. <p>
  218. 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
  219. somewhere secret. Ideally, you should memorize it and then burn the note (or not even write it down, and memorize it still)>
  220. </p>
  221. </div>
  222. <div class="section">
  223. <h1>
  224. Modify grub.cfg (CBFS)
  225. </h1>
  226. <p>
  227. Now you need to set it up so that the system will automatically boot, without having to type a bunch of commands.
  228. </p>
  229. <p>
  230. Modify your grub.cfg (in the firmware) <a href="grub_cbfs.html">using this tutorial</a>;
  231. just change the default menu entry 'Load Operating System' to say this inside:
  232. </p>
  233. <p>
  234. <b>cryptomount -a</b><br/>
  235. <b>set root='lvm/matrix-root'</b><br/>
  236. <b>linux /vmlinuz root=/dev/mapper/matrix-root cryptdevice=/dev/mapper/matrix-root:root</b><br/>
  237. <b>initrd /initrd.img</b>
  238. </p>
  239. <p>
  240. Without specifying a device, the <i>-a</i> parameter tries to unlock all detected LUKS volumes.
  241. You can also specify -u UUID or -a (device).
  242. </p>
  243. <p>
  244. 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
  245. 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>
  246. </p>
  247. <p>
  248. Use of the <i>diceware method</i> is recommended, for generating secure passphrases (as opposed to passwords).
  249. </p>
  250. <p>
  251. The GRUB utility can be used like so:<br/>
  252. $ <b>grub-mkpasswd-pbkdf2</b>
  253. </p>
  254. <p>
  255. Give it a password (remember, it has to be secure) and it'll output something like:<br/>
  256. <b>grub.pbkdf2.sha512.10000.711F186347156BC105CD83A2ED7AF1EB971AA2B1EB2640172F34B0DEFFC97E654AF48E5F0C3B7622502B76458DA494270CC0EA6504411D676E6752FD1651E749.8DD11178EB8D1F633308FD8FCC64D0B243F949B9B99CCEADE2ECA11657A757D22025986B0FA116F1D5191E0A22677674C994EDBFADE62240E9D161688266A711</b>
  257. </p>
  258. <p>
  259. Use of the <i>diceware method</i> is recommended, for generating secure passphrases (instead of passwords).
  260. </p>
  261. <p>
  262. Put that in the grub.cfg (the one for CBFS inside the ROM) before the 'Load Operating System' menu entry like so (example):<br/>
  263. </p>
  264. <pre>
  265. <b>set superusers=&quot;root&quot;</b>
  266. <b>password_pbkdf2 root grub.pbkdf2.sha512.10000.711F186347156BC105CD83A2ED7AF1EB971AA2B1EB2640172F34B0DEFFC97E654AF48E5F0C3B7622502B76458DA494270CC0EA6504411D676E6752FD1651E749.8DD11178EB8D1F633308FD8FCC64D0B243F949B9B99CCEADE2ECA11657A757D22025986B0FA116F1D5191E0A22677674C994EDBFADE62240E9D161688266A711</b>
  267. </pre>
  268. <p style="font-size:2em;">
  269. MAKE SURE TO DO THIS ON grubtest.cfg *BEFORE* DOING IT ON grub.cfg.
  270. Then select the menu entry that says <i>Switch to grubtest.cfg</i> and test that it works.
  271. Then copy that to grub.cfg once you're satisfied.
  272. WHY? BECAUSE AN INCORRECTLY SET PASSWORD CONFIG MEANS YOU CAN'T AUTHENTICATE, WHICH MEANS 'BRICK'.
  273. </p>
  274. <p>
  275. (emphasis added, because it's needed. This is a common roadblock for users)
  276. </p>
  277. <p>
  278. 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!
  279. </p>
  280. <p>
  281. 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
  282. using <a href="../install/index.html#flashrom">this tutorial</a>.
  283. </p>
  284. </div>
  285. <div class="section">
  286. <h1 id="troubleshooting">Troubleshooting</h1>
  287. <p>
  288. A user reported issues when booting with a docking station attached
  289. on an X200, when decrypting the disk in GRUB. The error
  290. <i>AHCI transfer timed out</i> was observed. The workaround
  291. was to remove the docking station.
  292. </p>
  293. <p>
  294. Further investigation revealed that it was the DVD drive causing problems.
  295. Removing that worked around the issue.
  296. </p>
  297. <pre>
  298. &quot;sudo wodim -prcap&quot; shows information about the drive:
  299. Device was not specified. Trying to find an appropriate drive...
  300. Detected CD-R drive: /dev/sr0
  301. Using /dev/cdrom of unknown capabilities
  302. Device type : Removable CD-ROM
  303. Version : 5
  304. Response Format: 2
  305. Capabilities :
  306. Vendor_info : 'HL-DT-ST'
  307. Identification : 'DVDRAM GU10N '
  308. Revision : 'MX05'
  309. Device seems to be: Generic mmc2 DVD-R/DVD-RW.
  310. Drive capabilities, per MMC-3 page 2A:
  311. Does read CD-R media
  312. Does write CD-R media
  313. Does read CD-RW media
  314. Does write CD-RW media
  315. Does read DVD-ROM media
  316. Does read DVD-R media
  317. Does write DVD-R media
  318. Does read DVD-RAM media
  319. Does write DVD-RAM media
  320. Does support test writing
  321. Does read Mode 2 Form 1 blocks
  322. Does read Mode 2 Form 2 blocks
  323. Does read digital audio blocks
  324. Does restart non-streamed digital audio reads accurately
  325. Does support Buffer-Underrun-Free recording
  326. Does read multi-session CDs
  327. Does read fixed-packet CD media using Method 2
  328. Does not read CD bar code
  329. Does not read R-W subcode information
  330. Does read raw P-W subcode data from lead in
  331. Does return CD media catalog number
  332. Does return CD ISRC information
  333. Does support C2 error pointers
  334. Does not deliver composite A/V data
  335. Does play audio CDs
  336. Number of volume control levels: 256
  337. Does support individual volume control setting for each channel
  338. Does support independent mute setting for each channel
  339. Does not support digital output on port 1
  340. Does not support digital output on port 2
  341. Loading mechanism type: tray
  342. Does support ejection of CD via START/STOP command
  343. Does not lock media on power up via prevent jumper
  344. Does allow media to be locked in the drive via PREVENT/ALLOW command
  345. Is not currently in a media-locked state
  346. Does not support changing side of disk
  347. Does not have load-empty-slot-in-changer feature
  348. Does not support Individual Disk Present feature
  349. Maximum read speed: 4234 kB/s (CD 24x, DVD 3x)
  350. Current read speed: 4234 kB/s (CD 24x, DVD 3x)
  351. Maximum write speed: 4234 kB/s (CD 24x, DVD 3x)
  352. Current write speed: 4234 kB/s (CD 24x, DVD 3x)
  353. Rotational control selected: CLV/PCAV
  354. Buffer size in KB: 1024
  355. Copy management revision supported: 1
  356. Number of supported write speeds: 4
  357. Write speed # 0: 4234 kB/s CLV/PCAV (CD 24x, DVD 3x)
  358. Write speed # 1: 2822 kB/s CLV/PCAV (CD 16x, DVD 2x)
  359. Write speed # 2: 1764 kB/s CLV/PCAV (CD 10x, DVD 1x)
  360. Write speed # 3: 706 kB/s CLV/PCAV (CD 4x, DVD 0x)
  361. Supported CD-RW media types according to MMC-4 feature 0x37:
  362. Does write multi speed CD-RW media
  363. Does write high speed CD-RW media
  364. Does write ultra high speed CD-RW media
  365. Does not write ultra high speed+ CD-RW media
  366. </pre>
  367. </div>
  368. <div class="section">
  369. <p>
  370. Copyright &copy; 2014, 2015 Leah Rowe &lt;info@minifree.org&gt;<br/>
  371. Permission is granted to copy, distribute and/or modify this document
  372. under the terms of the GNU Free Documentation License, Version 1.3
  373. or any later version published by the Free Software Foundation;
  374. with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
  375. A copy of the license can be found at <a href="../gfdl-1.3.txt">../gfdl-1.3.txt</a>
  376. </p>
  377. <p>
  378. Updated versions of the license (when available) can be found at
  379. <a href="https://www.gnu.org/licenses/licenses.html">https://www.gnu.org/licenses/licenses.html</a>
  380. </p>
  381. <p>
  382. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
  383. EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
  384. AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
  385. ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
  386. IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
  387. WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
  388. PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
  389. ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
  390. KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
  391. ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
  392. </p>
  393. <p>
  394. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
  395. TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
  396. NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
  397. INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
  398. COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
  399. USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
  400. ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
  401. DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
  402. IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
  403. </p>
  404. <p>
  405. The disclaimer of warranties and limitation of liability provided
  406. above shall be interpreted in a manner that, to the extent
  407. possible, most closely approximates an absolute disclaimer and
  408. waiver of all liability.
  409. </p>
  410. </div>
  411. </body>
  412. </html>