how to sync time between two linux servers

  1. Option 1
  2. Found a way to synchronize date and time with a server over ssh which can quickly solve the problem:

    # date --set="$(ssh user@server date)"

    Or you can do it the other way around:

    # ssh user@host "date --set \"$(date)\""

  3. Option 2

  4. ‘ntpdate 10.200.117.37’
    or
    ‘/usr/sbin/sntp -P no -r 10.200.117.37’
    Of course you need to set up a ntp or sntp server first.

Leave a comment

About Michael Li

user-pic I blog issues resolved at work