第一步,将服务器的时间同步对象改为阿里的时间服务器(这样比较精准)
先启动服务:[root@server ~]# systemctl start chronyd
进入配置文件:[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,
| / ? ? ? ? ? ? 'x' = may be in error, '~' = too variable, '?' = unusable.
|| ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? .- xxxx [ yyyy ] +/- zzzz
|| ? ? ?Reachability register (octal) -. ? ? ? ? ? | ?xxxx = adjusted offset,
|| ? ? ?Log2(Polling interval) --. ? ? ?| ? ? ? ? ?| ?yyyy = measured offset,
|| ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\ ? ? | ? ? ? ? ?| ?zzzz = estimated error.
|| ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? | ? ?| ? ? ? ? ? \
MS Name/IP address ? ? ? ? Stratum Poll Reach LastRx Last sample ? ? ? ? ? ? ??
===============================================================================
^* 203.107.6.88 ? ? ? ? ? ? ? ? ?2 ? 6 ? ?17 ? ?26 ? +367us[+3046us] +/- ? 37ms最后在客户端上修改同步对象
然后重启服务再查看
首先创建redhat用户
[root@server ~]# adduser redhat
[root@server ~]# passwd redhat
然后进入客户端创建公钥
[root@wang ~]# ssh-keygen -t rsa
过程一路回车发送公钥
[root@wang ~]# ssh-copy-id redhat@192.168.153.137
输入redhat的密码最后验证
[root@wang ~]# ssh redhat@192.168.153.137
Authorized users only. All activities may be monitored and reported.
Authorized users only. All activities may be monitored and reported.
Last login: Wed Jan 24 18:48:05 2024 from 192.168.153.130
Welcome to 5.10.0-182.0.0.95.oe2203sp3.x86_64System information as of time: ?? ?2024年 01月 24日 星期三 18:53:07 CST
System load: ?? ?0.00
Processes: ?? ?147
Memory used: ?? ?11.7%
Swap used: ?? ?0%
Usage On: ?? ?7%
IP address: ?? ?192.168.153.141
Users online: ?? ?4
To run a command as administrator(user "root"),use "sudo <command>".
[redhat@server ~]$?
?