任务要求:
一.配置server主机要求如下:
1.server主机的主机名称为 ntp_server.example.com
2.server主机的IP为: 172.25.254.100
3.server主机的时间为1984-11-11 11:11:11
4.配置server主机的时间同步服务要求可以被所有人使用
二.设定clinet主机要求如下
1.client主机的IP为:172.25.254.200
2.client主机的主机名称为: client.example.com
3.同步172.25.254.100主机的时间到达本机
4.用命令显示对于172.25.254.100主机的时间同步情况
一.配置server主机
1.环境准备
[root@server200 ~]# hostnamectl hostname ntp_server.example.com (改名字)
[root@server200 ~]# vm.sh 100 (改IP)
[root@server200 ~]# systemctl stop chronyd.service (关闭时间同步服务)
[root@server200 ~]# timedatectl set-time "1984-11-11 11:11:11" (改时间)
2.基础配置
.阿里云公共NTP服务器
国家授时中心服务器:ntp.ntsc.ac.cn
[root@server200 ~]# vim /etc/chrony.conf
[root@server200 ~]# systemctl restart chronyd.service (重启此服务)
最后关闭防火墙server主机的配置就完成了
[root@server200 ~]# systemctl disable --now firewalld (关闭防火墙)
二.设定clinet主机
1.环境准备
2.文件配置
3.查看
[root@server200 ~]# chronyc sources -v (查看命令)