encrypted_trisquel.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481
  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 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><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</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</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. Without specifying a device, the <i>-a</i> parameter tries to unlock all detected LUKS volumes.
  232. You can also specify -u UUID or -a (device).
  233. </p>
  234. <p>
  235. 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
  236. 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>
  237. </p>
  238. <p>
  239. The GRUB utility can be used like so:<br/>
  240. $ <b>grub-mkpasswd-pbkdf2</b>
  241. </p>
  242. <p>
  243. Give it a password (remember, it has to be secure) and it'll output something like:<br/>
  244. <b>grub.pbkdf2.sha512.10000.711F186347156BC105CD83A2ED7AF1EB971AA2B1EB2640172F34B0DEFFC97E654AF48E5F0C3B7622502B76458DA494270CC0EA6504411D676E6752FD1651E749.8DD11178EB8D1F633308FD8FCC64D0B243F949B9B99CCEADE2ECA11657A757D22025986B0FA116F1D5191E0A22677674C994EDBFADE62240E9D161688266A711</b>
  245. </p>
  246. <p>
  247. Put that in the grub.cfg (the one for CBFS inside the ROM) before the 'Load Operating System' menu entry like so (example):<br/>
  248. </p>
  249. <pre>
  250. <b>set superusers=&quot;root&quot;</b>
  251. <b>password_pbkdf2 root grub.pbkdf2.sha512.10000.711F186347156BC105CD83A2ED7AF1EB971AA2B1EB2640172F34B0DEFFC97E654AF48E5F0C3B7622502B76458DA494270CC0EA6504411D676E6752FD1651E749.8DD11178EB8D1F633308FD8FCC64D0B243F949B9B99CCEADE2ECA11657A757D22025986B0FA116F1D5191E0A22677674C994EDBFADE62240E9D161688266A711</b>
  252. </pre>
  253. <p style="font-size:2em;">
  254. MAKE SURE TO DO THIS ON grubtest.cfg *BEFORE* DOING IT ON grub.cfg.
  255. Then select the menu entry that says <i>Switch to grubtest.cfg</i> and test that it works.
  256. Then copy that to grub.cfg once you're satisfied.
  257. WHY? BECAUSE AN INCORRECTLY SET PASSWORD CONFIG MEANS YOU CAN'T AUTHENTICATE, WHICH MEANS 'BRICK'.
  258. </p>
  259. <p>
  260. (emphasis added, because it's needed. This is a common roadblock for users)
  261. </p>
  262. <p>
  263. 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!
  264. </p>
  265. <p>
  266. 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
  267. using <a href="../install/index.html#flashrom">this tutorial</a>.
  268. </p>
  269. </div>
  270. <div class="section">
  271. <h1 id="troubleshooting">Troubleshooting</h1>
  272. <p>
  273. A user reported issues when booting with a docking station attached
  274. on an X200, when decrypting the disk in GRUB. The error
  275. <i>AHCI transfer timed out</i> was observed. The workaround
  276. was to remove the docking station.
  277. </p>
  278. <p>
  279. Further investigation revealed that it was the DVD drive causing problems.
  280. Removing that worked around the issue.
  281. </p>
  282. <pre>
  283. &quot;sudo wodim -prcap&quot; shows information about the drive:
  284. Device was not specified. Trying to find an appropriate drive...
  285. Detected CD-R drive: /dev/sr0
  286. Using /dev/cdrom of unknown capabilities
  287. Device type : Removable CD-ROM
  288. Version : 5
  289. Response Format: 2
  290. Capabilities :
  291. Vendor_info : 'HL-DT-ST'
  292. Identification : 'DVDRAM GU10N '
  293. Revision : 'MX05'
  294. Device seems to be: Generic mmc2 DVD-R/DVD-RW.
  295. Drive capabilities, per MMC-3 page 2A:
  296. Does read CD-R media
  297. Does write CD-R media
  298. Does read CD-RW media
  299. Does write CD-RW media
  300. Does read DVD-ROM media
  301. Does read DVD-R media
  302. Does write DVD-R media
  303. Does read DVD-RAM media
  304. Does write DVD-RAM media
  305. Does support test writing
  306. Does read Mode 2 Form 1 blocks
  307. Does read Mode 2 Form 2 blocks
  308. Does read digital audio blocks
  309. Does restart non-streamed digital audio reads accurately
  310. Does support Buffer-Underrun-Free recording
  311. Does read multi-session CDs
  312. Does read fixed-packet CD media using Method 2
  313. Does not read CD bar code
  314. Does not read R-W subcode information
  315. Does read raw P-W subcode data from lead in
  316. Does return CD media catalog number
  317. Does return CD ISRC information
  318. Does support C2 error pointers
  319. Does not deliver composite A/V data
  320. Does play audio CDs
  321. Number of volume control levels: 256
  322. Does support individual volume control setting for each channel
  323. Does support independent mute setting for each channel
  324. Does not support digital output on port 1
  325. Does not support digital output on port 2
  326. Loading mechanism type: tray
  327. Does support ejection of CD via START/STOP command
  328. Does not lock media on power up via prevent jumper
  329. Does allow media to be locked in the drive via PREVENT/ALLOW command
  330. Is not currently in a media-locked state
  331. Does not support changing side of disk
  332. Does not have load-empty-slot-in-changer feature
  333. Does not support Individual Disk Present feature
  334. Maximum read speed: 4234 kB/s (CD 24x, DVD 3x)
  335. Current read speed: 4234 kB/s (CD 24x, DVD 3x)
  336. Maximum write speed: 4234 kB/s (CD 24x, DVD 3x)
  337. Current write speed: 4234 kB/s (CD 24x, DVD 3x)
  338. Rotational control selected: CLV/PCAV
  339. Buffer size in KB: 1024
  340. Copy management revision supported: 1
  341. Number of supported write speeds: 4
  342. Write speed # 0: 4234 kB/s CLV/PCAV (CD 24x, DVD 3x)
  343. Write speed # 1: 2822 kB/s CLV/PCAV (CD 16x, DVD 2x)
  344. Write speed # 2: 1764 kB/s CLV/PCAV (CD 10x, DVD 1x)
  345. Write speed # 3: 706 kB/s CLV/PCAV (CD 4x, DVD 0x)
  346. Supported CD-RW media types according to MMC-4 feature 0x37:
  347. Does write multi speed CD-RW media
  348. Does write high speed CD-RW media
  349. Does write ultra high speed CD-RW media
  350. Does not write ultra high speed+ CD-RW media
  351. </pre>
  352. </div>
  353. <div class="section">
  354. <p>
  355. Copyright &copy; 2014, 2015 Francis Rowe &lt;info@gluglug.org.uk&gt;<br/>
  356. Permission is granted to copy, distribute and/or modify this document
  357. under the terms of the GNU Free Documentation License, Version 1.3
  358. or any later version published by the Free Software Foundation;
  359. with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
  360. A copy of the license can be found at <a href="../gfdl-1.3.txt">../gfdl-1.3.txt</a>
  361. </p>
  362. <p>
  363. Updated versions of the license (when available) can be found at
  364. <a href="https://www.gnu.org/licenses/licenses.html">https://www.gnu.org/licenses/licenses.html</a>
  365. </p>
  366. <p>
  367. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
  368. EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
  369. AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
  370. ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
  371. IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
  372. WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
  373. PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
  374. ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
  375. KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
  376. ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
  377. </p>
  378. <p>
  379. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
  380. TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
  381. NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
  382. INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
  383. COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
  384. USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
  385. ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
  386. DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
  387. IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
  388. </p>
  389. <p>
  390. The disclaimer of warranties and limitation of liability provided
  391. above shall be interpreted in a manner that, to the extent
  392. possible, most closely approximates an absolute disclaimer and
  393. waiver of all liability.
  394. </p>
  395. </div>
  396. </body>
  397. </html>