ITG Unix Support
>    
     |  List directory  |  History  |  Similar  |  Print version  

General UNIX > Tips > Configuring Time Synchronization in UNIX

Configuring Time Synchronization in UNIX

It is important that all hosts have their time in sync. This not only makes it much easier to correlate logs between hosts during a break-in attempt, but it makes it so that time-based authentication such as Kerberos works properly. We recommend that every UNIX host have the NTP service running.

Initial time synchronization

The first time that you configure the time server, we recommend forcing a synchronization just to ensure that everything is working as expected. It will look up the current time, set it, and then exit. To run ntpdate, type:

ntpdate ntp.indiana.edu
  • If ntpdate is not found, try /usr/sbin/ntpdate.
  • If it still does not work, you may not have ntp (sometimes called xntpd) installed.
  • If you get the message the NTP socket is in use, exiting, it means that the ntp service is already running, and that you should go ahead and kill it (try "killall ntpd") before trying again.

Verifying your time

At a command prompt, run the date command. It should look like:

% date
Mon Nov 15 10:25:07 EST 2004

If the time is really wrong after running ntpdate, you probably have the wrong timezone configured.

Configuring the NTP service

If you are running SUSE Linux, I recommend using YaST for this step. You will find the preferences within Network Services -> NTP Client.

The configuration file for the NTP service is normally /etc/ntp.conf. Somewhere in that file, you will want to add the following line to have it synchronize with the university time system:

server ntp.indiana.edu

You may now start the NTP service in SUSE Linux by running /etc/init.d/xntpd start

In Red Hat, use /etc/init.d/ntpd start

Enabling the NTP service at startup

In SUSE, type chkconfig ntpd on

In Red Hat, do something else.

To manually start the ntp service, r

 

Reference http://wiki.chem.indiana.edu/GeneralUNIX/ConfiguringTimeSynchronizationInUNIX
Rights rw-rw-r--   tstrombe   ITG

Prev. Setting up real-time system log forwarding under UNIX