{"id":7094,"date":"2022-08-24T23:02:27","date_gmt":"2022-08-24T15:02:27","guid":{"rendered":"http:\/\/123.57.164.21\/?p=7094"},"modified":"2022-08-29T20:13:01","modified_gmt":"2022-08-29T12:13:01","slug":"linux%e8%af%be%e5%a0%82%e7%ac%94%e8%ae%b04","status":"publish","type":"post","link":"https:\/\/92it.top\/?p=7094","title":{"rendered":"Linux\u8bfe\u5802\u7b14\u8bb0(4)"},"content":{"rendered":"\n<p><strong>systemd\u7b80\u4ecb<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>Systemd\u662fLinux\u7cfb\u7edf\u5de5\u5177\u4e5f\u662f\u7cfb\u7edf\u57fa\u7840\u7ec4\u4ef6\u7684<a rel=\"noreferrer noopener\" href=\"https:\/\/so.csdn.net\/so\/search?q=%E9%9B%86%E5%90%88&amp;spm=1001.2101.3001.7020\" target=\"_blank\">\u96c6\u5408<\/a>\u7528\u6765\u542f\u52a8\u5b88\u62a4\u8fdb\u7a0b\u3002\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7cfb\u7edf\u548c\u670d\u52a1\u7ba1\u7406\u5668\uff0c\u662f\u7cfb\u7edf\u542f\u52a8\u7684\u542f\u52a8\u7b2c\u4e00\u4e2a\u7a0b\u5e8f\u3001\u8fd0\u884c\u4e3a PID 1\uff0c\u5e76\u8d1f\u8d23\u542f\u52a8\u5176\u5b83\u7a0b\u5e8f\u5176\u4e2dsystemctl\u662fsystemd\u7684\u7ba1\u7406\u63a7\u5236\u5de5\u5177<\/p>\n\n\n\n<p>Systemd\u5b88\u62a4\u8fdb\u7a0b\u7ba1\u7406linux\u7684\u542f\u52a8\uff0c\u5305\u62ec\u670d\u52a1\u542f\u52a8\u548c\u670d\u52a1\u7ba1\u7406\uff1b\u5b83\u53ef\u4ee5\u5728\u7cfb\u7edf\u5f15\u5bfc\u65f6\u4ee5\u53ca\u8fd0\u884c\u4e2d\u7684\u7cfb\u7edf\u4e0a\u6fc0\u6d3b\u7cfb\u7edf\u8d44\u6e90\uff0c\u670d\u52a1\u5668\u5b88\u62a4\u8fdb\u7a0b\u548c\u5176\u5b83\u8fdb\u7a0b<\/p>\n\n\n\n<p>\u5b88\u62a4\u8fdb\u7a0b\u6982\u5ff5\uff1a\u5728\u6267\u884c\u5404\u79cd\u4efb\u52a1\u7684\u540e\u53f0\u7b49\u5f85\u6216\u8fd0\u884c\u7684\u8fdb\u7a0b\uff0c\u5728\u7cfb\u7edf\u5f15\u5bfc\u65f6\u81ea\u52a8\u542f\u52a8\u5e76\u6301\u7eed\u8fd0\u884c\u81f3\u5173\u673a\u6216\u88ab\u624b\u52a8\u505c\u6b62\uff0c\u901a\u5e38\u5b88\u62a4\u8fdb\u7a0b\u7684\u540d\u79f0\u4ee5\u5b57\u6bcdd\u7ed3\u5c3e<\/p>\n\n\n\n<p>\u7ea2\u5e3d\u4e2dLinux\u7684systemd \u5b88\u62a4\u8fdb\u7a0b\u529f\u80fd\uff08PID=1\uff09<\/p>\n\n\n\n<ul><li>\u540c\u65f6\u542f\u52a8\u591a\u4e2a\u670d\u52a1\uff0c\u63d0\u9ad8\u7cfb\u7edf\u7684\u542f\u52a8\u901f\u5ea6<\/li><li>\u6309\u9700\u542f\u52a8\u5b88\u62a4\u8fdb\u7a0b\uff0c\u4e0d\u9700\u8981\u5355\u72ec\u7684\u670d\u52a1<\/li><li>\u81ea\u52a8\u670d\u52a1\u4f9d\u8d56\u5173\u7cfb\u7ba1\u7406\u3002\u4f8b\u5982\uff1a\u53ea\u6709\u7f51\u7edc\u53ef\u7528\u65f6\uff0c\u4f9d\u8d56\u7f51\u7edc\u7684\u670d\u52a1\u624d\u4f1a\u5c1d\u8bd5\u542f\u52a8<\/li><\/ul>\n\n\n\n<p>systemd \u4f7f\u7528\u5355\u5143\u7ba1\u7406\u4e0d\u540c\u7c7b\u578b\u7684\u5bf9\u8c61<\/p>\n\n\n\n<ul><li>\u670d\u52a1\u5355\u5143\uff08.service\uff09\uff1a\u4ee3\u8868\u7cfb\u7edf\u670d\u52a1\uff0c\u7528\u4e8e\u542f\u52a8\u7ecf\u5e38\u8bbf\u95ee\u7684\u5b88\u62a4\u8fdb\u7a0b\uff0c\u5982web\u670d\u52a1\u5668<\/li><li>\u4e3e\u4f8b\uff1a systemctl status&nbsp; sshd.service<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/08\/image-58.png\" alt=\"\" class=\"wp-image-7095\" width=\"652\" height=\"139\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-58.png 826w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-58-300x64.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-58-768x164.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-58-230x49.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-58-350x75.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-58-480x102.png 480w\" sizes=\"(max-width: 652px) 100vw, 652px\" \/><\/figure><\/div>\n\n\n\n<p>systemctl\u8f93\u51fa\u7684\u670d\u52a1\u72b6\u6001<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/08\/image-59.png\" alt=\"\" class=\"wp-image-7096\" width=\"645\" height=\"221\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-59.png 920w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-59-300x103.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-59-768x264.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-59-830x285.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-59-230x79.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-59-350x120.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-59-480x165.png 480w\" sizes=\"(max-width: 645px) 100vw, 645px\" \/><\/figure><\/div>\n\n\n\n<p>\u63a7\u5236\u670d\u52a1\u547d\u4ee4<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">systemctl status sshd.service\nsystemctl is-active sshd.service\nsystemctl is-enabled sshd.service\nsystemctl enable sshd.service\nsystemctl disable sshd.service\nsystemctl stop sshd.service\nsystemctl start sshd.service\nsystemctl restart sshd.service\nsystemctl reload sshd.service\nsystemctl reload-or-restart sshd.service\uff1a\nsystemctl is-failed sshd.service\nsystemctl  mask  UNIT\nsystemctl  unmask UNIT<\/pre>\n\n\n\n<p><strong>SSH<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>OpenSSH\uff1aSecure Shell \u534f\u8bae\u4f7f\u7cfb\u7edf\u80fd\u591f\u4ee5\u52a0\u5bc6\u7684\u65b9\u5f0f\u8fdb\u884c\u901a\u4fe1<\/p>\n\n\n\n<p>SSH\u767b\u5f55\u65b9\u5f0f<\/p>\n\n\n\n<ul type=\"1\"><li>\u4ea4\u4e92\u5f0fshell\u4f1a\u8bdd\u65b9\u5f0f\uff1assh&nbsp;&nbsp; username@IP address<\/li><li>\u975e\u4ea4\u4e92\u5f0fshell\u4f1a\u8bdd\u65b9\u5f0f\uff1assh user@IP address&nbsp;&nbsp; hostname<\/li><\/ul>\n\n\n\n<p>SSH\u670d\u52a1\u5668\u914d\u7f6e\u6587\u4ef6\u4f4d\u7f6e\uff1a\/etc\/ssh\/sshd_config<\/p>\n\n\n\n<p>\u5ba2\u6237\u7aef\u9996\u6b21\u767b\u5f55\u670d\u52a1\u5668\u8fc7\u7a0b<\/p>\n\n\n\n<ul><li>\u670d\u52a1\u5668\u5f00\u542fSSH\u670d\u52a1\u65f6\u81ea\u52a8\u521b\u5efa3\u7ec46\u4e2akey\u6587\u4ef6\uff0c\u4f5c\u4e3a\u672a\u6765\u670d\u52a1\u5668\u6307\u7eb9\u4fe1\u606f\uff0c\u4f4d\u7f6e\/etc\/ssh\/<\/li><li>\u5ba2\u6237\u7aef\u9996\u6b21\u767b\u5f55\u670d\u52a1\u5668\u65f6\uff0c\u670d\u52a1\u5668\u5c06\u516c\u94a5\u526f\u672c\u53d1\u9001\u7ed9\u5ba2\u6237\u7aef\uff0c\u5ba2\u6237\u7aef\u5b58\u50a8\u670d\u52a1\u5668\u516c\u94a5\u526f\u672c\u7684\u9ed8\u8ba4\u4f4d\u7f6e\uff1a<\/li><\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">~\/.ssh\/known_hosts\uff0c\u4f5c\u4e3a\u4e4b\u540e\u767b\u5f55\u670d\u52a1\u5668\u7684\u6307\u7eb9\u4fe1\u606f<\/pre>\n\n\n\n<ul><li>\u5ba2\u6237\u7aef\u5b58\u50a8\u7684\u4e3b\u673a\u516c\u94a5\u4fe1\u606f\u5b57\u6bb5\u542b\u4e49<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/08\/image-60.png\" alt=\"\" class=\"wp-image-7097\" width=\"697\" height=\"99\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-60.png 954w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-60-300x43.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-60-768x109.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-60-830x118.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-60-230x33.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-60-350x50.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-60-480x68.png 480w\" sizes=\"(max-width: 697px) 100vw, 697px\" \/><\/figure><\/div>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\u7b2c\u4e00\u4e2a\u5b57\u6bb5\uff1a\u5171\u4eab\u8be5\u516c\u94a5\u7684\u4e3b\u673a\u540d\u548cIP\u5730\u5740\u5217\u8868\n\u7b2c\u4e8c\u4e2a\u5b57\u6bb5\uff1a\u516c\u94a5\u52a0\u5bc6\u7b97\u6cd5\n\u7b2c\u4e09\u4e2a\u5b57\u6bb5\uff1a\u516c\u94a5\u672c\u8eab\n<\/pre>\n\n\n\n<ul><li>\u57fa\u4e8eSSH\u5bc6\u94a5\u7684\u8eab\u4efd\u9a8c\u8bc1\u6982\u5ff5\uff1a\u5728\u4e0d\u4f7f\u7528\u5bc6\u7801\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u8eab\u4efd\u9a8c\u8bc1\uff0c\u8eab\u4efd\u9a8c\u8bc1\u57fa\u4e8e1\u5bf9\u79d8\u94a5\uff08\u516c\u94a5\u548c\u79c1\u94a5\uff09<\/li><\/ul>\n\n\n\n<p><strong>\u5ba2\u6237\u7aef<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">a.\tssh-keygen\uff1a\u751f\u6210\u5bc6\u94a5\u6587\u4ef6\uff0c\u4e00\u628a\u516c\u94a5\uff0c\u4e00\u628a\u79c1\u94a5\nb.\t\u516c\u94a5\u548c\u79c1\u94a5\u4f4d\u7f6e\uff1a~\/.ssh\/\nc.\tssh-copy-id  username@IP address\uff1a\u5c06\u516c\u94a5\u526f\u672c\u53d1\u9001\u7ed9\u670d\u52a1\u5668\uff0c\u7528\u4e8e\u9a8c\u8bc1\u79c1\u94a5\n<\/pre>\n\n\n\n<ul><li>\u670d\u52a1\u5668\u5b58\u653e\u5ba2\u6237\u7aef\u516c\u94a5\u526f\u672c\u4f4d\u7f6e\uff1a~\/.ssh\/authorized_keys<\/li><\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">ssh-keygen -f \uff1a\u6307\u5b9a\u4fdd\u5b58\u516c\u94a5\u548c\u79c1\u94a5\u7684\u65b0\u76ee\u5f55\u4f4d\u7f6e\nssh-copy-id -i\uff1a\u6307\u5b9a\u590d\u5236\u7684\u516c\u94a5\u7684\u6587\u4ef6\u4f4d\u7f6e \n<\/pre>\n\n\n\n<ul><li>\u81ea\u5b9a\u4e49OPENSSH\u670d\u52a1\u914d\u7f6e\uff1a\/etc\/ssh\/sshd_config<\/li><\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">1)\t\u7981\u6b62root\u7528\u6237\u8fdc\u7a0b\u767b\u5f55\uff1aPermitRootLogin  no\n2)\t\u53ea\u5141\u8bb8root\u7528\u6237\u57fa\u4e8e\u5bc6\u94a5\u767b\u5f55\uff1aPermitRootLogin  without-password \n3)\t\u7981\u6b62\u4f7f\u7528\u5bc6\u7801\u767b\u5f55\uff1aPasswordAuthentication  no\n<\/pre>\n\n\n\n<p><strong>RHEL8\uff1asystemd-journald\u670d\u52a1\u548crsyslog\u670d\u52a1\u5904\u7406RHEL8\u7684\u65e5\u5fd7\u6d88\u606f<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<ul><li>systemd-journald\u670d\u52a1\uff1a\u662f\u64cd\u4f5c\u7cfb\u7edf\u4e8b\u4ef6\u65e5\u5fd7\u67b6\u6784\u7684\u6838\u5fc3\u3002\u6536\u96c6\u7684\u4e8b\u4ef6\u6d88\u606f\u5305\u62ec\uff1a\u5185\u6838\uff0c\u5f15\u5bfc\u8fc7\u7a0b\u65e9\u671f\u9636\u6bb5\u7684\u8f93\u51fa\uff0c\u5b88\u62a4\u8fdb\u7a0b\uff0c\u8fd0\u884c\u65f6\u7684\u6807\u51c6\u8f93\u51fa\u4ee5\u53ca\u6807\u51c6\u9519\u8bef\uff0c\u4ee5\u53casyslog\u4e8b\u4ef6\uff0c\u5c06\u6536\u5230\u7684\u6d88\u606f\u5199\u8fdb\u5e26\u6709\u7d22\u5f15\u7684\u7ed3\u6784\u5316\u7cfb\u7edf\u65e5\u5fd7\u4e2d\uff0c\u9ed8\u8ba4\u8be5\u65e5\u5fd7\u5b58\u50a8\u5728\u7cfb\u7edf\u91cd\u542f\u540e\u4e0d\u4fdd\u7559\u7684\u6587\u4ef6\u7cfb\u7edf\u4e0a<\/li><li>rsyslog\u670d\u52a1\uff1a\u4ece\u65e5\u5fd7\u4e2d\u8bfb\u53d6systemd-journald\u6536\u5230\u7684syslog\u6d88\u606f\uff0c\u5bf9syslog\u6d88\u606f\u8fdb\u884c\u6392\u5e8f\uff0c\u5c06\u5b83\u4eec\u5199\u5165\u5230\u5728\u7cfb\u7edf\u91cd\u542f\u540e\u4e0d\u4fdd\u7559\u7684\u65e5\u5fd7\u6587\u4ef6\u4e2d\uff0c\u6216\u8005\u6839\u636e\u914d\u7f6e\u5c06\u5b83\u4eec\u8f6c\u53d1\u7ed9\u5176\u5b83\u670d\u52a1<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/08\/image-61.png\" alt=\"\" class=\"wp-image-7098\" width=\"604\" height=\"214\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-61.png 916w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-61-300x106.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-61-768x272.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-61-830x294.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-61-230x81.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-61-350x124.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-61-480x170.png 480w\" sizes=\"(max-width: 604px) 100vw, 604px\" \/><\/figure><\/div>\n\n\n\n<ul><li>syslog\u4f18\u5148\u7ea7<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/08\/image-62.png\" alt=\"\" class=\"wp-image-7099\" width=\"490\" height=\"348\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-62.png 644w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-62-300x213.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-62-230x164.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-62-350x249.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-62-480x341.png 480w\" sizes=\"(max-width: 490px) 100vw, 490px\" \/><\/figure><\/div>\n\n\n\n<ul><li>rsyslog \u914d\u7f6e\u89c4\u5219\u4f4d\u4e8e\uff1a\/etc\/rsyslog.conf\u548c\/etc\/rsyslog.d\u76ee\u5f55\u4e2d\u6269\u5c55\u540d\u4e3a.conf\u7684\u4efb\u4f55\u6587\u4ef6\u3002\u5de6\u4fa7\u8868\u793a\u4e0e\u89c4\u5219\u5339\u914d\u7684syslog\u6d88\u606f\u7684\u7c7b\u578b\u548c\u4e25\u91cd\u6027\uff1b\u53f3\u4fa7\u8868\u793a\u8981\u5c06\u65e5\u5fd7\u6d88\u606f\u4fdd\u5b58\u5230\u7684\u6587\u4ef6\u6216\u8005\u6d88\u606f\u8981\u53d1\u9001\u5230\u7684\u5176\u5b83\u4f4d\u7f6e\uff1b*\u8868\u793a\u5339\u914d\u6240\u6709\u503c<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/08\/image-63.png\" alt=\"\" class=\"wp-image-7100\" width=\"587\" height=\"62\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-63.png 704w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-63-300x32.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-63-230x24.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-63-350x37.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-63-480x50.png 480w\" sizes=\"(max-width: 587px) 100vw, 587px\" \/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/08\/image-64.png\" alt=\"\" class=\"wp-image-7101\" width=\"637\" height=\"53\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-64.png 908w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-64-300x25.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-64-768x64.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-64-830x69.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-64-230x19.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-64-350x29.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-64-480x40.png 480w\" sizes=\"(max-width: 637px) 100vw, 637px\" \/><\/figure><\/div>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">1)\t\u8bb0\u5f55\u8be5\u65e5\u5fd7\u6761\u76ee\u7684\u65f6\u95f4\u6233\n2)\t\u53d1\u9001\u8be5\u65e5\u5fd7\u6d88\u606f\u7684\u4e3b\u673a\n3)\t\u53d1\u9001\u8be5\u65e5\u5fd7\u6d88\u606f\u7684\u7a0b\u5e8f\u6216\u8fdb\u7a0b\u540d\u79f0\u548cPID\u7f16\u53f7\n4)\t\u53d1\u9001\u7684\u5b9e\u9645\u6d88\u606f\n<\/pre>\n\n\n\n<ul><li>\u624b\u52a8\u53d1\u9001syslog\u6d88\u606f\uff1alogger\u547d\u4ee4\u9ed8\u8ba4\u5c06\u4f18\u5148\u7ea7\u4e3anotice(user.notice)\u6d88\u606f\u53d1\u9001\u5230rsyslog\u670d\u52a1\uff0c-p \u9009\u9879\u6307\u5b9a\u5176\u5b83\u7ea7\u522b<\/li><li>\u4e3e\u4f8b\uff1a\u5411rsyslog\u670d\u52a1\u53d1\u9001\u6d88\u606f\u5e76\u8bb0\u5f55\u5728\/var\/log\/boot.log\u65e5\u5fd7\u6587\u4ef6\u4e2d<\/li><\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"> logger  -p   local7.notice  \u201cLog entry  create  on host\u201d\n cat  \/var\/log\/boot.log\n<\/pre>\n\n\n\n<p><strong>\u8bfe\u5802\u7ec3\u4e60<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">1)\t\u6dfb\u52a0\u914d\u7f6e\u6587\u4ef6\/etc\/rsyslog.d\/debug.conf\nvim  \/etc\/rsyslog.d\/debug.conf\n2)\t\u5c06\u4efb\u4f55\u670d\u52a1\u7684\u4f18\u5148\u7ea7\u4e3adebug\u6216\u4ee5\u4e0a\u7684\u6240\u6709\u6d88\u606f\u8bb0\u5f55\u5230\u65b0\u7684\/var\/log\/message-debug\u65e5\u5fd7\u6587\u4ef6\u4e2d\n*.debug   \/var\/log\/messages-debug\nsystemctl  restart  rsyslog.service\n3)\tlogger\u6d4b\u8bd5\uff1a\u4f7f\u7528-p\u6307\u5b9auser.debug\uff0c\u663e\u793a\u7684\u6d88\u606f\u662fdebug  message test  123456\nlogger    -p  user.debug \"debug  message  test 123456\u201c\n<\/pre>\n\n\n\n<p><strong>\u65e5\u5fd7\u68c0\u7d22\uff1ajournalctl<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">1)\t-n\uff1a\u8bbe\u7f6e\u663e\u793a\u65e5\u5fd7\u6700\u540e\u7684\u6761\u6570\uff0c\u9ed8\u8ba4\u663e\u793a\u6700\u540e10\u6761\u65e5\u5fd7\n2)\t-f\uff1a \u52a8\u6001\u8f93\u51fa\u7cfb\u7edf\u65e5\u5fd7\u6700\u540e10\u884c\uff0c\u65b0\u65e5\u5fd7\u6761\u76ee\u5199\u5165\u5230\u65e5\u5fd7\u4e2d\u65f6\uff0c\u7ee7\u7eed\u8f93\u51fa\u5b83\u4eec\n3)\t-p\uff1a\u63a5\u53d7\u4f18\u5148\u7ea7\u7684\u540d\u79f0\u6216\u7f16\u53f7\u4f5c\u4e3a\u53c2\u6570\uff0c\u663e\u793a\u8be5\u4f18\u5148\u7ea7\u522b\u4ee5\u4e0a\u7684\u65e5\u5fd7\u6761\u76ee\n4)\t\u4e3e\u4f8b\uff1ajournalct   -p  err\n5)\t--since\u548c--until\u9009\u9879\uff1a\u9650\u5236\u7279\u5b9a\u65f6\u95f4\u6bb5\u3002\u683c\u5f0f\u201dYYYY-MM-DD hh:mm:ss\u201d\uff0c\u5fc5\u987b\u4f7f\u7528\u53cc\u5f15\u53f7\uff0c\u4ee5\u4fdd\u7559\u9009\u9879\u4e2d\u7684\u7a7a\u683c\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528yesterday\uff0ctoday\uff0ctomorrow\n6)\tjournalctl  --since today\uff1bjournalctl --since \"2020-12-12 12:12:00\" --until \"2021-1-1 12:12:00\"\n7)\tjournalctl  --since   \u201c-1  hour\u201d \u4e0a\u4e00\u5c0f\u65f6\u7684\u6240\u6709\u6761\u76ee\n<\/pre>\n\n\n\n<ul><li>\u7cfb\u7edf\u65e5\u5fd7\u5e38\u7528\u5b57\u6bb5\u7528\u4e8e\u641c\u7d22\u4e0e\u7279\u5b9a\u8fdb\u7a0b\u6216\u4e8b\u4ef6\u76f8\u5173\u7684\u884c<\/li><\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">1\uff09     COMM\uff1a\u547d\u4ee4\u7684\u540d\u79f0\n2)\t_PID\uff1a\u8fdb\u7a0b\u7684PID\n3)\t_UID\uff1a\u8fd0\u884c\u8be5\u8fdb\u7a0b\u7684\u7528\u6237\u7684UID\n4)\t_SYSTEMD_UNIT\uff1a\u542f\u52a8\u8be5\u8fdb\u7a0b\u7684systemd\u5355\u5143\n5)\t\u4e3e\u4f8b\uff1ajournalctl   _SYSTEMD_UNIT=sshd.service\n<\/pre>\n\n\n\n<ul><li>\u6c38\u4e45\u5b58\u50a8\u7cfb\u7edf\u65e5\u5fd7<\/li><\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">1)\t\u7cfb\u7edf\u65e5\u5fd7\u9ed8\u8ba4\u4fdd\u5b58\u4f4d\u7f6e\uff1a\/run\/log\/journal\u76ee\u5f55\u4e2d\uff0c\u7cfb\u7edf\u91cd\u542f\u65e5\u5fd7\u4f1a\u88ab\u6e05\u9664\n2)\t\u914d\u7f6e\u6587\u4ef6 \uff1a\/etc\/systemd\/journal.conf\n3)\tstorage    \u53c2\u6570\u51b3\u5b9a\u7cfb\u7edf\u65e5\u5fd7\u5b58\u50a8\u65b9\u5f0f\uff08\u9ed8\u8ba4\u65b9\u5f0fauto\uff09\na.\tpersistent\uff1a\u7cfb\u7edf\u91cd\u542f\u540e\u6301\u4e45\u4fdd\u7559\uff0c\u65e5\u5fd7\u5b58\u50a8\u4f4d\u7f6e\/var\/log\/journal\u76ee\u5f55\u4e2d\nb.\tvolatile\uff1a\u7cfb\u7edf\u91cd\u542f\u540e\u4e0d\u4fdd\u7559\uff0c\u65e5\u5fd7\u5b58\u50a8\u4f4d\u7f6e\/run\/log\/journal\u76ee\u5f55\u4e2d\nc.\tauto\uff1a\u7531rsyslog\u51b3\u5b9a\u662f\u5426\u6301\u4e45\u4fdd\u7559\u3002\u5982\u679c\/var\/log\/journal\u76ee\u5f55\u5b58\u5728\uff0c\u90a3\u4e48rsyslog\u4f1a\u4f7f\u7528\u6301\u4e45\u4fdd\u7559\uff1b\u5426\u5219\u4f7f\u7528\u6613\u5931\u6027\u5b58\u50a8\u3002\nd.\tsystemctl restart systemd-journald.service\n<\/pre>\n\n\n\n<p><strong>\u8bbe\u7f6e\u672c\u5730\u65f6\u949f\u548c\u65f6\u533a<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">1)\ttimedatectl\uff1a\u663e\u793a\u5f53\u524d\u7684\u65f6\u95f4\u76f8\u5173\u7cfb\u7edf\u8bbe\u7f6e\uff08\u5f53\u5730\u65f6\u95f4\uff1b\u4f26\u6566\u65f6\u95f4\uff1b\u786c\u4ef6\u65f6\u95f4\uff09\n2)\ttimedatectl  list-timezones\uff1a\u663e\u793a\u65f6\u533a\n3)\ttimedatectl  set-ntp\uff1a\u8bbe\u7f6e\u542f\u52a8\u6216\u7981\u7528NTP\u540c\u6b65\uff08true\uff1bfalse\uff09\n<\/pre>\n\n\n\n<p><strong>\u914d\u7f6e\u548c\u76d1\u63a7Chronyd\u670d\u52a1<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>Chronyd\u670d\u52a1\u901a\u8fc7\u4e0e\u914d\u7f6e\u7684NTP\u670d\u52a1\u5668\u8fdb\u884c\u540c\u6b65\uff0c\u8c03\u6574\u672c\u5730\u786c\u4ef6\u65f6\u949f\uff08RTC\uff09<\/p>\n\n\n\n<p>server\u548cpeer\uff1a\u5728\u914d\u7f6e\u6587\u4ef6<strong>\/etc\/chrony.conf<\/strong>\u4e2d\u914d\u7f6e<\/p>\n\n\n\n<p>chronyd\u6307\u5411\u672c\u5730\u65f6\u95f4\u6e90\uff1aserver classroom.example.com iburst<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/08\/image-65.png\" alt=\"\" class=\"wp-image-7102\" width=\"637\" height=\"122\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-65.png 786w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-65-300x57.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-65-768x147.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-65-230x44.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-65-350x67.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-65-480x92.png 480w\" sizes=\"(max-width: 637px) 100vw, 637px\" \/><\/figure><\/div>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">systemctl  restart   chronyd.service<\/pre>\n\n\n\n<ul><li>\u4e3e\u4f8b\uff1a\u914d\u7f6e\u7cfb\u7edf\uff0c\u4f7f\u5176\u6210\u4e3avvv.zzz.example.com\u7684NTP\u5ba2\u6237\u7aef<\/li><\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">1)\tsystemctl   status   chronyd.service\n2)\tvim  \/etc\/chrony.conf\nserver vvv.zzz.example.com iburst\nsystemctl   restart   chronyd.service\n<\/pre>\n\n\n\n<p><strong>\u7f51\u7edc\u6982\u5ff5<\/strong><br><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<ul type=\"1\"><li>TCP\/IP\u7f51\u7edc\u6a21\u578b<\/li><li>IPv4\u5730\u5740\u548c\u63a9\u7801<\/li><li>\u7f51\u5173\u548c\u8def\u7531<\/li><li>\u5b50\u7f51\u5212\u5206<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/08\/image-66.png\" alt=\"\" class=\"wp-image-7103\" width=\"494\" height=\"156\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-66.png 752w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-66-300x95.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-66-230x73.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-66-350x111.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-66-480x152.png 480w\" sizes=\"(max-width: 494px) 100vw, 494px\" \/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/08\/image-67.png\" alt=\"\" class=\"wp-image-7104\" width=\"612\" height=\"136\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-67.png 934w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-67-300x67.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-67-768x171.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-67-830x185.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-67-230x51.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-67-350x78.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-67-480x107.png 480w\" sizes=\"(max-width: 612px) 100vw, 612px\" \/><\/figure><\/div>\n\n\n\n<ul><li>\u7f51\u7edc\u914d\u7f6e\u57fa\u7840\u547d\u4ee4<\/li><\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">ip  [-s ] link show  \u7f51\u5361\u540d\uff1a\u663e\u793a\u6307\u5b9a\u7f51\u5361\u94fe\u8def\u5c42\u4fe1\u606f\uff08-s\u8868\u793a\u7edf\u8ba1\u4fe1\u606f\uff09\nip  [-s ] address show \u7f51\u5361\u540d\uff1a\u663e\u793a\u6307\u5b9a\u7f51\u5361\u7f51\u7edc\u5c42\u4fe1\u606f\uff08-s\u8868\u793a\u7edf\u8ba1\u4fe1\u606f\uff09\nping\uff1a\u68c0\u6d4b\u4e3b\u673a\u4e4b\u95f4\u7684\u8fde\u901a\u6027\nip route\uff1a\u8def\u7531\u4fe1\u606f\nroute -n\uff1a\u663e\u793a\u5185\u6838\u8def\u7531\u8868\n<\/pre>\n\n\n\n<ul><li>\u4ece\u547d\u4ee4\u884c\u914d\u7f6e\u7f51\u7edc<\/li><\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">1)\tNetworkManager.service\u76d1\u63a7\u548c\u7ba1\u7406\u7f51\u7edc\u8bbe\u7f6e\u7684\u5b88\u62a4\u8fdb\u7a0b\u3002\u547d\u4ee4\u884c\u548c\u56fe\u5f62\u5de5\u5177\u4e0eNetworkManager\u901a\u4fe1\uff0c\u5c06\u914d\u7f6e\u6587\u4ef6\u4fdd\u5b58\u5728\/etc\/sysconfig\/network-scripts\u76ee\u5f55\u4e2d\n2)\tnmcli\u57fa\u7840\u547d\u4ee4\nnmcli device status\uff1a\u663e\u793a\u6240\u6709\u7f51\u7edc\u8bbe\u5907\u7684\u72b6\u6001\nnmcli connection show\uff1a\u663e\u793a\u6240\u6709\u8fde\u63a5\u7684\u5217\u8868\nnmcli connection add con-name shida type ethernet\uff1a\u6dfb\u52a0\u4e00\u4e2a\u540d\u4e3ashida\u7684\u8fde\u63a5\nnmcli connection up shida\uff1a\u6fc0\u6d3bshida\u8fde\u63a5\nnmcli connection down shida\uff1a\u5173\u95edshida\u8fde\u63a5\nnmcli connection delete shida\uff1a\u5220\u9664shida\u8fde\u63a5\u53ca\u5176\u914d\u7f6e\u6587\u4ef6\nnmcli device disconnect ens160\uff08\u7f51\u7edc\u63a5\u53e3\u540d\u79f0\uff09\uff1a\u5173\u95ed\u7f51\u7edc\u63a5\u53e3\nnmcli connection add con-name shida ifname ens160 type ethernet ipv4.addresses 1.1.1.1\/24 ipv4.gateway 1.1.1.2\nnmcli connection modify ens160 con-name abc\uff1a\u4fee\u6539\u7f51\u7edc\u8fde\u7684\u540d\u5b57\nnmcli connection reload\uff1a\u91cd\u65b0\u8bfb\u53d6\u7f51\u7edc\u8fde\u63a5\u914d\u7f6e\u6587\u4ef6\uff0c\u4f7f\u5176\u751f\u6548\n<\/pre>\n\n\n\n<ul><li>\u56fe\u5f62\u5316\u684c\u9762\u914d\u7f6e\u7f51\u7edc<\/li><li>nmtui\u914d\u7f6e\u7f51\u7edc<\/li><li>\u914d\u7f6e\u6587\u4ef6\u7f16\u8f91\u7f51\u7edc<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/08\/image-68.png\" alt=\"\" class=\"wp-image-7105\" width=\"566\" height=\"174\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-68.png 864w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-68-300x92.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-68-768x236.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-68-830x256.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-68-230x71.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-68-350x108.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-68-480x148.png 480w\" sizes=\"(max-width: 566px) 100vw, 566px\" \/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/08\/image-69.png\" alt=\"\" class=\"wp-image-7106\" width=\"586\" height=\"207\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-69.png 864w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-69-300x106.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-69-768x272.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-69-830x294.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-69-230x81.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-69-350x124.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/08\/image-69-480x170.png 480w\" sizes=\"(max-width: 586px) 100vw, 586px\" \/><\/figure><\/div>\n\n\n\n<p><strong>\u914d\u7f6e\u4e3b\u673a\u540d\u548c\u540d\u79f0\u89e3\u6790<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<ul><li>\u7f6e\u7cfb\u7edf\u4e3b\u673a\u540d<\/li><\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">hostname xxxx\uff1a\u7acb\u523b\u751f\u6548\uff08\u91cd\u65b0\u5f00\u542f\u4e0b\u7ec8\u7aef\uff09\uff0c\u91cd\u542f\u5931\u6548\n\u914d\u7f6e\u6587\u4ef6\/etc\/hostname\uff1a\u5f53\u524d\u4e0d\u751f\u6548\uff0c\u91cd\u542f\u751f\u6548\nhostnamectl set-hostname xxxx\uff1a\u7acb\u523b\u751f\u6548\uff08\u91cd\u65b0\u5f00\u542f\u4e0b\u7ec8\u7aef\uff09\uff0c\u91cd\u542f\u4ecd\u6709\u6548\n<\/pre>\n\n\n\n<ul><li>\u914d\u7f6e\u540d\u79f0\u89e3\u6790<\/li><\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">1)\t\u9ed8\u8ba4\u67e5\u627e\u6587\u4ef6\/etc\/hosts\uff1b\u5982\u679c\u6ca1\u6709\uff0c\u90a3\u4e48\u4f7f\u7528DNS\u57df\u540d\u670d\u52a1\u5668\u67e5\u8be2\n2)\t\/etc\/nsswitch.conf\uff1a\u5b58\u50a8\u540d\u79f0\u5207\u6362\u6587\u4ef6\n     hosts:  dns  files\uff1a\u5f53\/etc\/hosts\u548cDNS\u53d1\u751f\u51b2\u7a81\u65f6\u5019\uff0cDNS\u4f18\u5148\uff01\n     hosts:  files  dns\uff1a\u5f53\/etc\/hosts\u548cDNS\u53d1\u751f\u51b2\u7a81\u65f6\u5019\uff0chosts\u6587\u4ef6\u4f18\u5148\uff08\u9ed8\u8ba4\uff09\n<\/pre>\n\n\n\n<ul><li>\u914d\u7f6e\u672c\u5730DNS<\/li><\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">1)\t\u914d\u7f6e\u6587\u4ef6\u4f4d\u7f6e\uff1a\/etc\/resolv.conf\n2)\tnameserver\uff1a\u67e5\u8be2\u7684\u540d\u79f0\u670d\u52a1\u5668IP\u5730\u5740\uff0c\u6700\u591a\u6307\u5b9a3\u4e2a\uff1b\u4fee\u6539dns\u670d\u52a1\u5668\u5730\u5740\u4e0d\u9700\u8981\u91cd\u542f\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>systemd\u7b80\u4ecb Systemd\u662fLinux\u7cfb\u7edf\u5de5\u5177\u4e5f\u662f\u7cfb\u7edf\u57fa\u7840\u7ec4\u4ef6\u7684\u96c6\u5408\u7528\u6765\u542f\u52a8\u5b88\u62a4\u8fdb\u7a0b\u3002\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7cfb\u7edf\u548c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[],"_links":{"self":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/7094"}],"collection":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7094"}],"version-history":[{"count":4,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/7094\/revisions"}],"predecessor-version":[{"id":7219,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/7094\/revisions\/7219"}],"wp:attachment":[{"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7094"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7094"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7094"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}