ntp 常用命令

1、调整时区

ls -l /etc/localtime  #查看当前时区

rm /etc/localtime

ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

 

2、启动ntp

systemctl status ntp 

systemctl list-unit-files --type=service | grep ntp

 

3、手动设置时间

 date --set "2022-01-17 17:25:50"

 

4、查看同步情况

ntpstat

ntpq -p

 

5、通过nc测ntp的端口

nc -vuz 127.0.0.1 123 #对应的ntp服务器

 

6、手动同步

ntpdate -u 127.0.0.1 #对应的ntp服务器

posted on 2022-05-16 12:23  每天进步一点点点点点  阅读(4152)  评论(0编辑  收藏  举报