Linux ntp配置
来源:互联网 发布:2017最新网络诈骗案件 编辑:程序博客网 时间:2024/05/03 13:49
Linux NTP配置
- Linux NTP配置
- 环境
- ntp服务端
- 配置etcntpdcn
- 启动ntpd服务
- 添加防火墙
- 查看服务状态
- ntp客户端
环境
Cenos 6.6 X86_64
ntp服务端
配置/etc/ntpd.cn
修改/etc/ntpd.cnf,完成后结果如下,我们使用grep -v “^#” /etc/ntp.conf查看下
driftfile /var/lib/ntp/driftrestrict default kod nomodify notrap nopeer noqueryrestrict -6 default kod nomodify notrap nopeer noqueryrestrict 127.0.0.1 restrict -6 ::1restrict 192.168.31.0 mask 255.255.255.0 nomodify notrapserver 0.pool.ntp.orgserver 1.pool.ntp.orgserver 2.pool.ntp.orgserver 3.pool.ntp.orgserver cn.pool.ntp.org preferserver 127.127.1.0 # local clockfudge 127.127.1.0 stratum 10includefile /etc/ntp/crypto/pwkeys /etc/ntp/keys
启动ntpd服务
service ntpd start
添加防火墙
修改/etc/sysconfig/iptables添加如下条目,开放udp 123端口
-A INPUT -p udp -m state --state NEW -s 192.168.31.0/24 --dport 123 -j ACCEPT
查看服务状态
查看服务是否开启service ntpd statusntpstat查看运行状态,ntp服务是否与上层联机[root@testsrv ~]# ntpstat unsynchronised polling server every 64 sntpq列出上层ntp状态[root@testsrv~]# ntpq -p remote refid st t when poll reach delay offset jitter==============================================================================*news.neu.edu.cn 202.118.1.47 2 u 28 64 37 127.321 201.540 98.977+dns1.synet.edu. 202.118.1.46 2 u 29 64 27 102.763 186.822 93.444 dns2.synet.edu. 202.118.1.46 2 u 39 64 51 457.176 359.954 172.589 LOCAL(0) .LOCL. 10 l 108 64 76 0.000 0.000 0.000
ntp客户端
加入定时任务,每小时的第1分钟同步时间
crontab -e1 * * * * /usr/sbin/ntpdate 192.168.31.10 && /sbin/hwclock --systohc重启下定时任务service crond restart
0 0
- Linux下NTP配置
- linux配置ntp讲解
- Linux配置NTP服务
- Linux配置NTP服务
- Linux NTP配置
- Linux配置NTP服务器
- linux配置NTP Server
- Linux ntp配置
- linux ntp 安装配置
- Linux NTP服务器配置
- 配置Linux 的NTP服务
- linux 中ntp的配置
- linux集群中ntp配置
- linux NTP 配置时间同步
- ntp服务器配置for linux
- linux 顶级ntp服务器配置
- linux 操作系统NTP客户端配置
- Linux 6.2 配置NTP服务
- java使用http创建https连接,并且使用http实现webservice服务端
- 值得推荐的C/C++框架和库
- jsp验证码
- tabtableView最下面加按钮
- javascript 插件
- Linux ntp配置
- Qt Library摘要
- JAVA泛型
- ATPCS, AAPCS
- CS和BS模式的区别
- Flume - 安装及启动命令详解
- 模拟tomcat部署项目
- Shell字符串
- java经典总结