Cento8<\/strong><\/div>\n\u5728\u6211\u5b9e\u9645\u6d4b\u8bd5\u7528\u8fd9\u4e2a\u65b9\u6cd5\u5728centos8\u662f\u6709\u6548\u7684\u3002<\/p>\n
\u5728root\u6743\u9650\u7f16\u8f91\"grub.d\"\u76ee\u5f55\u4e0b\u7684\"00_header\"\u6587\u4ef6\uff0c\u547d\u4ee4\u6a21\u5f0f\u8f93\u5165\u5927\u5199G\uff0c\u8df3\u8f6c\u5230\u6587\u4ef6\u5c3e\u90e8\u3002<\/p>\n
vim \/etc\/grub.d\/00_header<\/pre>\n<\/p>\n
\u5728\u5c3e\u90e8\u8ffd\u52a0\u4e0b\u9762\u7684\u8bed\u53e5\uff0c\u4e24\u5904admin\u4f4d\u7f6e\u4ee3\u8868\u8d26\u6237\uff0cqwe123\u4f4d\u7f6e\u4ee3\u8868\u5bc6\u7801\uff0c\u53ef\u4ee5\u81ea\u884c\u8bbe\u7f6e\u5176\u4ed6\u3002<\/p>\n
cat <<EOF\r\nset superusers='admin'\r\npassword admin qwe123\r\nE0F<\/pre>\n
\n\u6587\u4ef6\u7f16\u8f91\u4fdd\u5b58\uff0c\u66f4\u65b0\u4e00\u4e0bgrub\u6587\u4ef6<\/p>\n
grub2-mkconfig -o \/boot\/grub2\/grub.cfg<\/pre>\n
\n\u7136\u540e\u91cd\u542f\uff0c\u5728\u5f00\u673agrub\u9009\u62e9\u9875\u9762\u6309e\u8fdb\u5165\u7f16\u8f91\u5f15\u5bfc\uff0c\u5982\u679c\u6709\u9700\u8981\u767b\u5f55\u4e14\u8f93\u5165\u5bf9\u5e94\u7684\u8d26\u6237\u5bc6\u7801\u8fdb\u5165\u7f16\u8f91\uff0c\u5373\u4e3a\u8bbe\u7f6e\u6210\u529f\u3002
\n<\/p>\n
Centos7.2\/Centos8<\/strong><\/div>\n\u9996\u5148\u8bbe\u7f6e\u5bc6\u7801<\/p>\n
grub2-set-password<\/pre>\n\u8bb0\u4f4f\u5bc6\u7801\uff0c\u8f93\u5165\u4e24\u6b21\u786e\u8ba4\u5bc6\u7801:
\n
\n\u5bc6\u7801\u5bc6\u6587\u5b58\u653e\u5728\uff1a\/boot\/grub2\/user.cfg\u6587\u4ef6\u4e2d
\n
\n\u8fd9\u6837\u751f\u6210\u7684\u9ed8\u8ba4\u8d26\u6237\u662froot\uff0c\u6709\u9700\u8981\u53ef\u4ee5\u628aroot\u4fee\u6539\u6210\u5176\u4ed6\u7684:<\/p>\n
vim \/etc\/grub.d\/01_users<\/pre>\n<\/p>\n
\u6700\u540e\u4e00\u6b65\u66f4\u65b0grub\u3002<\/p>\n
grub2-mkconfig -o \/boot\/grub2\/grub.cfg<\/pre>\n\u7136\u540e\u91cd\u542f\u5728grub\u9009\u62e9\u9879\u90a3\u91cc\u6309e\u6d4b\u8bd5grub\u8d26\u6237\u5bc6\u7801\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
\u5728\u6211\u5b9e\u9645\u6d4b\u8bd5\u7528\u8fd9\u4e2a\u65b9\u6cd5\u5728centos8\u662f\u6709\u6548\u7684\u3002 \u5728root\u6743\u9650\u7f16\u8f91”grub.d”\u76ee\u5f55\u4e0b\u7684”00_heade […]<\/p>\n","protected":false},"author":362,"featured_media":199801,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-199750","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/199750","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/362"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=199750"}],"version-history":[{"count":30,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/199750\/revisions"}],"predecessor-version":[{"id":199866,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/199750\/revisions\/199866"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/199801"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=199750"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=199750"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=199750"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}