ntpdate를 사용한 설정
유닉스, 리눅스에서는 ntpdate라는 명령으로 시간을 특정서버(Time Server)의 시간과 동기화 할 수 있습니다.
문법은 아래와 같이 간단합니다.
# ntpdate time.bora.net
단, ntpd 혹은 xntpd와 같은 데몬이 구동되어 있을 경우는 명령이 제대로 동작하지 않으며 데몬을 죽이고 명령을 내리면 됩니다.
Redhat 계열에서는 아래 명령으로 내릴 수 있으며, 일반적으로 /etc/init.d 디렉토리에 서비스 구동 명령이 포함되어 있습니다. 단, 아래 명령으로 내릴 경우, 시스템 재부팅시 서비스가 다시 구동되며, 문서를 참고하여 서비스를 영구 종료할 수 있습니다.
# service ntpd stop
서버 주소 목록
서버 주소 | 서버 IP |
---|---|
time.bora.net(20090914현재. 사용 불가) |
203.248.240.103 |
ntp.ewha.net (20090914현재. 다른 주소를 가리키고 있음.) |
211.189.50.33 |
kr.pool.ntp.org | 211.51.221.196 |
222.239.76.226 | |
58.73.137.250 | |
211.51.221.130 | |
asia.pool.ntp.org | 58.73.137.250 |
60.56.119.79 | |
61.70.206.117 | |
140.112.132.106 | |
192.115.25.179 | |
211.51.221.196 | |
219.87.217.84 |
ntp 데몬을 사용하는 설정
아래는 Unbuntu에서 사용중인 설정 내용입니다.
# /etc/ntp.conf, configuration for ntpd driftfile /var/lib/ntp/ntp.drift statsdir /var/log/ntpstats/ statistics loopstats peerstats clockstats filegen loopstats file loopstats type day enable filegen peerstats file peerstats type day enable filegen clockstats file clockstats type day enable # You do need to talk to an NTP server or two (or three). server ntp.ubuntu.com server kr.pool.ntp.org server 127.127.1.0 fudge 127.127.1.0 stratum 5 # By default, exchange time with everybody, but don't allow configuration. # See /usr/share/doc/ntp-doc/html/accopt.html for details. restrict default kod notrap nomodify nopeer noquery # Local users may interrogate the ntp server more closely. restrict 127.0.0.1 nomodify # Clients from this (example!) subnet have unlimited access, # but only if cryptographically authenticated #restrict 192.168.123.0 mask 255.255.255.0 notrust # If you want to provide time to your local subnet, change the next line. # (Again, the address is an example only.) #broadcast 192.168.123.255 # If you want to listen to time broadcasts on your local subnet, # de-comment the next lines. Please do this only if you trust everybody # on the network! #disable auth #broadcastclient