Linux-基础-NTP服务

本文介绍Liunx系统中常用的时间管理命令,包括查看系统时间和硬件时间的方法。此外,还详细讲解了NTP服务的概念及其在Liunx系统中的安装配置过程,帮助读者实现网络中各计算机时间的精准同步。

1、Liunx常用时间命令

查看系统时间
date
查看硬件时间
hwclock

2、什么是NTP服务

NTP是网络时间协议(Network Time Protocol),它是用来同步网络中各个计算机的时间的协议。

3、安装配置NTP服务

(1) 查看是否安装NTP服务

rpm -qa|grep ntp

(2) 安装NTP服务

 yum install -y ntp

(3) 常用的时间服务器
可以在 NTP时间源服务器 中获取中国时间源服务器

image.png

(4)同步系统时间

ntpdate  0.cn.pool.ntp.org
hwclock -w 系统时间保存到硬件时间

(5)修改NTP配置文件
配置 vim /etc/ntp.conf ,修改server 为中国服务器

 server 0.cn.pool.ntp.org iburst
 server 1.cn.pool.ntp.org iburst
 server 2.cn.pool.ntp.org iburst
server 3.cn.pool.ntp.org iburst

(6)启动NTP服务

systemctl start ntpd.service 

(7)设置开机启动

systemctl enable ntpd.service
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值