Set up Linux (Ubuntu) server to synchronise clock with NTP time server
ntupdate comes built in into Ubintu server. To manually adjust server time run:
sudo ntpdate ntp.ubuntu.com
You can choose another ntp server instead of ntp.ubuntu.com
To automatically keep server time up to date use ntp.
sudo apt-get install ntp
ntpd should start working immediately without any additional configuration. However you obviously can adjust settings if you wish.
ntpd configuration file is located in /etc/ntp.conf
Default server is server ntp.ubuntu.com
To use additional servers just add them bellow server ntp.ubuntu.com. e.g.
# You do need to talk to an NTP server or two (or three).
To enable logging uncomment:
logs will be placed in /var/log/ntpstats/
sudo /etc/init.d/ntp restart
sudo /etc/init.d/ntp stop
sudo /etc/init.d/ntp start
List peers and status
Check in ntpd process is running
ps ax | grep ntp
Ubuntu Server 10.10