centos系統(tǒng)環(huán)境搭建專欄??點擊跳轉(zhuǎn)
Centos7設(shè)置時間為網(wǎng)絡時間
1.設(shè)置時間
安裝ntpdate工具
yum -y install ntp ntpdate
關(guān)閉ntpd
service ntpd stop
設(shè)置系統(tǒng)時間與網(wǎng)絡時間同步
ntpdate 0.asia.pool.ntp.org
將系統(tǒng)時間寫入硬件時間
hwclock --systohc
啟動 NTP 服務
service ntpd start
開機自啟動
systemctl enable ntpd
驗證時間同步
ntpq -p
查看系統(tǒng)的硬件時間,即BIOS時間
hwclock -r
2. 修改時區(qū)
使用date命令查看Centos時區(qū)
date -R
通常通過以下方法修改系統(tǒng)的時區(qū)就可以了,不必修改硬件時間。將時區(qū)信息文件拷貝至/etc/localtime下,將上海時區(qū)拷貝至/etc下。文章來源:http://www.zghlxwxcb.cn/news/detail-659497.html
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime -R
Centos系統(tǒng)修改BIOS硬件時間文章來源地址http://www.zghlxwxcb.cn/news/detail-659497.html
hwclock -w
到了這里,關(guān)于CentOS系統(tǒng)環(huán)境搭建(二)——Centos7設(shè)置時間為網(wǎng)絡時間的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!