要在CentOS中使用NTP服务同步时间,可以按照以下步骤操作:
sudo yum install ntp
sudo systemctl start ntpd
sudo systemctl enable ntpd
编辑NTP配置文件/etc/ntp.conf
,可以根据自己所在地区选择合适的NTP服务器,添加如下内容:
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst
sudo systemctl restart ntpd
sudo systemctl status ntpd
通过以上步骤,您的CentOS系统应该已经成功配置NTP服务并同步了时间。
辰迅云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读: 如何在CentOS中安装和配置Apache服务器