linux自动同步时间

手动修改时间

date -s '2023-12-28 13:20:20'

查看当前服务器时间

date

 

使用ntp自动同步时间

ntpdate time.windows.com

sudo ntpdate time.windows.com

若提示the NTP socket is in use,则需要使用命令systemctl stop ntpd.service先停掉ntp,再使用自动同步时间命令

还有一种说法是使用 ntp -u ntp-server,加上-u是为了避免报错“no server suitable for synchronization found。”(目前未遇到此种情况)

 

其他:

安装

sudo yum install ntp

设置时区?

tzselect

设置ntp服务开机不自启动

chkconfig ntpd off

 

NTP服务器(上海) :ntp.api.bz

中国国家授时中心:210.72.145.44

阿里云:ntp1.aliyun.com

美国:time.nist.gov

复旦:ntp.fudan.edu.cn

微软公司授时主机(美国) :time.windows.com

台警大授时中心(台湾):asia.pool.ntp.org

 

posted @   hushuer  阅读(608)  评论(0编辑  收藏  举报
(评论功能已被禁用)
相关博文:
阅读排行:
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· 单线程的Redis速度为什么快?
· 展开说说关于C#中ORM框架的用法!
· Pantheons:用 TypeScript 打造主流大模型对话的一站式集成库
历史上的今天:
2022-12-28 python——random模块
点击右上角即可分享
微信分享提示