- 手动
#apt -y install ntp #vi /etc/ntp.conf ... pool ntp7.aliyun.com iburst //阿里云 pool cn.ntp.org.cn iburst //中国 pool edu.ntp.org.cn iburst //中国教育网 pool hk.ntp.org.cn iburst //中国香港 pool jp.ntp.org.cn iburst //日本 ... systemctl restart ntp ntpq -p
- 脚本配置set-ntp.sh`
#!/bin/bash apt -y install ntp sed -i '/^pool 0./i pool ntp1.aliyun.com iburst' /etc/ntp.conf sed -i "/^pool 0./i pool ntp.ntsc.ac.cn iburst" /etc/ntp.conf sed -i "s/pool 0./#pool 0./g" /etc/ntp.conf sed -i "s/pool 1./#pool 1./g" /etc/ntp.conf sed -i "s/pool 2./#pool 2./g" /etc/ntp.conf sed -i "s/pool 3./#pool 3./g" /etc/ntp.conf systemctl restart ntp ntpq -p
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)