修改时区
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
环境
CentOS Linux release 7.9.2009 (Core)
时间服务器:192.1.1.1
命令同步
ntpdate 192.1.1.1 # 手工与时间服务器同步
[root@client ~]# ntpdate 192.1.1.1
30 Mar 09:58:00 ntpdate[23254]: step time server 192.1.1.1 offset -0.954192 sec
ntpd服务的方式进行同步
ntpd安装(服务端、客户端都需要)
yum -y install ntp
systemctl enable ntpd # 服务名称ntpd
systemctl start ntpd
# 配置文件
vi /etc/ntp.conf
1.服务器端