トップ 差分 一覧 ソース 置換 検索 ヘルプ PDF RSS ログイン

linux で NTP の設定をする

http://www.ipa.go.jp/security/awareness/administrator/secure-web/chap4/4_ntpd.html

ntpd をインストールし、/etc/inet/ntp.conf で設定する。
このサービスで自分の時間を上位NTPサーバと同期しつつ、
自分をNTPサーバにする。

---ntp.confファイル---

#一方的に時刻を同期する上位NTPサーバーを指定する
server 210.xxx.xxx.x

#NTPデーモンが時刻の変動を記録するdriftfileを指定する
driftfile /etc/inet/ntp.drift

#デフォルトでは全てのホストとのNTP通信を許可しない
#対象NTPサーバーに「default」または「0.0.0.0」と指定すると
#デフォルトのルールを記述したことになる
#最後にマッチした行の制限がかかるので、最初にデフォルトを記述する必要がある
restrict default ignore

#localhostはアクセス制限なし
restrict 127.0.0.1

#組織内ネットワークからの時刻問い合わせにのみ応答する
restrict 192.168.0.0 mask 255.255.255.0 noquery nomodify nopeer notrust notrap

#一方的に時刻を参照する上位NTPサーバーからのNTP通信を限定する
restrict 210.xxx.xxx.x noquery nomodify

キーワード 解説
server 一方的に時刻を同期するNTPサーバーを指定
peer 相互に時刻を同期するNTPサーバーを指定
restrict 指定したNTPサーバーとのNTP通信を許可

キーワード「restrict」では、オプションを指定し、NTP通信の動作を設定することができる。

オプション 解説 構文
ignore すべてのNTPパケットを無視 restrict <対象NTPサーバー> ignore
nomodify 時刻問い合わせに応答するが、時刻の変更要求などは無視 restrict <対象NTPサーバー> nomodify
notrust 時刻問い合わせに応答するが、自身の時刻合わせには使用しない restrict <対象NTPサーバー> notrust
nopeer 指定ホストと相互に同期しない restrict <対象NTPサーバー> nopeer
noquery NTPの実装に依存する時刻問い合わせを無視 restrict <対象NTPサーバー> noquery
[カテゴリ: OS > Linux]

[通知用URL]



  • Hatenaブックマークに追加
  • livedoorクリップに追加
  • del.icio.usに追加
  • FC2ブックマークに追加

最終更新時間:2012年06月05日 21時54分09秒