NTP服务器常用操作
安装ntp服务
ubuntu:
apt-getinstall ntp
centOS
yum install ntp
配置文件路径 :/etc/ntp.conf
重启ntp服务
/etc/init.d/ntp restart
查看服务连接和监听
netstat -tlump | grep ntp
查看网络中的ntp服务器
ntpq -pshell
查看端口占用
nc -uz -w 3 172.0.0.1 123
netstat -nupl | grep "123"
查看时间同步状态
ntpstat
时间同步
同步ntp-server时间(-u代表不使用默认端口)
ntpdate -u ipaddress
系统时间同步到硬件
hwclock -systohc