Debian でシステム時刻を同期するにはどうすればよいですか? Debian システム時刻設定 (NTP サービス)

A. ソースを更新し、ntpdate をインストールします。

apt-getアップデート

apt-get インストール ntpdate

ntpdate ntp1.aliyun.com

タイムゾーンを変更する

  1. Linux サーバーのタイムゾーンを変更および設定する

    方法 A コマンド:「tzselect」

    方法 B RedHat Linux および CentOS のみ コマンド: 「timeconfig」

    方法 C は Debian コマンド「dpkg-reconfigure tzdata」用です。

/etc/profile を通じて変更します

echo “export TZ='UTC'” >> /etc/profile

source /etc/profile はシステム変数を更新します

この方法を使用してタイムゾーン構成を変更します

[root@Matrix_061001 ~]echo "export TZ='Asia/Shanghai'" >> /etc/profile
[root@Matrix_061001 ~]source /etc/profile

NTP と RTC の時刻同期

[root@Matrix_061001 ~]cat /etc/default/ntpdate
#Configuration script used by ntpdate-sync script

NTPSERVERS="ntp1.aliyun.com"

#Set to "yes" to write time to hardware clock on success
UPDATE_HWC

おすすめ

転載: blog.csdn.net/qq_33468857/article/details/132495221
おすすめ