CentOS6 更改时区方法(以设置 UTC+8 为例)
为方便平时查看带时间戳的日志/事件,系统常规设置项之一是修改默认时区。不同于 CentOS7 可以用简单一句命令搞定,CentOS6 稍微麻烦了些,下面介绍具体设置方法。
查看当前时区
查询当前系统使用的时区。下面示例输出使用的北美东部夏令时间(EDT,UTC−4 时区)。
[test@localhost ~]$ date Thu Mar 21 22:30:53 EDT 2019
设置系统时区
使用下面命令设置系统时区,红色部分是时区参数,完整时区名称列表这里有介绍。
# 设置 上海 UTC+8 时区 sudo ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime # 设置 香港 UTC+8 时区 sudo ln -sf /usr/share/zoneinfo/Asia/Hong_Kong /etc/localtime # 设置 台北 UTC+8 时区 sudo ln -sf /usr/share/zoneinfo/Asia/Taipei /etc/localtime # 设置 北美东部标准 UTC-5 时区 sudo ln -sf /usr/share/zoneinfo/EST /etc/localtime # 设置 协调世界时 UTC 时区 sudo ln -sf /usr/share/zoneinfo/UTC /etc/localtime
设置硬件时区
如需修改硬件设备时区,编辑下面文件。
sudo vi /etc/sysconfig/clock
修改其中的 ZONE 参数值,并额外添加两行,将 UTC(BIOS 时间) 和 ARC 参数设置为 false。
ZONE="Asia/Shanghai"
UTC=false
ARC=false
更新硬件时间。用sudo hwclock
命令查询验证(date
查询的是系统时间)。
sudo hwclock --systohc --localtime
定期同步时间
如果需要定期检查调准时间,可以设置 NTP 时间同步服务。
# 安装 NTP 软件包 sudo yum -y install ntp # 添加可信任的 NTP 时间同步服务器 sudo ntpdate -d asia.pool.ntp.org # 重启刷新 NTP 服务 sudo service ntpd restart
如果启用了系统防火墙并采取白名单方式管理端口,别忘了添加允许 NTP 所使用的 123/UDP 端口。如果不清楚如何设置防火墙,可参考之前有关 Iptables 或 Firewalld 的使用教程文章。
is there generic latisse https://carepro1st.com/
canadian hydroxychloroquine https://hydroxychloroquine.webbfenix.com/
generic ivermectin available in usa https://ivermectin.mlsmalta.com/
generic dapoxetine cvs https://ddapoxetine.com/
daily vidalista vs regular vidalista https://vidalista40mg.mlsmalta.com/
coupon for tadalafil 5 mg https://wisig.org/
what is the dosage for hydroxychloroquine https://hydroxychloroquinee.com/
ventolin alternatives for asthma https://amstyles.com/
for what is prednisone https://prednisone.bvsinfotech.com/
acyclovir in canada https://www.herpessymptomsinmen.org/productacyclovir/
tamoxifen and missed periods https://tamoxifen.mrdgeography.com/
professional vidalista vs regular vidalista https://vidalista.mlsmalta.com/
cialis viagra mix https://cialzi.com/
viagra without doctor prescription http://viaaagra.com/
discount sildalis
ivermectin 6 tablet
buy elimite cream online
viagra generic
payday loans no credit check same day
cialis pill generic
levitra tablets price in india
sildalis cheap
elimite cream ebay
payday loan now
loans without checking account
fluoxetine tablets uk
payday loans indianapolis
price of lopressor
car loans
money fast and free
chloroquine otc uk
toprol xl 200 mg price
flomax 4 mg
over the counter female viagra pills
quicken personal loans
can i buy real cialis online
no credit check payday loans
prednisolone tablets 5mg price
where can i purchase disulfiram
liquid stromectol for poultry https://ivermectin1st.com/
buy cialis online cheap https://cialis.adicbc.com/
buy cialis online cheap https://cialis.grassfed.us/