Time synchronization command:
ntpdata time.windows.com
Automatic time synchronization:
You need to configure the /etc/crontab file to automatically execute the task and let linux automatically synchronize the time from time.windows.com.
vi /etc/crontab
Add a sentence:
00 0 1 * * root ntpdate -s time.windows.com
Time.nist.gov is a time server.
Linux Time Server Configuration (192.168.10.1)
# rpm -ivh ntp-4.1.2-4.EL3.1.i386.rpm# vi /etc/ntp.conf
Comment on a line
restrict default ignore
Add a line
restrict 192.168.10.0 mask 255.255.255.0 notrust nomodify notrap# vi /etc/ntp/step-tickers
Add a line
pool.ntp.org
So that every time ntpd is started, it will automatically connect to the international standard time server.
# service ntpd start # netstat -an |grep 123
Make sure that the port is open in udp.
Time Client Configuration (192.168.10.2)
# ntpdate 192.168.10.2
Synchronization should be displayed successfully.
# crond -e
join
0-59/10 * * * * /usr/sbin/ntpdate 192.168.10.1
Indicates that the time is synchronized every 10 minutes.
Copyright Description:No reproduction without permission。
Knowledge sharing community for developers。
Let more developers benefit from it。
Help developers share knowledge through the Internet。
Follow us