{"id":15337,"date":"2025-04-18T21:53:13","date_gmt":"2025-04-18T13:53:13","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/15337.html"},"modified":"2025-04-18T21:53:13","modified_gmt":"2025-04-18T13:53:13","slug":"linux%e5%9c%a8-ubuntu-%e7%b3%bb%e7%bb%9f%e4%b8%ad%e8%ae%be%e7%bd%ae%e6%9c%8d%e5%8a%a1%e5%99%a8%e6%97%b6%e9%97%b4","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/15337.html","title":{"rendered":"linux\u5728 Ubuntu \u7cfb\u7edf\u4e2d\u8bbe\u7f6e\u670d\u52a1\u5668\u65f6\u95f4"},"content":{"rendered":"<p>\u5728 Ubuntu \u7cfb\u7edf\u4e2d\u8bbe\u7f6e\u670d\u52a1\u5668\u65f6\u95f4\u901a\u5e38\u6d89\u53ca\u4ee5\u4e0b\u6b65\u9aa4&#xff0c;\u6db5\u76d6\u81ea\u52a8\u540c\u6b65\u548c\u624b\u52a8\u914d\u7f6e\u4e24\u79cd\u65b9\u5f0f\u3002\u4ee5\u4e0b\u662f\u8be6\u7ec6\u64cd\u4f5c\u6307\u5357&#xff1a;<\/p>\n<hr \/>\n<h4>\u4e00\u3001\u68c0\u67e5\u5f53\u524d\u65f6\u95f4\u72b6\u6001<\/h4>\n<p>timedatectl status<\/p>\n<ul>\n<li>\u8f93\u51fa\u793a\u4f8b&#xff1a;Local time: Wed 2023-10-18 15:30:00 UTC<br \/>\nUniversal time: Wed 2023-10-18 15:30:00 UTC<br \/>\nRTC time: Wed 2023-10-18 15:30:00<br \/>\nTime zone: Etc\/UTC (UTC, &#043;0000)<br \/>\nSystem clock synchronized: yes<br \/>\nNTP service: active<br \/>\nRTC in local TZ: no<\/p>\n<ul>\n<li>\u5173\u952e\u4fe1\u606f&#xff1a;\u65f6\u533a&#xff08;Time zone&#xff09;\u3001NTP \u662f\u5426\u542f\u7528&#xff08;NTP service&#xff09;\u3001\u7cfb\u7edf\u65f6\u95f4\u540c\u6b65\u72b6\u6001\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<hr \/>\n<h4>\u4e8c\u3001\u8bbe\u7f6e\u65f6\u533a<\/h4>\n<h5>1. \u5217\u51fa\u6240\u6709\u53ef\u7528\u65f6\u533a<\/h5>\n<p>timedatectl list-timezones<\/p>\n<h5>2. \u8bbe\u7f6e\u65f6\u533a&#xff08;\u5982 Asia\/Shanghai&#xff09;<\/h5>\n<p><span class=\"token function\">sudo<\/span> timedatectl set-timezone Asia\/Shanghai<\/p>\n<h5>3. \u9a8c\u8bc1\u65f6\u533a<\/h5>\n<p><span class=\"token function\">date<\/span><br \/>\n<span class=\"token comment\"># \u6216<\/span><br \/>\ntimedatectl<\/p>\n<hr \/>\n<h4>\u4e09\u3001\u81ea\u52a8\u540c\u6b65\u65f6\u95f4&#xff08;NTP \u670d\u52a1&#xff09;<\/h4>\n<h5>1. \u542f\u7528 NTP \u65f6\u95f4\u540c\u6b65<\/h5>\n<p><span class=\"token function\">sudo<\/span> timedatectl set-ntp <span class=\"token boolean\">true<\/span><\/p>\n<h5>2. \u68c0\u67e5 NTP \u670d\u52a1\u72b6\u6001<\/h5>\n<p>systemctl status systemd-timesyncd<\/p>\n<h5>3. \u5b89\u88c5\u66f4\u5f3a\u5927\u7684 NTP \u5de5\u5177&#xff08;\u53ef\u9009&#xff09;<\/h5>\n<ul>\n<li>Chrony&#xff08;\u63a8\u8350&#xff09;&#xff1a;<span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> <span class=\"token function\">install<\/span> chrony<br \/>\n<span class=\"token function\">sudo<\/span> systemctl restart chrony\n <\/li>\n<li>ntpd&#xff1a;<span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> <span class=\"token function\">install<\/span> ntp<br \/>\n<span class=\"token function\">sudo<\/span> systemctl restart ntp\n <\/li>\n<\/ul>\n<h5>4. \u914d\u7f6e NTP \u670d\u52a1\u5668&#xff08;\u5982\u81ea\u5b9a\u4e49\u670d\u52a1\u5668&#xff09;<\/h5>\n<p>\u7f16\u8f91\u914d\u7f6e\u6587\u4ef6&#xff08;\u4ee5 Chrony \u4e3a\u4f8b&#xff09;&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">nano<\/span> \/etc\/chrony\/chrony.conf<\/p>\n<ul>\n<li>\u6dfb\u52a0\u6216\u66ff\u6362\u4e3a\u56fd\u5185 NTP \u670d\u52a1\u5668&#xff1a;server ntp.aliyun.com iburst<br \/>\nserver cn.pool.ntp.org iburst\n <\/li>\n<\/ul>\n<p>\u91cd\u542f\u670d\u52a1&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> systemctl restart chrony<\/p>\n<hr \/>\n<h4>\u56db\u3001\u624b\u52a8\u8bbe\u7f6e\u65f6\u95f4<\/h4>\n<h5>1. \u7981\u7528 NTP \u540c\u6b65&#xff08;\u907f\u514d\u8986\u76d6\u624b\u52a8\u8bbe\u7f6e&#xff09;<\/h5>\n<p><span class=\"token function\">sudo<\/span> timedatectl set-ntp <span class=\"token boolean\">false<\/span><\/p>\n<h5>2. \u624b\u52a8\u8bbe\u7f6e\u65f6\u95f4<\/h5>\n<ul>\n<li>\u65b9\u6cd5 1&#xff1a;\u4f7f\u7528 timedatectl<span class=\"token function\">sudo<\/span> timedatectl set-time <span class=\"token string\">&#034;2023-10-18 15:30:00&#034;<\/span>\n <\/li>\n<li>\u65b9\u6cd5 2&#xff1a;\u4f7f\u7528 date<span class=\"token function\">sudo<\/span> <span class=\"token function\">date<\/span> <span class=\"token parameter variable\">-s<\/span> <span class=\"token string\">&#034;2023-10-18 15:30:00&#034;<\/span>\n <\/li>\n<\/ul>\n<h5>3. \u540c\u6b65\u786c\u4ef6\u65f6\u949f&#xff08;RTC&#xff09;<\/h5>\n<p><span class=\"token function\">sudo<\/span> hwclock <span class=\"token parameter variable\">&#8211;systohc<\/span><\/p>\n<hr \/>\n<h4>\u4e94\u3001\u9a8c\u8bc1\u65f6\u95f4\u914d\u7f6e<\/h4>\n<h5>1. \u68c0\u67e5\u7cfb\u7edf\u65f6\u95f4<\/h5>\n<p><span class=\"token function\">date<\/span><\/p>\n<h5>2. \u68c0\u67e5\u786c\u4ef6\u65f6\u949f<\/h5>\n<p><span class=\"token function\">sudo<\/span> hwclock <span class=\"token parameter variable\">&#8211;show<\/span><\/p>\n<h5>3. \u68c0\u67e5 NTP \u540c\u6b65\u72b6\u6001&#xff08;Chrony&#xff09;<\/h5>\n<p>chronyc tracking<\/p>\n<hr \/>\n<h4>\u516d\u3001\u5e38\u89c1\u95ee\u9898<\/h4>\n<h5>1. NTP \u540c\u6b65\u5931\u8d25<\/h5>\n<ul>\n<li>\u68c0\u67e5\u9632\u706b\u5899\u662f\u5426\u653e\u884c UDP 123 \u7aef\u53e3\u3002<\/li>\n<li>\u67e5\u770b\u65e5\u5fd7&#xff1a;journalctl <span class=\"token parameter variable\">-u<\/span> systemd-timesyncd\n <\/li>\n<\/ul>\n<h5>2. \u65f6\u533a\u8bbe\u7f6e\u65e0\u6548<\/h5>\n<ul>\n<li>\u786e\u4fdd\u65f6\u533a\u540d\u79f0\u6b63\u786e&#xff08;\u533a\u5206\u5927\u5c0f\u5199&#xff09;\u3002<\/li>\n<li>\u91cd\u542f\u7cfb\u7edf\u6216\u670d\u52a1&#xff1a;<span class=\"token function\">sudo<\/span> systemctl restart systemd-timesyncd\n <\/li>\n<\/ul>\n<h5>3. \u65f6\u95f4\u504f\u5dee\u8f83\u5927<\/h5>\n<ul>\n<li>\u624b\u52a8\u5f3a\u5236\u540c\u6b65&#xff1a;<span class=\"token function\">sudo<\/span> chronyc <span class=\"token parameter variable\">-a<\/span> makestep\n <\/li>\n<\/ul>\n<hr \/>\n<p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4&#xff0c;\u60a8\u53ef\u4ee5\u6839\u636e\u9700\u6c42\u7075\u6d3b\u914d\u7f6e Ubuntu \u670d\u52a1\u5668\u7684\u65f6\u95f4\u3002\u63a8\u8350\u4f18\u5148\u4f7f\u7528 NTP \u81ea\u52a8\u540c\u6b65\u4ee5\u786e\u4fdd\u65f6\u95f4\u51c6\u786e\u6027&#xff0c;\u5c24\u5176\u662f\u5728\u751f\u4ea7\u73af\u5883\u4e2d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.1k\u6b21\uff0c\u70b9\u8d5e13\u6b21\uff0c\u6536\u85cf13\u6b21\u3002\u5728 Ubuntu \u7cfb\u7edf\u4e2d\u8bbe\u7f6e\u670d\u52a1\u5668\u65f6\u95f4_ubuntu\u66f4\u6539\u670d\u52a1\u5668\u65f6\u95f4<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[58,103,43],"topic":[],"class_list":["post-15337","post","type-post","status-publish","format-standard","hentry","category-server","tag-linux","tag-ubuntu","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>linux\u5728 Ubuntu \u7cfb\u7edf\u4e2d\u8bbe\u7f6e\u670d\u52a1\u5668\u65f6\u95f4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/15337.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"linux\u5728 Ubuntu \u7cfb\u7edf\u4e2d\u8bbe\u7f6e\u670d\u52a1\u5668\u65f6\u95f4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.1k\u6b21\uff0c\u70b9\u8d5e13\u6b21\uff0c\u6536\u85cf13\u6b21\u3002\u5728 Ubuntu \u7cfb\u7edf\u4e2d\u8bbe\u7f6e\u670d\u52a1\u5668\u65f6\u95f4_ubuntu\u66f4\u6539\u670d\u52a1\u5668\u65f6\u95f4\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/15337.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-18T13:53:13+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/15337.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/15337.html\",\"name\":\"linux\u5728 Ubuntu \u7cfb\u7edf\u4e2d\u8bbe\u7f6e\u670d\u52a1\u5668\u65f6\u95f4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T13:53:13+00:00\",\"dateModified\":\"2025-04-18T13:53:13+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/15337.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/15337.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/15337.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"linux\u5728 Ubuntu \u7cfb\u7edf\u4e2d\u8bbe\u7f6e\u670d\u52a1\u5668\u65f6\u95f4\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"linux\u5728 Ubuntu \u7cfb\u7edf\u4e2d\u8bbe\u7f6e\u670d\u52a1\u5668\u65f6\u95f4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/15337.html","og_locale":"zh_CN","og_type":"article","og_title":"linux\u5728 Ubuntu \u7cfb\u7edf\u4e2d\u8bbe\u7f6e\u670d\u52a1\u5668\u65f6\u95f4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.1k\u6b21\uff0c\u70b9\u8d5e13\u6b21\uff0c\u6536\u85cf13\u6b21\u3002\u5728 Ubuntu \u7cfb\u7edf\u4e2d\u8bbe\u7f6e\u670d\u52a1\u5668\u65f6\u95f4_ubuntu\u66f4\u6539\u670d\u52a1\u5668\u65f6\u95f4","og_url":"https:\/\/www.wsisp.com\/helps\/15337.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T13:53:13+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/15337.html","url":"https:\/\/www.wsisp.com\/helps\/15337.html","name":"linux\u5728 Ubuntu \u7cfb\u7edf\u4e2d\u8bbe\u7f6e\u670d\u52a1\u5668\u65f6\u95f4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T13:53:13+00:00","dateModified":"2025-04-18T13:53:13+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/15337.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/15337.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/15337.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"linux\u5728 Ubuntu \u7cfb\u7edf\u4e2d\u8bbe\u7f6e\u670d\u52a1\u5668\u65f6\u95f4"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/15337","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=15337"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/15337\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=15337"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=15337"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=15337"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=15337"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}