lexus

CentOS 5设置NTP服务器 | 涂虫小记

CentOS 5设置NTP服务器

 

参考文献:Setup NTP Server

其实非常简单,因为在CentOS 5不再区分客户端和服务器,只要配置了NTP,它就会提供NTP服务。这一点与Solaris不同,其中提供了ntp.client和ntp.server可供选择,想使用哪个直接用相应文件覆盖/etc/ntp.conf即可。

1)确认已经ntp程序包:

# yum install ntp

2)配置时间源

# vi /etc/ntp.conf

server time.lib.tsinghua.edu.cn

server 0.pool.ntp.org

server 1.pool.ntp.org

server 2.pool.ntp.org

3)配置是否为其他PC提供时间服务

# vi /etc/ntp.conf

restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

4)配置开机时自动运行时间服务

# chkconfig ntpd on

5)启动或停止时间服务

# service ntpd start

# service ntpd stop

# service ntpd restart

6)验证ntp服务已经运行

# pgrep ntpd

7)初始同步

# ntpdate -u time.lib.tsinghua.edu.cn

8)确认同步成功

# ntpq -p

当然,如果要提供时间服务,还必须相应的设置iptable防火墙的配置。CentOS的时间服务使用udp 123端口。

分类:

技术点:

相关文章:

  • 2021-10-01
  • 2021-11-18
  • 2022-12-23
  • 2021-11-23
  • 2021-07-08
  • 2021-05-30
  • 2022-12-23
猜你喜欢
  • 2021-12-09
  • 2019-12-06
  • 2021-06-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案