Forked from HardenedArray/Efficient Encrypted UEFI-Booting Arch Installation
Created
June 18, 2020 13:11
-
-
Save elston/0dc8a241e70a95c29d0a082aac1ce3df to your computer and use it in GitHub Desktop.
Revisions
-
HardenedArray revised this gist
Mar 4, 2020 . No changes.There are no files selected for viewing
-
HardenedArray revised this gist
Feb 28, 2020 . No changes.There are no files selected for viewing
-
HardenedArray revised this gist
Feb 28, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -322,7 +322,7 @@ Therefore, instead of using this example from above: GRUB_CMDLINE_LINUX="cryptdevice=/dev/sdXZ:2016-Global-OpSec-Champion-LyingHillary resume=/dev/mapper/Arch-swap" Run 'blkid' as root, and find the correct PARTUUID for your external device's encrypted partition. N.B.: PARTUUIDs are completely unrelated to UUIDs. -
HardenedArray revised this gist
Feb 27, 2020 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -161,8 +161,7 @@ nano /etc/pacman.d/mirrorlist # optional: make and enjoy some fresh java while the following command completes. Once completed, you'll only # be a few minutes away from putting your new system to serious work! pacstrap /mnt base base-devel grub efibootmgr dialog wpa_supplicant linux linux-headers nano dhcpcd netctl lvm2 linux-firmware # Create and review FSTAB -
HardenedArray revised this gist
Feb 27, 2020 . 1 changed file with 0 additions and 22 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -339,28 +339,6 @@ All other parts of my installation procedure should be followed without modifica __________________________ Multi-OS-Booting Notes: I UEFI boot and run more than five operating systems from my SSD. -
HardenedArray revised this gist
Feb 20, 2020 . No changes.There are no files selected for viewing
-
HardenedArray revised this gist
Feb 20, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -161,7 +161,7 @@ nano /etc/pacman.d/mirrorlist # optional: make and enjoy some fresh java while the following command completes. Once completed, you'll only # be a few minutes away from putting your new system to serious work! pacstrap /mnt base base-devel grub efibootmgr dialog wpa_supplicant linux linux-headers dkms nano dhcpcd netctl lvm2 linux-firmware # Create and review FSTAB -
HardenedArray revised this gist
Nov 15, 2019 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -156,8 +156,8 @@ nano /etc/pacman.d/mirrorlist # We will be addressing those issues in our pacstrap command below. # This installation command provides a decent set of basic system programs which will also support WiFi through # netctl's `wifi-menu` after initially booting into your Arch system. Having WiFi following installation is particularly # critical for anyone running a modern ultrabook, as most are equipped with WiFi-only access to the Net. Recommended, yet # optional: make and enjoy some fresh java while the following command completes. Once completed, you'll only # be a few minutes away from putting your new system to serious work! -
HardenedArray revised this gist
Nov 15, 2019 . 1 changed file with 6 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -155,12 +155,14 @@ nano /etc/pacman.d/mirrorlist # The new base-metapackage does not contain a kernel nor an editor and several other important packages. # We will be addressing those issues in our pacstrap command below. # This installation command provides a decent set of basic system programs which will also support WiFi through # netctl's `wifi-menu` when initially booting into your Arch system. Having WiFi following is particularly critical # for anyone running a modern ultrabook, as most are only equipped with WiFi access to the Net. Recommended, yet # optional: make and enjoy some fresh java while the following command completes. Once completed, you'll only # be a few minutes away from putting your new system to serious work! pacstrap /mnt base base-devel grub-efi-x86_64 efibootmgr dialog wpa_supplicant linux linux-headers dkms nano dhcpcd netctl lvm2 linux-firmware # Create and review FSTAB -
HardenedArray revised this gist
Nov 14, 2019 . No changes.There are no files selected for viewing
-
HardenedArray revised this gist
Nov 14, 2019 . 1 changed file with 6 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -32,14 +32,17 @@ https://gist.github.com/HardenedArray/d5b70681eca1d4e7cfb88df32cc4c7e6 # Download the archlinux-*.iso image from https://www.archlinux.org/download/ and its GnuPG signature. # Use gpg --verify to ensure your archlinux-*.iso is exactly what the Arch developers intended. For example: $ gpg -v archlinux-2019.11.01-x86_64.iso.sig gpg: WARNING: no command supplied. Trying to guess what you mean ... gpg: assuming signed data in 'archlinux-2019.11.01-x86_64.iso' gpg: Signature made Fri Nov 1 16:34:35 2019 UTC gpg: using RSA key 4AA4767BBC9C4B1D18AE28B77F2D434B9741E8AC gpg: using pgp trust model gpg: Good signature from "Pierre Schmitz <[email protected]>" [unknown] gpg: WARNING: This key is not certified with a trusted signature! gpg: There is no indication that the signature belongs to the owner. Primary key fingerprint: 4AA4 767B BC9C 4B1D 18AE 28B7 7F2D 434B 9741 E8AC gpg: binary signature, digest algorithm SHA256, key algorithm rsa2048 # Burn the archlinux-*.iso to a 1+ Gb USB stick. On linux, do something like: -
HardenedArray revised this gist
Nov 14, 2019 . 1 changed file with 8 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -146,11 +146,18 @@ nano /etc/pacman.d/mirrorlist # Install your Arch system # If you read the contents of https://www.archlinux.org/ you would know the Arch developers made significant # changes to the 'base' package in October 2019. # The new base-metapackage does not contain a kernel nor an editor and several other important packages. # We will be addressing those issues in our pacstrap command below. # This installation command provides a decent set of basic system programs which will also support WiFi when initially # booting into your Arch system. Recommended, yet optional: make and enjoy some fresh java while the following # command completes. Once completed, you'll only be a few minutes away from putting your new system to serious work! pacstrap /mnt base base-devel grub-efi-x86_64 efibootmgr dialog wpa_supplicant linux linux-headers dkms nano dhcpcd linux-firmware # Create and review FSTAB -
HardenedArray revised this gist
Jul 12, 2019 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -234,7 +234,8 @@ GRUB_CMDLINE_LINUX="cryptdevice=/dev/sdXZ:2016-Global-OpSec-Champion-LyingHillar # GRUB_ENABLE_CRYPTODISK=y # Note that you do NOT need to enable that cryptodisk statement to boot your LUKS encrypted / and swap ArchLinux system, # assuming you are **NOT** trying to decrypt an encrypted /boot. If you want to encrypt /boot, read my encrypted boot # installation guide, which requires an entirely different, and incompatiable, installation procedure. # Generate Your Final Grub Configuration: -
HardenedArray revised this gist
Jul 12, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -43,7 +43,7 @@ Primary key fingerprint: 4AA4 767B BC9C 4B1D 18AE 28B7 7F2D 434B 9741 E8AC # Burn the archlinux-*.iso to a 1+ Gb USB stick. On linux, do something like: dd bs=4M if=archlinux-*.iso of=/dev/sdX status=progress oflag=sync # If running Windows, use Rufus to burn the archlinux-*.iso to your USB stick in DD mode. # Also, if you are running BitLocker to encrypt your Windows system, read my BitLocker notes below, before proceeding. -
HardenedArray revised this gist
Jul 12, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -43,7 +43,7 @@ Primary key fingerprint: 4AA4 767B BC9C 4B1D 18AE 28B7 7F2D 434B 9741 E8AC # Burn the archlinux-*.iso to a 1+ Gb USB stick. On linux, do something like: dd bs=4M if=archlinux-***.iso of=/dev/sdX status=progress oflag=sync # If running Windows, use Rufus to burn the archlinux-*.iso to your USB stick in DD mode. # Also, if you are running BitLocker to encrypt your Windows system, read my BitLocker notes below, before proceeding. -
HardenedArray revised this gist
Apr 21, 2019 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,12 +6,12 @@ # also CANNOT be subsequently converted to support an encrypted /boot!!! A CLEAN INSTALL will be required! # Therefore, if you want to have an encrypted /boot or will want an encrypted /boot system at some point in the future, # please ONLY follow my encrypted /boot installation guide, which lives here: https://gist.github.com/HardenedArray/ee3041c04165926fca02deca675effe1 # My encrypted /boot guide varies in several different, critically important, ways from the correct and secure encrypted # root / and swap installation process I have outlined below. # Note: This method supports both dedicated Arch installs and those who wish to install Arch on a multi-OS-UEFI booting system. @@ -59,7 +59,7 @@ wifi-menu # It is possible to access this guide from within your Arch installation environment using the built-in elinks text browser. # For those interested, open a new terminal at tty2 using ctrl-alt-f2, then use elinks to search for 'HardenedArray Gists' # which should return the URL of my Arch installation guides: https://gist.github.com/HardenedArray/31915e3d73a4ae45adc0efa9ba458b07 -
HardenedArray revised this gist
Apr 21, 2019 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,16 +2,16 @@ # OBJECTIVE: Install Arch Linux with encrypted root and swap filesystems and boot from UEFI. # Note this encrypted installation method, while perfectly correct and highly secure, CANNOT support encrypted /boot and # also CANNOT be subsequently converted to support an encrypted /boot!!! A CLEAN INSTALL will be required! # Therefore, if you want to have an encrypted /boot or will want an encrypted /boot system at some point in the future, # follow my encrypted /boot installation guide here: https://gist.github.com/HardenedArray/ee3041c04165926fca02deca675effe1 # My encrypted /boot guide varies in several different, critically important ways from the encrypted root and swap # installation process I have outlined below. # Note: This method supports both dedicated Arch installs and those who wish to install Arch on a multi-OS-UEFI booting system. -
HardenedArray revised this gist
Apr 21, 2019 . 1 changed file with 12 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,17 @@ # OBJECTIVE: Install Arch Linux with encrypted root and swap filesystems and boot from UEFI. # Note this encrypted installation method, while perfectly corrent and highly secure, CANNOT support encrypted /boot and # also CANNOT be subsequently converted to support an encrypted /boot!!! A CLEAN INSTALL will be required! # Therefore, if you want to have an encrypted /boot or will want an encryted /boot system at some point in the future, # follow my encrypted /boot installation guide here: https://gist.github.com/HardenedArray/ee3041c04165926fca02deca675effe1 # My encrypted /boot guide varies in several different, highly ways from the encrypted root and swap installation process # I have outlined below. # Note: This method supports both dedicated Arch installs and those who wish to install Arch on a multi-OS-UEFI booting system. -
HardenedArray revised this gist
Apr 21, 2019 . 1 changed file with 0 additions and 94 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -230,100 +230,6 @@ GRUB_CMDLINE_LINUX="cryptdevice=/dev/sdXZ:2016-Global-OpSec-Champion-LyingHillar grub-mkconfig -o /boot/grub/grub.cfg # Exit Your New Arch System exit -
HardenedArray revised this gist
Feb 21, 2019 . 1 changed file with 5 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -276,7 +276,7 @@ chmod 000 /crypto_keyfile.bin chmod 600 /boot/initramfs-linux* cryptsetup luksAddKey /dev/sdX# /crypto_keyfile.bin # Obviously, adjusting /dev/sdX# to your current root partition on your physical HDD/SSD. # When prompted for your passphrase with 'luksAddKey' be certain to enter ONLY your current LUKS passphrase, @@ -539,15 +539,15 @@ pacman -S plasma-meta # This large package set will also provide us with sddm, systemctl enable sddm systemctl enable NetworkManager # After your next reboot you will have full, correct, networking support from boot. pacman -S kde-applications-meta pacman -S xdg-user-dirs # If you want full (US English) spelling support for all of your applications, do: pacman -S hunspell-en_US hyphen-en libmythes mythes-en aspell-en # Everyone has their own font preferences, but I agree with Arch's initial ttf-font recommendations because they look great!: -
HardenedArray revised this gist
Nov 24, 2018 . 1 changed file with 5 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -286,11 +286,13 @@ cryptsetup luksAddKey /dev/sdX# /crypto_keyfile.bin cryptsetup luksDump /dev/sda23 # Now run to verify the partition where /boot is mounted on your physical drive: df -h # Then run and record the EXACT UUID of your Arch /boot partition: ls -l /dev/disk/by-uuid # Now run: -
HardenedArray revised this gist
Nov 24, 2018 . 1 changed file with 3 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -290,19 +290,13 @@ cryptsetup luksDump /dev/sda23 lsblk -f # Verify the partition where /boot is mounted on your physical drive and record the EXACT UUID of your Arch /boot partition. # Now run: nano /etc/crypttab # Add a new line in precisely this format: encryptedBOOT UUID=YourArch/bootUUIDgoeshere none luks,timeout=180 -
HardenedArray revised this gist
Nov 23, 2018 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -290,6 +290,12 @@ cryptsetup luksDump /dev/sda23 lsblk -f # and verify the partition where /boot is mounted on your physical drive # now run: ls -al /dev/disk/by-uuid # and obtain the EXACT UUID of your Arch /boot partition # then: -
HardenedArray revised this gist
Nov 15, 2018 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -300,6 +300,9 @@ nano /etc/crypttab encryptedBOOT UUID=YourArch/bootUUIDgoeshere none luks,timeout=180 # Of course, alternatively, it is trivial to point /etc/crypttab at a REQUIRED_TO_BE_PRESENT_AT_BOOT external USB stick, etc. # I will leave that part up to you to figure out. # Now run: mkinitcpio -p linux -
HardenedArray revised this gist
Nov 15, 2018 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -243,7 +243,7 @@ grub-mkconfig -o /boot/grub/grub.cfg # enormous complexity underlying how grub's code actually achieves this seamless dual encrypted booting and mounting # outcome, but this encrypted /boot sub-procedure is known to work! # Setting up an encrypted /boot requires further configuration. # ASSUMING you have followed **ALL** of the above installation steps, now do: @@ -282,7 +282,7 @@ cryptsetup luksAddKey /dev/sdX# /crypto_keyfile.bin # This will add your (second) new LUKS random key, now protecting /boot, to Key Slot #1. # Verify your new key has been correctly added with something like: cryptsetup luksDump /dev/sda23 -
HardenedArray revised this gist
Nov 14, 2018 . 1 changed file with 10 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -132,7 +132,7 @@ mount /dev/sdXX /mnt/boot/efi nano /etc/pacman.d/mirrorlist # Copy one or two mirrors near your physical location to the top of the mirrorlist. # Install your Arch system @@ -190,7 +190,7 @@ nano /etc/mkinitcpio.conf HOOKS="base udev autodetect modconf block keymap encrypt lvm2 resume filesystems keyboard fsck" # Note that recent ArchLinux installation images have shipped with a new version of /etc/mkinitcpio.conf. The # only difference is that the new version uses '(' and ')' instead of dual double quotation marks: ' " " '. Therefore, # the current HOOKS statement should be: HOOKS=(base udev autodetect modconf block keymap encrypt lvm2 resume filesystems keyboard fsck) @@ -210,7 +210,7 @@ grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=ArchL # Edit /etc/default/grub so it includes a statement like this: GRUB_CMDLINE_LINUX="cryptdevice=/dev/sdYZ:MyDevMapperMountpoint resume=/dev/mapper/MyVolGroupName-MyLVSwapName" # Maintaining consistency with the examples provided above, you would use something like: @@ -236,12 +236,12 @@ grub-mkconfig -o /boot/grub/grub.cfg **OPTIONAL** Encrypted /boot Configuration and Installation # Booting from an encrypted /boot is entirely optional, but, if you expect to maintain data privacy, unlike having (almost) # mandatory encrypted / and swap, booting from an encrypted /boot provides an extra layer of security for the truly paranoid! # I spent a great deal of time discussing this topic with a very intelligent Arch developer. I will hide you from the # enormous complexity underlying how grub's code actually achieves this seamless dual encrypted booting and mounting # outcome, but this encrypted /boot sub-procedure is known to work! # Setting up an encrypted /boot requires further configuartion. @@ -282,7 +282,7 @@ cryptsetup luksAddKey /dev/sdX# /crypto_keyfile.bin # This will add your (second) new LUKS random key, now protecting /boot, to Key Slot #1. # Verify your new key has been coorectly added with something like: cryptsetup luksDump /dev/sda23 @@ -314,7 +314,7 @@ grub-mkconfig -o /boot/grub/grub.cfg # FINISHED! Now you are completely re-synced with the non-encrypted /boot installers. Merely exit and umount, as below! # Enjoy the decryption magic upon your next, and all subsequent, reboots! Bad Actors will be most uphappy, as if I cared! ++++++++++++++++++++++++++++++++++ -
HardenedArray revised this gist
Nov 14, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # OBJECTIVE: Install Arch Linux with encrypted root and swap filesystems and boot from UEFI. Optionally, we will also encrypt /boot and then decrypt and mount our entire encrypted system using a single LUKS passphrase entry. # Note: This method supports both dedicated Arch installs and those who wish to install Arch on a multi-OS-UEFI booting system. -
HardenedArray revised this gist
Nov 14, 2018 . 1 changed file with 43 additions and 41 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -201,7 +201,7 @@ HOOKS=(base udev autodetect modconf block keymap encrypt lvm2 resume filesystems mkinitcpio -p linux # Install and Configure Grub-EFI # The correct way to install grub on an UEFI computer, irrespective of your use of a HDD or SSD, and whether you are # installing dedicated Arch, or multi-OS booting, is: @@ -223,96 +223,98 @@ GRUB_CMDLINE_LINUX="cryptdevice=/dev/sdXZ:2016-Global-OpSec-Champion-LyingHillar # Uncomment to enable booting from LUKS encrypted devices # GRUB_ENABLE_CRYPTODISK=y # Note that you do NOT need to enable that cryptodisk statement to boot your LUKS encrypted / and swap ArchLinux system, # assuming you are **NOT** trying to decrypt an encrypted /boot. If you want to encrypt /boot, continue reading. # Generate Your Final Grub Configuration: grub-mkconfig -o /boot/grub/grub.cfg # If you are not interested in encrypted /boot, you are almost done! Skip down to: # Exit Your New Arch System, below. ++++++++++++++++++++++++++++++++++ **OPTIONAL** Encrypted /boot Configuration and Installation Booting from an encrypted /boot is entirely optional, but, if you expect to maintain data privacy, unlike having (almost) mandatory encrypted / and swap, booting from an encrypted /boot provides an extra layer of security for the truly paranoid! I spent a great deal of time discussing this topic with a very intelligent Arch developer. I will hide you from the enormous complexity underlying how grub's code actually achieves this seamless dual encrypted booting outcome, but this encrypted /boot sub-procedure is known to work! # Setting up an encrypted /boot requires further configuartion. # ASSUMING you have followed **ALL** of the above installation steps, now do: nano /etc/default/grub # and enable, by uncommenting: GRUB_ENABLE_CRYPTODISK=y # then: nano /etc/mkinitcpio.conf # Make certain your FILES statement matches this: FILES=(/crypto_keyfile.bin) # Ensure that /boot and /boot/efi and / are all mounted with: df -h # then ensure your 'pwd' is at / with: cd / # Now run these four commands in succession: dd bs=512 count=4 if=/dev/random of=/crypto_keyfile.bin chmod 000 /crypto_keyfile.bin chmod 600 /boot/initramfs-linux* cryptsetup luksAddKey /dev/sdX# /crypto_keyfile.bin # Obviously, adjusting /dev/sdaX# to your current root partition on your physical HDD/SSD. # When prompted for your passphrase with 'luksAddKey' be certain to enter ONLY your current LUKS passphrase, # This will add your (second) new LUKS random key, now protecting /boot, to Key Slot #1. # Verify your new Key with something like: cryptsetup luksDump /dev/sda23 # Now run: lsblk -f # and obtain the EXACT UUID of your Arch /boot partition # then: nano /etc/crypttab # add a new line in precisely this format: encryptedBOOT UUID=YourArch/bootUUIDgoeshere none luks,timeout=180 # Now run: mkinitcpio -p linux # then, re-install grub, and YES, I DO MEAN, a second time: grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=ArchLinux --modules="part_gpt part_msdos" # and finally: grub-mkconfig -o /boot/grub/grub.cfg # FINISHED! Now you are completely re-synced with the non-encrypted /boot installers. Merely exit and umount, as below! # Enjoy the decryption magic upon your next, and upon all subsequent, reboots! Bad Actors will be most uphappy, as if I cared! ++++++++++++++++++++++++++++++++++ -
HardenedArray revised this gist
Nov 14, 2018 . 1 changed file with 91 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,7 @@ # OBJECTIVE: Install Arch Linux with encrypted root and swap filesystems and boot from UEFI. Optinally, we will also encrypt /boot and then decrypt and mount our entire encrypted system using a single LUKS passphrase entry. # Note: This method supports both dedicated Arch installs and those who wish to install Arch on a multi-OS-UEFI booting system. @@ -222,12 +223,100 @@ GRUB_CMDLINE_LINUX="cryptdevice=/dev/sdXZ:2016-Global-OpSec-Champion-LyingHillar # Uncomment to enable booting from LUKS encrypted devices # GRUB_ENABLE_CRYPTODISK=y # Note that you do NOT need to enable that cryptodisk statement to boot your LUKS encrypted ArchLinux system, assuming you are **NOT** trying to unlock an encrypted /boot. # Generate Your Final Grub Configuration: grub-mkconfig -o /boot/grub/grub.cfg If you are not interested in encrypted /boot, you are almost done! Skip down to: # Exit Your New Arch System, below. ++++++++++++++++++++++++++++++++++ **OPTIONAL** Encrypted /boot Configuration and Installation Booting from an encrypted /boot is entirely optional, but, if you expect to maintain data privacy, unlike having (almost) mandatory encrypted / and swap, booting from an encrypted /boot provides an extra measure of security for the truly paranoid! I spent a great deal of time discussing this topic with a very smart Arch developer. I will hide you from the enormous complexity underlying how grub actually achieves this stupedous dual encrypted booting outcome, but this sub-procedure is known to work! Setting up an encrypted /boot requires further configuartion. ASSUMING you have followed **ALL** of the above installation steps, now do: # nano /etc/default/grub and enable, by uncommenting: GRUB_ENABLE_CRYPTODISK=y then: # nano /etc/mkinitcpio.conf Make certain your FILES statement matches this: FILES=(/crypto_keyfile.bin) Ensure that /boot and /boot/efi and / and / are all mounted with: # df -h then ensure your 'pwd' is at / with: # cd / Now run these four commands in succession: # dd bs=512 count=4 if=/dev/random of=/crypto_keyfile.bin # chmod 000 /crypto_keyfile.bin # chmod 600 /boot/initramfs-linux* # cryptsetup luksAddKey /dev/sdX# /crypto_keyfile.bin Obviously, adjusting /dev/sdaX# to your current root partition on your physical HDD/SSD. When prompted for your passphrase with 'luksAddKey' be certain to enter ONLY your current LUKS passphrase, This will add your (second) new LUKS random key, now protecting /boot, to Key Slot #1. This can be verified with something like: cryptsetup luksDump /dev/sda15 Now run: # lsblk -f and obtain the EXACT UUID of your /boot partition then: # nano /etc/crypttab add a new line in precisely this format: encryptedBOOT UUID=Your/bootUUIDgoeshere none luks,timeout=180 Now run: # mkinitcpio -p linux then: grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=ArchLinux --modules="part_gpt part_msdos" and finally: grub-mkconfig -o /boot/grub/grub.cfg FINISHED! Now you are completely re-synced with the non-encrypted /boot installers. Merely exit and umount, as below! Enjoy the decryption magic upon your next, and upon all subsequent reboots! Bad Actors will be most uphappy, as if I cared! ++++++++++++++++++++++++++++++++++ # Exit Your New Arch System exit -
HardenedArray revised this gist
Feb 3, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -95,7 +95,7 @@ cryptsetup luksOpen /dev/sdXZ 2016-Global-OpSec-Champion-LyingHillary # (or use # a very poor idea. Swap partitions are not controlled by BTRFS so they work fine. Read the BTRFS ArchWiki before proceeding. # Also note that BTRFS fully supports, detects, and properly configures settings for all modern SSDs, which is the drive type # almost everyone should be running when installing ArchLinux! HDDs are only useful for infrequently accessed data, and # for storing your SSD's critical directories as encrypted backups. # Modify this structure only if you need additional, separate partitions. The sizes used below are only suggestions. # The VG and LV labels 'Arch, root and swap' can be changed to anything memorable to you. Use your labels consistently, below!
NewerOlder