LoginSignup
1
0

More than 5 years have passed since last update.

馬鹿の一つ覚え: UbuntuでNTPサーバ設定

Last updated at Posted at 2017-05-25

Ubuntu 16.04.2 LTSでNTPサーバをインストールし、設定、起動してみた。最近のUbuntuではchkconfigの代わりにsysv-rc-confを使うようなので、これもインストール。ファイアウォール設定はコマンドufwで比較的簡単に行うことができる。このufwは、uncomplicated firewallの略だと思われる。

$ ps -ef | grep ntp
glire    23285 23190  0 10:10 pts/21   00:00:00 grep ntp
$ sudo apt-get -y install ntp
$ ls -l /etc/ntp.conf
-rw-r--r-- 1 root root 2424 Apr  5 22:28 /etc/ntp.conf
$ sudo cp -p /etc/ntp.conf /etc/ntp_20170405.conf
$ sudo vi /etc/ntp.conf
$ sudo systemctl start ntp
$ ntpq -p
$ sudo apt-get -y install sysv-rc-conf
$ sudo sysv-rc-conf --list ntp
ntp          1:off  2:on    3:on    4:on    5:on
$ sudo ufw allow ntp
Rule added
$ sudo ufw status
Status: active

To                         Action      From
--                         ------      ----
22                         ALLOW       Anywhere                  
123                        ALLOW       Anywhere                  

$ ps -ef | grep ntp
ntp      24365     1  0 10:10 ?        00:00:00 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 122:129
glire    27735 23190  0 11:15 pts/21   00:00:00 grep ntp
$ ntpq -p
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0