Configure the NTP Time Server Client in Linux

Source: Internet
Author: User
Configuring NTP to set up the local time server NTP is a protocol used to keep the system and a precise time source at time. in Linux, we can use the Network Time Protocol to keep our system accurate. install: # Yum install NTP or find the ntp rpm package from the installation disk. when you only have one server that can be connected to the Internet, add # crontab-e to a line: */15 * ntpdate 210.72.145.44 210.72.145.44 is the address of the China National Time Service Center server, so that the server can be synchronized with the National Time Service Center. To set up a local time server, you only need to modify/etc/NTP. several simple configurations in the conf file are available. The configuration I added is as follows: # Add By fengshihua server 210.72.145.44 prefer (China National Time Service Center server address prefer indicates priority to change the default server to this address) server 218.21.130.42 (cn.pool.ntp.org IP address) restrict 192.168.100.0 mask 255.255.255.0 nomodify (Intranet Communication allowed) restrict 0.0.0.0 mask 0.0.0.0 nomodify notrap noquery notrust. To enable the NTP service to be automatically started during system boot, run the following command: # chkconfig ntpd on start/stop/restart NTP: #/etc/init. d/ntpd start #/etc/init. d/ntpd stop #/etc/init. d/ntpd restart: Write the synchronization time to the cmos vi/etc/sysconfig/ntpd sync_hwclock = yes. Remember to restart the service every time you modify the configuration file to make the configuration take effect. You can use the following command to check whether the NTP service is started. You should get a process ID: # pgrep ntpd use the following command to check the synchronization status of the Time Server: # ntpq-P you can use ntpstat to view some synchronization statuses, and use netstat-ntlup to view port usage! It takes 5 to 10 minutes to update the client from the server after the client is installed! Client settings: # crontab-e add a line: */15 ***** ntpdate Server IP address.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.