1. 程式人生 > 其它 >ntp 漏洞修復| ntp編譯升級

ntp 漏洞修復| ntp編譯升級

wget https://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-4.2.8p15.tar.gz

mkdir /tmp/ntp

service ntp stop #關閉ntp服務,如果沒有開啟可以跳過

mv /usr/sbin/ntp* /tmp/ntp

tar xvf ntp4/ntp-4.2/ntp-4.2.8p15.tar.gz
cd ntp-4.2.8p15

vim include/ntp_syscall.h.patch #輸入以下內容
--- ntp-4.2.4p7/include/ntp_syscall.h

+++ ntp-4.2.4p7/include/ntp_syscall.h

@@ 
-14,5+14,13 @@ #include #endif +#if defined(ADJ_NANO) && !defined(MOD_NANO) +#define MOD_NANO ADJ_NANO +#endif + +#if defined(ADJ_TAI) && !defined(MOD_TAI) +#define MOD_TAI ADJ_TAI +#endif + #ifndefNTP_SYSCALLS_LIBC #ifdefNTP_SYSCALLS_STD # cd include # patch -p0 < ntp_syscall.h.patch
patch file to:ntp_syscall.h # cd .. # make && make install
cd include
patch -p1 < ntp_syscall.h.patch
#然後點選回車

cd ..
./configure --prefix=/usr/local/ntp --enable-all-clocks --enable-parse-clocks --enable-clockctl

make
make install
cp /usr/local/ntp/bin/ntp* /usr/sbin/

#注意檢查ntp.conf的配置
chkconfig ntp on
service ntp start
service ntp status
ntpd 
--version
python, equal to anything!