ubuntu ntp服务(时间同步服务)

apt install ntp

开启ntp服务器步骤
编辑配置文件
sudo vim /etc/ntp.conf
增加内容

restrict 0.0.0.0 mask 255.255.255.255 nomodify notrap
作用:允许外网所有client(0.0.0.0代表任意IP,如果限制局域网那么更改对应网段)连接到这台服务器同步时间,但是拒绝他们修改服务器时间
systemctl status ntp

systemctl restart ntp

systemctl enable ntp

posted @ 2023-06-30 11:28  谁主沉浮1226  阅读(277)  评论(0)    收藏  举报