1.配置ntp时间服务器,确保客户端主机能和服务主机同步时间
2.配置ssh免密登陆,能够通过客户端主机通过redhat用户和服务端主 机基于公钥验证方式进行远程连接
1.配置ntp时间服务器,确保客户端主机能和服务主机同步时间
ssh 192.168.227.129
crontab -e
timedatectl
rpm -qc chrony
vim /etc/chrony.cong
进去光标放第一行按D删掉所有并复制下边内容
server ntp.aliyun.com iburst
stratumweight 0
driftfile /var/lib/chrony/drift
rtcsync
makestep 10 3
bindcmdaddress 127.0.0.1
bindcmdaddress ::1
keyfile /etc/chrony.keys
commandkey 1
generatecommandkey
logchange 0.5
logdir /var/log/chrony
yum list | grep chrony
yum install chrony -y
systemctl enable chronyd
vim /etc/chrony.conf
date -s 8:00
vim /etc/chrony.conf
sychronyc sources -v
stemctl restart chronyd
上次元数据过期检查:0:56:41 前,执行于 2023年05月23日 星期二 19时17分55秒。
软件包 chrony-4.3-1.el9.x86_64 已安装。
依赖关系解决。
无需任何处理。
完毕!
[root@server ~]# yum install chrony -y
上次元数据过期检查:1:03:05 前,执行于 2023年05月23日 星期二 19时17分55秒。
软件包 chrony-4.3-1.el9.x86_64 已安装。
依赖关系解决。
无需任何处理。
完毕!
[root@server ~]# systemctl enable
Too few arguments.
[root@server ~]# systemctl enable chronyd
[root@server ~]# systemctl start chronyd
[root@server ~]# vim /etc/chrony.conf
[root@server ~]# data -s 8:00
bash: data: command not found...
[root@server ~]# data -s 8:00
bash: data: command not found...
[root@server ~]# data -s 6:00
bash: data: command not found...
[root@server ~]# vim /etc/chrony.conf
[root@server ~]# vim /etc/chrony.conf
[root@server ~]# systemctl restart chronyd
[root@server ~]# chronyc sources -v
.-- Source mode '^' = server, '=' = peer, '#' = local clock.
/ .- Source state '*' = current best, '+' = combined, '-' = not combined,
===============================================================================
^* 203.107.6.88 2 6 17 42 -1163us[-5844us] +/- 41ms
[root@server ~]# timedatectl status
Local time: 二 2023-05-23 20:34:55 CST
Universal time: 二 2023-05-23 12:34:55 UTC
RTC time: 二 2023-05-23 12:34:56
Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
[root@server ~]# data
bash: data: command not found...
[root@server ~]# date
2023年 05月 23日 星期二 20:36:12 CST
[root@server ~]# vim /etc/chrony.conf
[root@server ~]# chronyc sources -v
.-- Source mode '^' = server, '=' = peer, '#' = local clock.
|| | | \
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* 203.107.6.88 2 6 377 63 -4205us[-2775us] +/- 37ms
[root@server ~]# ping ntp.aliyun.com
PING ntp.aliyun.com (203.107.6.88) 56(84) 比特的数据。
64 比特,来自 203.107.6.88 (203.107.6.88): icmp_seq=1 ttl=128 时间=56.4 毫秒
64 比特,来自 203.107.6.88 (203.107.6.88): icmp_seq=2 ttl=128 时间=56.5 毫秒
64 比特,来自 203.107.6.88 (203.107.6.88): icmp_seq=3 ttl=128 时间=56.1 毫秒
64 比特,来自 203.107.6.88 (203.107.6.88): icmp_seq=4 ttl=128 时间=55.5 毫秒
^C
--- ntp.aliyun.com ping 统计 ---
已发送 4 个包, 已接收 4 个包, 0% packet loss, time 3006ms
rtt min/avg/max/mdev = 55.463/56.100/56.512/0.401 ms
[root@server ~]# chronyc sources -v
.-- Source mode '^' = server, '=' = peer, '#' = local clock.
/ .- Source state '*' = current best, '+' = combined, '-' = not combined,
| / 'x' = may be in error, '~' = too variable, '?' = unusable.
^* 203.107.6.88 2 6 377 15 -43us[+1557us] +/- 34ms
[root@server ~]# timedatectl status
Local time: 二 2023-05-23 20:50:31 CST
Universal time: 二 2023-05-23 12:50:31 UTC
RTC time: 二 2023-05-23 12:50:31
Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
[root@server ~]# date
2023年 05月 23日 星期二 20:53:53 CST
2.配置ssh免密登陆,能够通过客户端主机通过redhat用户和服务端主 机基于公钥验证方式进行远程连接