升级ssh时连带升级OpenSSL 后ntp无法启动,yum升级ntp无果,决定重新编译个.
#ntpd –version
ntpd – NTP daemon program – Ver. 4.2.4p8
#tail /var/log/messages
ntpd: OpenSSL version mismatch. Built against 10000003, you have 1000103f
删除原ntp
yum remove ntp
编译ntp
wget http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-4.2.6p5.tar.gz
tar zxvf ntp-4.2.6p5.tar.gz
cd ntp-4.2.6p5
./configure –prefix=/usr/local/ntp-4.2.6p5 –enable-all-clocks –enable-parse-clocks
make && make install
创建软链接
ln -s /usr/local/ntp-4.2.6p5 /usr/local/ntp
编辑配置文件
vi /etc/ntp.conf
driftfile /var/lib/ntp/drift
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict -6 ::1
server 0.centos.pool.ntp.org
server 1.centos.pool.ntp.org
server 2.centos.pool.ntp.org
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
运行ntp
/usr/local/ntp/bin/ntpd -c /etc/ntp.conf
检查同步情况
watch /usr/local/bin/ntpq -p
开机运行
echo ‘/usr/local/ntp/bin/ntpd -c /etc/ntp.conf’ >> /etc/rc.local
参考:
http://vbird.dic.ksu.edu.tw/linux_server/0440ntp/0440ntp-centos4.php
可以装轻量级的openntpd嘛