centos7 6 實現ntp時間同步服務

2021-09-26 07:35:26 字數 1086 閱讀 8355

一台服務端主機:10.0.0.31

一台客戶端主機:10.0.0.61

兩台主機都安裝ntpdate服務,

安裝命令: yum install -y ntp

配置檔案路徑:/etc/ntp.conf

配置檔案內容

driftfile /var/lib/ntp/drift

restrict default kod nomodify notrap nopeer noquery

restrict -4 default kod nomodify notrap nopeer noquery

restrict 127.0.0.1

restrict -6 ::1

restrict 172.16.1.0 mask 255.255.255.0 nomodify notr

restrict time1.aliyun.com nomodify notrap noquery

restrict ntp1.aliyun.com nomodify notrap noquery

server 127.127.1.0

fudge 127.127.1.0 stratum 8

includefile /etc/ntp/crypto/pw

keys /etc/ntp/keys

裡面配置的允許其他機器同步設定為172.16.1.0這個網段的內網位址同步其本機的時間

配置路徑:/etc/ntp.conf

配置檔案內容:

#只需在配置檔案的server下在加一條**,允許同步10.0.0.31這台主機時間

server 10.0.0.31 iburst

重啟命令:systemctl restart ntpd

在客戶端進行測試:

測試命令:ntpdate 10.0.0.31

在通過date命令檢視當前時間,看是否與服務端時間相同。

centos7 6 更換核心

目標 私有的module在某個版本上出現了問題,需要借助核心本身的工具來幫助除錯這個問題,所以我的目標僅僅是開啟某些除錯選項來除錯問題.所以原始碼仍然選擇了centos release的.國內有一些知名的源,它會和centos的源 進行同步,而因為處於國內,速度非常快。推薦使用tuna 清華 163...

CentOS 7 6編譯安裝LNMP

一 前期準備 1.伺服器以最小化方式安裝centos 7.6 2.配置本地源及安裝epel源 cd etc yum.repos.d vi centos base.repo 增加enable 1 yum install wget wget o etc yum.repos.d centos base.r...

Centos7 6修改網絡卡名稱

centos7.6修改網絡卡名稱 1.修改網絡卡配置檔案名稱 建議備份配置檔案 root 192 cd etc sysconfig network scripts cp a ifcfg ens32 ifcfg eth0 備份配置檔案 root 192 network scripts mv ifcfg...