首页 技术 正文
技术 2022年11月16日
0 收藏 513 点赞 2,302 浏览 1143 个字

1:实验环境

前提条件:虚拟机环境,windows 客户端,关闭防火墙;linux 服务器关闭防火墙,关闭selinux。

Cent OS :NTP服务器 IP: 192.168.80.134  /255.255.255.0

windows 7 : 客户端   IP: 192.168.80.133  /255.255.255.0

2:ntp服务安装

①一般自带有:

 [root@localhost ~]# rpm -qa | grep ntp
ntp-4.2.6p5-.el6.centos.x86_64
fontpackages-filesystem-1.41-1.1.el6.noarch
ntpdate-4.2.6p5-.el6.centos.x86_64

②若没有,这安装

㈠rpm安装:

rpm -ivh ntp-*.rpm

卸载:

rpm -e ntp-*.rpm

㈡yum安装

yum -y install ntp.i*

卸载:

yum -y remove ntp.i*

3:服务配置:

①: vi /etc/ntp.conf

 restrict 192.168.80.0 mask 255.255.255.0 nomodify notrap # Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
#server .centos.pool.ntp.org iburst
#server .centos.pool.ntp.org iburst
#server .centos.pool.ntp.org iburst
#server .centos.pool.ntp.org iburst
server asia.pool.ntp.org
 /etc/rc.d/init.d/ntpd start
 chkconfig ntpd on 

②:更改时区:

tzselect:

执行tzselect命令–>选择Asia–>选择China–>选择east China – Beijing, Guangdong, Shanghai, etc–>然后输入1;

执行TZ=’Asia/Shanghai’; export TZ 并将这行命令添加到.profile中,然后退出并重新登录。

参考:http://jingyan.baidu.com/article/fa4125acb7328628ac70920e.html

③手动更新:

ntpdate asia.pool.ntp.org

④查看本机与上层ntp服务器同步情况:

ntpq -p

至此:ntp自身的时间同步正常,然后设置客户端

⑤更改windows 同步服务器的IP地址为搭建的ntp服务器IP,立即更新时间。

最后:简单的搭建的NTP服务器,实现了基本的功能。

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,082
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,556
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,406
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,179
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,815
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,898