{"id":294,"date":"2018-08-12T05:35:28","date_gmt":"2018-08-12T02:35:28","guid":{"rendered":"http:\/\/kifarunix.com\/?p=294"},"modified":"2024-03-11T08:23:12","modified_gmt":"2024-03-11T05:23:12","slug":"how-to-reset-or-recover-root-password-on-opnsense","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/how-to-reset-or-recover-root-password-on-opnsense\/","title":{"rendered":"How To Reset Or Recover Root Password On OPNsense"},"content":{"rendered":"\n<p>How To Reset Or Recover Root Password On <a href=\"https:\/\/opnsense.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">OPNsense<\/a>? So for some reason you just forgot the root password for your OPNsense router\/firewall and you are now locked out and don&#8217;t know what to do!!? Relax as in this article, we will show you how you can recover the password from single user mode.<\/p>\n\n\n\n<p>You can also check our previous guide on <a href=\"https:\/\/kifarunix.com\/how-to-install-opnsense-on-virtualbox\/\" target=\"_blank\" rel=\"noopener\">how to install OPNsense Firewall on VirtualBox<\/a>.<\/p>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>Table of Contents<\/h2><nav><ul><li><a href=\"#resetting-or-recovering-root-password-on-op-nsense\">Resetting Or Recovering Root Password On OPNsense<\/a><ul><li><a href=\"#boot-op-nsense-into-single-user-mode\">Boot OPNsense into Single User Mode<\/a><\/li><li><a href=\"#mount-root-partition-in-read-write-mode\">Mount Root Partition in Read\/Write Mode<\/a><\/li><li><a href=\"#reset-or-recover-root-password-on-op-nsense\">Reset Or Recover Root Password On OPNsense<\/a><\/li><li><a href=\"#reboot-op-nsense\">Reboot OPNsense<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"resetting-or-recovering-root-password-on-op-nsense\">Resetting Or Recovering Root Password On OPNsense<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"boot-op-nsense-into-single-user-mode\">Boot OPNsense into Single User Mode<\/h3>\n\n\n\n<p>The first step in recovering lost or forgotten root password for opnsense router\/firewall is to boot it to <strong>single user mode<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"572\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/05\/boot-opnsense-virtualbox.png\" alt=\"OPNsense single user mode\" class=\"wp-image-16502\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/05\/boot-opnsense-virtualbox.png?v=1683739838 969w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/05\/boot-opnsense-virtualbox-768x453.png?v=1683739838 768w\" sizes=\"(max-width: 969px) 100vw, 969px\" \/><\/figure>\n\n\n\n<p>Therefore reboot OPNsense and once it boots, immediately press 2 on your keyboard to switch to <strong>Single User Mode<\/strong> from the loader menu as shown in the screenshot above.<\/p>\n\n\n\n<p>After it boots, you will be prompted to select the shell. Press Enter to start <strong>\/bin\/sh.<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"mount-root-partition-in-read-write-mode\">Mount Root Partition in Read\/Write Mode<\/h3>\n\n\n\n<p>Before you can reset the password, you need to remount the drives as rewritable.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mount -o rw \/<\/code><\/pre>\n\n\n\n<p>OR to mount all the drives;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mount -a -t ufs<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"reset-or-recover-root-password-on-op-nsense\">Reset Or Recover Root Password On OPNsense<\/h3>\n\n\n\n<p>Once you have mounted the drives, run the following command to reset the root password.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>opnsense-shell password<\/code><\/pre>\n\n\n\n<p>Follow the prompts to reset the password.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"875\" height=\"542\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/05\/reset-root-user-password.png\" alt=\"\" class=\"wp-image-16508\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/05\/reset-root-user-password.png?v=1683743109 875w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/05\/reset-root-user-password-768x476.png?v=1683743109 768w\" sizes=\"(max-width: 875px) 100vw, 875px\" \/><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"reboot-op-nsense\">Reboot OPNsense<\/h3>\n\n\n\n<p>You can reboot the system and log in with new password.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span class=\"hljs-section\">\/sbin\/reboot<\/span><\/code><\/pre>\n\n\n\n<p>And Voila!! This is how simple it is to reset or recover root password on OPNsense.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How To Reset Or Recover Root Password On OPNsense? So for some reason you just forgot the root password for your OPNsense router\/firewall and you<\/p>\n","protected":false},"author":1,"featured_media":16502,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[34,44,45],"tags":[11,41,6637,6635,6634,6636],"class_list":["post-294","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-security","category-firewall","category-opnsense","tag-firewall","tag-opnsense","tag-opnsense-shell","tag-recover-opnsense-root-password","tag-reset-opnsense-root-password","tag-use-opnsense-shell-password","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/294"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=294"}],"version-history":[{"count":10,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/294\/revisions"}],"predecessor-version":[{"id":20971,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/294\/revisions\/20971"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/16502"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=294"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=294"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=294"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}