Elvis Woo

这是一个快被主人遗忘的角落

Skip to: Content | Sidebar | Footer



NTP (Network Time Protocol) Server on CentOS 5

29 December, 2007 (15:28) | Linux

step 1
#yum install ntp
or download ntp rpmpkg

step 2
# crontab -e
*/15 * * * * ntpdate 210.72.145.44

step 3
# vi /etc/ntp.conf
(add or replace the text as follows)
server 210.72.145.44 prefer
(set the default source is from "TIME OF THE NET SERVER IN CHINA")
server 218.21.130.42
(an other source server)
restrict 0.0.0.0 mask 0.0.0.0 nomodify
(allow all client)

step 4
# chkconfig ntpd on
# vi /etc/sysconfig/ntpd
 SYNC_HWCLOCK=yes
(write the sync time to CMOS)

Final
# pgrep ntpd
(checking the ntpd process ID)
# netstat -ntlup
(checking the sync status)
# ntpq -p
(checking the port’s status)
configure the firewall rule, make sure the UDP:123 is accept.
#service ntpd start
 (start the ntp server)
Client may get the ntpserver time after 5~10 min.

**************************************************

Write a comment

You need to login to post comments!