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