NTP时间同步

Network Time Protocol:网络时间协议
NTP目的是对网络内所有具有时钟的设备进行时间同步,使设备能够提供基于同一时间的多种应用。

同步本机时间

#!/bin/bash
yum -y install ntp
ntpdate time.windows.com

windows的时间同步服务器个人感觉非常不好用,这里也可以用阿里的服务器
ntp1.aliyun.com
ntp2.aliyun.com
ntp3.aliyun.com
ntp4.aliyun.com
ntp5.aliyun.com
ntp6.aliyun.com
ntp7.aliyun.com

将本机制成时间同步服务器

#!/bin/bash
#修改配置文件
sed -i 17c"restrict 192.168.10.0 mask 255.255.255.0 nomodify notrap" /etc/ntp.conf
sed -i 20a"server 127.127.1.0" /etc/ntp.conf
sed -i 21a"fudge 127.127.1.0 stratum 10" /etc/ntp.conf
#添加自启动重启
systemctl enable ntpd
systemctl restart ntpd
#打开firewall端口
firewall-cmd --add-port=123/udp
firewall-cmd --add-port=123/udp --permanent

计算机英语

restrict限制
stratum
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值