{"id":603,"date":"2021-10-23T02:30:00","date_gmt":"2021-10-23T02:30:00","guid":{"rendered":"https:\/\/262235.xyz\/?p=603"},"modified":"2021-10-23T02:30:00","modified_gmt":"2021-10-23T02:30:00","slug":"603","status":"publish","type":"post","link":"https:\/\/lyvba.com\/index.php\/2021\/10\/23\/603\/","title":{"rendered":"Fedora CoreOS \u5b89\u88c5\u7b14\u8bb0 \u548c \u6316\u5751\u586b\u5751\u8bb0"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/lyvba.com\/wp-content\/uploads\/2021\/10\/1125930128.png\" alt=\"800px-Fedora_CoreOS_logo.svg.png\" title=\"800px-Fedora_CoreOS_logo.svg.png\"><br \/>Fedora CoreOS \u662f\u4e00\u4e2a\u81ea\u52a8\u66f4\u65b0\u7684\u3001\u6700\u5c0f\u7684\u3001\u5355\u4e00\u7684\u3001\u4ee5\u5bb9\u5668\u4e3a\u4e2d\u5fc3\u7684\u64cd\u4f5c\u7cfb\u7edf\uff0c\u4e3a\u96c6\u7fa4\u8bbe\u8ba1\uff0c\u4f46\u4e5f\u53ef\u4ee5\u72ec\u7acb\u8fd0\u884c\uff0c\u4e3a Kubernetes \u4f18\u5316\uff0c\u4f46\u6ca1\u6709\u5b83\u4e5f\u5f88\u597d\u3002\u5b83\u65e8\u5728\u7ed3\u5408 CoreOS Container Linux \u548c Fedora Atomic Host \u7684\u4f18\u70b9\uff0c\u5c06\u6765\u81ea Container Linux \u7684 Ignition \u7b49\u6280\u672f\u4e0e\u6765\u81ea Project Atomic \u7684 rpm-ostree \u548c SELinux \u52a0\u56fa\u6280\u672f\u76f8\u7ed3\u5408\u3002\u5176\u76ee\u6807\u662f\u63d0\u4f9b\u6700\u4f73\u5bb9\u5668\u4e3b\u673a\uff0c\u4ee5\u5b89\u5168\u3001\u5927\u89c4\u6a21\u5730\u8fd0\u884c\u5bb9\u5668\u5316\u5de5\u4f5c\u8d1f\u8f7d\u3002<\/p>\n<h2>\u83b7\u53d6 Fedora CoreOS<\/h2>\n<p><a href=\"https:\/\/getfedora.org\/coreos\/download\/\">\u4e0b\u8f7d Fedora CoreOS<\/a><\/p>\n<ul>\n<li>Bare Metal  ISO   34.20211004.3.1 stable<\/li>\n<li><a href=\"https:\/\/builds.coreos.fedoraproject.org\/prod\/streams\/stable\/builds\/34.20211004.3.1\/x86_64\/fedora-coreos-34.20211004.3.1-live.x86_64.iso\">https:\/\/builds.coreos.fedoraproject.org\/prod\/streams\/stable\/builds\/34.20211004.3.1\/x86_64\/fedora-coreos-34.20211004.3.1-live.x86_64.iso<\/a><\/li>\n<\/ul>\n<h2>\u4e0b\u8f7d\u597dlive\u5149\u76d8iso\u6587\u4ef6\uff0c\u5efa\u7acb\u4e00\u4e2a\u865a\u62df\u673a<\/h2>\n<ul>\n<li>\n<p>live\u5149\u76d8\u542f\u52a8\u540e\u662f\u4e00\u4e2a\u7c7b\u4f3c WinPE\u7684\u5185\u5b58\u6302\u8f7d\u7cfb\u7edf\uff0c\u7528\u6765\u5b89\u88c5 <code>Fedora CoreOS<\/code><\/p>\n<pre><code>###########################################################################\nWelcome to the CoreOS live environment. This system is running completely\nfrom memory, making it a good candidate for hardware discovery and\ninstalling persistently to disk. Here is an example of running an install\nto disk via coreos-installer:\n\nsudo coreos-installer install \/dev\/sda \\r\n  --ignition-url https:\/\/example.com\/example.ign\n\nYou may configure networking via 'sudo nmcli' or 'sudo nmtui' and have\nthat configuration persist into the installed system by passing the\n'--copy-network' argument to 'coreos-installer install'. Please run\n'coreos-installer install --help' for more information on the possible\ninstall options.\n###########################################################################\n\nFedora CoreOS 34.20211004.3.1\nTracker: https:\/\/github.com\/coreos\/fedora-coreos-tracker\nDiscuss: https:\/\/discussion.fedoraproject.org\/c\/server\/coreos\/\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<h2>\u5b89\u88c5 <code>Fedora CoreOS<\/code> \u5230\u786c\u76d8\u4e2d\u7684\u547d\u4ee4<\/h2>\n<pre><code>sudo coreos-installer install \/dev\/sda<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/lyvba.com\/wp-content\/uploads\/2021\/10\/2146682180.png\" alt=\"CoreOS.png\" title=\"CoreOS.png\"><\/p>\n<h2>\u5b89\u88c5\u901f\u5ea6\u8fd8\u662f\u975e\u5e38\u5feb\u7684\uff0c\u53ea\u662f\u628a\u786c\u76d8\u5206\u533a\uff0c\u7136\u540e\u628a\u5149\u76d8\u4e2d\u7684\u6587\u4ef6\u60f3 ghost \u4e00\u6837\u89e3\u538b\u5230\u786c\u76d8\u4e2d<\/h2>\n<ul>\n<li>34.20211004.3.1 Arch: x86_64 Release Date: Oct 20, 2021<\/li>\n<li>ignition 2.12.0 kernel5.14.9 moby-engine 20.10.8 podman 3.3.1 rpm-ostree 2021.11 systemd 248.7<\/li>\n<li>396 packages (expand); 47 upgraded (expand);<\/li>\n<li>\u5149\u76d8\u4e2d\u7684\u8f6f\u4ef6\u5305\u4e3b\u8981\u5982\u4e0a\uff0c\u5de5\u5177\u8f6f\u4ef6\u662f\u662f\u53ea\u8bfb\u4fdd\u5b58\u5728\u4e00\u4e2a img \u6587\u4ef6\u4e2d\uff0c\u7cfb\u7edf\u542f\u52a8\u7684\u65f6\u5019\u6302\u8f7d\u8fd9\u4e2a img \u955c\u50cf<\/li>\n<\/ul>\n<h2><code>Fedora CoreOS<\/code> \u7cfb\u7edf\u5df2\u7ecf\u5b89\u88c5\u5b8c\u6210\u4e86\uff0creboot \u91cd\u542f\u5230\u5b9e\u9645\u7684\u786c\u76d8\u7cfb\u7edf<\/h2>\n<ul>\n<li>\u4f60\u662f\u6ca1\u6cd5\u767b\u9646\u7684\uff0c\u56e0\u4e3a\u4f60\u4e0d\u77e5\u9053\u5bc6\u7801\uff0c\u4e5f\u6ca1\u8fdc\u7a0b\u767b\u9646\u7684\u8bc1\u4e66<br \/><img decoding=\"async\" src=\"https:\/\/lyvba.com\/wp-content\/uploads\/2021\/10\/2606428005.png\" alt=\"123.png\" title=\"123.png\"><\/li>\n<\/ul>\n<h2>\u5148\u7814\u7a76\u4e0bssh\u8bc1\u4e66\u767b\u9646 <a href=\"https:\/\/lyvba.com\/index.php\/archives\/23\/\">\u8bc1\u4e66\u767b\u9646\u7684\u811a\u672c.sh<\/a><\/h2>\n<pre><code>#!\/bin\/bash\nmkdir -p ~\/.ssh  &amp;&amp; cd ~\/.ssh\nauthorized_keys(){\ncat &lt;&lt;EOF &gt;&gt;  authorized_keys\nssh-rsa \u628a\u4f60\u7684\u516c\u94a5\u653e\u8fd9\u884c root\nEOF\n}\nauthorized_keys<\/code><\/pre>\n<ul>\n<li>\u5236\u4f5c\u7c7b\u4f3c\u4e00\u4e2a\u811a\u672c\u4fdd\u5b58\u5728\u80fd web\u8bbf\u95ee\u7684\u7f51\u9875\u76ee\u5f55\u4e0b\uff0c\u5982\u679c\u4f60\u4e0d\u61c2\uff0c\u5c31\u5f53\u6211\u6ca1\u8bf4<\/li>\n<\/ul>\n<h1><code>Fedora CoreOS<\/code> \u7cfb\u7edf\u5b89\u88c5\u540e\u6ca1\u6cd5\u542f\u52a8\uff0c\u5148live\u5149\u76d8\u542f\u52a8\uff0c\u628a SSH \u8bc1\u4e66 \u6ce8\u5165\u5230\u786c\u76d8\u7cfb\u7edf<\/h1>\n<ul>\n<li>\u5982\u679c\u4f60\u91cd\u542f\u6ca1\u6cd5\u767b\u9646\uff0c\u7814\u7a76\u4e86ssh\u8bc1\u4e66\u767b\u9646\uff0c\u7136\u540e\u4f7f\u7528 live \u5149\u76d8\u91cd\u542f\u6765\u4fee\u590d\u8bc1\u4e66\u767b\u9646<\/li>\n<\/ul>\n<h3>1. \u5148\u542f\u7528live\u5149\u76d8 ssh \u8bc1\u4e66\u767b\u9646\uff0c\u4f7f\u7528SSH\u8fdc\u7a0b\u767b\u9646\uff0c\u65b9\u4fbf\u590d\u5236\u7c98\u8d34<\/h3>\n<pre><code>bash &lt; (curl -sL 188.8.8.8\/sshkey.sh)\n# \u4f60\u628a sshkey.sh \u811a\u672c\u5b58\u653e\u5230\u4e00\u53f0\u7f51\u9875\u670d\u52a1\u5668\u4e0a\nssh core@192.168.1.146    # \u4f7f\u7528ssh\u5de5\u5177\u8fdc\u7a0b\u767b\u9646<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/lyvba.com\/wp-content\/uploads\/2021\/10\/1427398441.png\" alt=\"1.png\" title=\"1.png\"><\/p>\n<h3>2. \u4f7f\u7528 partx\u6216fdisk \u67e5\u770b\u786c\u76d8\u5206\u533a\uff0c\u67e5\u5230 <code>\/dev\/sda4<\/code> \u662f\u786c\u76d8\u7cfb\u7edf root \u5206\u533a<\/h3>\n<pre><code>$ sudo partx \/dev\/sda\n\nNR   START     END SECTORS SIZE NAME       UUID\n 1    2048    4095    2048   1M BIOS-BOOT  e7503859-edcd-4cd0-af97-0a2fe6684831\n 2    4096  264191  260096 127M EFI-SYSTEM 37d8cf15-0620-4a6d-ba07-a0836412b7d5\n 3  264192 1050623  786432 384M boot       c251fa18-a8cf-46e9-9779-38061d148096\n 4 1050624 5005278 3954655 1.9G root       c5cebabd-7bd9-49da-bfbd-395e534885b2\n\n$ sudo fdisk -l\nDevice       Start     End Sectors  Size Type\n\/dev\/sda1     2048    4095    2048    1M BIOS boot\n\/dev\/sda2     4096  264191  260096  127M EFI System\n\/dev\/sda3   264192 1050623  786432  384M Linux filesystem\n\/dev\/sda4  1050624 5005278 3954655  1.9G Linux filesystem<\/code><\/pre>\n<h3>3. \u6302\u8f7d <code>\/dev\/sda4<\/code> \u6839\u5206\u533a\uff0c\u6dfb\u52a0 ssh \u8bc1\u4e66\u6587\u4ef6<\/h3>\n<pre><code>sudo mkdir \/mnt\/sda4\nsudo mount \/dev\/sda4 \/mnt\/sda4\n\ncd \/mnt\/sda4\/ostree\/deploy\/fedora-coreos\/var\/home\/core\nsudo mkdir .ssh\nsudo cp ~\/.ssh\/authorized_keys  .ssh\/\n\n$ ls -a .ssh\/\nauthorized_keys<\/code><\/pre>\n<h3>4. \u7ed9 root \u7528\u6237\u4e5f\u6dfb\u52a0 ssh \u8bc1\u4e66<\/h3>\n<pre><code>sudo -i\ncd \/mnt\/sda4\/ostree\/deploy\/fedora-coreos\/var\/\ncd roothome\/\ncp \/home\/core\/.ssh\/authorized_keys .ssh\/\n\n$ ls -a .ssh\/\nauthorized_keys<\/code><\/pre>\n<h3>\u5378\u8f7d\u5149\u76d8\u4f7f\u7528\u786c\u76d8\u542f\u52a8\uff0c\u518d\u8fdc\u7a0b ssh \u767b\u9646  root \u548c core \u7528\u6237\u90fd\u80fd\u8fdc\u7a0b\u767b\u9646\u4e86<\/h3>\n<pre><code>ssh core@192.168.1.146\nssh root@192.168.1.146<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Fedora CoreOS \u662f\u4e00\u4e2a\u81ea\u52a8\u66f4\u65b0\u7684\u3001\u6700\u5c0f\u7684\u3001\u5355\u4e00\u7684\u3001\u4ee5\u5bb9\u5668\u4e3a\u4e2d\u5fc3\u7684\u64cd\u4f5c\u7cfb\u7edf\uff0c\u4e3a\u96c6\u7fa4\u8bbe\u8ba1\uff0c\u4f46 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[15,23],"class_list":["post-603","post","type-post","status-publish","format-standard","hentry","category-linux","tag-docker","tag-linux"],"_links":{"self":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/603","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/comments?post=603"}],"version-history":[{"count":0,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/603\/revisions"}],"wp:attachment":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/media?parent=603"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/categories?post=603"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/tags?post=603"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}