ubantu系统如何搭建NTP服务器?
1、首先打开ssh连接工具,输入服务器的IP地址,连接服务器;
2、输入su,切换root用户;
3、检查网络环境,可连接外网;
4、输入sudo apt-get update,回车,更新系统。

2、输入sudo apt-get install ntp,回车安装ntp服务器。

3、输入sudo vim /etc/ntp.conf,修改配置文件;
2、在配置文件中的:
restrict -6 default kod notrap nomodify nopeer noquery
语句后面加入:
restrict 192.168.80.0 mask 255.255.255.0 nomodify
restrict 192.168.90.0 mask 255.255.255.0 nomodify
注意:此配置是表示允许能同步的服务器所在的内部网段。
3、保存,退出。

4、输入sudo /etc/init.d/ntp restart ,回车重启ntp服务。

5、输入ntpq -p,查看ntp服务启动是否正常。如下图所示为正常情况。

6、在需要ntp同步时间的客户端上输入 ntpdate xxx.xxx.xxx.xxx ,即可同步时间。
注意:
初次安装完后,直接输入,可能返回no server suitable for synchronization found 错误,这是因为ntp server自身与时间服务器对时需要5分钟左右的时间造成。等5分钟再次尝试即可。


声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:41
阅读量:20
阅读量:173
阅读量:142
阅读量:195