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 搭建的更多相关文章

  1. Ubuntu server 搭建Git server

    Ubuntu server 搭建Git server,git相比svn,最主要就是分布式了,每个客户端用户的本地都是一个版本管理控制器. Ubuntu server 版本为12.04 搭建步骤如下: ...

  2. Ubuntu Server搭建svn服务以及迁移方法【转】

    转自:http://www.linuxidc.com/Linux/2013-05/84693.htm Ubuntu Server搭建svn服务以及迁移方法 采用apache+svn,http访问方式. ...

  3. Ubuntu server搭建vsftpd小记

    Ubuntu server中搭建vsftpd小记 <h1> 在Ubuntu server中安装vsftpd</h1> sudo apt-get install vsftpd & ...

  4. Ubuntu server 搭建Git server【转】

    转自:http://www.cnblogs.com/candle806/p/4064610.html Ubuntu server 搭建Git server,git相比svn,最主要就是分布式了,每个客 ...

  5. Ubuntu 配置NTP Server

    Ubuntu安装NTP Server很简单,分位3步走: 第一步:安装NTP root@cephadmin:~/ceph-cluster# apt-get install ntp Reading pa ...

  6. (转)ubuntu 12.04搭建Adobe Flash Media Server服务

    破解版传送门:http://fms45.cuplayer.com/fms4download.html 福利:1462-5247-1705-7678-8379-5590 下载解压 cd进目录,./ins ...

  7. 使用阿里云镜像站NTP服务搭建NTP服务器(基于CentOS 7系统)

    镜像下载.域名解析.时间同步请点击 阿里云开源镜像站 一.NTP服务器介绍 网络时间协议(Network Time Protocol,NTP)服务器,也就是日常所说的NTP服务器,用来提供同步时间服务 ...

  8. 创建一个Windows的NTP Server

    搭建一个VMware vRealize Suite的时候遇见了不少时间同步的问题, 实验室里网络与外界隔绝, 不能使用公网的NTP服务器, 所以使用文中的方法自己搭建了一个. 蛮好用的. Creati ...

  9. Ubuntu 14.04搭建简单git服务器

    /****************************************************************************** * Ubuntu 14.04搭建简单gi ...

随机推荐

  1. IIS调试技巧

    VS2010如何调试IIS上的网站 通常,我们在Visual Studio里调试ASP.NET网站,都是加个断点,然后按F5,在VS自带的虚拟服务器下调试的.但有时候,VS自带的服务器弱爆了,无法满足 ...

  2. python3 使用pyperclip读写剪贴板(windows)

    2016年5月14日 03:41:38 codegay 使用pyperclip库读写剪贴板非常简单~, 1.使用命令安装: pip install pyperclip 2.然后...就可以了: 以下是 ...

  3. springmvc 向页面传值

  4. SQL2008无法启动,报错"17051

    解决办法: 第一步:进入SQL2008配置工具中的安装中心, 第二步:再进入维护界面,选择版本升级, 第三步:进入产品密钥,输入密钥 Developer: PTTFM-X467G-P7RH2-3Q6C ...

  5. c#中各类日期的计算方法,收藏

    DateTime startWeek = dt.AddDays(1 - Convert.ToInt32(dt.DayOfWeek.ToString("d")));  //本周周一D ...

  6. js 上传文件预览

    1. FILE API html5提供了FIle和FileReader两个方法,可以读取文件信息并读取文件. 2. example <html> <body> <div ...

  7. Windows2003系统问题:“无法加载安装程序库wbemupgd.dll,或是找不到函数OcEntry.

    “无法加载安装程序库wbemupgd.dll,或是找不到函数OcEntry.请与您的系统管理员联系.特定错误码是 0x7e;" 然后是警告框: " 无法初始化应用程序." ...

  8. 第二个Sprint冲刺事后诸葛亮报告

    用户反馈:计时的填空题难度过大,计时选择题的画面太亮. 用户数量:4 团队改进建议:bug有点多 工作: 主界面 试卷题,是整合以前的内容的 选择题:也是整合以前功能的 初级的 计时题 1.每个成员第 ...

  9. Kerberos安装及使用

    转载请注明出处:http://www.cnblogs.com/xiaodf/ 2. 安装 Kerberos2.1. 环境配置 安装kerberos前,要确保主机名可以被解析. 主机名 内网IP 角色 ...

  10. [Debian]8.2升8.3

    $ uname -mrs $ lsb_release -a $ sudo apt-get update#開始升級 $ sudo apt-get dist-upgrade $ sudo reboot#重 ...