配置前的几个注意点本人使用root权限做测试,权限不够自行sudo
系统时钟设置# 系统时间查看
date
-------------------------------------------------------------
# 系统时间设置
date -s "YYYY-MM-DD hh:mm:ss"
e.g.
date -s "2020-10-15 10:20:15"
硬件时钟# 硬件时钟查看
hwclock
-----------------------------------------------------------
# 硬件时钟同步系统时钟(改了硬件时钟)
hwclock -w
-----------------------------------------------------------
# 系统时钟同步硬件时钟(改了系统时钟)
hwclock -h
Ubuntu自带的时间同步行为Ubuntu本身自带ntp来更新时间,如有必要,需要自行关闭# 关闭自带的更新功能
timedatectl set-ntp no # yes为开启(不成功就yes/no反复几次)
-----------------------------------------------------------
# 查看timedatectl功能是否成功关闭
timedatectl status
# 结果
System clock synchronized: no
systemd-timesyncd.service active: no
RTC in local TZ: no
ntp 配置</