1. To synchronization immediately or for the one-time synchronization only, use the ntpdate command as below :
[root@centos63 ~]# ntpdate -q time.internet.com2. Enable running the ntpdate at boot time:
[root@centos63 ~]# chkconfig ntpdate onSteps B
However, there are alternative way to set the ntpd daemon to synchronize the time at boot time automatically :
1. Install ntpd service daemon :
[root@centos63 ~]# yum install ntp -y2. Open the NTP configuration file /etc/ntp.conf :
[root@centos63 ~]# vi /etc/ntp.conf3. Now add or edit the list of public NTP servers.
server 0.asia.pool.ntp.org server 1.asia.pool.ntp.org server 2.asia.pool.ntp.org server 3.asia.pool.ntp.org4. Set the proper permissions, giving the unrestricted access to localhost only:
restrict default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery restrict 127.0.0.1 restrict -6 ::15. Restart the NTP daemon:
[root@centos63 ~]# service ntpd restart Shutting down ntpd: [ OK ] Starting ntpd: [ OK ]6.Set ntpd daemon is started at boot time :
[root@centos63 ~]# chkconfig ntpd on
0 comments:
Post a Comment