查看是否安装软件包,一般系统中已安装。编辑主配置文件。ntp服务的端口号为udp的123.
[root@localhost ~]# vim /etc/ntp.conf restrict 172.16.10.0 mask255.255.255.0 nomodify notrap nopeer kod restrict 权限控制 kod 开启阻止Kiss of Death包*** nomodify 客户端不能更改ntp服务器的时间参数,但是可以校对时间 notrap 不提供trap远程事件登陆 nopeer 不予其他同一层的NTP服务器同步时间 noquery 不提供ntp服务 server 设定上层NTP服务器
重启服务
[root@localhost ~]# service ntpd restart
设为开机自启动
[root@localhost ~]# chkconfig ntpd on
客户端从服务器校对时间
[root@localhost ~]# ntpdate 172.16.10.1
添加循环计划任务
[root@localhost ~]# crontab -e
*/10 * * * * /sbin/ntpdate 172.16.10.1
ntp服务的图形管理
[root@localhost ~]# system-config-date
本文详细介绍了如何配置NTP服务,包括检查软件包安装状态、编辑配置文件、设置权限控制及服务重启等内容,并提供了客户端时间同步及定时任务设置的方法。
625

被折叠的 条评论
为什么被折叠?



