{"id":13758,"date":"2024-09-21T17:26:16","date_gmt":"2024-09-21T09:26:16","guid":{"rendered":"https:\/\/blog.pfchina.org\/?p=13758"},"modified":"2024-09-21T17:26:56","modified_gmt":"2024-09-21T09:26:56","slug":"opnsense%e7%a6%81%e6%ad%a2%e4%bb%a5root%e7%94%a8%e6%88%b7%e8%ba%ab%e4%bb%bd%e7%99%bb%e5%bd%95","status":"publish","type":"post","link":"https:\/\/blog.pfchina.org\/?p=13758","title":{"rendered":"OPNsense\u7981\u6b62\u4ee5root\u7528\u6237\u8eab\u4efd\u767b\u5f55"},"content":{"rendered":"<p style=\"text-align: justify;\">\u5b89\u88c5OPNsense\u540e\uff0c\u9ed8\u8ba4\u767b\u5f55\u540d\u4e3aroot\u7528\u6237\u3002\u4e3a\u4e86\u4fdd\u8bc1\u5b89\u5168\uff0c\u5f3a\u70c8\u4e0d\u5efa\u8baeroot\u4ee5\u7528\u6237\u8eab\u4efd\u767b\u5f55\uff0c\u56e0\u4e3a\u7528\u6237\u5bf9\u6587\u4ef6\u548c\u8fdb\u7a0b\u5177\u6709\u5b8c\u5168\u8bbf\u95ee\u6743\u9650\u3002\u4f8b\u5982\uff0cLinux\u7528\u6237\u5728\u5b89\u88c5\u65f6\u4f1a\u88ab\u8981\u6c42\u521b\u5efa\u4e00\u4e2a\u5355\u72ec\u7684\u7528\u6237\u5e10\u6237\u3002\u7136\u540e\u7528\u6237\u53ef\u4ee5\u4f7f\u7528sudo\u547d\u4ee4\u63d0\u5347\u6743\u9650\u6765\u6267\u884c\u7ba1\u7406\u4efb\u52a1\u3002\u5982\u679c\u7528\u6237\u7684\u5e10\u6237\u88ab\u76d7\u7528\uff0c\u7406\u8bba\u4e0a\u8be5root\u5e10\u6237\u4ecd\u7136\u53d7\u5230\u4fdd\u62a4\uff08\u5047\u8bbe\u6ca1\u6709\u7279\u6743\u63d0\u5347\u6f0f\u6d1e\u88ab\u5229\u7528\u6216\u5bc6\u7801\u5df2\u88ab\u53d1\u73b0\uff09\u3002<\/p>\n<div class=\"gtx-body\" style=\"text-align: justify;\">OpenSSH\u6709\u4e00\u4e2a\u9009\u9879\u53ef\u4ee5\u7981\u7528SSH\u670d\u52a1\u5668\u7684root\u7528\u6237\u8bbf\u95ee\u6743\u9650\u3002\u4f5c\u4e3a\u4e00\u79cd\u5b89\u5168\u673a\u5236\uff0c\u5b83\u53ef\u4ee5\u9632\u6b62\u4ee5root\u7528\u6237\u76f4\u63a5\u767b\u5f55\u3002\u57fa\u4e8eFreeBSD\u6784\u5efa\u7684OPNsense\u4e5f\u4e0d\u4f8b\u5916\u3002<\/div>\n<h2 id=\"create-a-new-administrator-account\" style=\"text-align: justify;\">\u521b\u5efa\u65b0\u7684\u7ba1\u7406\u5458\u5e10\u6237<\/h2>\n<p style=\"text-align: justify;\">\u8f6c\u5230\u201c\u7cfb\u7edf&gt;\u8bbf\u95ee&gt;\u7528\u6237\u201d\uff0c\u53ef\u4ee5\u770b\u5230root\u4e3a\u5217\u51fa\u7684\u9ed8\u8ba4\u7528\u6237\uff1a<\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"img \" title=\"\" src=\"https:\/\/homenetworkguy.com\/images\/how-to\/disable-root-user-opnsense\/opnsense-user-access-list_hu19e68e770720d7283d623bff6fd2cd21_17898_1099x291_resize_q90_h2_lanczos_3.webp\" alt=\"\u9ed8\u8ba4\u7528\u6237\u5e10\u6237\u5217\u8868\" width=\"1099\" height=\"291\" \/><\/p>\n<p style=\"text-align: justify;\">\u5728\u7981\u7528root\u7528\u6237\u5e10\u6237\u4e4b\u524d\uff0c\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u8bbe\u7f6e\u4e3a\u7ba1\u7406\u5458\u7684\u65b0\u7528\u6237\u5e10\u6237\u3002\u521b\u5efa\u65b0\u7ba1\u7406\u5458\u65f6\uff0c\u6700\u91cd\u8981\u7684\u90e8\u5206\u662f\u201c\u7ec4\u6210\u5458\u201d\u90e8\u5206\u3002\u9700\u8981\u5c06\u201c\u7ba1\u7406\u5458\u201d\u7ec4\u4ece\u5de6\u4fa7\u6846\u79fb\u52a8\u5230\u53f3\u4fa7\u6846\uff1a<\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"img \" title=\"\" src=\"https:\/\/homenetworkguy.com\/images\/how-to\/disable-root-user-opnsense\/add-user-member-group_hub50d86c2d84fad3f87163804fd529092_13074_820x483_resize_q90_h2_lanczos_3.webp\" alt=\"\u56e2\u4f53\u4f1a\u5458\u79d1\" width=\"820\" height=\"483\" \/><\/p>\n<p style=\"text-align: justify;\">\u6dfb\u52a0\u65b0\u7528\u6237\u540e\uff0c\u60a8\u4f1a\u6ce8\u610f\u5230\u60a8\u6709\u4e24\u4e2a\u7ba1\u7406\u5458\u5e10\u6237\uff1a<\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"img \" title=\"\" src=\"https:\/\/homenetworkguy.com\/images\/how-to\/disable-root-user-opnsense\/opnsense-user-access-list-with-new-user_hu0dc4b2fc6e119de307a2f94ef9c67ca1_20644_1101x326_resize_q90_h2_lanczos_3.webp\" alt=\"\u7528\u6237\u5e10\u6237\u5217\u8868\" width=\"1101\" height=\"326\" \/><\/p>\n<h2 id=\"disable-root-user\" style=\"text-align: justify;\">\u7981\u7528root\u7528\u6237<\/h2>\n<p style=\"text-align: justify;\">\u73b0\u5728\u5df2\u7ecf\u521b\u5efa\u65b0\u7684\u7ba1\u7406\u5458\u7528\u6237\uff0c\u9700\u8981\u6ce8\u9500\u8be5root\u5e10\u6237\uff0c\u7136\u540e\u767b\u5f55\u65b0\u7684\u7ba1\u7406\u5458\u5e10\u6237\u3002<\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"img \" title=\"\" src=\"https:\/\/homenetworkguy.com\/images\/how-to\/disable-root-user-opnsense\/lobby-logout-link_hu38d6e27c783f53e3507c119915ac67e2_6498_284x245_resize_q90_h2_lanczos_3.webp\" alt=\"\u767b\u51fa\u94fe\u63a5\" width=\"284\" height=\"245\" \/><\/p>\n<p style=\"text-align: justify;\">\u6ce8\u610f\uff1a\u5df2\u767b\u5f55\u5e10\u53f7\u65e0\u6cd5\u7981\u7528\u81ea\u5df1\u3002<\/p>\n<p style=\"text-align: justify;\">\u8fd4\u56de\u201c\u7cfb\u7edf &gt; \u8bbf\u95ee &gt; \u7528\u6237\u201d\u9875\u9762\u3002\u73b0\u5728\u5355\u51fbroot\u7528\u6237\u65c1\u8fb9\u7684\u7f16\u8f91\u6309\u94ae\u3002\u5355\u51fb\u6807\u7b7e\u201c\u5df2\u7981\u7528\u201d\u65c1\u8fb9\u7684\u590d\u9009\u6846\uff1a<\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"img \" title=\"\" src=\"https:\/\/homenetworkguy.com\/images\/how-to\/disable-root-user-opnsense\/disable-root-user_hue10348552bae2c27431e4e2e34a16de8_12921_614x475_resize_q90_h2_lanczos_3.webp\" alt=\"\u7981\u7528 Root \u7528\u6237\" width=\"614\" height=\"475\" \/><\/p>\n<p style=\"text-align: justify;\">\u5355\u51fb\u201c\u4fdd\u5b58\u201d\u5e76\u8fd4\u56de\u7528\u6237\u5e10\u6237\u9875\u9762\u540e\uff0c\u5e94\u8be5\u770b\u5230\u8be5root\u7528\u6237\u73b0\u5728\u53d8\u4e3a\u7070\u8272\uff0c\u8868\u793a\u5df2\u88ab\u7981\u7528\u3002<\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"img \" title=\"\" src=\"https:\/\/homenetworkguy.com\/images\/how-to\/disable-root-user-opnsense\/opnsense-user-access-list-with-root-disabled_hu18982dba494a9c67da2cb1b90c3f809b_20534_1101x305_resize_q90_h2_lanczos_3.webp\" alt=\"\u5df2\u7981\u7528 Root \u6743\u9650\u7684\u7528\u6237\u5e10\u6237\u5217\u8868\" width=\"1101\" height=\"305\" \/><\/p>\n<p style=\"text-align: justify;\">\u73b0\u5728\uff0c\u6211\u4eec\u53ea\u80fd\u4f7f\u7528\u65b0\u521b\u5efa\u7684\u7ba1\u7406\u5458\u7528\u6237\u5e10\u6237\u767b\u5f55\uff01<\/p>\n<h2 id=\"optional-enabling-sudo-for-ssh-access\" style=\"text-align: justify;\">\u542f\u7528Sudo\u8fdb\u884cSSH\u8bbf\u95ee<\/h2>\n<p style=\"text-align: justify;\">\u5982\u679c\u5e0c\u671b\u5728\u901a\u8fc7SSH\u6216\u63a7\u5236\u53f0\u767b\u5f55\u65f6\u62e5\u6709\u6743\u9650\uff0c\u5219\u9700\u8981\u542f\u7528sudo\uff0csudo\u5982\u4e0b\u9762\u7684\u5c4f\u5e55\u622a\u56fe\u6240\u793a\u3002\u53ef\u4ee5\u5728\u201c\u7cfb\u7edf &gt; \u8bbe\u7f6e &gt; \u7ba1\u7406\u201d\u9875\u9762\u5e95\u90e8\u9644\u8fd1\u7684\u201c\u8eab\u4efd\u9a8c\u8bc1\u201d\u90e8\u5206\u4e2d\u627e\u5230\u8fd9\u4e9b\u8bbe\u7f6e\u3002<\/p>\n<p style=\"text-align: justify;\">\u201cSudo\u201d\u9009\u9879\u9009\u62e9\u201c\u8be2\u95ee\u5bc6\u7801\u201d\u3002\u4e5f\u53ef\u4ee5\u9009\u62e9\u201cwheel, admins\u201d\u800c\u4e0d\u662f\u201cwheel\u201d\uff0c\u4ee5\u4e0eSSH\u7684\u767b\u5f55\u7ec4\u4fdd\u6301\u4e00\u81f4\u3002<\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"img \" title=\"\" src=\"https:\/\/homenetworkguy.com\/images\/how-to\/disable-root-user-opnsense\/allow-sudo_hudc9e45024a68db32a487e5d6d551a194_13829_711x338_resize_q90_h2_lanczos_3.webp\" alt=\"\u5141\u8bb8 Sudo\" width=\"711\" height=\"338\" \/><\/p>\n<p style=\"text-align: justify;\">\u5f53\u901a\u8fc7\u65b0\u7684\u7ba1\u7406\u5458\u5e10\u6237\u767b\u5f55SSH\u65f6\uff0c\u53ef\u4ee5\u8f93\u5165sudo su\uff0c\u5e76\u4e14\u5c06\u4f1a\u770b\u5230\u4e0e\u4ee5root\u7528\u6237\u8eab\u4efd\u767b\u5f55\u76f8\u540c\u7684\u83dc\u5355\u9009\u9879\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b89\u88c5OPNsense\u540e\uff0c\u9ed8\u8ba4\u767b\u5f55\u540d\u4e3aroot\u7528\u6237\u3002\u4e3a\u4e86\u4fdd\u8bc1\u5b89\u5168\uff0c\u5f3a\u70c8\u4e0d\u5efa\u8baeroo &hellip; <a href=\"https:\/\/blog.pfchina.org\/?p=13758\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[456,457],"class_list":["post-13758","post","type-post","status-publish","format-standard","hentry","category-opnsense","tag-root","tag-457"],"_links":{"self":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts\/13758","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=13758"}],"version-history":[{"count":5,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts\/13758\/revisions"}],"predecessor-version":[{"id":13763,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts\/13758\/revisions\/13763"}],"wp:attachment":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=13758"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=13758"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=13758"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}