分类: LINUX
2009-10-31 13:12:37
$sudo apt-get install ntp
$sudo echo server 0.pool.ntp.org >> /etc/ntp.conf
$sudo echo server 1.pool.ntp.org >> /etc/ntp.conf
$sudo echo server 2.pool.ntp.org >> /etc/ntp.conf
$sudo /etc/init.d/ntp restart
也可以打开它自己编辑,内容如下:
# You do need to talk to an NTP server or two (or three).
server ntp.ubuntu.com
server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org
server 3.pool.ntp.org
运行效果如下:
duxingxia@ubuntu:/etc$ ntpq -pn
remote refid st t when poll reach delay offset jitter
==============================================================================
91.189.94.4 .INIT. 16 u - 64 0 0.000 0.000 0.002
211.160.78.27 .INIT. 16 u - 64 0 0.000 0.000 0.002
114.80.81.69 .INIT. 16 u - 64 0 0.000 0.000 0.002
114.80.81.72 .INIT. 16 u - 64 0 0.000 0.000 0.002
61.129.66.79 .INIT. 16 u - 64 0 0.000 0.000 0.002
duxingxia@ubuntu:/etc$
ok