Ubuntuで時刻を合わせる
GNU Mailmanを入れようと思ってインストールマニュアルを読んでいたら「マシンの同期はとれているかな?」という記述があったので、いまさらながら NTPで時刻を合わせておくことにしました。
やり方
1>$ s ntpdate -b ntp.nict.jp 2>$ s apt-get install ntp 3>$ e /etc/ntp.conf 4>$ s /etc/init.d/ntp restart 5>$ s ntpq -p
- とりあえず今の時間を合わせておきます。
- ntpをインストールします。
- 設定ファイル(/etc/ntp.conf)の『server ntp.ubuntu.com』をコメントにして『server ntp.nict.jp』を3つ書きます。こんな(↓)感じです。
# server ntp.ubuntu.com
server ntp.nict.jp
server ntp.nict.jp
server ntp.nict.jp - ntpを再起動します。
- ntpの設定を確認します。
こんな風(↓)に出てればいいんじゃないでしょうか?
remote refid st t when poll reach delay ============================================================= ntp-a3.nict.go. .RMOT. 16 u - 64 0 0.000 ntp-a2.nict.go. .INIT. 16 u - 64 0 0.000
もう1台の方
同じやり方で設定ファイル(/etc/ntp.conf)の部分だけ、先ほど設定したマシンのIP『server 192.168.1.250』にしておきます。
5>$ s ntpq -p
remote refid st t when poll reach delay ============================================================= 192.168.1.250 .INIT. 16 u 12 64 0 0.000
参考
- http://www.kotodama.jp/blog/index.php/2008/03/18/ubuntu-ntp
まんまこのままやらせていただきました。ありがとうございます。