I’m using Oracle Linux 6.5.
For synchronize your machine with the known NTP/Time server you can change the config in /etc/ntp.conf
look at the file, and you can see in the bottom the NTP server destination :
fudge 127.127.1.0 stratum 10
restrict 0.id.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery
The first two lines point to local time, and the next two lines are the Indonesia NTP domain. You can more NTP Server if you want.
Then you need to stop it first.
After you stop the ntpd service, you need to sync the NTP with NTP server with this command
ntpdate -s <NTP_SERVER>
ntpdate -s 0.id.pool.ntp.org
Then you start the ntpd service again
If you check from NTPSTAT you’ll see that your machine will undergo the synchonization, so it’s normal if it’s unsynchonize after the restart. After a while (maybe 10-15 minutes, or more), your machine will be synchronize with the new NTP Server.
I found that my timezone is messed up before (registered as EDT/Eastern Daylight Time), check it using date.. so below are the reposted way how to change the timezone.
repost from here.
There are several different ways to manage time in Linux. This quick tip will show you how to quickly change the local time to the correct time zone for the server. In this Linux tip I’ll show you how to change the localtime to your (or a) current time zone.
Location of the local time file
Linux looks at /etc/localtime to determine the current time of your machine. This can either be a symbolic link to the correct time zone or a direct copy of the time zone file.
Timezone files are located in /usr/share/zoninfo/
For this tip we will assume your server is located in America and will be under the Chicago CST zone.
I change the Linux time zone by copying or making a symbolic link to from /usr/share/zoneinfo/America/Chicago to /etc/localtime
Two methods to do this
1) cp /usr/share/zoneinfo/America/Chicago /etc/localtime
2) ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime
To test it, you can do :