Linux server time synchronization in LAN

Source: Internet
Author: User


Linux server time synchronization in LAN 1. use an Internet-accessible server as a time server: #/usr/bin/rdate-s time-b.timefreq.bldrdoc.gov // synchronize the time server with the Internet time server #/etc/init. d/ntpd start // start time server # vi/etc/cron. weekly/rdateweekly. sh // set the scheduled task to be synchronized once a week ----------------------------------------#! /Bin/sh www.2cto.com/usr/bin/rdate-s time-b.timefreq.bldrdoc.gov ---------------------------------------- # chmod a + x/etc/cron. weekly/rdateweekly. sh # setup // set ntpd to auto start # vi/etc/sysconfig/iptables // modify firewall to allow time server communication ---------------------------------------------A RH-Firewall-1-INPUT-m state -- state NEW-m udp-p udp -- dport 123-j ACCEPT-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tc P -- dport 123-j ACCEPT -------------------------------------------- www.2cto.com 2. set other servers in the LAN to synchronize with the time server # ntpdate 192.168.1.1 // the IP address is the IP address of the above time server # vi/etc/cron. weekly/ntpdateweekly. sh // set the scheduled task to be synchronized once a week ----------------------------------------#! /Bin/sh/usr/sbin/ntpdate 192.168.1.1 ---------------------------------------- # chmod a + x/etc/cron. weekly/ntpdateweekly. sh 3. Get it done! Iloveyin

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.