{"id":5245,"date":"2022-08-17T15:05:58","date_gmt":"2022-08-17T07:05:58","guid":{"rendered":"https:\/\/www.baishitou.cn\/?p=5245"},"modified":"2022-08-17T15:17:26","modified_gmt":"2022-08-17T07:17:26","slug":"centos%e7%b3%bb%e7%bb%9f%e5%a6%82%e4%bd%95%e9%87%8d%e7%bd%aeroot%e5%af%86%e7%a0%81","status":"publish","type":"post","link":"https:\/\/www.baishitou.cn\/5245.html","title":{"rendered":"CentOS\u7cfb\u7edf\u5982\u4f55\u91cd\u7f6eroot\u5bc6\u7801"},"content":{"rendered":"
\u5982\u679c\u60a8\u5fd8\u8bb0\u4e86CentOS\u670d\u52a1\u5668\u5bc6\u7801\uff0c\u5e76\u4e14\u65e0\u6cd5\u8bbf\u95eeroot\u5e10\u6237\uff0c\u5219\u9700\u8981\u542f\u52a8\u5230\u5355\u7528\u6237\u6a21\u5f0f\u5e76\u91cd\u7f6e root \u5bc6\u7801\u3002\u60a8\u5c06\u5728\u4e0b\u9762\u627e\u5230 CentOS 6\u30017\u30018\u30018 Stream \u548c 9 Stream \u7684\u8bf4\u660e\u3002<\/p>\n CentOS\u7cfb\u7edf\u5982\u4f55\u91cd\u7f6eRoot\u5bc6\u7801 \u5982\u679c\u60a8\u5fd8\u8bb0\u4e86CentOS\u670d\u52a1\u5668\u5bc6\u7801\uff0c\u5e76\u4e14\u65e0\u6cd5\u8bbf\u95eeroot\u5e10\u6237\uff0c\u5219\u9700\u8981\u542f\u52a8 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[1015,1686,1687],"class_list":["post-5245","post","type-post","status-publish","format-standard","hentry","category-vultrvps","tag-centos","tag-root"],"_links":{"self":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts\/5245","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/comments?post=5245"}],"version-history":[{"count":0,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts\/5245\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/media?parent=5245"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/categories?post=5245"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/tags?post=5245"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}<\/a><\/p>\n
\u8fde\u63a5\u5230\u63a7\u5236\u53f0<\/h2>\n
\n
<\/a><\/li>\n
<\/a>\u60a8\u8fd8\u53ef\u4ee5\u4ece Web \u63a7\u5236\u53f0\u5185\u90e8\u91cd\u65b0\u542f\u52a8\u670d\u52a1\u5668\u3002<\/li>\n
\u4e2d\u592e\u64cd\u4f5c\u7cfb\u7edf 6<\/h2>\n
\n
single<\/code>\u3002<\/li>\n
passwd<\/code>\u5e76\u6309\u7167\u63d0\u793a\u66f4\u6539 root \u5bc6\u7801\u3002<\/li>\n
reboot<\/code>\u4ee5\u91cd\u65b0\u542f\u52a8\u670d\u52a1\u5668\u3002<\/li>\n<\/ol>\n
CentOS 7<\/h2>\n
\n
ro<\/code>\u4e3a
rw init=\/sysroot\/bin\/sh<\/code>\u3002<\/li>\n
chroot \/sysroot<\/code>\u3002<\/li>\n
passwd<\/code>\u5e76\u6309\u7167\u63d0\u793a\u66f4\u6539 root \u5bc6\u7801\u3002<\/li>\n
touch \/.autorelabel<\/code>\u4ee5\u5f3a\u5236\u91cd\u65b0\u6807\u8bb0\u6587\u4ef6\u7cfb\u7edf\u3002\u8fd9\u662f\u4f7f\u7528 SELinux \u7684\u7cfb\u7edf\u6240\u5fc5\u9700\u7684\u3002\u5f53\u60a8\u91cd\u65b0\u542f\u52a8\u7cfb\u7edf\u65f6\uff0c\u5b83\u5c06\u4e3a SElinux \u91cd\u65b0\u6807\u8bb0\u6587\u4ef6\u7cfb\u7edf\u3002\u5728\u6b64\u8fc7\u7a0b\u4e2d\uff0c\u91cd\u65b0\u542f\u52a8\u53ef\u80fd\u9700\u8981\u989d\u5916\u7684\u65f6\u95f4\u3002<\/li>\n
exit<\/code>\u3002<\/li>\n
reboot -f<\/code>\u4ee5\u91cd\u65b0\u542f\u52a8\u670d\u52a1\u5668\u3002<\/li>\n<\/ol>\n
CentOS 8 \u548c CentOS 8 Stream<\/h2>\n
\n
ro<\/code>\u4e3a
rw init=\/sysroot\/bin\/sh<\/code>\u3002<\/li>\n
chroot \/sysroot<\/code>\u3002<\/li>\n
passwd<\/code>\u5e76\u6309\u7167\u63d0\u793a\u66f4\u6539 root \u5bc6\u7801\u3002<\/li>\n
touch \/.autorelabel<\/code>\u4ee5\u5f3a\u5236\u91cd\u65b0\u6807\u8bb0\u6587\u4ef6\u7cfb\u7edf\u3002\u8fd9\u662f\u4f7f\u7528 SELinux \u7684\u7cfb\u7edf\u6240\u5fc5\u9700\u7684\u3002\u5f53\u60a8\u91cd\u65b0\u542f\u52a8\u7cfb\u7edf\u65f6\uff0c\u5b83\u5c06\u4e3a SElinux \u91cd\u65b0\u6807\u8bb0\u6587\u4ef6\u7cfb\u7edf\u3002\u5728\u6b64\u8fc7\u7a0b\u4e2d\uff0c\u91cd\u65b0\u542f\u52a8\u53ef\u80fd\u9700\u8981\u989d\u5916\u7684\u65f6\u95f4\u3002<\/li>\n
exit<\/code>\u3002<\/li>\n
logout<\/code>\u3002<\/li>\n
reboot<\/code>\u4ee5\u91cd\u65b0\u542f\u52a8\u670d\u52a1\u5668\u3002<\/li>\n<\/ol>\n
CentOS 9 Stream<\/h2>\n
\n
ro<\/code>\u4e3a
rw init=\/sysroot\/bin\/sh<\/code>\u3002<\/li>\n
chroot \/sysroot<\/code>\u3002<\/li>\n
passwd<\/code>\u5e76\u6309\u7167\u63d0\u793a\u66f4\u6539 root \u5bc6\u7801\u3002<\/li>\n
touch \/.autorelabel<\/code>\u4ee5\u5f3a\u5236\u91cd\u65b0\u6807\u8bb0\u6587\u4ef6\u7cfb\u7edf\u3002\u8fd9\u662f\u4f7f\u7528 SELinux \u7684\u7cfb\u7edf\u6240\u5fc5\u9700\u7684\u3002\u5f53\u60a8\u91cd\u65b0\u542f\u52a8\u7cfb\u7edf\u65f6\uff0c\u5b83\u5c06\u4e3a SElinux \u91cd\u65b0\u6807\u8bb0\u6587\u4ef6\u7cfb\u7edf\u3002\u5728\u6b64\u8fc7\u7a0b\u4e2d\uff0c\u91cd\u65b0\u542f\u52a8\u53ef\u80fd\u9700\u8981\u989d\u5916\u7684\u65f6\u95f4\u3002<\/li>\n
exit<\/code>\u3002<\/li>\n
reboot<\/code>\u4ee5\u91cd\u65b0\u542f\u52a8\u670d\u52a1\u5668\u3002<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"