2023年6月30日发(作者:)
linux下ntp命令详解,Linux系统中NTP(NetworkTimeProtocol。。。NTP(⽹络时间协议)是⼀种通过因特⽹服务于计算机时钟的时间同步协议。它提供了⼀种同步时间机制,能在庞⼤⽽复杂多样的因特⽹中⽤光速调整时间分配。⼀、安装NTPcentos系统# yum install ntpubuntu系统# apt install ntp⼆、配置NTP安装ntp后,到NTP官⽹,选择⾃⼰所在的⼤洲,找到所在的国家,会列出⼏个NTP服务的地址。编辑ntp的配置⽂件,将默认的服务地址更改为所在国家的即可。# vim /etc/例如centos中默认的⼏个为server iburstserver iburstserver iburstserver iburst将这⼏⾏替换为以下内容server iburstserver iburstserver iburstserver iburst三、添加防⽕墙规则并且启动NTP打开防⽕墙端⼝# firewall-cmd --add-service=ntp --permanent# firewall-cmd --reload启动ntp并把ntp设置为开机⾃启# systemctl start ntpd# systemctl enable ntpd四、确认时间同步NTP启动后就会将本机时间同步为服务器时间,使⽤如下命令来确认时间同步情况# ntpq -p# date -R也可以⼿动和指定的服务器时间同步,如下# ntpdate -q
发布者:admin,转转请注明出处:http://www.yc00.com/web/1688118593a84701.html
评论列表(0条)