0
点赞
收藏
分享

微信扫一扫

linux下ntp时间服务

李雨喵 2022-01-13 阅读 244

ntp时间服务

1.linux常用时间命令

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

2.安装部署ntp服务

    1、查看是否安装ntp服务
    rpm -qa|grep ntp

    2、安装ntp服务
    yum install -y ntp

    3、同步系统时间
    ntpdate  0.cn.pool.ntp.org
    hwclock -w  # 系统时间保存到硬件时间

    4、修改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

    5、启动ntp服务
    systemctl start ntpd.service 

    6、设置开机启动
    systemctl enable ntpd.service
    
举报

相关推荐

0 条评论