Skip to content

Commit

Permalink
Auto deploy from GitHub Actions build 443
Browse files Browse the repository at this point in the history
[28a290e] iBug: new-server: Add systemd-timesyncd config
  • Loading branch information
web-flow authored Jul 26, 2024
1 parent 2db3ca1 commit cb255b9
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 11 deletions.
2 changes: 1 addition & 1 deletion search/search_index.json

Large diffs are not rendered by default.

42 changes: 32 additions & 10 deletions workflow/new-server/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2656,19 +2656,41 @@

<h1 id="new-server-setup-checklist">New Server Setup Checklist<a class="headerlink" href="#new-server-setup-checklist" title="Permanent link">&para;</a></h1>
<h2 id="ntp-date">NTP Date<a class="headerlink" href="#ntp-date" title="Permanent link">&para;</a></h2>
<p>Install either <code>chrony</code> or <code>systemd-timesyncd</code>. Usually chrony comes pre-installed so it's easily forgot.</p>
<p>Replace the default NTP pool with USTC's NTP server <code>time.ustc.edu.cn</code>, like this:</p>
<div class="highlight"><table class="highlighttable"><tr><th colspan="2" class="filename"><span class="filename">/etc/chrony/chrony.conf</span></th></tr><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-7">7</a></span>
<span class="normal"><a href="#__codelineno-0-8">8</a></span>
<span class="normal"><a href="#__codelineno-0-9">9</a></span></pre></div></td><td class="code"><div><pre><span></span><code><a id="__codelineno-0-7" name="__codelineno-0-7"></a><span class="c1"># Use Debian vendor zone.</span>
<a id="__codelineno-0-8" name="__codelineno-0-8"></a><span class="c1">#pool 2.debian.pool.ntp.org iburst</span>
<a id="__codelineno-0-9" name="__codelineno-0-9"></a>server<span class="w"> </span>time.ustc.edu.cn<span class="w"> </span>iburst
</code></pre></div></td></tr></table></div>
<p>Install either <code>chrony</code> or <code>systemd-timesyncd</code> (recommended). Usually chrony comes pre-installed so it's easily forgot.</p>
<p>=== "Chrony"</p>
<div class="highlight"><pre><span></span><code>Replace the default NTP pool with USTC&#39;s NTP server `time.ustc.edu.cn`, like this:

```shell title=&quot;/etc/chrony/chrony.conf&quot; linenums=&quot;7&quot;
# Use Debian vendor zone.
#pool 2.debian.pool.ntp.org iburst
server time.ustc.edu.cn iburst
```

Then restart the service:

```shell
systemctl restart chrony
```
</code></pre></div>
<p>=== "systemd-timesyncd"</p>
<div class="highlight"><pre><span></span><code>For Debian 11 and up, we use an override file to configure the NTP server:

```shell title=&quot;/etc/systemd/timesyncd.conf.d/ustc.conf&quot;
[Time]
NTP=time.ustc.edu.cn
```

Then restart the service:

```shell
systemctl restart systemd-timesyncd
```
</code></pre></div>
<h2 id="time-zone">Time zone<a class="headerlink" href="#time-zone" title="Permanent link">&para;</a></h2>
<p>Run <code>dpkg-reconfigure tzdata</code> and select Asia/Shanghai as the timezone. Reboot the server.</p>
<h2 id="use-nft-backend-for-iptables">Use nft-backend for iptables<a class="headerlink" href="#use-nft-backend-for-iptables" title="Permanent link">&para;</a></h2>
<div class="highlight"><pre><span></span><code><a id="__codelineno-1-1" name="__codelineno-1-1" href="#__codelineno-1-1"></a>update-alternatives<span class="w"> </span>--set<span class="w"> </span>iptables<span class="w"> </span>/usr/sbin/iptables-nft
<a id="__codelineno-1-2" name="__codelineno-1-2" href="#__codelineno-1-2"></a>update-alternatives<span class="w"> </span>--set<span class="w"> </span>ip6tables<span class="w"> </span>/usr/sbin/ip6tables-nft
<div class="highlight"><pre><span></span><code><a id="__codelineno-4-1" name="__codelineno-4-1" href="#__codelineno-4-1"></a>update-alternatives<span class="w"> </span>--set<span class="w"> </span>iptables<span class="w"> </span>/usr/sbin/iptables-nft
<a id="__codelineno-4-2" name="__codelineno-4-2" href="#__codelineno-4-2"></a>update-alternatives<span class="w"> </span>--set<span class="w"> </span>ip6tables<span class="w"> </span>/usr/sbin/ip6tables-nft
</code></pre></div>
<h2 id="update-resolvconf">Update resolv.conf<a class="headerlink" href="#update-resolvconf" title="Permanent link">&para;</a></h2>
<h2 id="install-console-setup">Install console-setup<a class="headerlink" href="#install-console-setup" title="Permanent link">&para;</a></h2>
Expand Down

0 comments on commit cb255b9

Please sign in to comment.