ubuntu NTP server 搭建
ubuntu server ntp时间同步服务器安装及使用
一、服务端
1 apt-get install ntp
2 安装后默认启动服务,如果没有启动,启动之。
/etc/init.d/ntp start
3 vi /etc/ntp.conf 修改为如下
restrict default nomodify notrap noquery
restrict 127.0.0.1
restrict 10.91.0.0 mask 255.255.255.0 nomodify
server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10
driftfile /var/lib/ntp/drift
broadcastdelay 0.008
keys /etc/ntp/keys
4 重启ntp服务
/etc/init.d/ntp restart
二、客户端
1 使用ntpdate命令,如果不存在这个命令,则先安装apt-get install ntp
sudo /usr/sbin/ntpdate 135.252.151.137 //即使用ip为135.252.151.137的ntp服务器同步时间
2 设置定时同步。
vi /etc/crontab
30 01 * * * /usr/sbin/ntpdate 135.252.151.137
系统便会在每天早上1点30分自动将系统时间同步到ntp服务器的时间。
当然这里crontab的时间是指客户端的时间,同步后等同于ntp服务器的时间。
ubuntu NTP server 搭建的更多相关文章
- Ubuntu server 搭建Git server
Ubuntu server 搭建Git server,git相比svn,最主要就是分布式了,每个客户端用户的本地都是一个版本管理控制器. Ubuntu server 版本为12.04 搭建步骤如下: ...
- Ubuntu Server搭建svn服务以及迁移方法【转】
转自:http://www.linuxidc.com/Linux/2013-05/84693.htm Ubuntu Server搭建svn服务以及迁移方法 采用apache+svn,http访问方式. ...
- Ubuntu server搭建vsftpd小记
Ubuntu server中搭建vsftpd小记 <h1> 在Ubuntu server中安装vsftpd</h1> sudo apt-get install vsftpd & ...
- Ubuntu server 搭建Git server【转】
转自:http://www.cnblogs.com/candle806/p/4064610.html Ubuntu server 搭建Git server,git相比svn,最主要就是分布式了,每个客 ...
- Ubuntu 配置NTP Server
Ubuntu安装NTP Server很简单,分位3步走: 第一步:安装NTP root@cephadmin:~/ceph-cluster# apt-get install ntp Reading pa ...
- (转)ubuntu 12.04搭建Adobe Flash Media Server服务
破解版传送门:http://fms45.cuplayer.com/fms4download.html 福利:1462-5247-1705-7678-8379-5590 下载解压 cd进目录,./ins ...
- 使用阿里云镜像站NTP服务搭建NTP服务器(基于CentOS 7系统)
镜像下载.域名解析.时间同步请点击 阿里云开源镜像站 一.NTP服务器介绍 网络时间协议(Network Time Protocol,NTP)服务器,也就是日常所说的NTP服务器,用来提供同步时间服务 ...
- 创建一个Windows的NTP Server
搭建一个VMware vRealize Suite的时候遇见了不少时间同步的问题, 实验室里网络与外界隔绝, 不能使用公网的NTP服务器, 所以使用文中的方法自己搭建了一个. 蛮好用的. Creati ...
- Ubuntu 14.04搭建简单git服务器
/****************************************************************************** * Ubuntu 14.04搭建简单gi ...
随机推荐
- String与InputStream相互转换
1.String to InputStream String str = "String与InputStream相互转换"; InputStream in_nocode = ...
- (转)javascript匿名函数的写法、传参和递归
(原)http://www.veryhuo.com/a/view/37529.html (转)javascript匿名函数的写法.传参和递归 http://www.veryhuo.com 2011-0 ...
- Unparsed aapt error(s)! Check the console for output解决方法
在Eclipse平台进行Android 应用开发时,编辑,修改或增删 res/下资源文件时有时会遇到如下错误提示:“Unparsed aapt error(s)! Check the console ...
- 团队开发——冲刺1.b
冲刺阶段一(第二天) 1.昨天做了什么? 在了解C#的基础上,深入熟悉Windows窗体应用程序,熟练掌握基本功能 2.今天准备做什么? 在C#的Windows窗体应用程序中,设计简单的游戏开始主界面 ...
- 如何垂直居中一个<img>?
<!doctype html><html> <head> <meta charset="UTF-8"> <meta name= ...
- easyUI笔记09.03
layout的布局可以自适应 <body class="easyui-layout"> <div data-options="region:'north ...
- 使用Object.observe 实现数据绑定
Object.observe API概述 最近,JavaScript的MVC框架在Web开发届非常盛行.在实现MVC框架的时候,一个非常重要的技术就是数据绑定技术.如果要实现模型与视图的分离,就必须要 ...
- php-数据库访问--数据修改
主页面元素修改脚本 <?php $code = $_GET["c"]; //造连接对象 $db = new MySQLi("localhost",&quo ...
- hdu4671 Backup Plan ——构造题
link:http://acm.hdu.edu.cn/showproblem.php?pid=4671 其实是不难的那种构造题,先排第一列,第二列从后往前选. #include <iostrea ...
- HDU-2778 DNA Sequence(AC自动机)
题目大意:统计模式串出现的次数. 题目分析:模板题. 代码如下: # include<iostream> # include<cstdio> # include<queu ...