{"id":7886,"date":"2026-03-05T18:18:47","date_gmt":"2026-03-05T18:18:47","guid":{"rendered":"https:\/\/commandlinux.com\/?p=7886"},"modified":"2026-03-06T15:21:11","modified_gmt":"2026-03-06T15:21:11","slug":"secure-boot","status":"publish","type":"post","link":"https:\/\/commandlinux.com\/arch-linux\/secure-boot\/","title":{"rendered":"How to Verify, Activate, or Turn Off Secure Boot on Linux"},"content":{"rendered":"\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n<link href=\"https:\/\/fonts.googleapis.com\/css2?family=Lora:wght@400;500;600&#038;family=JetBrains+Mono:wght@400;500&#038;display=swap\" rel=\"stylesheet\">\n<style>\n  code, kbd {\n    font-family: 'JetBrains Mono', 'Courier New', monospace;\n    font-size: 0.85em;\n    background: #f3f4f6;\n    padding: 0.15em 0.4em;\n    border-radius: 3px;\n    color: #c0392b;\n  }\n\n  pre {\n    font-family: 'JetBrains Mono', 'Courier New', monospace;\n    font-size: 0.875rem;\n    background: #1e1e1e;\n    color: #d4d4d4;\n    padding: 1.1rem 1.4rem;\n    border-radius: 6px;\n    overflow-x: auto;\n    margin: 0.6rem 0 1.2rem;\n    line-height: 1.6;\n  }\n\n  pre code {\n    background: none;\n    color: inherit;\n    padding: 0;\n    font-size: inherit;\n  }\n\n  table {\n    width: 100%;\n    border-collapse: collapse;\n    margin: 1rem 0 1.4rem;\n    font-size: 0.93rem;\n  }\n\n  th {\n    background: #f0f0f0;\n    font-family: 'Lora', serif;\n    font-weight: 600;\n    text-align: left;\n    padding: 0.6rem 0.9rem;\n    border: 1px solid #ddd;\n  }\n\n  td {\n    padding: 0.55rem 0.9rem;\n    border: 1px solid #ddd;\n    vertical-align: top;\n  }\n\n  tr:nth-child(even) td { background: #fafafa; }\n\n.secure-boot-container  ul {\n    margin: 0.4rem 0 1rem 1.4rem;\n  }\n\n.secure-boot-container   ul li {\n    margin-bottom: 0.35rem;\n  }\n\n  .note, .warning, .tip {\n    padding: 0.85rem 1.1rem;\n    border-radius: 5px;\n    margin: 1rem 0 1.3rem;\n    font-size: 0.94rem;\n    line-height: 1.65;\n  }\n\n  .note {\n    background: #eff6ff;\n    border-left: 4px solid #3b82f6;\n  }\n\n  .warning {\n    background: #fff1f2;\n    border-left: 4px solid #ef4444;\n  }\n\n  .tip {\n    background: #f0fdf4;\n    border-left: 4px solid #22c55e;\n  }\n\n  .note strong, .warning strong, .tip strong {\n    display: inline-block;\n    margin-right: 0.3em;\n    font-weight: 600;\n  }\n\n  hr {\n    border: none;\n    border-top: 1px solid #e5e7eb;\n    margin: 2rem 0;\n  }\n\n  \/* FAQ Accordion *\/\n  .faq-section { margin-top: 2.5rem; }\n\n  .faq-section h2 { margin-top: 0; }\n\n  .faq-item {\n    border-bottom: 1px solid #e5e7eb;\n    margin-bottom: 0;\n  }\n\n  .faq-item input[type=\"checkbox\"] {\n    display: none;\n  }\n\n  .faq-item label {\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    cursor: pointer;\n    padding: 0.85rem 0;\n    user-select: none;\n  }\n\n  .faq-item label h3 {\n    font-size: 1rem;\n    font-weight: 600;\n    color: #111;\n    margin: 0;\n    line-height: 1.4;\n  }\n\n  .faq-item label::after {\n    content: '+';\n    font-size: 1.3rem;\n    color: #555;\n    flex-shrink: 0;\n    margin-left: 1rem;\n    transition: transform 0.2s ease;\n    font-family: monospace;\n  }\n\n  .faq-item input:checked + label::after {\n    content: '\u2212';\n  }\n\n  .faq-answer {\n    max-height: 0;\n    overflow: hidden;\n    transition: max-height 0.3s ease, padding 0.2s ease;\n  }\n\n  .faq-item input:checked ~ .faq-answer {\n    max-height: 200px;\n    padding-bottom: 0.9rem;\n  }\n\n  .faq-answer p {\n    font-size: 0.94rem;\n    color: #333;\n    margin: 0;\n    line-height: 1.65;\n  }\n\n  @media (max-width: 600px) {\n    body { font-size: 16px; padding: 1.2rem 1rem 3rem; }\n    h2 { font-size: 1.25rem; }\n    pre { font-size: 0.8rem; padding: 0.9rem 1rem; }\n  }\n<\/style>\n<\/head>\n<body>\n\n<p>Secure Boot is a UEFI feature that checks every piece of startup software against a database of trusted cryptographic signatures. If anything in the boot chain fails verification, the system halts. This blocks rootkits and boot-level malware before your OS ever loads.<\/p>\n\n<h2>How Secure Boot Works on Linux<\/h2>\n\n<p>The firmware stores three types of keys that control what runs at boot:<\/p>\n\n<table>\n  <thead>\n    <tr>\n      <th>Key Type<\/th>\n      <th>Purpose<\/th>\n    <\/tr>\n  <\/thead>\n  <tbody>\n    <tr>\n      <td><code>Platform Key (PK)<\/code><\/td>\n      <td>Root authority over all key operations<\/td>\n    <\/tr>\n    <tr>\n      <td><code>Key Exchange Key (KEK)<\/code><\/td>\n      <td>Authorizes changes to the signature database<\/td>\n    <\/tr>\n    <tr>\n      <td><code>Signature Database (db)<\/code><\/td>\n      <td>Holds public keys of approved software publishers<\/td>\n    <\/tr>\n  <\/tbody>\n<\/table>\n\n<p>At startup, the firmware checks the bootloader&#8217;s signature against the <code>db<\/code>. The bootloader then checks the kernel. Both must pass before the OS runs. Distributions like Ubuntu, Fedora, and openSUSE ship pre-signed bootloaders and work with Secure Boot out of the box.<\/p>\n\n<h2>How to Check Secure Boot Status on Linux<\/h2>\n\n<p>Open a terminal and run:<\/p>\n\n<pre><code>$ sudo mokutil --sb-state<\/code><\/pre>\n\n<p>The output shows either <code>SecureBoot enabled<\/code> or <code>SecureBoot disabled<\/code>. The <code>mokutil<\/code> utility comes with the <code>shim<\/code> package on most distributions. If it is missing, install <code>shim<\/code> through your package manager.<\/p>\n\n<p>To inspect the firmware variable directly:<\/p>\n\n<pre><code>$ cat \/sys\/firmware\/efi\/efivars\/SecureBoot-*<\/code><\/pre>\n\n<div class=\"tip\">\n  <strong>Tip:<\/strong> Run <code>sudo bootctl status<\/code> or <code>sudo dmesg | grep -i secure<\/code> for an alternative way to confirm Secure Boot state, especially on systemd-based distributions.\n<\/div>\n\n<h2>How to Enable Secure Boot on Linux<\/h2>\n\n<p>Secure Boot is toggled from your firmware setup screen, not from within Linux itself.<\/p>\n\n<ol style=\"margin: 0.4rem 0 1rem 1.4rem;\">\n  <li style=\"margin-bottom: 0.5rem;\">Restart your computer and press the firmware key during POST \u2014 commonly <kbd>F2<\/kbd>, <kbd>Del<\/kbd>, or <kbd>Esc<\/kbd>.<\/li>\n  <li style=\"margin-bottom: 0.5rem;\">Navigate to the <strong>Security<\/strong> or <strong>Boot<\/strong> tab.<\/li>\n  <li style=\"margin-bottom: 0.5rem;\">Find the <strong>Secure Boot<\/strong> option and set it to <strong>Enabled<\/strong>.<\/li>\n  <li style=\"margin-bottom: 0.5rem;\">Save your settings and exit.<\/li>\n<\/ol>\n\n<div class=\"note\">\n  <strong>Note:<\/strong> If your distribution was installed while Secure Boot was disabled, re-enabling it may prevent booting. A non-secure-boot shim may have been installed during setup. Test after enabling and revert if the system fails to boot.\n<\/div>\n\n<h2>How to Disable Secure Boot on Linux<\/h2>\n\n<p>Disable Secure Boot when a third-party driver, custom kernel, or unsigned bootloader blocks your system from starting.<\/p>\n\n<ol style=\"margin: 0.4rem 0 1rem 1.4rem;\">\n  <li style=\"margin-bottom: 0.5rem;\">Restart and enter firmware setup using the appropriate key for your hardware.<\/li>\n  <li style=\"margin-bottom: 0.5rem;\">Go to the <strong>Security<\/strong> or <strong>Boot<\/strong> section.<\/li>\n  <li style=\"margin-bottom: 0.5rem;\">Set <strong>Secure Boot<\/strong> to <strong>Disabled<\/strong>.<\/li>\n  <li style=\"margin-bottom: 0.5rem;\">Save and reboot.<\/li>\n<\/ol>\n\n<div class=\"warning\">\n  <strong>Warning:<\/strong> Disabling Secure Boot removes verification of your startup chain. Unsigned code \u2014 including malware \u2014 can run during boot. Re-enable it as soon as the reason for disabling it no longer applies.\n<\/div>\n\n<h3>Disable Secure Boot Validation from the Terminal (Ubuntu\/Debian)<\/h3>\n\n<p>On systems using <code>shim<\/code>, you can disable Secure Boot validation without entering firmware:<\/p>\n\n<pre><code>$ sudo mokutil --disable-validation<\/code><\/pre>\n\n<p>Enter a temporary password (8\u201316 digits) when prompted. Reboot, then follow the on-screen MOK management prompts to confirm. To re-enable validation later:<\/p>\n\n<pre><code>$ sudo mokutil --enable-validation<\/code><\/pre>\n\n<h2>How to Sign a Custom Kernel for Secure Boot<\/h2>\n\n<p>If you compile your own kernel, you must sign it before the firmware will accept it. On Debian-based systems, install the signing tools first:<\/p>\n\n<pre><code># apt-get install sbsigntools<\/code><\/pre>\n\n<p>Generate a signing key and self-signed certificate:<\/p>\n\n<pre><code>$ openssl req -new -x509 -newkey rsa:2048 \\\n  -subj \"\/CN=CustomKernel\/\" \\\n  -keyout MOK.key -out MOK.crt \\\n  -days 3650 -nodes<\/code><\/pre>\n\n<p>Sign the kernel image:<\/p>\n\n<pre><code>$ sbsign --key MOK.key --cert MOK.crt \\\n  \/boot\/vmlinuz -o \/boot\/vmlinuz.signed<\/code><\/pre>\n\n<p>Import the certificate into the Machine Owner Key list:<\/p>\n\n<pre><code>$ sudo mokutil --import MOK.crt<\/code><\/pre>\n\n<p>Reboot and follow the on-screen prompts to enroll the key. After enrollment, the firmware trusts your signed kernel.<\/p>\n\n<div class=\"warning\">\n  <strong>Warning:<\/strong> Store <code>MOK.key<\/code> securely. Treat it like a password. Lock down file permissions with <code>chmod 600 MOK.key<\/code>. Anyone with access to this key can sign arbitrary code your firmware will trust.\n<\/div>\n\n<h2>Practical Tips for Managing Secure Boot on Linux<\/h2>\n\n<ul>\n  <li>After any kernel or bootloader update, confirm the new files are correctly signed before rebooting.<\/li>\n  <li>Review boot-time signature errors with <code>journalctl -b | grep -i secureboot<\/code>.<\/li>\n  <li>Check firmware variables at <code>\/sys\/firmware\/efi\/efivars\/<\/code> to inspect current key state.<\/li>\n  <li>Pair Secure Boot with a firewall and regular package updates \u2014 it only protects the boot chain, not the running system.<\/li>\n<\/ul>\n\n<hr>\n\n<div class=\"faq-section\">\n  <h2>FAQs<\/h2>\n\n  <div class=\"faq-item\">\n    <input type=\"checkbox\" id=\"faq1\">\n    <label for=\"faq1\"><h3>How do I check if Secure Boot is enabled on Linux?<\/h3><\/label>\n    <div class=\"faq-answer\">\n      <p>Run <code>sudo mokutil --sb-state<\/code> in a terminal. The output reads either <code>SecureBoot enabled<\/code> or <code>SecureBoot disabled<\/code>. Alternatively, run <code>sudo bootctl status<\/code> on systemd-boot systems.<\/p>\n    <\/div>\n  <\/div>\n\n  <div class=\"faq-item\">\n    <input type=\"checkbox\" id=\"faq2\">\n    <label for=\"faq2\"><h3>Can I disable Secure Boot without entering the BIOS?<\/h3><\/label>\n    <div class=\"faq-answer\">\n      <p>Yes, on systems using <code>shim<\/code>. Run <code>sudo mokutil --disable-validation<\/code>, set a temporary password, then reboot and confirm via the MOK management screen.<\/p>\n    <\/div>\n  <\/div>\n\n  <div class=\"faq-item\">\n    <input type=\"checkbox\" id=\"faq3\">\n    <label for=\"faq3\"><h3>Does disabling Secure Boot on Linux affect Windows in a dual-boot setup?<\/h3><\/label>\n    <div class=\"faq-answer\">\n      <p>Windows will still boot, but its Secure Boot protections are also removed. Re-enable Secure Boot after resolving your Linux boot issue to restore protection for both operating systems.<\/p>\n    <\/div>\n  <\/div>\n\n  <div class=\"faq-item\">\n    <input type=\"checkbox\" id=\"faq4\">\n    <label for=\"faq4\"><h3>Why won&#8217;t Linux boot after enabling Secure Boot?<\/h3><\/label>\n    <div class=\"faq-answer\">\n      <p>Your distribution may have installed an unsigned shim when Secure Boot was disabled at install time. Reinstall with Secure Boot enabled, or enroll your bootloader&#8217;s key using <code>mokutil --import<\/code>.<\/p>\n    <\/div>\n  <\/div>\n\n  <div class=\"faq-item\">\n    <input type=\"checkbox\" id=\"faq5\">\n    <label for=\"faq5\"><h3>Do I need to verify Secure Boot status after a kernel update?<\/h3><\/label>\n    <div class=\"faq-answer\">\n      <p>Yes. Kernel updates can replace the signed image. Confirm the new kernel is signed by running <code>sudo mokutil --sb-state<\/code> after reboot, and check <code>journalctl -b | grep -i secureboot<\/code> for errors.<\/p>\n    <\/div>\n  <\/div>\n<\/div>\n\n<\/body>\n<\/html>\n","protected":false},"excerpt":{"rendered":"<p>Secure Boot is a UEFI feature that checks every piece of startup software against a database of trusted cryptographic signatures. If anything in the boot chain fails verification, the system halts. This blocks rootkits and boot-level malware before your OS ever loads. How Secure Boot Works on Linux The firmware stores three types of keys<\/p>\n","protected":false},"author":1,"featured_media":7887,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[47],"tags":[],"class_list":["post-7886","post","type-post","status-publish","format-standard","has-post-thumbnail","category-arch-linux"],"_links":{"self":[{"href":"https:\/\/commandlinux.com\/wp-json\/wp\/v2\/posts\/7886","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/commandlinux.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/commandlinux.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/commandlinux.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/commandlinux.com\/wp-json\/wp\/v2\/comments?post=7886"}],"version-history":[{"count":2,"href":"https:\/\/commandlinux.com\/wp-json\/wp\/v2\/posts\/7886\/revisions"}],"predecessor-version":[{"id":7939,"href":"https:\/\/commandlinux.com\/wp-json\/wp\/v2\/posts\/7886\/revisions\/7939"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/commandlinux.com\/wp-json\/wp\/v2\/media\/7887"}],"wp:attachment":[{"href":"https:\/\/commandlinux.com\/wp-json\/wp\/v2\/media?parent=7886"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/commandlinux.com\/wp-json\/wp\/v2\/categories?post=7886"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/commandlinux.com\/wp-json\/wp\/v2\/tags?post=7886"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}