<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>Owen Young&#x27;s Blog - Debian</title>
    <subtitle>Mainly focus on technology, reading, excerpts, miscellaneous, article review, tool sharing, workflow, inspiration, English learning, attention management, deep work and other directions</subtitle>
    <link rel="self" type="application/atom+xml" href="https://old.owenyoung.com/en/tags/debian/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://old.owenyoung.com"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2022-03-26T00:00:00+00:00</updated>
    <id>https://old.owenyoung.com/en/tags/debian/atom.xml</id>
    <entry xml:lang="en">
        <title>Debian Server Setup</title>
        <published>2021-03-26T00:00:00+00:00</published>
        <updated>2022-03-26T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Owen Young
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://old.owenyoung.com/en/blog/debian-server-setup/"/>
        <id>https://old.owenyoung.com/en/blog/debian-server-setup/</id>
        
        <summary type="html">&lt;blockquote&gt;
&lt;p&gt;For linux common commands, see &lt;a href=&quot;https:&#x2F;&#x2F;old.owenyoung.com&#x2F;dev-tips&#x2F;#linux-common-commands&quot;&gt;开发技巧收藏&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
</summary>
        
        <content type="html" xml:base="https://old.owenyoung.com/en/blog/debian-server-setup/">&lt;blockquote&gt;
&lt;p&gt;For linux common commands, see &lt;a href=&quot;https:&#x2F;&#x2F;old.owenyoung.com&#x2F;dev-tips&#x2F;#linux-common-commands&quot;&gt;开发技巧收藏&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Update Source&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;apt&lt;&#x2F;span&gt;&lt;span&gt; update&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; --yes &lt;&#x2F;span&gt;&lt;span&gt;&amp;amp;&amp;amp; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;apt&lt;&#x2F;span&gt;&lt;span&gt; upgrade&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; --yes
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Install sudo package&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;apt&lt;&#x2F;span&gt;&lt;span&gt; install&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; -y&lt;&#x2F;span&gt;&lt;span&gt; sudo
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Open BBR: &lt;a href=&quot;https:&#x2F;&#x2F;old.owenyoung.com&#x2F;en&#x2F;blog&#x2F;open-bbr-for-debian&#x2F;&quot;&gt;Open BBR for Debian&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Use ssh key login instead of password, for more details see &lt;a rel=&quot;noopener nofollow noreferrer&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.digitalocean.com&#x2F;community&#x2F;tutorials&#x2F;how-to-configure-ssh-key-based-authentication-on-a-linux-server&quot;&gt;How To Configure SSH Key-Based Authentication on a Linux Server&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;In your local machine:&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;ssh-copy-id -i ~&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;.ssh&#x2F;id_rsa.pub username@remote_host
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;blockquote&gt;
&lt;p&gt;This will copy your id_rsa.pub to remote machine &lt;code&gt;~&#x2F;.ssh&#x2F;authorized_keys&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;ol start=&quot;3&quot;&gt;
&lt;li&gt;
&lt;p&gt;Change the default password&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;passwd&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Create an admin group&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;groupadd admin&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Give admin group root access, and no password sudo
&lt;ol&gt;
&lt;li&gt;Backup sudo files &lt;code&gt;cp &#x2F;etc&#x2F;sudoers &#x2F;root&#x2F;sudoers.bak&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Edit the &lt;code&gt;&#x2F;etc&#x2F;sudoers&lt;&#x2F;code&gt; file by typing the command: &lt;code&gt;visudo&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Add &lt;code&gt;%admin ALL=(ALL:ALL) NOPASSWD:ALL&lt;&#x2F;code&gt; after &lt;code&gt;sudo&lt;&#x2F;code&gt; group&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Create a admin group user&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;useradd username -g admin&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Use ssh key login instead of password for normal user&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;ssh-copy-id -i ~&#x2F;.ssh&#x2F;id_rsa.pub username@remote_host&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Login with new normal user &lt;code&gt;ssh username@ip&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Install common utils:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;sudo apt install build-essential software-properties-common curl vim unzip git pkg-config libssl-dev --yes&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Create &lt;code&gt;&#x2F;data&lt;&#x2F;code&gt; for store data files with &lt;code&gt;777&lt;&#x2F;code&gt; permissions, avoid to use &lt;code&gt;&#x2F;home&lt;&#x2F;code&gt; directory&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;You might want to read also:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;old.owenyoung.com&#x2F;en&#x2F;blog&#x2F;shadowsocks-rust-setup-for-debian&#x2F;&quot;&gt;Shadowsocks Rust Setup for Debian&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;old.owenyoung.com&#x2F;en&#x2F;blog&#x2F;caddy2-setup-for-debian&#x2F;&quot;&gt;Caddy2 Setup for Debian&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</content>
    </entry>
</feed>
