centos6.5配置NTP服务器的详细步骤
2017-11-14 00:46
323 查看
1.查看是否安装了NTP:
# rpm -q ntp
ntp-4.2.4p8-2.el6.x86_64 // 这表示已安装了,如果没有安装,这是空白。
2.如果没有安装,我们按照下
# yum install ntp
注意:前提是已经配置好了yum源。
3.开启ntp的自启命令:
# chkconfig ntpd on
4.配置NTP的配置文件:
#vi /etc/ntp.conf
需修改内容为:
restrict 127.0.0.1
restrict -6 ::1
添加内容:
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
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
# Enable public key cryptography.
#crypto
5.保存退出即可。
6.开启ntp服务:
# service ntpd start
7.一般需要5-10分钟左右,查看状态:
# netstat -tlunp | grep ntp
出现:udp 0 0 172.24.240.160:123 0.0.0.0:* 23103/ntpd 说明配置成功。
(注意:本机的ip为172.24.240.160)。
到此服务器已经配置完成。
客户机时间同步配置:
1.# yum install ntp
...
# chkconfig ntp on
2.# vim /etc/ntp.conf
配置文件内容为:
driftfile /var/lib/ntp/drift
restrict 127.0.0.1
restrict -6 ::1
# 配置时间服务器为本地的时间服务器
server 172.24.240.160
restrict 172.24.240.160 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
保存退出。
3.手动同步:
ntpdate -u 172.24.240.160
4.查看状态:
# ntpstat
出现:synchronised to NTP server (172.24.240.160) at stratum 12
表示配置成功。
恭喜你配置完成!
# rpm -q ntp
ntp-4.2.4p8-2.el6.x86_64 // 这表示已安装了,如果没有安装,这是空白。
2.如果没有安装,我们按照下
# yum install ntp
注意:前提是已经配置好了yum源。
3.开启ntp的自启命令:
# chkconfig ntpd on
4.配置NTP的配置文件:
#vi /etc/ntp.conf
需修改内容为:
restrict 127.0.0.1
restrict -6 ::1
添加内容:
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
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
# Enable public key cryptography.
#crypto
5.保存退出即可。
6.开启ntp服务:
# service ntpd start
7.一般需要5-10分钟左右,查看状态:
# netstat -tlunp | grep ntp
出现:udp 0 0 172.24.240.160:123 0.0.0.0:* 23103/ntpd 说明配置成功。
(注意:本机的ip为172.24.240.160)。
到此服务器已经配置完成。
客户机时间同步配置:
1.# yum install ntp
...
# chkconfig ntp on
2.# vim /etc/ntp.conf
配置文件内容为:
driftfile /var/lib/ntp/drift
restrict 127.0.0.1
restrict -6 ::1
# 配置时间服务器为本地的时间服务器
server 172.24.240.160
restrict 172.24.240.160 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
保存退出。
3.手动同步:
ntpdate -u 172.24.240.160
4.查看状态:
# ntpstat
出现:synchronised to NTP server (172.24.240.160) at stratum 12
表示配置成功。
恭喜你配置完成!
相关文章推荐
- Centos6.5升级glibc的详细步骤
- 安装中文CentOS 6.5的详细步骤及要注意点
- 阿里云CentOS 6.5 安装Docker详细步骤
- Centos 6.5 下hadoop2.5.2的HA集群原理讲解以及详细配置(自动切换)
- 以太坊(1)--在CentOS 6.5上搭建以太坊私有链的步骤(图文详细)
- centos6.5配置nfs服务详细
- 基于VMware12对centOS6.5使用NAT模式配置网络步骤
- centos配置nfs服务详细步骤(centos开启nfs服务)
- CentOS 6.5系统安装配置图解教程(详细图文)
- centos 5 yum安装与配置vsFTPd FTP服务器详细步骤
- CentOS 6.5系统安装配置图解教程(详细图文)
- VMware Workstation安装centos 6.5详细步骤
- 超详细CentOS6.5配置rsync+inotify实现同步
- CentOS 6.5系统安装配置图解教程(详细图文)
- VMwareWorkstation10 中安装Centos6.5(64位)图文并茂详细步骤
- CentOS6.5连接Wifi详细步骤及常见问题解答
- VMwareWorkstation10 中安装Centos6.5(64位)图文并茂详细步骤
- CentOS7 配置163 yum源(详细步骤)
- 安装和配置CentOS服务器的详细步骤
- CentOS6.5服务器配置建站环境详细流程