配置时间显示为24小时制:
/etc/profile
最后加下: export LC_TIME=POSIX
source /etc/profile
debian12 Ununtu20.04
1、在debian12上,ntp能装,但不能同步时间,需要使用systemd-timesyncd
2、配置文件
/etc/systemd/timesyncd.conf
[Time]
NTP=时钟服务器地址
3、常用命令
立即同步: timedatectl set-ntp true
同步状态: timedatectl status
Redhat7.5
yum install ntp
修改 /etc/ntp.conf
systemctl start ntpd
systemctl enable ntpd
ntpd显示与上层NTP服务器的状态 ntpq -p
ntpq启动后,需要一段时间几分钟或更长才校时
KylinV10
etc/chronyc.conf server 10.1.0.26
重启chronyc:systemctl restart chronyd
查看 ntp_servers
chronyc sources -v
查看 ntp_servers 状态
chronyc sourcestats -v
查看 ntp_servers 是否在线
chronyc activity -v
查看 ntp 详细信息
chronyc tracking -v
强制同步下系统时钟
chronyc -a makestep