Linux-ntp-server+client

Source: Internet
Author: User
Tags greenwich time zone

GMT/UTC/CST;
/etc/localtime,/usr/share/zoneinfo/* time zone file,/etc/profile plus TZ variable;
Hardware time RTC, system time; date,hwclock,tzselect;
/usr/share/zoneinfo/asia

Zdump Sichuan View the current time for each zone
# Hwclock--set--date= "Mm/dd/yy hh:mm:ss" Set hardware time we can set it up in the BIOS when booting. You can also use the Hwclock command
# date-s "Dd/mm/yyyy hh:mm:ss" It's easiest to modify the system time with the date command.

1. Set the time zone
GMT: Greenwich Time Zone
UTC: World coordinated Time zone
CST: China Standard Time zone
Cp/usr/share/zoneinfo/asia/shanghai/etc/localtime
Ln-sf/usr/share/zoneinfo/asia/shanghai/etc/localtime
If the time zone is not correct, delete,/etc/localtime, and then configure
Tzselect (5) asia--9) china--1) Beijing time

2.Command
# Hwclock--set--date= "Mm/dd/yy hh:mm:ss"
# date-s "Dd/mm/yyyy hh:mm:ss"
# Hwclock--SYSTOHC
# Hwclock--hctosys

3.NTP SERVER
Rpm-qa | grep NTP
Yum-y ntpd Install
http://www.pool.ntp.org
SERVER = cn.pool.ntp.org
Ntpdate cn.pool.ntp.org

/etc/ntp.conf

#server cn.pool.ntp.org
#fudge 127.127.1.0 stratum stratum
#driftfile/var/lib/ntp/ntp.drift
#restrict default Kod nomodify notrap nopeer noquery defaults to all operations denied by the client
#restrict 127.0.0.1 allow native address everything
#restrict 192.168.1.0 Mask 255.255.255.0 nomodify allows all clients in the LAN to connect to this server for synchronization time.

#/ETC/INIT.D/NTPD Start
# chkconfig--level ntpd on

# VI/ETC/SYSCONFIG/NTPD
Sync_hwclock=yes
Watch Ntpq-p

4.NTP Client Settings
/etc/ntp.conf
Server 192.168.1.105
Linux clients use
Ntpdate 92.168.1.105
# Hwclock--SYSTOHC

If the synchronization does not check successfully: Iptables need Disable or TCP 123

Linux-ntp-server+client

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.