ユーザ用ツール

サイト用ツール


ntpサーバ

ntpサーバのインストール

$ sudo apt-get update
$ sudo apt-get install ntp ntp-doc ntpdate

$ sudo vi /etc/ntp.conf
 で、
server ntp.xxx.or.jp  <== プロバイダのNTPサーバを指定

ntpサーバの起動

$ sudo /etc/init.d/ntp start

動作確認

$ ntpq -pn
で、
      remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*aaa.bbb.cc.d    eee.fff.gg.hh    2 u   61   64   77   31.218   38.906  24.929
 127.127.1.0     LOCAL(0)        13 l   61   64   77    0.000    0.000   0.001

上のように、サーバのアドレスの前に * がついていれば、
そのサーバと同期がとれていることをあらわす

dateによる時刻表示が9時間ずれる場合(UTC表示)は

$ date
2007年  1月 28日 日曜日 11:12:40 UTC

$ sudo /usr/sbin/tzconfig
Your current time zone is set to UTC
Do you want to change that? [n]: JST   <== JST をタイプ

Please enter the number of the geographic area in which you live: 


        1) Africa                       7) Australia

        2) America                      8) Europe 

        3) US time zones                9) Indian Ocean

        4) Canada time zones            10) Pacific Ocean

        5) Asia                         11) Use System V style  time zones

        6) Atlantic Ocean               12) None of the above


Then you will be shown a list of cities which represent the time zone
in which they are located. You should choose a city in your time zone.

Number: 5  <== 5 をタイプ

Aden Almaty Amman Anadyr Aqtau Aqtobe Ashgabat Ashkhabad Baghdad Bahrain
Baku Bangkok Beirut Bishkek Brunei Calcutta Choibalsan Chongqing Chungking
Colombo Dacca Damascus Dhaka Dili Dubai Dushanbe Gaza Harbin Hong_Kong
Hovd Irkutsk Istanbul Jakarta Jayapura Jerusalem Kabul Kamchatka Karachi
Kashgar Katmandu Krasnoyarsk Kuala_Lumpur Kuching Kuwait Macao Macau
Magadan Makassar Manila Muscat Nicosia Novosibirsk Omsk Oral Phnom_Penh
Pontianak Pyongyang Qatar Qyzylorda Rangoon Riyadh Riyadh87 Riyadh88
Riyadh89 Saigon Sakhalin Samarkand Seoul Shanghai Singapore Taipei
Tashkent Tbilisi Tehran Tel_Aviv Thimbu Thimphu Tokyo Ujung_Pandang
Ulaanbaatar Ulan_Bator Urumqi Vientiane Vladivostok Yakutsk Yekaterinburg
Yerevan

Please enter the name of one of these cities or zones
You just need to type enough letters to resolve ambiguities
Press Enter to view all of them again
Name: [] tokyo  <== tokyo をタイプ
Your default time zone is set to 'Asia/Tokyo'.
Local time is now:      2007年  1月 28日 日曜日 20:15:40 JST.
Universal Time is now:  2007年  1月 28日 日曜日 11:15:40 UTC.

$ date
2007年  1月 28日 日曜日 20:15:47 JST

時刻情報取得状況

ntpサーバ.txt · 最終更新: 2020/09/12 05:49 by admin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki