玄箱HGメモ/Debian/NTP導入
緑文字が入力コマンド。
NTPクライアントを導入します。
管理者権限(管理者アカウント参照)で作業する必要があります。
KAGUYA:~# aptitude install ntp[ENTER]
NTP導入画面(例)
Reading Package Lists... Done Building Dependency Tree Reading extended state information Initializing package states... Done Reading task descriptions... Done The following NEW packages will be automatically installed: libreadline5 readline-common The following packages have been kept back: adduser apt apt-utils aptitude base-files base-passwd bash bsdmainutils bsdutils console-common console-data console-tools cpio cron debconf debconf-i18n debianutils dhcp-client dpkg dselect e2fslibs e2fsprogs fileutils findutils ftp gcc-3.3-base gettext-base grep groff-base gzip hostname ifupdown info initscripts iptables klogd libacl1 libattr1 libblkid1 libcomerr2 libconsole libdb1-compat libdb3 libdb4.2 libgcc1 libgdbm3 libldap2 liblocale-gettext-perl liblockfile1 liblzo1 libpam-modules libpam-runtime libpam0g libpcre3 libpopt0 libsasl2 libss2 libstdc++2.10-glibc2.2 libstdc++5 libtext-charwidth-perl libtext-iconv-perl libtext-wrapi18n-perl libuuid1 libwrap0 login logrotate make makedev man-db manpages modconf modutils mount nano ncurses-base ncurses-bin net-tools netbase netkit-ping nvi passwd pciutils perl perl-base perl-modules powerpc-utils procps psmisc sed shellutils sysklogd sysv-rc sysvinit tar tasksel tcpd telnetd textutils util-linux whiptail yaboot zlib1g The following NEW packages will be installed: libreadline5 ntp readline-common 0 packages upgraded, 3 newly installed, 0 to remove and 102 not upgraded. Need to get 542kB of archives. After unpacking 1462kB will be used. Do you want to continue? [Y/n/?]
Y[ENTER]
Writing extended state information... Done Get:1 ftp://ftp.dti.ad.jp stable/main readline-common 5.2-2 [50.6kB] Get:2 ftp://ftp.dti.ad.jp stable/main libreadline5 5.2-2 [133kB] Get:3 ftp://ftp.dti.ad.jp stable/main ntp 1:4.2.2.p4+dfsg-2 [358kB] Fetched 542kB in 4s (121kB/s) Selecting previously deselected package readline-common. (Reading database ... 9250 files and directories currently installed.) Unpacking readline-common (from .../readline-common_5.2-2_all.deb) ... Replacing files in old package libreadline4 ... Selecting previously deselected package libreadline5. Unpacking libreadline5 (from .../libreadline5_5.2-2_powerpc.deb) ... Selecting previously deselected package ntp. Unpacking ntp (from .../ntp_1%3a4.2.2.p4+dfsg-2_powerpc.deb) ... Setting up readline-common (5.2-2) ... Setting up libreadline5 (5.2-2) ... Setting up ntp (4.2.2.p4+dfsg-2) ... Starting NTP server: ntpd. Reading Package Lists... Done Building Dependency Tree Reading extended state information Initializing package states... Done Reading task descriptions... Done KAGUYA:~#
玄箱/HGをリブートします。
途中で設定画面が出なかったのでNTPサーバーの設定をします。
NTPサーバーとしてserver ntp.nict.jpとserver ntp.nasa.govを追加してみます。
追加するNTPサーバーはお好みでどうぞ。
元のファイルはとりあえず残しておきます。
KAGUYA:~# cp -p /etc/ntp.conf /etc/ntp.conf._org[ENTER]
KAGUYA:~# vi /etc/ntp.conf[ENTER]
/etc/ntp.confの例
# /etc/ntp.conf, configuration for ntpd driftfile /var/lib/ntp/ntp.drift statsdir /var/log/ntpstats/ statistics loopstats peerstats clockstats filegen loopstats file loopstats type day enable filegen peerstats file peerstats type day enable filegen clockstats file clockstats type day enable # You do need to talk to an NTP server or two (or three). #server ntp.your-provider.example
以下の2行を追加
server ntp.nict.jp server ntp.nasa.gov
# pool.ntp.org maps to more than 300 low-stratum NTP servers. # Your server will pick a different set every time it starts up. # *** Please consider joining the pool! *** # *** <http://www.pool.ntp.org/join.html> *** server 0.debian.pool.ntp.org iburst server 1.debian.pool.ntp.org iburst server 2.debian.pool.ntp.org iburst server 3.debian.pool.ntp.org iburst # By default, exchange time with everybody, but don't allow configuration. # See /usr/share/doc/ntp-doc/html/accopt.html for details. restrict -4 default kod notrap nomodify nopeer noquery restrict -6 default kod notrap nomodify nopeer noquery # Local users may interrogate the ntp server more closely. restrict 127.0.0.1 restrict ::1 # Clients from this (example!) subnet have unlimited access, # but only if cryptographically authenticated #restrict 192.168.123.0 mask 255.255.255.0 notrust # If you want to provide time to your local subnet, change the next line. # (Again, the address is an example only.) #broadcast 192.168.123.255 # If you want to listen to time broadcasts on your local subnet, # de-comment the next lines. Please do this only if you trust everybody # on the network! #disable auth #broadcastclient
設定を有効にするために面倒なので玄箱/HGをリブートします。
設定の確認をします。
管理者権限(管理者アカウント参照)で作業する必要があります。
KAGUYA:~# ntpq -p[ENTER]
NTP設定確認画面(例)
remote refid st t when poll reach delay offset jitter ============================================================================== *ntp-b3.nict.go. .NICT. 1 u 34 64 377 34.625 -82.813 15.662 +ntp-nasa.arc.na .GPS. 1 u 35 64 377 152.041 -83.593 14.923 211.19.56.138 133.243.238.164 2 u 25 64 277 39.956 -81.657 16.139 +ntp.kiba.net 3.245.216.189 2 u 35 64 377 29.947 -99.371 25.926 +sylph.white-voi 150.26.2.66 2 u 33 64 377 37.266 -87.793 17.399 KAGUYA:~#
追加したNTPサーバーっぽい文字列(nictとnasa)が出ているので良しということで。
作業終了です。
以降の作業を行わない場合は管理者アカウント終了してtelnet切断します。
コメントはありません。 コメント/玄箱HGメモ/Debian/NTP導入?
Online: 1