您好,欢迎进入北京泰福特电子科技有限公司官网

咨询服务热线

400-015-1230

centos搭建ntp时间同步服务器

发布时间:2022-04-12 10:17:41

centos最小化安装后登陆:

login as: root

root@192.168.205.132's password:

Last login: Thu Apr 25 13:33:52 2019

[root@localhost ~]# hostname -I 查看本机ip信息

192.168.205.132

[root@localhost ~]# yum install -y ntp 通过yum安装ntp服务

[root@localhost ~]# rpm -qa ntp 验证ntp服务安装情况

ntp-4.2.6p5-28.el7.centos.x86_64

[root@localhost ~]# vi /etc/ntp.conf 设置ntp配置文件

restrict 192.168.205.0 加上可以接收ntp的网段

server ntp1.aliyun.com iburst

server time.nist.gov iburst 设置本机需要同步的时间服务器,如果用本机时间,那么此处设置本机ip

[root@localhost ~]# systemctl start ntpd 启动ntp服务

[root@localhost ~]# netstat -lnuto|grep 123 查看端口开启情况

-bash: netstat: 未找到命令

[root@localhost ~]# yum -y install net-tools 找不到以上命令需要安装net-tools

[root@localhost ~]# ntpq -p 查看ntp同步情况

[root@localhost ~]# firewall-cmd --permanent --add-port=123/udp 把udp 123端口加到防火墙里

success

[root@localhost ~]# firewall-cmd --reload

success

完成即可作为时间同步服务器。


  • 联系方式
  • 传 真:86-10-82782026
  • 电 话:400-015-1230
  • 地 址:北京市海淀区北清路68号院用友软件园北区17号楼三层
在线咨询

咨询电话:

400-015-1230

  • 微信扫码 关注我们

Copyright © 2002-2035 北京泰福特电子科技有限公司 版权所有 备案号:京ICP备12028220号-1
京公网安备 11010802025976号

扫一扫咨询微信客服

18519396506
Powered by RRZCMS