{"id":8665,"date":"2025-04-18T16:52:46","date_gmt":"2025-04-18T08:52:46","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/8665.html"},"modified":"2025-04-18T16:52:46","modified_gmt":"2025-04-18T08:52:46","slug":"centos-7%e5%86%85%e7%bd%91%e6%9c%8d%e5%8a%a1%e5%99%a8ntp%e6%97%b6%e9%97%b4%e6%a0%a1%e5%87%86%e4%b8%8e%e5%90%8c%e6%ad%a5","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/8665.html","title":{"rendered":"CentOS 7\u5185\u7f51\u670d\u52a1\u5668NTP\u65f6\u95f4\u6821\u51c6\u4e0e\u540c\u6b65"},"content":{"rendered":"<\/p>\n<h4>\u670d\u52a1\u5668\u4e0d\u80fd\u4e0a\u7f51&#xff0c;\u65f6\u95f4\u5bf9\u4e0d\u4e0a&#xff0c;\u591a\u53f0\u670d\u52a1\u5668\u65f6\u95f4\u4e0d\u540c\u6b65<\/h4>\n<ul>\n<li>\u4e0d\u5c31\u6821\u51c6\u4e00\u4e2a\u65f6\u95f4\u5417&#xff1f;\u6709\u591a\u96be&#xff1f;<\/li>\n<li>\u8be5\u6b7b\u7684\u5b8c\u7f8e\u4e3b\u4e49&#xff0c;\u5148\u660e\u786e\u9700\u6c42\u5427&#xff01;<\/li>\n<li>\u8fd8\u63d0\u8981\u6c42&#xff0c;\u5148\u770b\u770b\u81ea\u5df1\u6709\u4ec0\u4e48&#xff1f;<\/li>\n<li>\u597d&#xff0c;\u90a3\u5c31\u5f00\u5e72&#xff01;<\/li>\n<li>\n<ul>\n<li>1.\u5916\u7f51NTP\u670d\u52a1\u5668\u6821\u51c6\u5185\u7f51\u670d\u52a1\u5668\u65f6\u95f4<\/li>\n<li>2.\u5185\u7f51\u81ea\u5efaNTP\u670d\u52a1\u5668<\/li>\n<li>3.\u914d\u7f6eNTP\u5ba2\u6237\u7aef<\/li>\n<\/ul>\n<\/li>\n<li>\u53c2\u8003\u8d44\u6599<\/li>\n<\/ul>\n<h2>\u4e0d\u5c31\u6821\u51c6\u4e00\u4e2a\u65f6\u95f4\u5417&#xff1f;\u6709\u591a\u96be&#xff1f;<\/h2>\n<p>\u670d\u52a1\u5668\u65f6\u95f4\u4e0d\u540c\u6b65&#xff0c;\u6700\u7b80\u5355\u7c97\u66b4\u7684\u65b9\u6cd5\u662f&#xff1a;\u76f4\u63a5\u7528\u547d\u4ee4\u624b\u52a8\u6539\u65f6\u95f4\u3002<\/p>\n<p>timedatectl set-timezone <span class=\"token string\">&#034;Asia\/Shanghai&#034;<\/span><br \/>\n<span class=\"token function\">date<\/span> <span class=\"token parameter variable\">-s<\/span> <span class=\"token string\">&#034;2024-2-6 21:00:00&#034;<\/span><\/p>\n<p>\u5148\u4fee\u6539\u65f6\u533a\u4e3a\u4e0a\u6d77&#xff0c;\u518d\u4fee\u6539\u65f6\u95f4&#xff0c;\u6240\u4ee5&#xff0c;so easy &#xff0c;\u672c\u6587\u7ed3\u675f\u2026 \u4e3a\u4ec0\u4e48&#xff1f;\u96be\u53d7&#xff01;\u8fd9\u5f88\u4e0d\u4f18\u96c5&#xff0c;\u522b\u95ee\u6211\u4e3a\u4ec0\u4e48&#xff0c;\u603b\u4e4b\u65e0\u6cd5\u63a5\u53d7<\/p>\n<h2>\u8be5\u6b7b\u7684\u5b8c\u7f8e\u4e3b\u4e49&#xff0c;\u5148\u660e\u786e\u9700\u6c42\u5427&#xff01;<\/h2>\n<li>\u81ea\u52a8\u6821\u51c6\u65f6\u95f4<\/li>\n<li>\u591a\u53f0\u670d\u52a1\u5668\u540c\u6b65\u65f6\u95f4<\/li>\n<li>\u6c38\u4e45\u751f\u6548&#xff0c;\u5373\u4f7f\u91cd\u542f<\/li>\n<h2>\u8fd8\u63d0\u8981\u6c42&#xff0c;\u5148\u770b\u770b\u81ea\u5df1\u6709\u4ec0\u4e48&#xff1f;<\/h2>\n<li>\u6709root\u6743\u9650<\/li>\n<li>\u670d\u52a1\u5668\u5728\u5185\u7f51\u4e0a\u4e0d\u4e86\u7f51<\/li>\n<li>\u53ef\u4ee5\u4ee3\u7406\u4e0a\u7f51<\/li>\n<li>\u53ef\u4ee5\u90e8\u7f72SSH\u96a7\u9053\u6620\u5c04\u7aef\u53e3<\/li>\n<h2>\u597d&#xff0c;\u90a3\u5c31\u5f00\u5e72&#xff01;<\/h2>\n<p>\u670d\u52a1\u56681&#xff1a;172.0.0.1 \u8ba1\u5212\u4f5c \u672c\u5730 NTP \u670d\u52a1\u5668 \u670d\u52a1\u56682&#xff1a;172.0.0.2 NTP \u5ba2\u6237\u7aef1 \u670d\u52a1\u56683&#xff1a;172.0.0.3 NTP \u5ba2\u6237\u7aef2 \u670d\u52a1\u56684&#xff1a;172.0.0.4 NTP \u5ba2\u6237\u7aef3<\/p>\n<p>\u6211\u7684\u7535\u8111&#xff1a;172.0.0.5 \u80fd\u4e0a\u7f51&#xff0c;\u4e3a\u4ec0\u4e48&#xff0c;\u56e0\u4e3a\u6211\u6709\u4e24\u5f20\u7f51\u5361&#xff0c;&#xff08;192.168.1.1&#xff09;<\/p>\n<h3>1.\u5916\u7f51NTP\u670d\u52a1\u5668\u6821\u51c6\u5185\u7f51\u670d\u52a1\u5668\u65f6\u95f4<\/h3>\n<p>\u5148\u5b89\u88c5\u4e2a\u8f6f\u4ef6\u5305&#xff0c;<\/p>\n<p>yum <span class=\"token function\">install<\/span> ntp<\/p>\n<p>\u4ec0\u4e48&#xff1f;\u88c5\u4e0d\u4e0a&#xff0c;\u90fd\u6ca1\u7f51&#xff0c;\u4ee3\u7406\u4e0a\u7f51\u4e0d\u4f1a\u5417&#xff1f;<\/p>\n<p><span class=\"token builtin class-name\">export<\/span> <span class=\"token assign-left variable\">http_proxy<\/span><span class=\"token operator\">&#061;<\/span>http:\/\/172.0.0.5:1556<br \/>\n<span class=\"token builtin class-name\">export<\/span> <span class=\"token assign-left variable\">https_proxy<\/span><span class=\"token operator\">&#061;<\/span>http:\/\/172.0.0.5:1556<br \/>\nyum <span class=\"token function\">install<\/span> ntp<\/p>\n<p>\u597d&#xff0c;\u8f6f\u4ef6\u5305\u88c5\u597d\u4e86&#xff0c;\u5f00\u59cb\u6821\u51c6\u65f6\u95f4\u3002<\/p>\n<p>ntpdate ntp.aliyun.com<\/p>\n<p>\u7528\u963f\u91cc\u7684\u670d\u52a1\u5668\u6821\u4e00\u6821&#xff0c;\u5f88\u9057\u61be&#xff0c;\u670d\u52a1\u5668\u6839\u672c\u6ca1\u914d\u7f6eDNS<\/p>\n<p><span class=\"token number\">6<\/span> Feb <span class=\"token number\">21<\/span>:09:08 ntpdate<span class=\"token punctuation\">[<\/span><span class=\"token number\">249451<\/span><span class=\"token punctuation\">]<\/span>: Can&#039;t <span class=\"token function\">find<\/span> <span class=\"token function\">host<\/span> ntp.aliyun.com: Name or <span class=\"token function\">service<\/span> not known <span class=\"token punctuation\">(<\/span>-2<span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token number\">6<\/span> Feb <span class=\"token number\">21<\/span>:09:08 ntpdate<span class=\"token punctuation\">[<\/span><span class=\"token number\">249451<\/span><span class=\"token punctuation\">]<\/span>: no servers can be used, exiting<\/p>\n<p>\u90a3\u6211\u81ea\u5df1\u76f4\u63a5\u7528IP&#xff0c;\u7528\u81ea\u5df1\u7684\u7535\u8111\u5148\u770b\u770bIP<\/p>\n<p><span class=\"token function\">ping<\/span> ntp.aliyun.com<br \/>\nPING ntp.aliyun.com <span class=\"token punctuation\">(<\/span><span class=\"token number\">203.107<\/span>.6.88<span class=\"token punctuation\">)<\/span> <span class=\"token number\">56<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">84<\/span><span class=\"token punctuation\">)<\/span> bytes of data.<\/p>\n<p>\u518d\u6821\u4e00\u6821\u8bd5\u8bd5<\/p>\n<p>ntpdate <span class=\"token number\">203.107<\/span>.6.88<\/p>\n<p>\u8fd8\u662f\u4e0d\u884c\u3002<\/p>\n<p><span class=\"token number\">6<\/span> Feb <span class=\"token number\">21<\/span>:12:53 ntpdate<span class=\"token punctuation\">[<\/span><span class=\"token number\">60842<\/span><span class=\"token punctuation\">]<\/span>: no server suitable <span class=\"token keyword\">for<\/span> synchronization found<\/p>\n<p>\u6ca1\u7f51&#xff1f;\u4e0d\u53ef\u80fd&#xff0c;\u4ee3\u7406\u4e0d\u4e86&#xff1f;\u679c\u7136&#xff0c;ntp\u670d\u52a1\u4f7f\u7528\u7684\u662fUDP\u534f\u8bae&#xff0c;\u7aef\u53e3\u4e3a123\u3002 \u90a3\u5c31\u5728\u8def\u7531\u5668\u4e0a\u914d\u4e2aUDP\u7aef\u53e3\u8f6c\u53d1&#xff0c;\u5c06123\u7aef\u53e3\u8f6c\u53d1\u5230203.107.6.88\u7684123\u7aef\u53e3\u3002 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418085245-680212dd91db3.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/>\u641e\u5b9a&#xff01; \u8fd9\u8def\u7531\u5668\u4e0d\u7b80\u5355&#xff0c;\u53ef\u4ee5NAT\u5230\u4e92\u8054\u7f51&#xff0c;\u7b80\u5316\u4e86\u8bb8\u591a\u64cd\u4f5c\u3002\u6ca1\u6709\u8def\u7531\u5668\u53ef\u4ee5\u7528\u5176\u4ed6\u65b9\u6cd5&#xff0c;\u6838\u5fc3\u5c31\u662f\u5c06\u5916\u7f51\u7684NTP\u670d\u52a1\u5668UDP\u7aef\u53e3123\u6620\u5c04\u5185\u7f51\u4e2d&#xff0c;\u8fd9\u65f6\u5019\u8def\u7531\u5668&#xff08;172.0.0.100&#xff09;\u5c31\u76f8\u5f53\u4e8e\u5185\u7f51\u7684NTP\u670d\u52a1\u5668\u4e86\u3002<\/p>\n<h3>2.\u5185\u7f51\u81ea\u5efaNTP\u670d\u52a1\u5668<\/h3>\n<p>\u4ee5\u4e0a\u6240\u6709\u670d\u52a1\u5668\u90fd\u80fd\u7528\u8def\u7531\u5668\u6765\u6821\u51c6\u65f6\u95f4&#xff0c;\u4e3a\u4ec0\u4e48\u8fd8\u8981\u5185\u7f51\u81ea\u5efaNTP\u670d\u52a1\u5668\u5462&#xff1f;\u56e0\u4e3a\u8003\u8651\u5230\u670d\u52a1\u5668\u4e4b\u95f4\u7684\u65f6\u95f4\u540c\u6b65\u95ee\u9898&#xff0c;\u5185\u5916\u7f51\u7edc\u73af\u5883\u7a33\u5b9a&#xff0c;\u5916\u7f51\u6ce2\u52a8\u5927&#xff0c;\u8def\u7531\u5668\u968f\u65f6\u53ef\u4ee5\u64a4\u3002\u67d0\u4e9b\u573a\u666f\u4e0b\u5916\u7f51\u662f\u5b8c\u5168\u9694\u79bb\u7684\u3002 \u7f16\u8f91\u4e00\u4e0b\u914d\u7f6e\u6587\u4ef6<\/p>\n<p><span class=\"token function\">vim<\/span> \/etc\/ntp.conf<\/p>\n<p>\u52a0\u5165\u8fd9\u4e24\u6761&#xff0c;\u7b2c\u4e00\u6761\u662f\u521a\u914d\u7f6e\u7684\u8f6c\u53d1\u8def\u7531\u5668\u5730\u5740&#xff0c;\u7b2c\u4e8c\u6761\u662f\u5b83\u81ea\u5df1&#xff0c;\u5f53\u5916\u90e8\u65f6\u95f4\u4e0d\u53ef\u7528\u65f6&#xff0c;\u4f7f\u7528\u672c\u5730\u65f6\u95f4\u3002\u628a\u5176\u4ed6\u4e0d\u7528\u7684\u670d\u52a1\u5668\u6ce8\u91ca\u5373\u53ef\u3002<\/p>\n<p><span class=\"token comment\"># server 0.centos.pool.ntp.org iburst<\/span><br \/>\n<span class=\"token comment\"># server 1.centos.pool.ntp.org iburst<\/span><br \/>\n<span class=\"token comment\"># server 2.centos.pool.ntp.org iburst<\/span><br \/>\n<span class=\"token comment\"># server 3.centos.pool.ntp.org iburst<\/span><br \/>\nserver <span class=\"token number\">172.0<\/span>.0.100 iburst<br \/>\nserver <span class=\"token number\">127.127<\/span>.1.0 iburst <\/p>\n<p>\u5176\u4ed6\u770b\u7740\u6539&#xff0c;\u5b8c\u6574\u914d\u7f6e\u6587\u4ef6\/etc\/ntp.conf<\/p>\n<p><span class=\"token comment\"># For more information about this file, see the man pages<\/span><br \/>\n<span class=\"token comment\"># ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).<\/span><\/p>\n<p>driftfile \/var\/lib\/ntp\/drift<\/p>\n<p><span class=\"token comment\"># Permit time synchronization with our time source, but do not<\/span><br \/>\n<span class=\"token comment\"># permit the source to query or modify the service on this system.<\/span><br \/>\n<span class=\"token comment\"># restrict default nomodify notrap nopeer noquery<\/span><\/p>\n<p><span class=\"token comment\"># Permit all access over the loopback interface.  This could<\/span><br \/>\n<span class=\"token comment\"># be tightened as well, but to do so would effect some of<\/span><br \/>\n<span class=\"token comment\"># the administrative functions.<\/span><br \/>\n<span class=\"token comment\"># restrict 127.0.0.1<\/span><br \/>\n<span class=\"token comment\"># restrict ::1<\/span><\/p>\n<p><span class=\"token comment\"># Hosts on local network are less restricted.<\/span><br \/>\nrestrict <span class=\"token number\">172.0<\/span>.0.0 mask <span class=\"token number\">255.255<\/span>.255.0 nomodify notrap<\/p>\n<p><span class=\"token comment\"># Use public servers from the pool.ntp.org project.<\/span><br \/>\n<span class=\"token comment\"># Please consider joining the pool (http:\/\/www.pool.ntp.org\/join.html).<\/span><br \/>\n<span class=\"token comment\"># server 0.centos.pool.ntp.org iburst<\/span><br \/>\n<span class=\"token comment\"># server 1.centos.pool.ntp.org iburst<\/span><br \/>\n<span class=\"token comment\"># server 2.centos.pool.ntp.org iburst<\/span><br \/>\n<span class=\"token comment\"># server 3.centos.pool.ntp.org iburst<\/span><br \/>\nserver <span class=\"token number\">172.0<\/span>.0.100 iburst<br \/>\nserver <span class=\"token number\">127.127<\/span>.1.0 iburst<br \/>\n<span class=\"token comment\"># fudge 127.127.1.0 stratum 8<\/span><\/p>\n<p><span class=\"token comment\">#broadcast 192.168.1.255 autokey        # broadcast server<\/span><br \/>\n<span class=\"token comment\">#broadcastclient                        # broadcast client<\/span><br \/>\n<span class=\"token comment\">#broadcast 224.0.1.1 autokey            # multicast server<\/span><br \/>\n<span class=\"token comment\">#multicastclient 224.0.1.1              # multicast client<\/span><br \/>\n<span class=\"token comment\">#manycastserver 239.255.254.254         # manycast server<\/span><br \/>\n<span class=\"token comment\">#manycastclient 239.255.254.254 autokey # manycast client<\/span><\/p>\n<p><span class=\"token comment\"># Enable public key cryptography.<\/span><br \/>\n<span class=\"token comment\">#crypto<\/span><\/p>\n<p>includefile \/etc\/ntp\/crypto\/pw<\/p>\n<p><span class=\"token comment\"># Key file containing the keys and key identifiers used when operating<\/span><br \/>\n<span class=\"token comment\"># with symmetric key cryptography.<\/span><br \/>\nkeys \/etc\/ntp\/keys<\/p>\n<p><span class=\"token comment\"># Specify the key identifiers which are trusted.<\/span><br \/>\n<span class=\"token comment\">#trustedkey 4 8 42<\/span><br \/>\n<span class=\"token comment\"># Specify the key identifier to use with the ntpdc utility.<\/span><br \/>\n<span class=\"token comment\">#requestkey 8<\/span><\/p>\n<p><span class=\"token comment\"># Specify the key identifier to use with the ntpq utility.<\/span><br \/>\n<span class=\"token comment\">#controlkey 8<\/span><\/p>\n<p><span class=\"token comment\"># Enable writing of statistics records.<\/span><br \/>\n<span class=\"token comment\">#statistics clockstats cryptostats loopstats peerstats<\/span><\/p>\n<p><span class=\"token comment\"># Disable the monitoring facility to prevent amplification attacks using ntpdc<\/span><br \/>\n<span class=\"token comment\"># monlist command when default restrict does not include the noquery flag. See<\/span><br \/>\n<span class=\"token comment\"># CVE-2013-5211 for more details.<\/span><br \/>\n<span class=\"token comment\"># Note: Monitoring will not be disabled with the limited restriction flag.<\/span><br \/>\ndisable monitor<\/p>\n<p>\u542f\u52a8NTP\u670d\u52a1,\u5e76\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f<\/p>\n<p>systemctl <span class=\"token builtin class-name\">enable<\/span> ntpd<br \/>\nsystemctl start ntpd<\/p>\n<p>\u67e5\u770b\u4e00\u4e0b\u72b6\u6001<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;server root<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ntpq -p<\/span><br \/>\n     remote           refid      st t when poll reach   delay   offset  jitter<br \/>\n<span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;&#061;<\/span><br \/>\n*172.0.0.1       <span class=\"token number\">101.207<\/span>.21.141   <span class=\"token number\">2<\/span> u   <span class=\"token number\">30<\/span>  <span class=\"token number\">128<\/span>  <span class=\"token number\">377<\/span>   <span class=\"token number\">43.155<\/span>    <span class=\"token number\">7.632<\/span>   <span class=\"token number\">2.896<\/span><br \/>\n LOCAL<span class=\"token punctuation\">(<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">)<\/span>        .LOCL.           <span class=\"token number\">5<\/span> l  72m   <span class=\"token number\">64<\/span>    <span class=\"token number\">0<\/span>    <span class=\"token number\">0.000<\/span>    <span class=\"token number\">0.000<\/span>   <span class=\"token number\">0.000<\/span><\/p>\n<h3>3.\u914d\u7f6eNTP\u5ba2\u6237\u7aef<\/h3>\n<p>\u5ba2\u6237\u7aef\u6bd4\u8f83\u7b80\u5355&#xff0c;\u6240\u6709\u670d\u52a1\u5668\u5148\u8ddf\u5185\u5916NTP\u670d\u52a1\u5668\u540c\u6b65\u4e00\u4e0b\u65f6\u95f4\u3002<\/p>\n<p>ntpdate <span class=\"token parameter variable\">-u<\/span> <span class=\"token number\">172.0<\/span>.0.1<\/p>\n<p>\u628a\u65f6\u95f4\u540c\u6b65\u5199\u5165\u786c\u4ef6\u4e2d<\/p>\n<p>hwclock <span class=\"token parameter variable\">-w<\/span><\/p>\n<p>\u6bcf\u53f0\u5ba2\u6237\u673a\u8bbe\u7f6e\u4e00\u4e2a\u5b9a\u65f6\u4efb\u52a1&#xff0c;\u6bcf\u5c0f\u65f6\u540c\u6b65\u4e00\u4e0b\u65f6\u95f4\u3002<\/p>\n<p><span class=\"token function\">crontab<\/span> <span class=\"token parameter variable\">-e<\/span><br \/>\n*\/60 * * * * \/usr\/sbin\/ntpdate <span class=\"token number\">172.0<\/span>.0.1 <span class=\"token operator\">&gt;&gt;<\/span>\/tmp\/ntp.log<\/p>\n<p>\u5927\u529f\u544a\u6210\u3002<\/p>\n<h2>\u53c2\u8003\u8d44\u6599<\/h2>\n<p>Linux\u7cfb\u7edf\u81ea\u52a8\u6821\u51c6\u65f6\u95f4 &gt; https:\/\/blog.csdn.net\/qq_45361058\/article\/details\/101153863 centos7\u8bbe\u7f6e\u65f6\u533a&#xff0c;\u65f6\u95f4&#043;\u65f6\u95f4\u540c\u6b65\u7684\u4e09\u79cd\u65b9\u5f0f &gt; https:\/\/blog.csdn.net\/Liu__sir__\/article\/details\/130635044 \u624b\u628a\u624b\u6559\u4f60\u5728centos 7.4\u4e0a\u642d\u5efaNTP\u670d\u52a1\u5668 &gt; https:\/\/developer.aliyun.com\/article\/946051<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb8.4k\u6b21\uff0c\u70b9\u8d5e24\u6b21\uff0c\u6536\u85cf41\u6b21\u3002\u5185\u7f51\u670d\u52a1\u5668\u65f6\u95f4\u6821\u51c6\u4e0e\u540c\u6b65_\u5185\u7f51\u670d\u52a1\u5668\u65f6\u95f4\u81ea\u52a8\u6821\u51c6<\/p>\n","protected":false},"author":2,"featured_media":8664,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[59,58,43],"topic":[],"class_list":["post-8665","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-centos","tag-linux","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>CentOS 7\u5185\u7f51\u670d\u52a1\u5668NTP\u65f6\u95f4\u6821\u51c6\u4e0e\u540c\u6b65 - \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\/8665.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"CentOS 7\u5185\u7f51\u670d\u52a1\u5668NTP\u65f6\u95f4\u6821\u51c6\u4e0e\u540c\u6b65 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb8.4k\u6b21\uff0c\u70b9\u8d5e24\u6b21\uff0c\u6536\u85cf41\u6b21\u3002\u5185\u7f51\u670d\u52a1\u5668\u65f6\u95f4\u6821\u51c6\u4e0e\u540c\u6b65_\u5185\u7f51\u670d\u52a1\u5668\u65f6\u95f4\u81ea\u52a8\u6821\u51c6\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/8665.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-18T08:52:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418085245-680212dd91db3.png\" \/>\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=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/8665.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/8665.html\",\"name\":\"CentOS 7\u5185\u7f51\u670d\u52a1\u5668NTP\u65f6\u95f4\u6821\u51c6\u4e0e\u540c\u6b65 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T08:52:46+00:00\",\"dateModified\":\"2025-04-18T08:52:46+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/8665.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/8665.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/8665.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CentOS 7\u5185\u7f51\u670d\u52a1\u5668NTP\u65f6\u95f4\u6821\u51c6\u4e0e\u540c\u6b65\"}]},{\"@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":"CentOS 7\u5185\u7f51\u670d\u52a1\u5668NTP\u65f6\u95f4\u6821\u51c6\u4e0e\u540c\u6b65 - \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\/8665.html","og_locale":"zh_CN","og_type":"article","og_title":"CentOS 7\u5185\u7f51\u670d\u52a1\u5668NTP\u65f6\u95f4\u6821\u51c6\u4e0e\u540c\u6b65 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb8.4k\u6b21\uff0c\u70b9\u8d5e24\u6b21\uff0c\u6536\u85cf41\u6b21\u3002\u5185\u7f51\u670d\u52a1\u5668\u65f6\u95f4\u6821\u51c6\u4e0e\u540c\u6b65_\u5185\u7f51\u670d\u52a1\u5668\u65f6\u95f4\u81ea\u52a8\u6821\u51c6","og_url":"https:\/\/www.wsisp.com\/helps\/8665.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T08:52:46+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418085245-680212dd91db3.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/8665.html","url":"https:\/\/www.wsisp.com\/helps\/8665.html","name":"CentOS 7\u5185\u7f51\u670d\u52a1\u5668NTP\u65f6\u95f4\u6821\u51c6\u4e0e\u540c\u6b65 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T08:52:46+00:00","dateModified":"2025-04-18T08:52:46+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/8665.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/8665.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/8665.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"CentOS 7\u5185\u7f51\u670d\u52a1\u5668NTP\u65f6\u95f4\u6821\u51c6\u4e0e\u540c\u6b65"}]},{"@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\/8665","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=8665"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/8665\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/8664"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=8665"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=8665"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=8665"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=8665"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}