Ubuntu _ set the time zone and NTP automatic update time

Source: Internet
Author: User
In Linux, the UTC format is used as the standard time format by default. Program And specifying a time zone different from the system in the process sequence may cause a time error. For Ubuntu Desktop, you can directly modify the time zone information in graphic mode. But for server, you need to modify the time zone information through tzconfig. Usage (such as setting the time zone to Asia/Chongqing): 1. Select the time zone sudo tzconfig. If the command does not exist, use dpkg-reconfigure tzdata and select the Asia sequence number as prompted, after the selection, a bunch of new prompts will be displayed-enter the city name, such as Shanghai or Chongqing, and then use sudo date-s "to modify the local time. Select the time zone as prompted. 2. To prevent time zone changes after system restart, run the following command: sudo CP/usr/share/zoneinfo/Asia/Shanghai/etc/localtime. 3. Manual Online synchronization time: 1. install ntpdate tool # sudo apt-Get install ntpdate 2. set system time and Network Time Synchronization # ntpdate cn.pool.ntp.org 3. write System Time to hardware time # hwclock -systohccn.pool.ntp.org is a public NTP server located in China to synchronize your time (If your time is different from the server's time cut, you may not be able to synchronize time or even execute commands such as sudo reboot ). 4. Set automatic online synchronization time

1. install the NTP tool # sudo apt-Get install NTP 2. set the network time synchronization server # Vim/etc/NTP. conf server ntp.ubuntu.com 3. start the service #/etc/init. d/NTP startntp service is a special thing. If it is enabled, other servers can also get time from this server, but it must get time from the upper-level server, A bit like DNS

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.