linux 时间同步
2015-11-22 16:39
316 查看
时间同步命令:
ntpdata time.windows.com
自动时间同步:
需要配置/etc/crontab文件,实现自动执行任务
让linux从time.windows.com自动同步时间
vi /etc/crontab
加上一句:
00 0 1 * * root ntpdate -s time.windows.com
time.nist.gov 是一个时间服务器.
Linux时间服务器配置(192.168.10.1)
1). # rpm -ivh ntp-4.1.2-4.EL3.1.i386.rpm
2). # vi /etc/ntp.conf
注释一行
restrict default ignore
加入一行
restrict 192.168.10.0 mask 255.255.255.0 notrust nomodify notrap
3). # vi /etc/ntp/step-tickers
加入一行
pool.ntp.org
这样每次ntpd启动时,会自动连接该国际标准时间服务器;
4). # service ntpd start
5). # netstat -an |grep 123
确保该端口以udp方式开放
时间客户端配置(192.168.10.2)
1). # ntpdate 192.168.10.2
应该显示同步成功
2). # crond -e
加入
0-59/10 * * * * /usr/sbin/ntpdate 192.168.10.1
表示每隔10分钟同步一次时间
ntpdata time.windows.com
自动时间同步:
需要配置/etc/crontab文件,实现自动执行任务
让linux从time.windows.com自动同步时间
vi /etc/crontab
加上一句:
00 0 1 * * root ntpdate -s time.windows.com
time.nist.gov 是一个时间服务器.
Linux时间服务器配置(192.168.10.1)
1). # rpm -ivh ntp-4.1.2-4.EL3.1.i386.rpm
2). # vi /etc/ntp.conf
注释一行
restrict default ignore
加入一行
restrict 192.168.10.0 mask 255.255.255.0 notrust nomodify notrap
3). # vi /etc/ntp/step-tickers
加入一行
pool.ntp.org
这样每次ntpd启动时,会自动连接该国际标准时间服务器;
4). # service ntpd start
5). # netstat -an |grep 123
确保该端口以udp方式开放
时间客户端配置(192.168.10.2)
1). # ntpdate 192.168.10.2
应该显示同步成功
2). # crond -e
加入
0-59/10 * * * * /usr/sbin/ntpdate 192.168.10.1
表示每隔10分钟同步一次时间
相关文章推荐
- Linux find命令用法小结
- Linux系统设置网卡为混杂模式
- LINUX下网站压力测试工具webbench
- 20151115linux 下这么去搜文件? ( which,whereis,locate, find )使用!
- Run a Java Application as a Service on Linux
- Linux Advance--线程和fork
- linux搭建基于LNMP的wordpress博客
- linux入侵检测系统Snort安装配置(+ACIDBASE)
- 【拔苗计划】linux学习笔记——netstat命令学习
- 一、linux 指令集(显示系统信息、关机操作)
- linux支持并发的服务器回射程序实例
- Linux下查看端口占用、进程号等使用情况
- samba ubuntu下快速配置
- linux --> gcc编译之路径搜索
- linux /proc/loadavg(平均负载)
- 在ubuntu15.10上编译arm-linux环境使用的log4c步骤
- Linux运维式具之pdsh
- centos 下设置grub密码
- linux日常管理-防火墙netfilter工具-iptables-1
- linux Loadavg和CPU利用率是如何算出来的