However, the more convenient way is to set the ntpd daemon to synchronize the time at boot time automatically:
- Open the NTP configuration file
/etc/ntp.conf
in a text editor such as vi or nano, or create a new one if it does not already exist:~]#
nano /etc/ntp.conf
- Now add or edit the list of public NTP servers. If you are using Red Hat Enterprise Linux 6, the file should already contain the following lines, but feel free to change or expand these according to your needs:
server 0.rhel.pool.ntp.org iburst server 1.rhel.pool.ntp.org iburst server 2.rhel.pool.ntp.org iburst server 3.rhel.pool.ntp.org iburst
Theiburst
directive at the end of each line is to speed up the initial synchronization. As of Red Hat Enterprise Linux 6.5 it is added by default. If upgrading from a previous minor release, and your/etc/ntp.conf
file has been modified, then the upgrade to Red Hat Enterprise Linux 6.5 will create a new file/etc/ntp.conf.rpmnew
and will not alter the existing/etc/ntp.conf
file. - Once you have the list of servers complete, in the same file, 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 ::1
- Save all changes, exit the editor, and restart the NTP daemon:
~]#
service ntpd restart
- Make sure that
ntpd
is started at boot time:~]#
chkconfig ntpd on
Tidak ada komentar:
Posting Komentar