歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> 學習Linux >> centos7 配置時間同步服務器ntp

centos7 配置時間同步服務器ntp

日期:2017/3/6 9:14:55   编辑:學習Linux

centos7 配置時間同步服務器ntp


centos7 配置時間同步服務器ntp


第一方法: 簡單 高效 沒煩惱 一條命令解決單台server-time
ntpdate -u ntp.api.bz
第二方法:時間服務器:
1) sudo yum install ntp
2)sudo nano /etc/ntp.conf
注釋一行
restrict default ignore
加入一行
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap #服務器的地址
3)sudo nano /etc/ntp/step-tickers
加入一行(也可以在原有基礎上改寫)
pool.ntp.org
這樣每次ntpd啟動時,會自動連接該國際標准時間服務器;
4)sudo systemctl restart ntpd
5)ss -an |grep 123
確保該端口以udp方式開放

6)sudo systemctl enable ntpdate.service (加入開機自啟動)
7)date (檢測時間是否靠譜)
Wed Aug 31 11:45:50 CST 2016

http://xxxxxx/Linuxjc/1155997.html TechArticle

Copyright © Linux教程網 All Rights Reserved