linux:ntp

文書の過去の版を表示しています。


NTPサーバー

$ sudo yum install ntp

設定ファイルのバックアップ。

$ sudo cp /etc/ntp.conf /etc/ntp.conf.org

設定ファイルの修正。

$ sudo vi /etc/ntp.conf
# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
#server 0.fedora.pool.ntp.org iburst
#server 1.fedora.pool.ntp.org iburst
#server 2.fedora.pool.ntp.org iburst
#server 3.fedora.pool.ntp.org iburst
server -4 ntp.nict.jp           # NICT
server -4 ntp.jst.mfeed.ad.jp   # MFEED
server -4 s2csntp.miz.nao.ac.jp # NAO
server -4 ntp.ring.gr.jp        # Ring Server
$ sudo firewall-cmd --permanent --add-service=ntp
$ sudo firewall-cmd --reload
$ sudo systemctl enable ntpd.service

サービスを起動する前に手動で同期しておく。

$ sudo ntpdate ntp.nict.jp
$ sudo systemctl start ntpd.service
  • linux/ntp.1437393935.txt.gz
  • 最終更新: 2019/05/18 02:23
  • (外部編集)