centos 6.5 ntp 服务器搭建

简介:

1、配置内网NTP-Server(192.168.1.135)

# yum install ntp

# chkconfig ntpd on

# chkconfig --list ntpd

#vim /etc/ntp.conf

------------------------------------------------------------------------------------------- 

# Hosts on local network are less restricted.

# 允许内网其他机器同步时间

restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap


# 中国这边最活跃的时间服务器 : http://www.pool.ntp.org/zone/cn

server 210.72.145.44 perfer   # 中国国家受时中心

server 202.112.10.36             # 1.cn.pool.ntp.org

server 59.124.196.83             # 0.asia.pool.ntp.org

  

# 允许上层时间服务器主动修改本机时间

restrict 210.72.145.44 nomodify notrap noquery

restrict 202.112.10.36 nomodify notrap noquery

restrict 59.124.196.83 nomodify notrap noquery


# 外部时间服务器不可用时,以本地时间作为时间服务

server  127.127.1.0     # local clock

fudge   127.127.1.0 stratum 10

------------------------------------------------------------------------------------------- 

#service ntpd start



2、配置内网NTP-Clients

# yum install ntp

# chkconfig ntpd on

# chkconfig --list ntpd

#vim /etc/ntp.conf

------------------------------------------------------------------------------------------- 

driftfile /var/lib/ntp/drift

restrict 127.0.0.1

restrict -6 ::1

# 配置时间服务器为本地的时间服务器

server 192.168.1.135

restrict 192.168.1.135 nomodify notrap noquery

server  127.127.1.0     # local clock

fudge   127.127.1.0 stratum 10

includefile /etc/ntp/crypto/pw

keys /etc/ntp/keys

------------------------------------------------------------------------------------------- 

#service ntpd start

手动同步服务器时间

ntpdate -u 192.168.1.135


硬件时间与系统时间一起同步

# vim /etc/sysconfig/ntpd

SYNC_HWCLOCK=yes




 本文转自1321385590 51CTO博客,原文链接:http://blog.51cto.com/linux10000/1717524,如需转载请自行联系原作者




相关文章
|
3月前
|
缓存 关系型数据库 MySQL
百度搜索:蓝易云【CentOS8服务器安装MySQL报错:no match mysql-community-server】
现在,你已经成功安装了MySQL服务器并解决了"no match mysql-community-server"的报错问题。祝你使用愉快!
43 1
|
4月前
|
Linux
CentOS7.9服务器一键脚本部署FRP内网穿透服务端与客户端
CentOS7.9服务器一键脚本部署FRP内网穿透服务端与客户端
253 0
|
4月前
|
Linux 网络安全
CentOS7服务器SSH登陆时自动显示服务器基础信息
CentOS7服务器SSH登陆时自动显示服务器基础信息
50 0
|
1天前
|
Linux 网络安全 数据库
linux centos系统搭建samba文件服务器 NetBIOS解析 (超详细)
linux centos系统搭建samba文件服务器 NetBIOS解析 (超详细)
|
12天前
|
安全 Linux 网络安全
记录_centos搭建ftp服务器
记录_centos搭建ftp服务器
11 0
|
14天前
|
运维 Apache 数据安全/隐私保护
CentOS6.5搭建SVN服务器(Apache+SVN)
CentOS6.5搭建SVN服务器(Apache+SVN)
|
28天前
|
Linux
centos 查看服务器信息 版本cpu
centos 查看服务器信息 版本cpu
14 0
|
2月前
|
Oracle 关系型数据库 Linux
服务器Centos7 静默安装Oracle Database 12.2
服务器Centos7 静默安装Oracle Database 12.2
100 0
|
2月前
|
存储 弹性计算 Linux
阿里云ECS(CentOS镜像)安装docker
阿里云ECS(CentOS镜像)安装docker
407 0
|
4月前
|
Linux 网络安全 数据安全/隐私保护
centos宝塔远程服务器怎么链接?
【1月更文挑战第6天】centos宝塔远程服务器怎么链接?
195 2