時刻の同期
はじめに
Active Directory(AD)では、正確な時刻同期が必要です。 たとえば、Kerberosではリプレイアタックを防ぐために正しいタイムスタンプが必 要で、ADではレプリケーションの競合を解決するためにこの時間を使用します。 ADのデフォルトの最大許容時間偏差は5分です。 ドメインメン バまたはドメインコントローラ(DC)の時間差がより大きいまたはより短い場合、アクセスは拒否されます。 その結果、ユーザーは共有にアク セスしたり、ディレクトリに問い合わせたりすることができません。
Sambaはhttp://ntp.orgからntpd
をサポートしています。 デーモンは外部ソースと時刻を同期させ、クライアントがデーモンを実
行しているサーバーから時刻を取得できるようにします。
ntpd
は、Windows 2000クライアントとの認証された時刻同期をサポートしていないことに注意してください。
DCにおいて時刻同期を設定する
要件
- ntpd> = 4.2.6(http://www.ntp.org)、signed ntp サポートを有効にしてコンパイル済み(
--enable-ntp-signd
) - ドメインコントローラ(DC)のソケットのアクセス許可を確認します。
ntpd
デーモンは、ntp_signed
ディレクトリで読み取り権限を持っている必要があります。 権限を表示するには、次のように入力します。
# ls -ld /usr/local/samba/var/lib/ntp_signd/ drwxr-x--- 2 root ntp 4096 1. May 09:30 /usr/local/samba/var/lib/ntp_signd/
権限を設定するには、次のコマンドを実行します。
# ls -ld /usr/local/samba/var/lib/ntp_signd/ drwxr-x--- 2 root ntp 4096 1. May 09:30 /usr/local/samba/var/lib/ntp_signd/
DC上にntpd.confファイルを設定する
通常、ntpd
デーモンは/etc/ntpd.conf
ファイルから設定を読み取ります。
以下は、3つの外部NTPサーバーと時刻を同期させ、クライアントが署名付きNTP要求を使用して時刻を照会できる最小のntpd.conf
ファイルです。
# Local clock. Note that is not the "localhost" address! server 127.127.1.0 fudge 127.127.1.0 stratum 10 # Where to retrieve the time from server 0.pool.ntp.org iburst prefer server 1.pool.ntp.org iburst prefer server 2.pool.ntp.org iburst prefer driftfile /var/lib/ntp/ntp.drift logfile /var/log/ntp ntpsigndsocket /usr/local/samba/var/lib/ntp_signd/ # Access control # Default restriction: Allow clients only to query the time restrict default kod nomodify notrap nopeer mssntp # No restrictions for "localhost" restrict 127.0.0.1 # Enable the time sources to only provide time to this host restrict 0.pool.ntp.org mask 255.255.255.255 nomodify notrap nopeer noquery restrict 1.pool.ntp.org mask 255.255.255.255 nomodify notrap nopeer noquery restrict 2.pool.ntp.org mask 255.255.255.255 nomodify notrap nopeer noquery
ntpd
のアクセス制御の詳細については、http://support.ntp.org/bin/view/Support/AccessRestrictionsを参照してください。
サーバでSELinuxを有効にしている場合は、「svradmin/samba4/transdoc/time_synchronisation_-_selinux_labeling_and_policy」を参照 してください。
Unixドメインメンバでの時刻同期の設定
要件
ntpd
http://www.ntp.org/
Unix ドメインメンバでntpd.confファイルを構成する
通常、ntpd
デーモンは、オペレーティングシステムに応じて、/etc/ntpd.conf
または/etc/ntp.conf
ファイルから構成を読み取ります。
次は、Samba Active Directory(AD)ドメインコントローラ(DC)DC1
およびDC2
と時間を同期させ、他のホストに時間サービスを提供しない最小限のconfファイルです。
# Local clock. Note that is not the "localhost" address! server 127.127.1.0 fudge 127.127.1.0 stratum 10 # Where to retrieve the time from server DC1.samdom.example.com iburst prefer server DC2.samdom.example.com iburst driftfile /var/lib/ntp/ntp.drift logfile /var/log/ntp # Access control # Default restriction: Disallow everything restrict default ignore # No restrictions for "localhost" restrict 127.0.0.1 # Enable the time sources only to only provide time to this host restrict DC1.samdom.example.com mask 255.255.255.255 nomodify notrap nopeer noquery restrict DC2.samdom.example.com mask 255.255.255.255 nomodify notrap nopeer noquery
ntpd
のアクセス制御の詳細については、http://support.ntp.org/bin/view/Support/AccessRestrictionsを参照してください。