Guest User

Untitled

a guest
Jan 25th, 2021
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. # Secureboot guide for linux:
  2. # Im using void but this should work on most distros. You will just have to replace stuff like xbps-install with apt for example.
  3. 0.1. Enter Root
  4. sudo su
  5. 1. Install efitools sbsigntool
  6. sudo xbps-install efitools efitools-efi
  7. 2.Create a GUID for owner identification
  8. uuidgen --random > GUID.txt
  9. 3. Platform key
  10. openssl req -newkey rsa:4096 -nodes -keyout PK.key -new -x509 -sha256 -days 3650 -subj "/CN=my Platform Key/" -out PK.crt
  11. openssl x509 -outform DER -in PK.crt -out PK.cer
  12. cert-to-efi-sig-list -g "$(< GUID.txt)" PK.crt PK.esl
  13. sign-efi-sig-list -g "$(< GUID.txt)" -k PK.key -c PK.crt PK PK.esl PK.auth
  14. 3.1 Sign an empty file to allow removing Platform Key when in "User Mode"
  15. sign-efi-sig-list -g "$(< GUID.txt)" -c PK.crt -k PK.key PK /dev/null rm_PK.auth
  16. 4. Key Exchange Key
  17. openssl req -newkey rsa:4096 -nodes -keyout KEK.key -new -x509 -sha256 -days 3650 -subj "/CN=my Key Exchange Key/" -out KEK.crt
  18. openssl x509 -outform DER -in KEK.crt -out KEK.cer
  19. cert-to-efi-sig-list -g "$(< GUID.txt)" KEK.crt KEK.esl
  20. sign-efi-sig-list -g "$(< GUID.txt)" -k PK.key -c PK.crt KEK KEK.esl KEK.auth
  21. 5. Signature Database key
  22. openssl req -newkey rsa:4096 -nodes -keyout db.key -new -x509 -sha256 -days 3650 -subj "/CN=my Signature Database key/" -out db.crt
  23. openssl x509 -outform DER -in db.crt -out db.cer
  24. cert-to-efi-sig-list -g "$(< GUID.txt)" db.crt db.esl
  25. sign-efi-sig-list -g "$(< GUID.txt)" -k KEK.key -c KEK.crt db db.esl db.auth
  26. 6. Signing Bootloader and Kernel. (I use grub)
  27. sbsign --key db.key --cert db.crt --output /boot/vmlinuz(enter version here) /boot/vmlinuz(enter version here)
  28. sbsign --key db.key --cert db.crt --output /boot/efi/EFI/BOOT/BOOTX64.EFI /boot/efi/EFI/BOOT/BOOTX64.EFI
  29. 7. Enroll your keys
  30. cp /root/*.cer /root/*.esl /root/*.auth /boot/efi/
  31.  
  32. Follow this guide: https://wiki.gentoo.org/wiki/User:Sakaki/Sakaki%27s_EFI_Install_Guide/Configuring_Secure_Boot#Method_3:_Inserting_Keys_via_Keytool
  33.  
  34. Keys should be added in this order: db => KEK => PK
  35.  
  36. 8. Enable SecureBoot and Enjoy!
Advertisement
Add Comment
Please, Sign In to add comment