Linux时间调整

本文介绍如何在Linux系统中更改时区设置,并详细解释了安装ntp时间服务器的过程,包括配置文件的具体调整方法,以实现不同网络环境下的时间同步。

Linux修改时区

shell # cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

Linux安装ntp时间服务器

shell # yum install ntp ntpdate -y
shell # vim /etc/ntp.conf
1)vim /etc/ntp.conf
①  配置方法一:只允许192.168.100.0网段的客户机进行时间同步
在restrict default kod nomodify notrap nopeer noquery(表示默认拒绝所有IP的时间同步)之后增加一行:
restrict 192.168.100.0 mask 255.255.255.0 nomodify notrap

②  配置方法二:允许任何ip的客户机都可以进行时间同步
将restrict default kod nomodify notrap nopeer noquery修改为如下行:
Restrict default nomodify

Linux时间调整

转载于:https://blog.51cto.com/chuckzeng/2061885

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值