利用 chrony 配置 Linux-1 为其他 Linux 主机提供时间同步服务。
时间: 2024-02-12 17:38:52 浏览: 115
好的,针对您的问题,我可以给出以下步骤:
1. 在Linux-1上安装 chrony:
```
sudo apt-get update
sudo apt-get install chrony
```
2. 编辑 chrony 的配置文件 /etc/chrony/chrony.conf,将如下内容添加到文件末尾:
```
# Allow other computers to synchronize with this computer
allow 192.168.0.0/16
```
这里192.168.0.0/16是示例用的IP地址段,根据实际情况修改。
3. 启动chrony并设置为开机自启:
```
sudo systemctl start chrony
sudo systemctl enable chrony
```
4. 验证时间同步服务是否正常工作:
```
chronyc tracking
```
执行命令后,如果输出类似以下内容,则表示同步成功:
```
Reference ID : 192.168.0.1 (主机IP地址)
Stratum : 2
Ref time (UTC) : Tue Mar 30 16:36:54 2021
System time : 0.000105968 seconds fast of NTP time
Last offset : -0.000000696 seconds
RMS offset : 0.000001124 seconds
Frequency : 24.424 ppm fast
Residual freq : +0.000 ppm
Skew : 0.005 ppm
Root delay : 0.000342 seconds
Root dispersion : 0.002405
阅读全文
相关推荐
















