<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
    <channel>
      <title></title>
      <link>https://www.sinankurtulmus.net</link>
      <description></description>
      <generator>Zola</generator>
      <language>en</language>
      <atom:link href="https://www.sinankurtulmus.net/rss.xml" rel="self" type="application/rss+xml"/>
      <lastBuildDate>Thu, 18 Apr 2024 00:00:00 +0000</lastBuildDate>
      <item>
          <title>Automation with Salt (SaltStack)</title>
          <pubDate>Thu, 18 Apr 2024 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://www.sinankurtulmus.net/handbook/salt/</link>
          <guid>https://www.sinankurtulmus.net/handbook/salt/</guid>
          <description xml:base="https://www.sinankurtulmus.net/handbook/salt/">&lt;p&gt; &lt;&#x2F;p&gt;
&lt;p&gt;Salt - also known as SaltStack - is an orchestration tool used for automated configuration management and simultaneous task execution on remote machines.
While &lt;code&gt;salt-ssh&lt;&#x2F;code&gt; is included in recent versions for agentless operation, Salt typically makes use of agents (&lt;em&gt;minions&lt;&#x2F;em&gt;) installed on configured managed systems, which are controlled from a central command server (&lt;em&gt;master&lt;&#x2F;em&gt;)
This guide walks through the steps that are required to establish communication between a master and multiple minions in an agent-based architecture, and provides instructions on how to perform tasks remotely using grains, modules and states.
Further information can be found at &lt;a href=&quot;https:&#x2F;&#x2F;docs.saltproject.io&quot;&gt;docs.saltproject.io&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;In order to better demonstrate the capabilities of Salt, typically, a setup with more than one minion machine is required.
For the purposes of this guide, I will be working with a two machines running CentOS Stream 9, and one machine running Ubuntu 22.04.
One of the CentOS machines will serve as the master, from which commands will be passed to the minions, while the other CentOS machine and the Ubuntu machine will be our minions.
I will be running all three systems as virtual machines (VMs) in VirtualBox on bridged network mode.
This setup can be achieved using physical machines and different Linux distributions as well (some instructions such as package manager commands may be different), so feel free to do so.
What is important is that all three machines have different IP and MAC addresses, and are on the same network. Cloned VMs will not work.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h3 id=&quot;initial-requirements&quot;&gt;Initial Requirements&lt;&#x2F;h3&gt;
&lt;p&gt;To begin, we need to download disk images for &lt;a href=&quot;https:&#x2F;&#x2F;centos.org&#x2F;&quot;&gt;CentOS Stream&lt;&#x2F;a&gt; and &lt;a href=&quot;https:&#x2F;&#x2F;ubuntu.com&quot;&gt;Ubuntu&lt;&#x2F;a&gt;.
We can then create the three virtual machines we need by clicking &quot;New&quot; and following the setup instructions in VirtualBox, and install the operating systems by going through with the graphical installation inside the VMs.
These processes are fairly straightforward and the default settings are most likely fine, but feel free to customize as you see fit.&lt;&#x2F;p&gt;
&lt;div class=&quot;text_img&quot;&gt;&lt;img src=&quot;&#x2F;assets&#x2F;images&#x2F;handbook&#x2F;virtualbox.png&quot;&gt;&lt;&#x2F;div&gt;
&lt;p&gt;Next, we need to configure bridged mode for all the network interfaces.
The default setting uses NAT (network address translation), which puts every VM on its own separate network.
Bridged mode will allow the VM to work with our network interface using the device driver on the host machine, assign it an IP address on the same network using DHCP, and filter packets accordingly.
Therefore, all of our VMs will be on the same network, of which our host machine is also a part.
After going to &quot;Settings&quot;, we can configure bridged mode in the &quot;Network&quot; tab shown below.
For all three VMs, we need to select the &quot;Bridged adapter&quot; setting and choose our regular network interface (which is a wireless interface in my case).&lt;&#x2F;p&gt;
&lt;div class=&quot;text_img&quot;&gt;&lt;img src=&quot;&#x2F;assets&#x2F;images&#x2F;handbook&#x2F;bridged.png&quot;&gt;&lt;&#x2F;div&gt;
&lt;h3 id=&quot;installing-salt&quot;&gt;Installing Salt&lt;&#x2F;h3&gt;
&lt;p&gt;To proceed, Salt needs to be installed.
The project website has instructions for installation using the bootstrap script.
Installation needs to be done on &lt;strong&gt;all three VMs.&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Download the bootstrap script:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@...:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ curl&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;o&lt;&#x2F;span&gt; install-salt.sh&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;L&lt;&#x2F;span&gt; https:&#x2F;&#x2F;bootstrap.saltproject.io&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Make the script executable:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@...:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ chmod +x install-salt.sh&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;div style=&quot;border: 1px solid; padding: 0 25px;&quot;&gt;
&lt;p&gt;For the CentOS minion, simply run the script:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@centos:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ .&#x2F;install-salt.sh&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;For the Ubuntu minion, run with the &lt;code&gt;-P&lt;&#x2F;code&gt; option to install needed packages through &lt;code&gt;pip&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@ubuntu&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ .&#x2F;install-salt.sh&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;P&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;For the master, run with the &lt;code&gt;-M&lt;&#x2F;code&gt; option to install master services as well:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@master&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ .&#x2F;install-salt.sh&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;M&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;&#x2F;div&gt;
&lt;h3 id=&quot;setting-up-the-salt-communication&quot;&gt;Setting up the Salt Communication&lt;&#x2F;h3&gt;
&lt;p&gt;In order to set up the connection between the master and the minions, we need to use the IP of our CentOS master machine, which can be obtained by running &lt;code&gt;ifconfig&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@master:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ ifconfig&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;I will assume that the IP address is &lt;code&gt;192.168.100.100&lt;&#x2F;code&gt;. We need to bind this address as the interface in the master configuration file.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@master:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ vi &#x2F;etc&#x2F;salt&#x2F;master&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Find the &lt;code&gt;interface&lt;&#x2F;code&gt; line, uncomment if necessary, and add the master IP address.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;yaml&quot; class=&quot;language-yaml z-code&quot;&gt;&lt;code class=&quot;language-yaml&quot; data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;&lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;interface&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-numeric z-float z-decimal z-yaml&quot;&gt;192&lt;span class=&quot;z-punctuation z-separator z-decimal z-yaml&quot;&gt;.&lt;&#x2F;span&gt;168.100.100&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Restart the master service to apply the change.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@master:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ systemctl restart salt-master&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Next, for both minions, we need to go into the minion configuration file, find the &lt;code&gt;master&lt;&#x2F;code&gt; line, uncomment if necessary, add the same master IP address, and then restart the minion service for the changes to take effect.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@...:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ vi &#x2F;etc&#x2F;salt&#x2F;minion&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;pre data-lang=&quot;yaml&quot; class=&quot;language-yaml z-code&quot;&gt;&lt;code class=&quot;language-yaml&quot; data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;&lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;master&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-numeric z-float z-decimal z-yaml&quot;&gt;192&lt;span class=&quot;z-punctuation z-separator z-decimal z-yaml&quot;&gt;.&lt;&#x2F;span&gt;168.100.100&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@...:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ systemctl restart salt-minion&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The minions now know the master, but the master does not know the minions. This is because Salt communications are initiated by minions, and this eliminates the need to open ports or alter SELinux configurations on the minions, minimizing the attack surface. Minions will send their keys to the master address in the configuration file (which they should already have after the changes above). We can list the incoming keys with &lt;code&gt;salt-key&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@master:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ salt-key&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;L&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;To accept all keys, run the command below.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@master:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ salt-key&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;A&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The connection should now be established. We can confirm this by pinging the minions from the master using Salt.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@master:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ salt &lt;span class=&quot;z-string z-quoted z-single z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;*&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; test.ping&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h3 id=&quot;salt-grains&quot;&gt;Salt Grains&lt;&#x2F;h3&gt;
&lt;p&gt;Salt uses the &lt;em&gt;grains&lt;&#x2F;em&gt; interface for obtaining information about the underlying system running a minion service.
This is crucial, since we might want to execute different commands depending on what kind of system we are working with.
Grains can provide information about the operating system, kernel, network, cpu, memory and many other properties of the system.
In fact, we can simply return the operating system families of our minions by running the following command on the master.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@master:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ salt &lt;span class=&quot;z-string z-quoted z-single z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;*&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; grains.get &lt;span class=&quot;z-string z-quoted z-single z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;os_family&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;div class=&quot;note&quot;&gt;&lt;small&gt;&lt;b&gt;Note:&lt;&#x2F;b&gt;
Note that we are asking for the OS family, not the OS.
Ubuntu will return &quot;Debian&quot; since it is a Debian-based system.
CentOS Stream, being upstream of Red Hat Enterprise Linux, will return &quot;RedHat&quot;.
&lt;&#x2F;small&gt;&lt;&#x2F;div&gt;
&lt;p&gt;This is useful, as we can now selectively run commands on systems, using Salt&#x27;s &lt;code&gt;-G&lt;&#x2F;code&gt; option for grains, while managing everything from the master.
For example, we can run the &lt;code&gt;yum&lt;&#x2F;code&gt; command - which is the package manager for Red Hat systems - on relevant minions only, without causing errors and unnecessary load on other machines.
In our case, salt should run yum on CentOS only, and make no changes on Ubuntu.
The command below will install the &lt;code&gt;epel-release&lt;&#x2F;code&gt; package for CentOS, which configures the &quot;Extra Packages for Enterprise Linux&quot; repository.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@master:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ salt&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;G&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-quoted z-single z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;os_family:RedHat&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; cmd.run &lt;span class=&quot;z-string z-quoted z-single z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;yum -y install epel-release&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;For a full list all grains and their data, we can run the following command.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@master:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ salt &lt;span class=&quot;z-string z-quoted z-single z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;*&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; grains.items&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h3 id=&quot;execution-modules&quot;&gt;Execution Modules&lt;&#x2F;h3&gt;
&lt;p&gt;Execution modules in Salt are functions that are called by the &lt;code&gt;salt&lt;&#x2F;code&gt; command to perform certain tasks.
In fact, we have already used a module: &lt;code&gt;grains&lt;&#x2F;code&gt; is technically an execution module which is used to interact with grains data.
We can make use of other modules following a similar syntax.
Here is one way to obtain minion IP addresses using the &lt;code&gt;network&lt;&#x2F;code&gt; module.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@master:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ salt &lt;span class=&quot;z-string z-quoted z-single z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;*&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; network.ip_addrs&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This next example makes use of the &lt;code&gt;file&lt;&#x2F;code&gt; module and its &lt;code&gt;file_exists&lt;&#x2F;code&gt; method to check if the &lt;code&gt;.bashrc&lt;&#x2F;code&gt; file for the &lt;code&gt;root&lt;&#x2F;code&gt; account exists on our systems.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@master:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ salt &lt;span class=&quot;z-string z-quoted z-single z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;*&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; file.file_exists &#x2F;root&#x2F;.bashrc&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If true, we could modify the file to add a setting of our own for the next time we log in to the system directly, using the &lt;code&gt;append&lt;&#x2F;code&gt; method of the same module.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@master:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ salt &lt;span class=&quot;z-string z-quoted z-single z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;*&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; file.append &#x2F;root&#x2F;.bashrc &lt;span class=&quot;z-string z-quoted z-double z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;alias grep=&amp;#39;grep --color=auto&amp;#39;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Next, leveraging grain data, we can check if the &lt;code&gt;epel-release&lt;&#x2F;code&gt; package was installed successfully.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@master:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ salt&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;G&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-quoted z-single z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;os_family:RedHat&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; pkg.list_pkgs&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-logical z-pipe z-shell&quot;&gt;|&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;grep&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt;&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;A&lt;&#x2F;span&gt; 1 &lt;span class=&quot;z-string z-quoted z-double z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;epel-release&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;In fact, the &lt;code&gt;pkg&lt;&#x2F;code&gt; module above is a &lt;em&gt;virtual&lt;&#x2F;em&gt; module.
Virtual modules can be used to provide a convenient standard interface for tasks handled by different programs on different systems.
For example, we can install the package &lt;code&gt;nginx&lt;&#x2F;code&gt; on both minions with a single command.
In this case, &lt;code&gt;pkg&lt;&#x2F;code&gt; will internally use &lt;code&gt;apt&lt;&#x2F;code&gt; for Ubuntu, and &lt;code&gt;yum&lt;&#x2F;code&gt;  for CentOS.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@master:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ salt &lt;span class=&quot;z-string z-quoted z-single z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;*&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; pkg.install nginx&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Salt has built-in modules which can be used to perform a variety of tasks on target machines.
A full list of these modules and their usage instructions can be found on the official documentation pages.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;state-files&quot;&gt;State Files&lt;&#x2F;h3&gt;
&lt;p&gt;Execution modules are typically used for executing immediate tasks or gathering information, but in order to define desired states and perform a large number of changes to systems, we need to make use of &lt;em&gt;state files&lt;&#x2F;em&gt;.
State files in Salt have the &lt;code&gt;.sls&lt;&#x2F;code&gt; extension (Structured Layered State), and are written in the YAML format, with the addition of jinja2 templating.
By default, they are stored in the &lt;code&gt;&#x2F;srv&#x2F;salt&lt;&#x2F;code&gt; directory.&lt;&#x2F;p&gt;
&lt;p&gt;States also make use of modules, but state modules and execution modules are not the same.
The official documentation has separate pages for state modules, which can be referred to when working with Salt states.&lt;&#x2F;p&gt;
&lt;p&gt;We can create a simple state file to install &lt;code&gt;git&lt;&#x2F;code&gt; on both minions using the &lt;code&gt;pkg&lt;&#x2F;code&gt; state module.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@master:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ vim &#x2F;srv&#x2F;salt&#x2F;mystate.sls&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;pre data-lang=&quot;yaml&quot; class=&quot;language-yaml z-code&quot;&gt;&lt;code class=&quot;language-yaml&quot; data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;&lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;git&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;pkg.installed&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;To apply a state for all minions, we need to run the following command, giving it the name of our state file without the extension:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@master:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ salt &lt;span class=&quot;z-string z-quoted z-single z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;*&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; state.apply mystate&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We can extend the file to install both &lt;code&gt;git&lt;&#x2F;code&gt; and &lt;code&gt;nginx&lt;&#x2F;code&gt;, and make it look more neat.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;yaml&quot; class=&quot;language-yaml z-code&quot;&gt;&lt;code class=&quot;language-yaml&quot; data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;&lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;packages&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;pkg.installed&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;pkgs&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;      &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;git&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;      &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;nginx&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This time, when we apply the state file, nothing will be installed.
This is because both packages are already installed on the minions.
Most modules in Salt work in a smart way which ensures that the system is in the desired state.
In this case, Salt will install the desired packages if they are not present on the system, and simply verify without making changes if they already exist.
This reduces overhead, as Salt will not attempt to make changes if the target system is already in the desired state.
It also prevents certain errors which might result from overwriting files or changing existing configurations.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@master:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ salt &lt;span class=&quot;z-string z-quoted z-single z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;*&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; state.apply mystate&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We can also work with the &lt;code&gt;file&lt;&#x2F;code&gt; module in state files, which comes in handy when deploying and managing configuration changes.
To demonstrate, this time we will source a file directly from the master.
We start by making a new directory and creating an exemplary file on our master machine.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@master:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ mkdir &#x2F;srv&#x2F;salt&#x2F;files&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@master:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ echo &lt;span class=&quot;z-string z-quoted z-double z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;Hello Kraken.&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-assignment z-redirection z-shell&quot;&gt;&amp;gt;&lt;&#x2F;span&gt; &#x2F;srv&#x2F;salt&#x2F;files&#x2F;hello&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;To deliver this file to the &lt;code&gt;&#x2F;etc&lt;&#x2F;code&gt; directory on both of our minions, we can apply the following state.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;yaml&quot; class=&quot;language-yaml z-code&quot;&gt;&lt;code class=&quot;language-yaml&quot; data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;&lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;example_file&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;file.managed&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;name&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&#x2F;etc&#x2F;hello&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;source&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;salt:&#x2F;&#x2F;files&#x2F;hello&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;div class=&quot;note&quot;&gt;&lt;small&gt;&lt;b&gt;Note:&lt;&#x2F;b&gt;
The &lt;code&gt;salt:&#x2F;&#x2F;&lt;&#x2F;code&gt; prefix tells Salt to look for the file in the &lt;code&gt;&#x2F;srv&#x2F;salt&lt;&#x2F;code&gt; directory on the master system by default.
This is not the only option; in fact, we can source remote files using &lt;code&gt;http:&#x2F;&#x2F;&lt;&#x2F;code&gt; or &lt;code&gt;ftp:&#x2F;&#x2F;&lt;&#x2F;code&gt; using the exact same syntax.
&lt;&#x2F;small&gt;&lt;&#x2F;div&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@master:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ salt &lt;span class=&quot;z-string z-quoted z-single z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;*&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; state.apply mystate&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Here is another state which we can append to our &lt;code&gt;mystate.sls&lt;&#x2F;code&gt; file.
This one will ensure that the group &lt;code&gt;morgan&lt;&#x2F;code&gt; with the group ID of 1944 exists, and the &lt;code&gt;user&lt;&#x2F;code&gt; morgan with the user ID of 1944, home directory of &lt;code&gt;&#x2F;home&#x2F;morgan&lt;&#x2F;code&gt;, default shell of &lt;code&gt;&#x2F;bin&#x2F;bash&lt;&#x2F;code&gt; and password of &lt;code&gt;captain&lt;&#x2F;code&gt; is also present on the system.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;yaml&quot; class=&quot;language-yaml z-code&quot;&gt;&lt;code class=&quot;language-yaml&quot; data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;&lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;morgan&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;group.present&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;gid&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-numeric z-integer z-decimal z-yaml&quot;&gt;1944&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;user.present&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;gid&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-numeric z-integer z-decimal z-yaml&quot;&gt;1944&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;uid&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-numeric z-integer z-decimal z-yaml&quot;&gt;1944&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;home&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&#x2F;home&#x2F;morgan&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;shell&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&#x2F;bin&#x2F;bash&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;password&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;captain&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;hash_password&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-language z-boolean z-yaml&quot;&gt;True&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@master:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ salt &lt;span class=&quot;z-string z-quoted z-single z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;*&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; state.apply mystate&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h3 id=&quot;pillar-data&quot;&gt;Pillar Data&lt;&#x2F;h3&gt;
&lt;p&gt;In the example above, declaring the password in the state file is not ideal.
This is a good time to introduce &lt;em&gt;pillars&lt;&#x2F;em&gt; in Salt.
Pillars are data structures which allow confidential data to be delivered only to relevant minions in a secure way.
Pillar data stored on the master needs to be made available to the desired minions in the &lt;code&gt;&#x2F;srv&#x2F;pillar&#x2F;top.sls&lt;&#x2F;code&gt; file.&lt;&#x2F;p&gt;
&lt;p&gt;Pillar files also have the &lt;code&gt;.sls&lt;&#x2F;code&gt; extension, and are stored in &lt;code&gt;&#x2F;srv&#x2F;pillar&lt;&#x2F;code&gt; by default.
To proceed, first we need to provide some data - in this case a password which we will use later - in a pillar file.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@master:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ vim &#x2F;srv&#x2F;pillar&#x2F;secret.sls&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We write the following line into the file.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;yaml&quot; class=&quot;language-yaml z-code&quot;&gt;&lt;code class=&quot;language-yaml&quot; data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;&lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;password&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;black&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Next, we need to make the pillar data available to minions.
For demonstration purposes, we will make the &quot;secret&quot; pillar available for the CentOS minion only, and create a new user there while doing nothing for Ubuntu.
Again, we can achieve this by using grains.
Here is the &lt;code&gt;top.sls&lt;&#x2F;code&gt; file for this configuration.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;yaml&quot; class=&quot;language-yaml z-code&quot;&gt;&lt;code class=&quot;language-yaml&quot; data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;&lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;base&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-quoted z-single z-yaml&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-yaml&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;os_family:RedHat&lt;span class=&quot;z-punctuation z-definition z-string z-end z-yaml&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;match&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;grain&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;secret&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;div class=&quot;note&quot;&gt;&lt;small&gt;&lt;b&gt;Note:&lt;&#x2F;b&gt;
We are working with the default environment in Salt, which is called &quot;base&quot;.
&lt;&#x2F;small&gt;&lt;&#x2F;div&gt;
&lt;p&gt;In order to work with this in a state file, we can to make use of conditional statements provided by jinja2.
We go back to our &lt;code&gt;mystate.sls&lt;&#x2F;code&gt; file.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@master:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ vim &#x2F;srv&#x2F;salt&#x2F;mystate.sls&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We add the following lines to the file and apply the state.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;yaml&quot; class=&quot;language-yaml z-code&quot;&gt;&lt;code class=&quot;language-yaml&quot; data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;&lt;span class=&quot;z-meta z-flow-mapping z-yaml&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-mapping z-begin z-yaml&quot;&gt;{&lt;&#x2F;span&gt;% &lt;span class=&quot;z-string z-unquoted z-plain z-in z-yaml&quot;&gt;if grains&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-flow-sequence z-yaml&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-sequence z-begin z-yaml&quot;&gt;[&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted z-single z-yaml&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-yaml&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;os_family&lt;span class=&quot;z-punctuation z-definition z-string z-end z-yaml&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-sequence z-end z-yaml&quot;&gt;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-in z-yaml&quot;&gt;== &amp;#39;RedHat&amp;#39; %&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-mapping z-end z-yaml&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;&lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;kraken&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;group.present&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;gid&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-numeric z-integer z-decimal z-yaml&quot;&gt;2010&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;user.present&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;gid&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-numeric z-integer z-decimal z-yaml&quot;&gt;2010&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;uid&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-numeric z-integer z-decimal z-yaml&quot;&gt;2010&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;home&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&#x2F;home&#x2F;kraken&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;shell&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&#x2F;bin&#x2F;sh&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;password&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-flow-mapping z-yaml&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-mapping z-begin z-yaml&quot;&gt;{&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-flow-mapping z-yaml&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-mapping z-begin z-yaml&quot;&gt;{&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-in z-yaml&quot;&gt;pillar&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-flow-sequence z-yaml&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-sequence z-begin z-yaml&quot;&gt;[&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted z-single z-yaml&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-yaml&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;password&lt;span class=&quot;z-punctuation z-definition z-string z-end z-yaml&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-sequence z-end z-yaml&quot;&gt;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-punctuation z-definition z-mapping z-end z-yaml&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-mapping z-end z-yaml&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;hash_password&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-language z-boolean z-yaml&quot;&gt;True&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;&lt;span class=&quot;z-meta z-flow-mapping z-yaml&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-mapping z-begin z-yaml&quot;&gt;{&lt;&#x2F;span&gt;% &lt;span class=&quot;z-string z-unquoted z-plain z-in z-yaml&quot;&gt;endif %&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-mapping z-end z-yaml&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@master:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ salt &lt;span class=&quot;z-string z-quoted z-single z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;*&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; state.apply mystate&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This will create the &lt;code&gt;kraken&lt;&#x2F;code&gt; group with the group ID of 2010, and the &lt;code&gt;kraken&lt;&#x2F;code&gt; user with the user ID of 2010, home directory of &lt;code&gt;&#x2F;home&#x2F;kraken&lt;&#x2F;code&gt;, default shell of &lt;code&gt;&#x2F;bin&#x2F;sh&lt;&#x2F;code&gt; and password of &lt;code&gt;black&lt;&#x2F;code&gt;, which will be obtained from the pillar file.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;salt-requisites&quot;&gt;Salt Requisites&lt;&#x2F;h3&gt;
&lt;p&gt;You might remember that the &lt;code&gt;hello&lt;&#x2F;code&gt; file that we created and delivered to the minions was actually addressed to the &lt;code&gt;kraken&lt;&#x2F;code&gt; user.
However, we delivered the file to the &lt;code&gt;&#x2F;etc&lt;&#x2F;code&gt; directory on both minions, including the one which does not have the user &lt;code&gt;kraken&lt;&#x2F;code&gt;.
A wiser choice would be to put the file to the user&#x27;s home directory, on the relevant machine.
One way to achieve this would be to use the requisites system to make sure that the user is present before attempting to place a file in her home directory.
This would not only prevent errors on all irrelevant minions, but it would also make sure that the user and the directory are present before the file operation by creating dependencies between states, thereby eliminating the risk of failure due to an inconsistent order of execution.
With these considerations in mind, we can rewrite the state in the following way.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;yaml&quot; class=&quot;language-yaml z-code&quot;&gt;&lt;code class=&quot;language-yaml&quot; data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;&lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;example_file&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;file.managed&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;name&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&#x2F;home&#x2F;kraken&#x2F;hello&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;source&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;salt:&#x2F;&#x2F;files&#x2F;hello&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;require&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;      &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;user&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;kraken&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;There are multiple requisite directives in Salt, and &lt;code&gt;require&lt;&#x2F;code&gt; is only one of them.
In the final section, we will use &lt;code&gt;require&lt;&#x2F;code&gt; as well as &lt;code&gt;watch&lt;&#x2F;code&gt; - a requisite type which allows us to trigger certain actions when certain changes occur.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;setting-up-a-working-web-server&quot;&gt;Setting up a Working Web Server&lt;&#x2F;h3&gt;
&lt;p&gt;As a final example, we will configure and start a Web server on the Ubuntu minion, using some of the modules we have seen so far, and a couple of new concepts.
First, we need a working &lt;code&gt;nginx.conf&lt;&#x2F;code&gt; file.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@master:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ vim &#x2F;srv&#x2F;salt&#x2F;files&#x2F;nginx.conf&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Below is a very minimal configuration.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;txt&quot; class=&quot;language-txt z-code&quot;&gt;&lt;code class=&quot;language-txt&quot; data-lang=&quot;txt&quot;&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;user www-data;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;worker_processes auto;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;events {
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;}
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;http {
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;  server {
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;    listen 80 default_server;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;    root &#x2F;var&#x2F;www&#x2F;hello;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;    index index.html;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;    location &#x2F; {
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;    }
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;  }
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Next, we need a basic &lt;code&gt;index.html&lt;&#x2F;code&gt; file.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@master:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ vim &#x2F;srv&#x2F;salt&#x2F;files&#x2F;index.html&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;pre data-lang=&quot;html&quot; class=&quot;language-html z-code&quot;&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;&lt;span class=&quot;z-text z-html z-basic&quot;&gt;&lt;span class=&quot;z-meta z-tag z-sgml z-doctype z-html&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-begin z-html&quot;&gt;&amp;lt;!&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-declaration z-doctype z-html&quot;&gt;DOCTYPE&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-language z-doctype z-html&quot;&gt;html&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-end z-html&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-html z-basic&quot;&gt;&lt;span class=&quot;z-meta z-tag z-structure z-any z-html&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-begin z-html&quot;&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-tag z-structure z-any z-html&quot;&gt;html&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-end z-html&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-html z-basic&quot;&gt;    &lt;span class=&quot;z-meta z-tag z-structure z-any z-html&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-begin z-html&quot;&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-tag z-structure z-any z-html&quot;&gt;head&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-end z-html&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-html z-basic&quot;&gt;        &lt;span class=&quot;z-meta z-tag z-inline z-any z-html&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-begin z-html&quot;&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-tag z-inline z-any z-html&quot;&gt;title&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-end z-html&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;Hello&lt;span class=&quot;z-meta z-tag z-inline z-any z-html&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-begin z-html&quot;&gt;&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-tag z-inline z-any z-html&quot;&gt;title&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-end z-html&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-html z-basic&quot;&gt;    &lt;span class=&quot;z-meta z-tag z-structure z-any z-html&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-begin z-html&quot;&gt;&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-tag z-structure z-any z-html&quot;&gt;head&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-end z-html&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-html z-basic&quot;&gt;    &lt;span class=&quot;z-meta z-tag z-structure z-any z-html&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-begin z-html&quot;&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-tag z-structure z-any z-html&quot;&gt;body&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-end z-html&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-html z-basic&quot;&gt;        &lt;span class=&quot;z-meta z-tag z-block z-any z-html&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-begin z-html&quot;&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-tag z-block z-any z-html&quot;&gt;p&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-end z-html&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;Configured by Salt.&lt;span class=&quot;z-meta z-tag z-block z-any z-html&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-begin z-html&quot;&gt;&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-tag z-block z-any z-html&quot;&gt;p&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-end z-html&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-html z-basic&quot;&gt;    &lt;span class=&quot;z-meta z-tag z-structure z-any z-html&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-begin z-html&quot;&gt;&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-tag z-structure z-any z-html&quot;&gt;body&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-end z-html&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-html z-basic&quot;&gt;&lt;span class=&quot;z-meta z-tag z-structure z-any z-html&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-begin z-html&quot;&gt;&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-tag z-structure z-any z-html&quot;&gt;html&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-end z-html&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Finally, we put everything together in a Salt state file.
The state file below does the following:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Ensure that our custom Web root directory (&lt;code&gt;&#x2F;var&#x2F;www&#x2F;hello&lt;&#x2F;code&gt;) exists.&lt;&#x2F;li&gt;
&lt;li&gt;Source the &lt;code&gt;index.html&lt;&#x2F;code&gt; file from the master.&lt;&#x2F;li&gt;
&lt;li&gt;Install &lt;code&gt;nginx&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;Source the &lt;code&gt;nginx.conf&lt;&#x2F;code&gt; file from the master (require &lt;code&gt;nginx&lt;&#x2F;code&gt; installation).&lt;&#x2F;li&gt;
&lt;li&gt;Enable the &lt;code&gt;nginx&lt;&#x2F;code&gt; service (require &lt;code&gt;nginx&lt;&#x2F;code&gt; installation).&lt;&#x2F;li&gt;
&lt;li&gt;Reload the service every time the configuration changes.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;pre data-lang=&quot;yaml&quot; class=&quot;language-yaml z-code&quot;&gt;&lt;code class=&quot;language-yaml&quot; data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;&lt;span class=&quot;z-meta z-flow-mapping z-yaml&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-mapping z-begin z-yaml&quot;&gt;{&lt;&#x2F;span&gt;% &lt;span class=&quot;z-string z-unquoted z-plain z-in z-yaml&quot;&gt;if grains&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-flow-sequence z-yaml&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-sequence z-begin z-yaml&quot;&gt;[&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted z-single z-yaml&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-yaml&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;os&lt;span class=&quot;z-punctuation z-definition z-string z-end z-yaml&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-sequence z-end z-yaml&quot;&gt;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-in z-yaml&quot;&gt;== &amp;#39;Ubuntu&amp;#39; %&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-mapping z-end z-yaml&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;&lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;web_root&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;file.directory&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;name&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&#x2F;var&#x2F;www&#x2F;hello&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;makedir&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-language z-boolean z-yaml&quot;&gt;True&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;&lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;web_index&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;file.managed&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;name&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&#x2F;var&#x2F;www&#x2F;hello&#x2F;index.html&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;source&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;salt:&#x2F;&#x2F;files&#x2F;index.html&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;require&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;      &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;file&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;web_root&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;&lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;web_server&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;pkg.installed&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;name&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;nginx&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;file.managed&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;name&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&#x2F;etc&#x2F;nginx&#x2F;nginx.conf&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;source&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;salt:&#x2F;&#x2F;files&#x2F;nginx.conf&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;require&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;      &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;pkg&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;nginx&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;service.running&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;name&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;nginx&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;enable&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-language z-boolean z-yaml&quot;&gt;True&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;reload&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-language z-boolean z-yaml&quot;&gt;True&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;watch&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;      &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;file&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&#x2F;etc&#x2F;nginx&#x2F;nginx.conf&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;require&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;      &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;pkg&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;nginx&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;&lt;span class=&quot;z-meta z-flow-mapping z-yaml&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-mapping z-begin z-yaml&quot;&gt;{&lt;&#x2F;span&gt;% &lt;span class=&quot;z-string z-unquoted z-plain z-in z-yaml&quot;&gt;endif %&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-mapping z-end z-yaml&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We should now have a working Web server on our Ubuntu machine, accessible on port 80!&lt;&#x2F;p&gt;
&lt;div class=&quot;text_img&quot;&gt;&lt;img src=&quot;&#x2F;assets&#x2F;images&#x2F;handbook&#x2F;saltwebserver.png&quot;&gt;&lt;&#x2F;div&gt;
</description>
      </item>
      <item>
          <title>Linux&#x2F;OpenBSD Cheatsheet</title>
          <pubDate>Sat, 04 Nov 2023 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://www.sinankurtulmus.net/handbook/linuxopenbsd-cheatsheet/</link>
          <guid>https://www.sinankurtulmus.net/handbook/linuxopenbsd-cheatsheet/</guid>
          <description xml:base="https://www.sinankurtulmus.net/handbook/linuxopenbsd-cheatsheet/">&lt;p&gt; &lt;&#x2F;p&gt;
&lt;p&gt;Linux and OpenBSD do share a great deal of common commands and core utilities, albeit with different implementations.
However, there are some obvious differences, due to the ways these systems work.
This page contains a cheatsheet for common commands, operations and files on OpenBSD and Linux (primarily Red Hat family) systems, which covers some of these differences.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt; &lt;&#x2F;p&gt;
&lt;h2 id=&quot;general-commands&quot;&gt;General Commands&lt;&#x2F;h2&gt;
&lt;table style=&quot;width: 100%; table-layout: fixed; font-size: 115%;&quot;&gt;
    &lt;tr&gt;
        &lt;th style=&quot;color: #88ccff;&quot;&gt;Linux&lt;&#x2F;th&gt;&lt;th style=&quot;color: #ffaa66;&quot;&gt;OpenBSD&lt;&#x2F;th&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;sudo&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;doas&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;sudo su&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;doas su&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;lsof&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;fstat&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;lsblk&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;sysctl hw.disknames&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;ip a&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;ifconfig&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;lspci&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;pcidump&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;adduser &amp;lt;username&amp;gt;&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;useradd -m &amp;lt;username&amp;gt;&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;deluser &amp;lt;username&amp;gt;&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;userdel &amp;lt;username&amp;gt;&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h2 id=&quot;service-management&quot;&gt;Service Management&lt;&#x2F;h2&gt;
&lt;table style=&quot;width: 100%; table-layout: fixed; font-size: 115%;&quot;&gt;
    &lt;tr&gt;
        &lt;th style=&quot;color: #88ccff;&quot;&gt;Linux&lt;&#x2F;th&gt;&lt;th style=&quot;color: #ffaa66;&quot;&gt;OpenBSD&lt;&#x2F;th&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;systemctl stop &amp;lt;service&amp;gt;&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;rcctl stop &amp;lt;service&amp;gt;&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;systemctl start &amp;lt;service&amp;gt;&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;rcctl start &amp;lt;service&amp;gt;&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;systemctl status &amp;lt;service&amp;gt;&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;rcctl check &amp;lt;service&amp;gt;&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;systemctl reload &amp;lt;service&amp;gt;&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;rcctl reload &amp;lt;service&amp;gt;&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;systemctl enable &amp;lt;service&amp;gt;&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;rcctl enable &amp;lt;service&amp;gt;&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;systemctl disable &amp;lt;service&amp;gt;&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;rcctl disable &amp;lt;service&amp;gt;&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;systemctl restart &amp;lt;service&amp;gt;&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;rcctl restart &amp;lt;service&amp;gt;&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;systemctl list-units --type=service&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;rcctl ls all&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;systemctl list-units --type=service --state=running&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;rcctl ls started&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;systemctl list-units --type=service --state=enabled&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;rcctl ls on&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h2 id=&quot;firewall-networking&quot;&gt;Firewall &amp;amp; Networking&lt;&#x2F;h2&gt;
&lt;table style=&quot;width: 100%; table-layout: fixed; font-size: 115%;&quot;&gt;
    &lt;tr&gt;
        &lt;th style=&quot;color: #88ccff;&quot;&gt;Linux&lt;&#x2F;th&gt;&lt;th style=&quot;color: #ffaa66;&quot;&gt;OpenBSD&lt;&#x2F;th&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;systemctl reload firewalld&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;pfctl -f &#x2F;etc&#x2F;pf.conf&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;systemctl enable firewalld&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;pfctl -e&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;systemctl disable firewalld&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;pfctl -d&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;firewall-cmd --list-all&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;pfctl -sr&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;firewall-cmd --add-port=...&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;vi &#x2F;etc&#x2F;pf.conf&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;firewall-cmd --runtime-to-permanent&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;-&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;systemctl restart network&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;sh &#x2F;etc&#x2F;netstart&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;less &#x2F;var&#x2F;log&#x2F;firewalld&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;tcpdump -n -e -ttt -r &#x2F;var&#x2F;log&#x2F;pflog&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h2 id=&quot;packages-upgrades&quot;&gt;Packages &amp;amp; Upgrades&lt;&#x2F;h2&gt;
&lt;table style=&quot;width: 100%; table-layout: fixed; font-size: 115%;&quot;&gt;
    &lt;tr&gt;
        &lt;th style=&quot;color: #88ccff;&quot;&gt;Linux&lt;&#x2F;th&gt;&lt;th style=&quot;color: #ffaa66;&quot;&gt;OpenBSD&lt;&#x2F;th&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;yum&#x2F;dnf install&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;pkg_add&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;yum&#x2F;dnf update&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;pkg_add -u&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;yum&#x2F;dnf remove&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;pkg_delete&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;yum&#x2F;dnf autoremove&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;pkg_delete -a&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;yum&#x2F;dnf search&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;pkg_info -Q&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;-&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;syspatch -c&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;-&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;syspatch&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;system-upgrade&#x2F;dist-upgrade&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;sysupgrade&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h2 id=&quot;important-files&quot;&gt;Important Files&lt;&#x2F;h2&gt;
&lt;table style=&quot;width: 100%; table-layout: fixed; font-size: 115%;&quot;&gt;
    &lt;tr&gt;
        &lt;th style=&quot;color: #88ccff;&quot;&gt;Linux&lt;&#x2F;th&gt;&lt;th style=&quot;color: #ffaa66;&quot;&gt;OpenBSD&lt;&#x2F;th&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;.bashrc&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;.kshrc&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;&#x2F;etc&#x2F;sudoers&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;&#x2F;etc&#x2F;doas.conf&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;&#x2F;etc&#x2F;sysconfig&#x2F;network-scripts&#x2F;ifcfg-&amp;lt;interface&amp;gt;&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;&#x2F;etc&#x2F;hostname.&amp;lt;interface&amp;gt;&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;&#x2F;etc&#x2F;firewalld&#x2F;firewalld.conf&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;&#x2F;etc&#x2F;pf.conf&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;&#x2F;var&#x2F;log&#x2F;secure&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;&#x2F;var&#x2F;log&#x2F;authlog&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;&#x2F;var&#x2F;log&#x2F;nginx&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td style=&quot;opacity: 75%;&quot;&gt;&lt;code&gt;&#x2F;var&#x2F;www&#x2F;logs&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
</description>
      </item>
      <item>
          <title>Installing and Running umurmur (for Mumble)</title>
          <pubDate>Sun, 20 Aug 2023 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://www.sinankurtulmus.net/handbook/umurmur/</link>
          <guid>https://www.sinankurtulmus.net/handbook/umurmur/</guid>
          <description xml:base="https://www.sinankurtulmus.net/handbook/umurmur/">&lt;p&gt; &lt;&#x2F;p&gt;
&lt;p&gt;Instead of relying on Discord&#x27;s &quot;dedicated&quot; and &quot;private&quot; servers, we can run our own open-source private VoIP server once we have a &lt;a href=&quot;https:&#x2F;&#x2F;www.sinankurtulmus.net&#x2F;handbook&#x2F;vps&#x2F;&quot;&gt;VPS running&lt;&#x2F;a&gt;.
This is, in fact, quite easy to achieve using a lightweight server component designed for Mumble, &lt;code&gt;umurmur&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;For this guide, we will be using an OpenBSD server, but feel free to follow similar steps on Linux.
First, we need to install &lt;code&gt;umurmur&lt;&#x2F;code&gt;, since it is not included in the base install.
A binary package is provided, which can be installed using the package manager.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ pkg_add umurmur&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;It is a good idea to edit the configuration file now to define a password (for users) and an admin password for the server.
16-character random passwords can be generated using the one-liner below.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ tr&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;dc&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-quoted z-single z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;[:graph:][:punct:]&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-numeric z-integer z-decimal z-file-descriptor z-shell&quot;&gt;2&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment z-redirection z-shell&quot;&gt;&amp;gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric z-integer z-decimal z-file-descriptor z-shell&quot;&gt;1&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-assignment z-redirection z-shell&quot;&gt;&amp;lt;&lt;&#x2F;span&gt; &#x2F;dev&#x2F;urandom&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-logical z-pipe z-shell&quot;&gt;|&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;dd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; bs=16 count=1 status=none &lt;span class=&quot;z-constant z-numeric z-integer z-decimal z-file-descriptor z-shell&quot;&gt;2&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment z-redirection z-shell&quot;&gt;&amp;gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric z-integer z-decimal z-file-descriptor z-shell&quot;&gt;1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-logical z-and z-shell&quot;&gt;&amp;amp;&amp;amp;&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-support z-function z-printf z-shell&quot;&gt;printf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-string z-quoted z-double z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;\n&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We can now look for the &lt;code&gt;password&lt;&#x2F;code&gt; and the &lt;code&gt;admin_password&lt;&#x2F;code&gt; directives in the &lt;code&gt;&#x2F;etc&#x2F;umurmur&#x2F;umurmur.con&lt;&#x2F;code&gt; file, and insert our generated passwords.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ vi &#x2F;etc&#x2F;umurmur&#x2F;umurmur.conf&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;pre data-lang=&quot;pl&quot; class=&quot;language-pl z-code&quot;&gt;&lt;code class=&quot;language-pl&quot; data-lang=&quot;pl&quot;&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;&lt;span class=&quot;z-constant z-other z-perl&quot;&gt;password&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment z-perl&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-string z-perl&quot;&gt;&lt;span class=&quot;z-string z-quoted z-double z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;...&lt;span class=&quot;z-punctuation z-definition z-string z-end z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-terminator z-statement z-perl&quot;&gt;;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;&lt;span class=&quot;z-constant z-other z-perl&quot;&gt;admin_password&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment z-perl&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-string z-perl&quot;&gt;&lt;span class=&quot;z-string z-quoted z-double z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;...&lt;span class=&quot;z-punctuation z-definition z-string z-end z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-terminator z-statement z-perl&quot;&gt;;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Feel free to make any other parameter changes that you see fit, or to add&#x2F;remove&#x2F;rename channels.
After saving the file, we can enable and start the &lt;code&gt;umurmurd&lt;&#x2F;code&gt; service to run the server.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ rcctl enable umurmurd&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ rcctl start umurmurd&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We have a running &lt;code&gt;umurmur&lt;&#x2F;code&gt; server!
We can now connect to it from Mumble clients and start voice chatting.
First, we need to install a Mumble client on a client machine.
This should be available on most Linux and BSD systems through the package management system.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;on-openbsd&quot;&gt;On OpenBSD&lt;&#x2F;h3&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@obsd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ doas pkg_add mumble&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h3 id=&quot;on-linux-red-hat-fedora&quot;&gt;On Linux (Red Hat&#x2F;Fedora)&lt;&#x2F;h3&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@linux&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ sudo dnf install mumble&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h3 id=&quot;on-linux-debian-ubuntu&quot;&gt;On Linux (Debian&#x2F;Ubuntu)&lt;&#x2F;h3&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@linux&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ sudo apt install mumble&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h3 id=&quot;on-linux-void&quot;&gt;On Linux (Void)&lt;&#x2F;h3&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@linux&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ sudo xbps-install mumble&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Upon running the client for the first time, Mumble will go through the initial setup for sound settings.
Once the setup is complete, we open the server connections interface.&lt;&#x2F;p&gt;
&lt;div class=&quot;text_img&quot;&gt;&lt;img src=&quot;&#x2F;assets&#x2F;images&#x2F;handbook&#x2F;mumbleconnect.png&quot;&gt;&lt;&#x2F;div&gt;
&lt;p&gt;Then, we add a new server, and fill in the public IP address of our server.
The default port is &lt;code&gt;64738&lt;&#x2F;code&gt;, which is the port our server uses.
The username and the label can be set to anything.&lt;&#x2F;p&gt;
&lt;div class=&quot;text_img&quot;&gt;&lt;img src=&quot;&#x2F;assets&#x2F;images&#x2F;handbook&#x2F;mumbleparams.png&quot;&gt;&lt;&#x2F;div&gt;
&lt;p&gt;After adding the server, we click the &lt;strong&gt;Connect&lt;&#x2F;strong&gt; button.&lt;&#x2F;p&gt;
&lt;p&gt;We are now connected to the server, and we can start chatting!&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>A Brief Apologia for Wine</title>
          <pubDate>Mon, 15 May 2023 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://www.sinankurtulmus.net/blog/wine/</link>
          <guid>https://www.sinankurtulmus.net/blog/wine/</guid>
          <description xml:base="https://www.sinankurtulmus.net/blog/wine/">&lt;p&gt; &lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;I recently traveled to Georgia, where I had the blessing of attending the Paschal Divine Liturgy at the &lt;a href=&quot;https:&#x2F;&#x2F;www.sinankurtulmus.net&#x2F;gallery&#x2F;travel&#x2F;sameba-cathedral1.jpg&quot;&gt;Holy Trinity Cathedral&lt;&#x2F;a&gt; of Tbilisi, as well as visiting a number of sacred places including the breathtaking &lt;a href=&quot;https:&#x2F;&#x2F;www.sinankurtulmus.net&#x2F;gallery&#x2F;travel&#x2F;gergeti-trinity-church.jpg&quot;&gt;Gergeti Trinity Church&lt;&#x2F;a&gt;.
I must say that Georgia is a fascinating place; it is one of the oldest Christian countries in the world, home to perhaps the most beautiful and unique musical tradition and sacred hymnody in all of Christendom, and the birthplace of wine.
I have tremendous respect for this small nation, and for all that they have kept in the face of dire circumstances.&lt;&#x2F;p&gt;
&lt;p&gt;On Bright Monday, I arrived in &lt;em&gt;Stepantsminda&lt;&#x2F;em&gt;, a small town at the foot of the Caucasus Mountains which is the hub for travelers who want to visit the Gergeti Trinity Church.
The weather was unusually clear, so much so that it even had the Georgians in awe as Mount Kazbek, standing at over 5000 meters above sea level, seemed to be right before our eyes.
The dirt road up to the church is steep, curvy and bumpy so we took a 4x4 ride from Stepantsminda, which has the added benefit of supporting the local economy during the off-season when the tourism stagnates.&lt;&#x2F;p&gt;
&lt;p&gt;That was the first time I heard about Georgians eating and drinking in cemeteries where they are close to the faithful departed - their loved ones who have passed away - particularly after Pascha and during Pentecostarion, as our driver enthusiastically told us about this tradition that is a proclamation Jesus Christ&#x27;s victory over death, with his fervent hope invigorated in the Resurrection.
&lt;strong&gt;For He is not a God of the dead, but of the living: for all live unto Him&lt;&#x2F;strong&gt; (Luke 20:38).&lt;&#x2F;p&gt;
&lt;p style=&quot;color: #ff0000; text-align: center&quot;&gt;&lt;i&gt;Christ is Risen!&lt;&#x2F;i&gt;&lt;&#x2F;p&gt;
&lt;p&gt;From the moment you step on Georgian soil, it becomes clear that wine has a special place in the culture.
It is a symbol of hospitality and friendship.
As the liturgical calendar of the Orthodox Church goes through periods of fasts where we physically and spiritually prepare ourselves with discipline, and feasts where we commemorate great events as God&#x27;s plan unfolds, we are given the chance to reflect on the value of the blessings that we have, and the things that ought to be celebrated.
For a faithful community, wine is also a beautiful symbol of joyous celebration.&lt;&#x2F;p&gt;
&lt;p&gt;Yet, the consumption of wine and other alcoholic beverages is frowned upon by many due to adverse health effects and behavioral concerns related to excessive imbibition.
Of course, moderation is crucial as is the case with anything, but we do not categorically reject bread simply because eating too much of it causes lethargy and obesity.
The secular world however, as far as I am concerned, is at odds with what wine represents as it pertains to our connection with one another, and our link to the past which we hold in reverence.
It reduces wine to a societal hazard - to a chemical substance with damaging effects and no benefit except for some fleeting carnal pleasure that it brings, which the contemporary ethos implicity despises in its own circular and self-defeating ways.
At the crossroads of unapologetic hedonism and arbitrary moral orientations, an age-old tradition that is ingrained in our philosophy of beauty and practiced in diligent enthusiasm and productive zeal is stripped of its symbolic meaning in a communal sense.
I believe it is at this point that the contemplative individual might feel compelled to reject this vulgar habit altogether, since we are all called to uphold virtue over vice.&lt;&#x2F;p&gt;
&lt;p&gt; &lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;...Do you think we should censure silver and gold because of greedy men, food because of gluttons, wine because of drunkards, attractive women because of fornicators and adulterers, and so on?&lt;&#x2F;em&gt;
&lt;em&gt;Especially since you recognize that the physician makes good use of fire whereas the poisoner makes evil use of bread!&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;St. Augustine of Hippo&lt;&#x2F;strong&gt;&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt; &lt;&#x2F;p&gt;
&lt;p&gt;I do not believe that antagonizing the substance itself is appropriate here.
Wine has accompanied human endeavour in good times and bad, and our complicated relationship with it comes into view throughout the Holy Scripture.
While its subversive effects on a mind that is slave to sin are undeniable, it can also amplify the good, stimulate fruitful discussions and inspire wonderful relationships when the mind is free and properly oriented.
I believe this has everything to do with how admiration of beauty unlocks a new dimension in our human experience, bringing the roses back to our cheeks.&lt;&#x2F;p&gt;
&lt;p&gt;The late Sir Roger Scruton introduces his wonderful book&lt;sup&gt;1&lt;&#x2F;sup&gt; as a tribute to pleasure, by a devotee of happiness, and a defence of virtue by an escapee from vice, addresing it to &quot;every thinking person in whom the joy of meditation has not extinguished the pleasures of embodiment&quot;.
At times, we are reminded that there is a natural, good and appropriate way to experience pleasure, through the appreciation of beauty and truth, and subordination to our love for God.
Although pleasure unto itself is just incoherent at best and a recipe for destruction at worst, while a life without pleasure is quite unpleasant, God is the primary principle brings everything together.
He has bestowed us with winemaking and the Logos has made sense of it, in Scripture and in liturgical life.&lt;&#x2F;p&gt;
&lt;p&gt;For the ancients, alcoholic beverages were an indispensable part of civilization.
It is more likely than one might think that our ancestors settled down and began practicing agriculture primarily for the production of fermented drinks, be it wine or beer.
Historical findings from ancient Mesopotamia seems to suggest that the timeline checks out.
In an era where diseases ran rampant, sanitary conditions were different, and most of the water that could be collected was unfit for human consumption, fermented drinks became the &quot;water of life&quot; for the people.
In ancient Egypt, the Nile was so contaminated that making beer was the only safe way of drinking the water from it.
The beer tasted bad (really bad).
They mixed in some spices to make it less unpleasant: Typically some combination of cassia, coriander and cardamom.
Then, it tasted a little bit better.
The desire for beauty found its appropriate place in the collective struggle to preserve and honor the life that we are given.
The ancient Greeks (and perhaps many others) worshipped an Unkown God along with many other gods, and one of the most important among them was Dionysus (also called Bacchus in Rome), the god of wine.
Many other traditions had their deities of viticulture.&lt;&#x2F;p&gt;
&lt;p&gt;Then the true God walked on the Earth, who was made known to the Greeks by the Apostle (&lt;a href=&quot;https:&#x2F;&#x2F;biblia.com&#x2F;books&#x2F;nkjv&#x2F;Ac17.16-34&quot;&gt;Acts 17:16-34&lt;&#x2F;a&gt;).
He transformed water into wine (&lt;a href=&quot;https:&#x2F;&#x2F;biblia.com&#x2F;books&#x2F;nkjv&#x2F;Jn2.1-11&quot;&gt;John 2:1-11&lt;&#x2F;a&gt;).
He ate and He drank, and He was accused of gluttony and drunkenness (&lt;a href=&quot;https:&#x2F;&#x2F;biblia.com&#x2F;books&#x2F;nkjv&#x2F;Mt11.19&quot;&gt;Matthew 11:19&lt;&#x2F;a&gt;, &lt;a href=&quot;https:&#x2F;&#x2F;biblia.com&#x2F;books&#x2F;nkjv&#x2F;Lk7.34&quot;&gt;Luke 7:34&lt;&#x2F;a&gt;).&lt;&#x2F;p&gt;
&lt;p&gt; &lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;And as they were eating, Jesus took bread, and blessed it, and brake it, and gave it to the disciples, and said, Take, eat; this is my body.&lt;&#x2F;em&gt;
&lt;em&gt;And He took the cup, and gave thanks, and gave it to them, saying, Drink ye all of it; For this is my blood of the new testament, which is shed for many for the remission of sins.&lt;&#x2F;em&gt;
&lt;em&gt;But I say unto you, I will not drink henceforth of this fruit of the vine, until that day when I drink it new with you in my Father’s kingdom.&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Matthew 26:26-29&lt;&#x2F;strong&gt;&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt; &lt;&#x2F;p&gt;
&lt;p&gt;The Eucharist is at the very center of the liturgical life of the Orthodox Church.
Jesus chose bread and wine as the offerings, both of which are deeply symbolic in mysterious ways and frequently mentioned in Scripture.
They are gifts that we receive in the form of the seed; we renew them, process them, elevate them, and offer them back to God.
This is not to be frowned upon; since man is created in the image of God, he is called to replenish the Earth, and subdue it (&lt;a href=&quot;https:&#x2F;&#x2F;biblia.com&#x2F;books&#x2F;nkjv&#x2F;Ge1.26-28&quot;&gt;Genesis 1:26-28&lt;&#x2F;a&gt;).
In the Eucharist, which is more than a symbol or a mere commemoration of events, the offerings - the bread and the wine - are then mystically transformed into the real body and blood of Jesus Christ.
During the Liturgy, through its divine power, we are projected to the point where eternity cuts across time, and at this point we become true &lt;em&gt;contemporaries&lt;&#x2F;em&gt; with the events which we commemorate&lt;sup&gt;2&lt;&#x2F;sup&gt;.
The substance, the symbol of ages, is transformed into the truth, and it gives life (&lt;a href=&quot;https:&#x2F;&#x2F;biblia.com&#x2F;books&#x2F;nkjv&#x2F;Jn6.51-58&quot;&gt;John 6:51-58&lt;&#x2F;a&gt;).&lt;&#x2F;p&gt;
&lt;p&gt;In my humble opinion, wine is one of our stronger connections to the past, a richly symbolic chapter in our story, and a catalyst for good conversations and friendships in the future when partaken of in moderation.
May the Lord sanctify our souls, hallow our bodies, correct our thoughts, cleanse our minds; deliver us from all tribulation, evil and distress.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;&lt;sup&gt;1&lt;&#x2F;sup&gt; &lt;small&gt;Scruton, Roger. &lt;em&gt;I Drink Therefore I am: A Philosopher&#x27;s Guide to Wine&lt;&#x2F;em&gt;. Bloomsbury, 2009.&lt;&#x2F;small&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;sup&gt;2&lt;&#x2F;sup&gt; &lt;small&gt;Ware, Kallistos. &lt;em&gt;The Orthodox Church&lt;&#x2F;em&gt;. Penguin, 1993.&lt;&#x2F;small&gt;&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Wireguard VPN for OpenBSD&#x2F;Linux</title>
          <pubDate>Sun, 19 Jun 2022 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://www.sinankurtulmus.net/handbook/wireguard/</link>
          <guid>https://www.sinankurtulmus.net/handbook/wireguard/</guid>
          <description xml:base="https://www.sinankurtulmus.net/handbook/wireguard/">&lt;p&gt; &lt;&#x2F;p&gt;
&lt;p&gt;Wireguard is a simple VPN (Virtual Private Network) protocol known for its speed and security.
It has been implemented in the Linux kernel as well as in OpenBSD.
This is a guide on how to set up a Wireguard connection between two devices (an OpenBSD server and a Linux client) and a DNS resolver, in order to securely tunnel the traffic while using insecure public networks, or in any other case where it might be needed.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;The official website of Wireguard includes a &lt;a href=&quot;https:&#x2F;&#x2F;www.wireguard.com&#x2F;#conceptual-overview&quot;&gt;conceptual overview&lt;&#x2F;a&gt; section and other links where the protocol is explained in more detail.
What we need to do is generate keypairs for our server and our client (which are not taxonomically different in terms of how their configurations are handled), add the client as a peer on the server configuration, and add the server as a peer on the client configuration.
Multiple peers may be added on the server to allow more client connections.&lt;&#x2F;p&gt;
&lt;p&gt;We begin by generating a base64 encoded 32-byte string that Wireguard can use as our private key.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@openbsd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ openssl rand&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;base64&lt;&#x2F;span&gt; 32 &lt;span class=&quot;z-keyword z-operator z-assignment z-redirection z-shell&quot;&gt;&amp;gt;&lt;&#x2F;span&gt; wg0.key&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The private key is now stored in the &lt;code&gt;wg0.key&lt;&#x2F;code&gt; file. We change the file permissions for good measure.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@openbsd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ chmod 600 wg0.key&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Next, we create a network interface for Wireguard associating it with the private key we generated.
We can also change the port for some obscurity, instead of using the default which is 51820. I chose 50101 in this case.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@openbsd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ doas ifconfig wg0 create wgport 50101 wgkey &lt;span class=&quot;z-meta z-group z-expansion z-command z-backticks z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-group z-begin z-shell&quot;&gt;`&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;cat&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; wg0.key&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-group z-end z-shell&quot;&gt;`&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We can now verify that the interface was created with &lt;code&gt;ifconfig&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@openbsd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ doas ifconfig&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The &lt;code&gt;wg0&lt;&#x2F;code&gt; interface should appear in the output.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;txt&quot; class=&quot;language-txt z-code&quot;&gt;&lt;code class=&quot;language-txt&quot; data-lang=&quot;txt&quot;&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;wg0: ...
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;...
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;    wgpubkey: &amp;lt;server-public-key&amp;gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;...
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The output should contain the public key that is extracted from the private key, on the line starting with &lt;code&gt;wgpubkey&lt;&#x2F;code&gt;. We note down this key.&lt;&#x2F;p&gt;
&lt;p&gt;We also need to assign an IP address to the server for the VPN tunnel. I&#x27;m using the 10.0.0.0&#x2F;24 subnet since it is available and reserved for private networks. You can use another subnet if this one not available for your network.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@openbsd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ doas ifconfig wg0 10.0.0.1 netmask 255.255.255.0&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Now we move on to the Linux client to set up the interface.&lt;&#x2F;p&gt;
&lt;p&gt;Here, we install the &lt;code&gt;wireguard-tools&lt;&#x2F;code&gt; package since it makes things easier. I am using Void Linux; you can use the package manager of your distribution.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@void&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ sudo xbps-install&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;Su&lt;&#x2F;span&gt; wireguard-tools&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;div class=&quot;note&quot;&gt;&lt;small&gt;&lt;b&gt;Note:&lt;&#x2F;b&gt; It is also possible to use &lt;code&gt;wireguard-tools&lt;&#x2F;code&gt; on OpenBSD, but unnecessary in my opinion since the OpenBSD implementation is very simple.&lt;&#x2F;small&gt;&lt;&#x2F;div&gt;
&lt;p&gt;We create a new Wireguard interface. This time we do not need to specify a wg port, as we do not need to handle incoming connections on the client for this setup.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@void&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ sudo ip link add dev wg0 type wireguard&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We also assign a different IP address for this endpoint, again on the 10.0.0.0&#x2F;24 subnet.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@void&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ sudo ip address add dev wg0 10.0.0.2&#x2F;24&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This time, we generate a key using the &lt;code&gt;wg&lt;&#x2F;code&gt; command from &lt;code&gt;wireguard-tools&lt;&#x2F;code&gt; and add it to the wg0 interface on our client. It is possible to use &lt;code&gt;openssl&lt;&#x2F;code&gt; for this as well.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@void&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ wg genkey &lt;span class=&quot;z-keyword z-operator z-assignment z-redirection z-shell&quot;&gt;&amp;gt;&lt;&#x2F;span&gt; wg0.key&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@void&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ chmod 600 wg0.key&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@void&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ sudo wg set wg0 private-key wg0.key&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Next up, we need to connect the client and the server.
For this step, we need the public keys in order to add peers.
We can check the public key that was extracted from the private key for our client.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@void&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ sudo wg&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The public key appears in the output. We note this key down.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;txt&quot; class=&quot;language-txt z-code&quot;&gt;&lt;code class=&quot;language-txt&quot; data-lang=&quot;txt&quot;&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;interface: wg0
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;    public key: &amp;lt;client-public-key&amp;gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;    private key: (hidden)
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;First, we add our server as a peer on the client, using the server public key we obtained earlier.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@void&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ sudo wg set wg0 peer &lt;span class=&quot;z-keyword z-operator z-assignment z-redirection z-shell&quot;&gt;&amp;lt;&lt;&#x2F;span&gt;server-public-key&lt;span class=&quot;z-keyword z-operator z-assignment z-redirection z-shell&quot;&gt;&amp;gt;&lt;&#x2F;span&gt; allowed-ips 0.0.0.0&#x2F;0 endpoint &lt;span class=&quot;z-keyword z-operator z-assignment z-redirection z-shell&quot;&gt;&amp;lt;&lt;&#x2F;span&gt;server-public-IP&lt;span class=&quot;z-keyword z-operator z-assignment z-redirection z-shell&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;:50101&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This specifies the peer public key, the allowed IP addresses and the server endpoint including the IP address and the port.&lt;&#x2F;p&gt;
&lt;div class=&quot;note&quot;&gt;&lt;small&gt;&lt;b&gt;Note:&lt;&#x2F;b&gt; &lt;code&gt;allowed-ips&lt;&#x2F;code&gt; is set to 0.0.0.0&#x2F;0, which means all IP addresses. This tells Wireguard to send packages destined for any IP address over the tunnel. Therefore, all traffic while browsing the Internet goes through Wireguard.&lt;&#x2F;small&gt;&lt;&#x2F;div&gt;
&lt;p&gt;Now we write all of this to a configuration file on the Linux client, in order to be able to quickly set up the interface and initiate the connection in the future.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@void&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ sudo mkdir&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;p&lt;&#x2F;span&gt; &#x2F;etc&#x2F;wireguard&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@void&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ sudo vim &#x2F;etc&#x2F;wireguard&#x2F;wg0.conf&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Here is the configuration including all the information.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;ini&quot; class=&quot;language-ini z-code&quot;&gt;&lt;code class=&quot;language-ini&quot; data-lang=&quot;ini&quot;&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;&lt;span class=&quot;z-storage z-type z-genconfig&quot;&gt;[Interface]
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;&lt;span class=&quot;z-meta z-param z-genconfig&quot;&gt;&lt;span class=&quot;z-variable z-parameter z-genconfig&quot;&gt;PrivateKey&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-genconfig&quot;&gt;=&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-genconfig&quot;&gt;&amp;lt;&lt;&#x2F;span&gt;client&lt;span class=&quot;z-keyword z-operator z-genconfig&quot;&gt;-&lt;&#x2F;span&gt;private&lt;span class=&quot;z-keyword z-operator z-genconfig&quot;&gt;-&lt;&#x2F;span&gt;key&lt;span class=&quot;z-keyword z-operator z-genconfig&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;&lt;span class=&quot;z-meta z-param z-genconfig&quot;&gt;&lt;span class=&quot;z-variable z-parameter z-genconfig&quot;&gt;Address&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-genconfig&quot;&gt;=&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-ip z-genconfig&quot;&gt;&lt;span class=&quot;z-constant z-other z-genconfig&quot;&gt;10.0.0.2&#x2F;24&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;&lt;span class=&quot;z-support z-constant z-genconfig&quot;&gt;DNS&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-genconfig&quot;&gt;=&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-ip z-genconfig&quot;&gt;&lt;span class=&quot;z-constant z-other z-genconfig&quot;&gt;10.0.0.1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;&lt;span class=&quot;z-storage z-type z-genconfig&quot;&gt;[Peer]
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;&lt;span class=&quot;z-meta z-param z-genconfig&quot;&gt;&lt;span class=&quot;z-variable z-parameter z-genconfig&quot;&gt;PublicKey&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-genconfig&quot;&gt;=&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-genconfig&quot;&gt;&amp;lt;&lt;&#x2F;span&gt;server&lt;span class=&quot;z-keyword z-operator z-genconfig&quot;&gt;-&lt;&#x2F;span&gt;public&lt;span class=&quot;z-keyword z-operator z-genconfig&quot;&gt;-&lt;&#x2F;span&gt;key&lt;span class=&quot;z-keyword z-operator z-genconfig&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;&lt;span class=&quot;z-meta z-param z-genconfig&quot;&gt;&lt;span class=&quot;z-variable z-parameter z-genconfig&quot;&gt;AllowedIPs&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-genconfig&quot;&gt;=&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-ip z-genconfig&quot;&gt;&lt;span class=&quot;z-constant z-other z-genconfig&quot;&gt;0.0.0.0&#x2F;0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;&lt;span class=&quot;z-meta z-param z-genconfig&quot;&gt;&lt;span class=&quot;z-variable z-parameter z-genconfig&quot;&gt;Endpoint&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-genconfig&quot;&gt;=&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-genconfig&quot;&gt;&amp;lt;&lt;&#x2F;span&gt;server&lt;span class=&quot;z-keyword z-operator z-genconfig&quot;&gt;-&lt;&#x2F;span&gt;public&lt;span class=&quot;z-keyword z-operator z-genconfig&quot;&gt;-&lt;&#x2F;span&gt;&lt;span class=&quot;z-support z-constant z-genconfig&quot;&gt;IP&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-genconfig&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;&lt;span class=&quot;z-meta z-param z-genconfig&quot;&gt;&lt;span class=&quot;z-variable z-parameter z-genconfig&quot;&gt;PersistentKeepalive&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-genconfig&quot;&gt;=&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-numeric z-genconfig&quot;&gt;25&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;div class=&quot;note&quot;&gt;&lt;small&gt;&lt;b&gt;Note:&lt;&#x2F;b&gt; Notice the &lt;code&gt;DNS&lt;&#x2F;code&gt; line in the configuration file. We will be setting up a DNS resolver on our server with &lt;code&gt;unbound&lt;&#x2F;code&gt; later. This is recommended, since your queries will go over your ISP&#x27;s default DNS servers otherwise, which defeats the purpose of using a VPN for privacy in most cases. If this is not what you want, you should omit this line so that you can keep using the default DNS settings.&lt;&#x2F;small&gt;&lt;&#x2F;div&gt;
&lt;p&gt;Next, we add the client as a peer on our OpenBSD server, and make the configuration persistent across reboots by creating a &lt;code&gt;hostname&lt;&#x2F;code&gt; file for the interface.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@openbsd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ doas ifconfig wg0 wgpeer &lt;span class=&quot;z-keyword z-operator z-assignment z-redirection z-shell&quot;&gt;&amp;lt;&lt;&#x2F;span&gt;client-public-key&lt;span class=&quot;z-keyword z-operator z-assignment z-redirection z-shell&quot;&gt;&amp;gt;&lt;&#x2F;span&gt; wgaip 10.0.0.2&#x2F;24&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@openbsd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ doas vi &#x2F;etc&#x2F;hostname.wg0&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Here is what we should write in &lt;code&gt;hostname.wg0&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;vim&quot; class=&quot;language-vim z-code&quot;&gt;&lt;code class=&quot;language-vim&quot; data-lang=&quot;vim&quot;&gt;&lt;span class=&quot;z-source z-viml&quot;&gt;inet &lt;span class=&quot;z-constant z-numeric z-integer&quot;&gt;10&lt;&#x2F;span&gt;&lt;span class=&quot;z-storage z-function z-viml&quot;&gt;.&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric z-integer&quot;&gt;0&lt;&#x2F;span&gt;&lt;span class=&quot;z-storage z-function z-viml&quot;&gt;.&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric z-integer&quot;&gt;0&lt;&#x2F;span&gt;&lt;span class=&quot;z-storage z-function z-viml&quot;&gt;.&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric z-integer&quot;&gt;1&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-numeric z-integer&quot;&gt;255&lt;&#x2F;span&gt;&lt;span class=&quot;z-storage z-function z-viml&quot;&gt;.&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric z-integer&quot;&gt;255&lt;&#x2F;span&gt;&lt;span class=&quot;z-storage z-function z-viml&quot;&gt;.&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric z-integer&quot;&gt;255&lt;&#x2F;span&gt;&lt;span class=&quot;z-storage z-function z-viml&quot;&gt;.&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric z-integer&quot;&gt;0&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-viml&quot;&gt;wgkey &lt;span class=&quot;z-support z-type z-viml&quot;&gt;&amp;lt;server-private-key&amp;gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-viml&quot;&gt;wgport &lt;span class=&quot;z-constant z-numeric z-integer&quot;&gt;50101&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-viml&quot;&gt;wgpeer &lt;span class=&quot;z-support z-type z-viml&quot;&gt;&amp;lt;client-public-key&amp;gt;&lt;&#x2F;span&gt; wgaip &lt;span class=&quot;z-constant z-numeric z-integer&quot;&gt;10&lt;&#x2F;span&gt;&lt;span class=&quot;z-storage z-function z-viml&quot;&gt;.&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric z-integer&quot;&gt;0&lt;&#x2F;span&gt;&lt;span class=&quot;z-storage z-function z-viml&quot;&gt;.&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric z-integer&quot;&gt;0&lt;&#x2F;span&gt;&lt;span class=&quot;z-storage z-function z-viml&quot;&gt;.&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric z-integer&quot;&gt;2&lt;&#x2F;span&gt;&#x2F;&lt;span class=&quot;z-constant z-numeric z-integer&quot;&gt;24&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-viml&quot;&gt;up
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We can use &lt;code&gt;unbound&lt;&#x2F;code&gt; with a simple setup for now. We open the &lt;code&gt;unbound&lt;&#x2F;code&gt; configuration file.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@openbsd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ doas vi &#x2F;var&#x2F;unbound&#x2F;etc&#x2F;unbound.conf&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Here is a basic configuration.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;yaml&quot; class=&quot;language-yaml z-code&quot;&gt;&lt;code class=&quot;language-yaml&quot; data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;&lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;server&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;interface&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-numeric z-float z-decimal z-yaml&quot;&gt;0&lt;span class=&quot;z-punctuation z-separator z-decimal z-yaml&quot;&gt;.&lt;&#x2F;span&gt;0.0.0&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;interface&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;::1&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;access-control&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;10.0.0.1&#x2F;24 allow&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;access-control&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;127.0.0.0&#x2F;8 allow&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;access-control&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;::1 allow&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;access-control&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;0.0.0.0&#x2F;0 refuse&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;access-control&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;::0&#x2F;0 refuse&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;hide-identity&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-language z-boolean z-yaml&quot;&gt;yes&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;hide-version&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-language z-boolean z-yaml&quot;&gt;yes&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;auto-trust-anchor-file&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-quoted z-double z-yaml&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-yaml&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&#x2F;var&#x2F;unbound&#x2F;db&#x2F;root.key&lt;span class=&quot;z-punctuation z-definition z-string z-end z-yaml&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;qname-minimisation&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-language z-boolean z-yaml&quot;&gt;yes&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;aggressive-nsec&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-language z-boolean z-yaml&quot;&gt;yes&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Now we enable and start &lt;code&gt;unbound&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@openbsd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ doas rcctl enable unbound&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@openbsd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ doas rcctl start unbound&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We also need to enable IP forwarding (and make it persistent across reboots) on our OpenBSD server so that the VPN can function for browsing the Web.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@openbsd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ doas sysctl net.inet.ip.forwarding=1&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@openbsd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ doas sysctl net.inet6.ip6.forwarding=1&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@openbsd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ doas echo &lt;span class=&quot;z-string z-quoted z-double z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;net.inet.ip.forwarding=1&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-assignment z-redirection z-shell&quot;&gt;&amp;gt;&amp;gt;&lt;&#x2F;span&gt; &#x2F;etc&#x2F;sysctl.conf&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@openbsd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ doas echo &lt;span class=&quot;z-string z-quoted z-double z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;net.inet6.ip6.forwarding=1&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-assignment z-redirection z-shell&quot;&gt;&amp;gt;&amp;gt;&lt;&#x2F;span&gt; &#x2F;etc&#x2F;sysctl.conf&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Finally, we need to make the necessary changes in our &lt;code&gt;pf&lt;&#x2F;code&gt; firewall configuration in order to allow traffic over Wireguard.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@openbsd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ doas vi &#x2F;etc&#x2F;pf.conf&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We add the following lines to &lt;code&gt;pf.conf&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;ini&quot; class=&quot;language-ini z-code&quot;&gt;&lt;code class=&quot;language-ini&quot; data-lang=&quot;ini&quot;&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;&lt;span class=&quot;z-meta z-param z-genconfig&quot;&gt;&lt;span class=&quot;z-variable z-parameter z-genconfig&quot;&gt;port_wg&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-genconfig&quot;&gt;=&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-quoted z-double z-genconfig&quot;&gt;&amp;quot;{50101}&amp;quot;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;&lt;span class=&quot;z-meta z-param z-genconfig&quot;&gt;&lt;span class=&quot;z-variable z-parameter z-genconfig&quot;&gt;pass&lt;&#x2F;span&gt; &lt;&#x2F;span&gt;in log &lt;span class=&quot;z-constant z-language z-genconfig&quot;&gt;on&lt;&#x2F;span&gt; wg&lt;span class=&quot;z-meta z-comment z-genconfig&quot;&gt; &lt;span class=&quot;z-comment z-line z-number-sign z-genconfig&quot;&gt;#allow traffic on wg interfaces
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;&lt;span class=&quot;z-meta z-param z-genconfig&quot;&gt;&lt;span class=&quot;z-variable z-parameter z-genconfig&quot;&gt;pass&lt;&#x2F;span&gt; &lt;&#x2F;span&gt;in log &lt;span class=&quot;z-constant z-language z-genconfig&quot;&gt;on&lt;&#x2F;span&gt; egress inet proto { udp } from any to any port &lt;span class=&quot;z-storage z-source z-genconfig&quot;&gt;$port_wg&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-comment z-genconfig&quot;&gt; &lt;span class=&quot;z-comment z-line z-number-sign z-genconfig&quot;&gt;#allow incoming traffic on the Wireguard port
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;&lt;span class=&quot;z-meta z-param z-genconfig&quot;&gt;&lt;span class=&quot;z-variable z-parameter z-genconfig&quot;&gt;match&lt;&#x2F;span&gt; &lt;&#x2F;span&gt;out &lt;span class=&quot;z-constant z-language z-genconfig&quot;&gt;on&lt;&#x2F;span&gt; egress inet from (wg&lt;span class=&quot;z-keyword z-operator z-genconfig&quot;&gt;:&lt;&#x2F;span&gt;network) to any nat&lt;span class=&quot;z-keyword z-operator z-genconfig&quot;&gt;-&lt;&#x2F;span&gt;to (egress&lt;span class=&quot;z-keyword z-operator z-genconfig&quot;&gt;:&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric z-genconfig&quot;&gt;0&lt;&#x2F;span&gt;)&lt;span class=&quot;z-meta z-comment z-genconfig&quot;&gt; &lt;span class=&quot;z-comment z-line z-number-sign z-genconfig&quot;&gt;#allow NAT (network address translation) on outgoing traffic
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We load the firewall configuration.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@openbsd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ doas pfctl&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;f&lt;&#x2F;span&gt; &#x2F;etc&#x2F;pf.conf&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;That&#x27;s is. We should now be able to initiate the VPN connection on our Linux client, and tunnel the traffic over Wireguard.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@void&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ sudo wg-quick up wg0&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
</description>
      </item>
      <item>
          <title>A Christian Perspective on Extraterrestrial Intelligence</title>
          <pubDate>Sat, 02 Apr 2022 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://www.sinankurtulmus.net/blog/aliens/</link>
          <guid>https://www.sinankurtulmus.net/blog/aliens/</guid>
          <description xml:base="https://www.sinankurtulmus.net/blog/aliens/">&lt;p&gt; &lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;Much to the regret of my friends, I find the topic of extraterrestrial life to be worthy of some discussion.
It is quite curious that the zeitgeist allows for little scepticism when it comes to the topic of the existence of aliens, whether it be any form of life or intelligent life.
The notorious Fermi paradox is premised on the assumption that there is no good reason to doubt the likelihood of extraterrestrial intelligent life.
Arguments appealing to the seemingly very probable existence of life outside of Earth - in particular, intelligent life in the form of distant civilizations that are yet to be encountered - are regarded by some to be demonstrative of the tenuousness of Christian doctrine, although it is often unclear how.&lt;&#x2F;p&gt;
&lt;p&gt;I believe that it is important to challenge this default position and recognize the possibility that there might be no paradox here whatsoever, but trying to address the scenario in which extraterrestrial life does exist could also be beneficial in discovering where our intellectual understanding of the Holy Mysteries may fall short.
Before proceeding, I would like also clarify that I am remaining within the boundaries of the purely hypothetical scenario in which extraterrestrial civilizations from exoplanets are manifestly a part of the reality of our daily lives, and of common knowledge.
I do not think we have much to gain from obsessing over bizarre media stories in anticipation of secret encounters, while we certainly have much to lose as the evil one often comes in disguise to divert us from the path to salvation.&lt;&#x2F;p&gt;
&lt;p&gt; &lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Be sober, be vigilant; because your adversary the devil walks about like a roaring lion, seeking whom he may devour.&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;1 Peter 5:8&lt;&#x2F;strong&gt;&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt; &lt;&#x2F;p&gt;
&lt;h3 id=&quot;arguments-for-and-against-extraterrestrial-intelligence&quot;&gt;Arguments For and Against Extraterrestrial Intelligence&lt;&#x2F;h3&gt;
&lt;p&gt;While the argument against such life from lack of what one would consider readily available physical evidence is an obvious one to make, in the context of this discussion it is often brushed aside as unsophisticated.
Remarkably, is is customary to make an argument from lack of such evidence when it comes to metaphysical entities and phenomena, and notably the question of God&#x27;s existence.
Perhaps one could argue that aliens are different in the sense that they are presumed to be - either partially or entirely - physical beings and therefore one could hope that physical evidence is produced at some point in the future, rendering the question obsolete.
I personally would argue that this makes the argument from lack of physical evidence - which is not very strong when tackling the question of God&#x27;s existence due to a category error - a lot stronger; the fact that there is no physical evidence for the existence of a certain being that is defined as a physical one, while it does not definitively disprove its existence, makes it somewhat less likely.&lt;&#x2F;p&gt;
&lt;p&gt;On the other hand, the only attempt at an argument &lt;em&gt;for&lt;&#x2F;em&gt; the existence of extraterrestrial intelligent life comes from the vastness of the universe. One could argue that with such an unimaginably grand universe, it is virtually certain that there is life, and even intelligent life outside of Earth.&lt;&#x2F;p&gt;
&lt;p&gt;This argument seems powerful at first glance, but its success depends on a condition: The assumption that the universe has the capacity to produce intelligent life by itself needs to be true.
In fact, to speak more precisely, one could see that if the universe is spatially and&#x2F;or temporally infinite, and has the capacity for producing such life, then the probability that intelligence outside of Earth exists is exactly 1.
Moreover, if the universe is at least either spatially or temporally infinite, the probability that there is an infinite number of extraterrestrial intelligent life forms is 1, provided that the same condition is met.&lt;&#x2F;p&gt;
&lt;p&gt;If the universe is in fact finite both spatially and temporally, and it has the capacity to produce intelligent life, then we would need to have a rough idea of the probabilities of life and intelligent life emerging by certain mechanisms out of lifelessness, which we do not, because scientific endeavor does not tell us much about the origins of life, besides repurposed indirect inferences about discoveries concerning certain components or materials that are essential for biological life.
It could be the case that the probability of such life emerging is so low that it is very close to impossible even in some of the largest finite universes one could conceptualize.
This could mean that there is no good reason to think that it would actually happen more than once.
This is one possible solution to the so-called Fermi paradox.
Interestingly enough, as C.S. Lewis noted in his essay &lt;em&gt;Religion and Rocketry&lt;&#x2F;em&gt;, some opponents of religion not only acknowledge that life is by all means very likely to be unlikely, but also hold that scientific findings are in support of this claim, only to then counterpose the apparent the hostility of the universe toward biological life to the concept of an intelligently designed fine-tuned universe, therefore claiming to have proven the absurdity of Christian doctrine.&lt;&#x2F;p&gt;
&lt;p&gt;Conversely, if the universe does not possess this capability, and the existence of intelligent life - namely human life - that exists therein is instead caused by an outside entity that is ontologically separate, such as God, then we must reach a different conclusion.
In that case, if God created extraterrestrial intelligence, then it exists, and if God did not create extraterrestrial intelligence, then it does not exist; the vastness of the universe has no bearing whatsoever on the question and the Fermi paradox is, once again, solved.
Therefore, in order to argue for the existence of extraterrestrial intelligent life from the vastness of the universe, one needs to posit that the universe is infinite, and also hold a positon of biological reductionism.
These are big and fundamentally extrascientific assumptions to make in the absence of clarity about the origins of life and the universe as far as scientific discovery is concerned.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;the-creator-and-the-biblical-account-of-creation&quot;&gt;The Creator and the Biblical Account of Creation&lt;&#x2F;h3&gt;
&lt;p&gt;From a broader perspective, I am genuinely intrigued by findings in cosmology and biology and see their values within their domains, but I believe that the most fascinating questions that science could ever hope to grapple with, and perhaps more precisely the greatest mysteries it could ever hope to partake in, are related to the study of foundational ontology - &lt;em&gt;metaphysica generalis&lt;&#x2F;em&gt; - which lies at the points of junction between natural sciences, philosophy and theology.
Great minds of old, fascinated by the intricacies that lie within creation, were also polymaths and theologians, often well aware of the categorical limitations of the natural sciences.
While we could hope to decipher more of the code that is ingrained in the physical universe, just as the work of art is so much more than simply paint on a canvas - to the point that it could rightly be said that its true essence and its reason d&#x27;être lie beyond the material composition - so is the Creator always essential in shaping a correct understanding of creation and its origin, beyond what science has to offer at different levels of abstraction.
In the truest sense, God is the source of life, for with God is &quot;the fountain of life&quot; (&lt;a href=&quot;https:&#x2F;&#x2F;biblia.com&#x2F;books&#x2F;nkjv&#x2F;Ps36:9&quot;&gt;Psalm 36:9&lt;&#x2F;a&gt;).&lt;&#x2F;p&gt;
&lt;p&gt;The Biblical account might not necessarily rule out the possibility of a created universe which has been given the capacity to produce some form of life through its own mechanisms.
To be clear, the characterization of the relationship between the Creator and all that is created in a way where events and regularities in the universe could occur without the presence and the activity of God and created life could be sustained to some degree without its giver does not seem to be a promising avenue; from a Christian perspective, it is theologically incorrect and most likely philosophically indefensible.
God not only sustains life, but He also holds the fabric of reality together.
The ways in which God is present in the universe while allowing transformation and growth do not point us to a watchmaker deity who has abandoned creation; natural processes are perhaps better understood in terms of God&#x27;s beautiful vision for His creation.&lt;&#x2F;p&gt;
&lt;p&gt;Arguably, this vision is set forth in the Biblical account of creation.
&lt;a href=&quot;https:&#x2F;&#x2F;biblia.com&#x2F;books&#x2F;nkjv&#x2F;Ge1.11-12&quot;&gt;Genesis 1:11-12&lt;&#x2F;a&gt; speaks of the Earth propagating different forms of life, with particular emphasis on the &lt;em&gt;seed&lt;&#x2F;em&gt;.
The capacity for reproduction is an essential property of life, and life on Earth is not static or incapable, but is replenished for generations, according to God&#x27;s vision of creation, which is good.
A similar pattern is repeated later in the chapter:&lt;&#x2F;p&gt;
&lt;p&gt; &lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Then God said, “Let the earth bring forth the living creature according to its kind: cattle and creeping thing and beast of the earth, each according to its kind”; and it was so.&lt;&#x2F;em&gt;
&lt;em&gt;And God made the beast of the earth according to its kind, cattle according to its kind, and everything that creeps on the earth according to its kind. And God saw that it was good.&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Genesis 1:24-25&lt;&#x2F;strong&gt;&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt; &lt;&#x2F;p&gt;
&lt;p&gt;It is fascinating, at the same time, that the earth itself &quot;brings forth&quot; all these forms of life, yet it is also fully true that God Himself has made them.
The aptitude of creation does not refute its creator, it only glorifies Him.
Would this mean that life elsewhere that is not strictly recorded in the Bible hypothetically springing from non-life could also, by the same token, be attributed primarily to God the Creator, and secondarily to the proliferousness of the created universe?
Perhaps it is not outside the realm of possibility that such life exists.&lt;&#x2F;p&gt;
&lt;p&gt;As a final note on the Biblical creation account, I think it is significant that &lt;a href=&quot;https:&#x2F;&#x2F;biblia.com&#x2F;books&#x2F;nkjv&#x2F;Ge1.26-27&quot;&gt;Genesis 1:26-27&lt;&#x2F;a&gt; does not utilize the same language.
&quot;God created man in His &lt;em&gt;own&lt;&#x2F;em&gt; image&quot;; other created beings could not possibly be credited for God&#x27;s image, and it is by virtue of being created in God&#x27;s image that man is set apart from them.
The provenance of our free will and spirit - which beasts do not possess - is found in this special account of creation.
In addition, phenomenological ways in which man stands separate from beasts would include things like a much higher level of intellectual ability, moral awareness, and the capacity to construct symbolic worlds which are meaningful to him.
I believe these points are also relevant since man is always, inevitably, our reference point in discussions of intelligent life in and outside of Earth.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;do-i-think-that-aliens-exist&quot;&gt;Do I Think that Aliens Exist?&lt;&#x2F;h3&gt;
&lt;p&gt;In light of these considerations, my guess is that we are probably, in fact, &quot;alone&quot; in this universe.
I do have my convictions, and I do not find arguments from the vastness of the universe convincing, because of the aforementioned points.
Firstly, we have no concrete evidence to support the claim that such beings or civilizations exist.
Secondly we have established that information about the scale of a finite universe alone is not enough to demonstrate that the existence of such beings is likely.
The emergence of simpler and non-intelligent extraterrestrial life forms is arguably somewhat more likely - which consequently means that their existence is more plausible - but I do not believe we are justified in claiming that it is more likely than not.&lt;&#x2F;p&gt;
&lt;p&gt;With all that being said, the existence of extraterrestrial intelligence could still be a non-negligible possibility, until and unless it is definitively shown to be impossible.
We could consider the implications of this possibility in relation to Christology, Christian cosmology and soteriology in various ways.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;implications-for-christian-doctrine&quot;&gt;Implications for Christian Doctrine&lt;&#x2F;h3&gt;
&lt;p&gt;When we speak of extraterrestrial intelligent life, we are typically referring to beings with physical, mental and emotional capabilities that seemingly match or exceed human benchmarks.
However, the Image of God in which God made humans - and by which we are &lt;em&gt;able to see and know realities by means of this assimilation to Himself&lt;&#x2F;em&gt; as St. Athanasius writes - is beyond what could be captured and quantified by our observations.
One could imagine creatures that do not appear to be particularly adept on the surface but deep down are like us, or ones that are much more intelligent than us but do not have access to the same kinds of knowledge and experiences.
Therefore, the discovery of intelligent life in itself would not necessarily have implications for Christian doctrine; we are more concerned with the possibility of the existence of extraterrestrial &lt;em&gt;spiritual&lt;&#x2F;em&gt; life, how to identify it.
With that being said, I would like to briefly touch upon a set of possible positions that Christians might consider regarding the hypothetical scenario in which extraterrestrial intelligent life does exist.&lt;&#x2F;p&gt;
&lt;p&gt;One potential response would be to assert that intelligent specimens of extraterrestrial origin are not spiritual; despite being living organisms, are like artificial intelligence in that they are &quot;cognitive zombies&quot; which exhibit intelligent relatable behavior and perhaps do not possess the &lt;em&gt;qualia&lt;&#x2F;em&gt; of which consciousness is a prerequisite, but I believe this position very difficult to justify, and it has no precedent.
Instead, they could be categorized as beasts that are more capable; I can imagine this being the more tempting option if these hypothetical creatures look quite different from humans on Earth.
While I cannot propose a strict playbook or certain criteria to look for, I would like to believe that if and when we see them, we will know: The Image of God would recognize the Image of God.&lt;&#x2F;p&gt;
&lt;p&gt;Other positions would involve recognizing extraterrestrial intelligent beings as spiritual, and conspecific in a theological sense, in their fallen states.
Lewis also addresses this briefly in the same essay (which is a very good read), along with the aforementioned position, but wisely refrains from formulating a definitive response.
In this case, it would be crucial to consider Christ&#x27;s incarnation and salvific work on Earth in relation to exoplanetary communities.
Some thinkers suggest the possibility of multiple incarnations for each species for their restoration of communion with the Creator.
Perhaps this could be problematic as the Bible speaks of a sacrifice that is once and for all (Hebrews &lt;a href=&quot;https:&#x2F;&#x2F;biblia.com&#x2F;books&#x2F;nkjv&#x2F;Heb9.28&quot;&gt;9:28&lt;&#x2F;a&gt;, &lt;a href=&quot;https:&#x2F;&#x2F;biblia.com&#x2F;books&#x2F;nkjv&#x2F;Heb10.12-14&quot;&gt;10:12-14&lt;&#x2F;a&gt;).
On the other hand, if the Incarnation, the Cross and the Resurrection are indeed events that happened once and for &lt;em&gt;all&lt;&#x2F;em&gt; in a particular time and place on Earth (and is made present in the sacraments of the Church - not repeated, but simply unbound by time), then it is to be preached in other worlds as well, just like it was preached here on Earth.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt; &lt;&#x2F;p&gt;
&lt;p&gt;Regardless of where we might currently stand on this matter, we are called to proclaim what the gospel has revealed to us and live a life of prayer.
In the broadest sense, as St. Paul states in &lt;a href=&quot;https:&#x2F;&#x2F;biblia.com&#x2F;books&#x2F;nkjv&#x2F;Col1.23&quot;&gt;Colossians 1:23&lt;&#x2F;a&gt;, the gospel was preached to every creature under heaven.
St. Athanasius affirms that &quot;the Lord touched all parts of creation, and freed and undeceived them all from every deceit&quot;.&lt;&#x2F;p&gt;
&lt;p&gt;As it pertains to our relation to the cosmos, I would like to share this beautiful idea presented in &lt;em&gt;For the Life of the World&lt;&#x2F;em&gt; by Fr. Alexander Schmemann:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;All rational, spiritual and other qualities of man, distinguishing him from other creatures, have their focus and ultimate fulfillment in this capacity to bless God, to know, so to speak, the meaning of the thirst and hunger that constitutes his life.&lt;&#x2F;em&gt;
&lt;em&gt;&lt;strong&gt;&quot;Homo sapiens,&quot; &quot;homo faber&quot;&lt;&#x2F;strong&gt;&lt;&#x2F;em&gt; &lt;em&gt;... yes, but first of all,&lt;&#x2F;em&gt; &lt;em&gt;&lt;strong&gt;&quot;homo adorans.&quot;&lt;&#x2F;strong&gt;&lt;&#x2F;em&gt;
&lt;em&gt;The first, the basic definition of man is that he is&lt;&#x2F;em&gt; &lt;em&gt;&lt;strong&gt;the priest.&lt;&#x2F;strong&gt;&lt;&#x2F;em&gt;
&lt;em&gt;He stands in the center of the world and unifies it in his act of blessing God, of both receiving the world from God and offering it to God-and by filling the world with this eucharist, he transforms his life, the one that he receives from the world, into life in God, into communion with Him.&lt;&#x2F;em&gt;
&lt;em&gt;The world was created as the &quot;matter,&quot; the material of one all-embracing eucharist, and man was created as the priest of this cosmic sacrament.&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
</description>
      </item>
      <item>
          <title>Hosting a Website (with OpenBSD httpd)</title>
          <pubDate>Sat, 26 Mar 2022 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://www.sinankurtulmus.net/handbook/httpd/</link>
          <guid>https://www.sinankurtulmus.net/handbook/httpd/</guid>
          <description xml:base="https://www.sinankurtulmus.net/handbook/httpd/">&lt;p&gt; &lt;&#x2F;p&gt;
&lt;p&gt;Having a personal website is one of the best ways to fine-tune your online presence as it allows you to have complete control over the content that you share, and the ways that you might want to structure it.
The base install of OpenBSD comes with its own Web server called &lt;code&gt;httpd&lt;&#x2F;code&gt;, and it is fairly simple to set up.
In this guide we will serve a webpage with &lt;code&gt;httpd&lt;&#x2F;code&gt;, register and link a domain name, and configure HTTPS (secure&#x2F;encrypted HTTP) with &lt;code&gt;acme-client&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;After &lt;a href=&quot;https:&#x2F;&#x2F;www.sinankurtulmus.net&#x2F;handbook&#x2F;vps&#x2F;&quot;&gt;deploying a VPS&lt;&#x2F;a&gt; (OpenBSD), we can log in with &lt;code&gt;ssh&lt;&#x2F;code&gt; and start setting up the server. We will need superuser access.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@server&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ su&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;Password:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;#&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We begin by making a directory for our webpage inside the default chroot directory for the &lt;code&gt;httpd&lt;&#x2F;code&gt; Web server, which is &lt;code&gt;&#x2F;var&#x2F;www&lt;&#x2F;code&gt;. We also make a rudimentary home page.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# mkdir&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;p&lt;&#x2F;span&gt; &#x2F;var&#x2F;www&#x2F;htdocs&#x2F;example.net&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# vi &#x2F;var&#x2F;www&#x2F;htdocs&#x2F;example.net&#x2F;index.html&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Here is a skeletal HTML page that we can use for the purposes of this guide.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;html&quot; class=&quot;language-html z-code&quot;&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;&lt;span class=&quot;z-text z-html z-basic&quot;&gt;&lt;span class=&quot;z-meta z-tag z-sgml z-doctype z-html&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-begin z-html&quot;&gt;&amp;lt;!&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-declaration z-doctype z-html&quot;&gt;DOCTYPE&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-language z-doctype z-html&quot;&gt;html&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-end z-html&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-html z-basic&quot;&gt;&lt;span class=&quot;z-meta z-tag z-structure z-any z-html&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-begin z-html&quot;&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-tag z-structure z-any z-html&quot;&gt;html&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-end z-html&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-html z-basic&quot;&gt;    &lt;span class=&quot;z-meta z-tag z-structure z-any z-html&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-begin z-html&quot;&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-tag z-structure z-any z-html&quot;&gt;head&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-end z-html&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-html z-basic&quot;&gt;        &lt;span class=&quot;z-meta z-tag z-inline z-any z-html&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-begin z-html&quot;&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-tag z-inline z-any z-html&quot;&gt;title&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-end z-html&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;Home Page&lt;span class=&quot;z-meta z-tag z-inline z-any z-html&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-begin z-html&quot;&gt;&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-tag z-inline z-any z-html&quot;&gt;title&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-end z-html&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-html z-basic&quot;&gt;    &lt;span class=&quot;z-meta z-tag z-structure z-any z-html&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-begin z-html&quot;&gt;&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-tag z-structure z-any z-html&quot;&gt;head&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-end z-html&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-html z-basic&quot;&gt;    &lt;span class=&quot;z-meta z-tag z-structure z-any z-html&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-begin z-html&quot;&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-tag z-structure z-any z-html&quot;&gt;body&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-end z-html&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-html z-basic&quot;&gt;        &lt;span class=&quot;z-meta z-tag z-block z-any z-html&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-begin z-html&quot;&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-tag z-block z-any z-html&quot;&gt;p&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-end z-html&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;Hello World!&lt;span class=&quot;z-meta z-tag z-block z-any z-html&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-begin z-html&quot;&gt;&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-tag z-block z-any z-html&quot;&gt;p&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-end z-html&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-html z-basic&quot;&gt;    &lt;span class=&quot;z-meta z-tag z-structure z-any z-html&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-begin z-html&quot;&gt;&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-tag z-structure z-any z-html&quot;&gt;body&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-end z-html&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-html z-basic&quot;&gt;&lt;span class=&quot;z-meta z-tag z-structure z-any z-html&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-begin z-html&quot;&gt;&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-tag z-structure z-any z-html&quot;&gt;html&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-tag z-end z-html&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;div class=&quot;note&quot;&gt;&lt;small&gt;&lt;b&gt;Note:&lt;&#x2F;b&gt;
This file is just something to serve on the Web for now.
Creating a real functional webpage will involve expanding this with more files and some directory structure.
&lt;&#x2F;small&gt;&lt;&#x2F;div&gt;
&lt;p&gt;Now we open the configuration file of &lt;code&gt;httpd&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# vi &#x2F;etc&#x2F;httpd.conf&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We edit the file to include the following lines.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;perl&quot; class=&quot;language-perl z-code&quot;&gt;&lt;code class=&quot;language-perl&quot; data-lang=&quot;perl&quot;&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;&lt;span class=&quot;z-meta z-comment z-perl&quot;&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-perl&quot;&gt;#&lt;&#x2F;span&gt; HTTP
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-perl&quot;&gt;&lt;span class=&quot;z-variable z-function z-perl&quot;&gt;server&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-string z-perl&quot;&gt;&lt;span class=&quot;z-string z-quoted z-double z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;example.net&lt;span class=&quot;z-punctuation z-definition z-string z-end z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-punctuation z-section z-block z-begin z-perl&quot;&gt;{&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;    &lt;span class=&quot;z-meta z-function-call z-perl&quot;&gt;&lt;span class=&quot;z-variable z-function z-perl&quot;&gt;alias&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-string z-perl&quot;&gt;&lt;span class=&quot;z-string z-quoted z-double z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;www.example.net&lt;span class=&quot;z-punctuation z-definition z-string z-end z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;    &lt;span class=&quot;z-meta z-function-call z-perl&quot;&gt;&lt;span class=&quot;z-support z-function z-perl&quot;&gt;listen&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-other z-perl&quot;&gt;on&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-arithmetic z-perl&quot;&gt;*&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-function-call z-perl&quot;&gt;&lt;span class=&quot;z-variable z-function z-perl&quot;&gt;port&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-numeric z-integer z-decimal z-perl&quot;&gt;80&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;    &lt;span class=&quot;z-meta z-function-call z-perl&quot;&gt;&lt;span class=&quot;z-variable z-function z-perl&quot;&gt;root&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-string z-perl&quot;&gt;&lt;span class=&quot;z-string z-quoted z-double z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&#x2F;htdocs&#x2F;example.net&lt;span class=&quot;z-punctuation z-definition z-string z-end z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-block z-end z-perl&quot;&gt;}&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;div class=&quot;note&quot;&gt;&lt;small&gt;&lt;b&gt;Note:&lt;&#x2F;b&gt;
Port 80 is the default port for HTTP. Port 443 is for HTTPS.
&lt;&#x2F;small&gt;&lt;&#x2F;div&gt;
&lt;p&gt;Assuming we have &lt;code&gt;pf&lt;&#x2F;code&gt; enabled and running, we need to open ports 80 and 443. We add the following lines to the existing configuration in &lt;code&gt;&#x2F;etc&#x2F;pf.conf&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;ini&quot; class=&quot;language-ini z-code&quot;&gt;&lt;code class=&quot;language-ini&quot; data-lang=&quot;ini&quot;&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;&lt;span class=&quot;z-meta z-comment z-genconfig&quot;&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-genconfig&quot;&gt;# Define HTTP&#x2F;HTTPS ports as a variable
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;&lt;span class=&quot;z-meta z-param z-genconfig&quot;&gt;&lt;span class=&quot;z-variable z-parameter z-genconfig&quot;&gt;port_http&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-genconfig&quot;&gt;=&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-quoted z-double z-genconfig&quot;&gt;&amp;quot;{80,443}&amp;quot;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;&lt;span class=&quot;z-meta z-comment z-genconfig&quot;&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-genconfig&quot;&gt;# Allow incoming HTTP&#x2F;HTTPS connections
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;&lt;span class=&quot;z-meta z-param z-genconfig&quot;&gt;&lt;span class=&quot;z-variable z-parameter z-genconfig&quot;&gt;pass&lt;&#x2F;span&gt; &lt;&#x2F;span&gt;in log &lt;span class=&quot;z-constant z-language z-genconfig&quot;&gt;on&lt;&#x2F;span&gt; egress proto tcp from any to any port &lt;span class=&quot;z-storage z-source z-genconfig&quot;&gt;$port_http&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;And load the new rules.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# pfctl&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;f&lt;&#x2F;span&gt; &#x2F;etc&#x2F;pf.conf&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;After checking the configuration, we enable and start &lt;code&gt;httpd&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# httpd&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;n&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# rcctl enable httpd&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# rcctl start httpd&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The webpage can now be accessed by typing in the public IP address of our server into the URL bar of the Web browser.
But we want to be able to access it by simply typing &quot;example.net&quot;.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;linking-a-domain-name&quot;&gt;Linking a Domain Name&lt;&#x2F;h3&gt;
&lt;p&gt;For the next step, we need to register a domain name.
I can recommend &lt;a href=&quot;https:&#x2F;&#x2F;www.gandi.net&quot;&gt;Gandi&lt;&#x2F;a&gt; as a domain registrar.
&lt;a href=&quot;https:&#x2F;&#x2F;www.namecheap.com&#x2F;&quot;&gt;Namecheap&lt;&#x2F;a&gt; and &lt;a href=&quot;https:&#x2F;&#x2F;www.godaddy.com&quot;&gt;GoDaddy&lt;&#x2F;a&gt; are other popular services.
Registering a domain is fairly straightforward once we provide the necessary information.&lt;&#x2F;p&gt;
&lt;p&gt;Having registered our domain, we navigate to the user panel&#x2F;dashboard on our registrar&#x27;s Web interface, and find the DNS records section.
There might be some preset records here.
We will delete all of them and add entries of our own.&lt;&#x2F;p&gt;
&lt;p&gt;Each record will have a record type, a subdomain name, a linked IP address, and a TTL (time to live) value for cached DNS information.
We will link our server&#x27;s public IPv4 and IPv6 addresses to 3 records: The root (@) domain, &quot;www&quot; domain, and the wildcard (*) for all other subdomains.
Type A is for IPv4, and type AAAA is for IPv6 addresses.
1800-3600 seconds should be reasonable values for TTL, but you can set it as low as 300 if you plan on changing IP addresses frequently.&lt;&#x2F;p&gt;
&lt;div class=&quot;note&quot;&gt;&lt;small&gt;&lt;b&gt;Note:&lt;&#x2F;b&gt;
Feel free to skip IPv6 records if you don&#x27;t need them.
&lt;&#x2F;small&gt;&lt;&#x2F;div&gt;
&lt;p&gt;Here are the DNS record entries that we will create:&lt;&#x2F;p&gt;
&lt;table&gt;
    &lt;tr&gt;
        &lt;th&gt;Type&lt;&#x2F;th&gt;&lt;th&gt;Subdomain&lt;&#x2F;th&gt;&lt;th&gt;TTL&lt;&#x2F;th&gt;&lt;th&gt;IP Address&lt;&#x2F;th&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td&gt;A&lt;&#x2F;td&gt;&lt;td&gt;@&lt;&#x2F;td&gt;&lt;td&gt;1800&lt;&#x2F;td&gt;&lt;td&gt;public-IPv4-address&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td&gt;A&lt;&#x2F;td&gt;&lt;td&gt;www&lt;&#x2F;td&gt;&lt;td&gt;1800&lt;&#x2F;td&gt;&lt;td&gt;public-IPv4-address&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td&gt;A&lt;&#x2F;td&gt;&lt;td&gt;&amp;ast;&lt;&#x2F;td&gt;&lt;td&gt;1800&lt;&#x2F;td&gt;&lt;td&gt;public-IPv4-address&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td&gt;AAAA&lt;&#x2F;td&gt;&lt;td&gt;@&lt;&#x2F;td&gt;&lt;td&gt;1800&lt;&#x2F;td&gt;&lt;td&gt;public-IPv6-address&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td&gt;AAAA&lt;&#x2F;td&gt;&lt;td&gt;www&lt;&#x2F;td&gt;&lt;td&gt;1800&lt;&#x2F;td&gt;&lt;td&gt;public-IPv6-address&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;&lt;tr&gt;
        &lt;td&gt;AAAA&lt;&#x2F;td&gt;&lt;td&gt;&amp;ast;&lt;&#x2F;td&gt;&lt;td&gt;1800&lt;&#x2F;td&gt;&lt;td&gt;public-IPv6-address&lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;p&gt;We should now be able to access our website by typing in the domain name (example.net).&lt;&#x2F;p&gt;
&lt;h3 id=&quot;configuring-https&quot;&gt;Configuring HTTPS&lt;&#x2F;h3&gt;
&lt;p&gt;Finally, we can obtain certificates and configure the HTTPS connection.
The OpenBSD base install includes a tool to handle this task called &lt;code&gt;acme-client&lt;&#x2F;code&gt;, as well as an example configuration file.
We can copy this example file to the default configuration file location, and edit the &quot;domain&quot; section to include our domain.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# cp &#x2F;etc&#x2F;examples&#x2F;acme-client.conf &#x2F;etc&#x2F;acme-client.conf&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# vi &#x2F;etc&#x2F;acme-client.conf&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The file should at least contain the following:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;perl&quot; class=&quot;language-perl z-code&quot;&gt;&lt;code class=&quot;language-perl&quot; data-lang=&quot;perl&quot;&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-perl&quot;&gt;&lt;span class=&quot;z-variable z-function z-perl&quot;&gt;authority&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-other z-perl&quot;&gt;letsencrypt&lt;&#x2F;span&gt; &lt;span class=&quot;z-punctuation z-section z-block z-begin z-perl&quot;&gt;{&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;        &lt;span class=&quot;z-meta z-function-call z-perl&quot;&gt;&lt;span class=&quot;z-variable z-function z-perl&quot;&gt;api&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-function-call z-perl&quot;&gt;&lt;span class=&quot;z-variable z-function z-perl&quot;&gt;url&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-string z-perl&quot;&gt;&lt;span class=&quot;z-string z-quoted z-double z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;https:&#x2F;&#x2F;acme-v02.api.letsencrypt.org&#x2F;directory&lt;span class=&quot;z-punctuation z-definition z-string z-end z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;        &lt;span class=&quot;z-meta z-function-call z-perl&quot;&gt;&lt;span class=&quot;z-variable z-function z-perl&quot;&gt;account&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-function-call z-perl&quot;&gt;&lt;span class=&quot;z-variable z-function z-perl&quot;&gt;key&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-string z-perl&quot;&gt;&lt;span class=&quot;z-string z-quoted z-double z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&#x2F;etc&#x2F;acme&#x2F;letsencrypt-privkey.pem&lt;span class=&quot;z-punctuation z-definition z-string z-end z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-block z-end z-perl&quot;&gt;}&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-perl&quot;&gt;&lt;span class=&quot;z-variable z-function z-perl&quot;&gt;domain&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-other z-perl&quot;&gt;example&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-concat z-perl&quot;&gt;.&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other z-perl&quot;&gt;net&lt;&#x2F;span&gt; &lt;span class=&quot;z-punctuation z-section z-block z-begin z-perl&quot;&gt;{&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;        &lt;span class=&quot;z-meta z-function-call z-perl&quot;&gt;&lt;span class=&quot;z-variable z-function z-perl&quot;&gt;alternative&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-other z-perl&quot;&gt;names&lt;&#x2F;span&gt; &lt;span class=&quot;z-punctuation z-section z-block z-begin z-perl&quot;&gt;{&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-other z-perl&quot;&gt;www&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-concat z-perl&quot;&gt;.&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other z-perl&quot;&gt;example&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-concat z-perl&quot;&gt;.&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other z-perl&quot;&gt;net&lt;&#x2F;span&gt; &lt;span class=&quot;z-punctuation z-section z-block z-end z-perl&quot;&gt;}&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;        &lt;span class=&quot;z-meta z-function-call z-perl&quot;&gt;&lt;span class=&quot;z-variable z-function z-perl&quot;&gt;domain&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-function-call z-perl&quot;&gt;&lt;span class=&quot;z-variable z-function z-perl&quot;&gt;key&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-string z-perl&quot;&gt;&lt;span class=&quot;z-string z-quoted z-double z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&#x2F;etc&#x2F;ssl&#x2F;private&#x2F;example.net.key&lt;span class=&quot;z-punctuation z-definition z-string z-end z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;        &lt;span class=&quot;z-meta z-function-call z-perl&quot;&gt;&lt;span class=&quot;z-variable z-function z-perl&quot;&gt;domain&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-function-call z-perl&quot;&gt;&lt;span class=&quot;z-variable z-function z-perl&quot;&gt;full&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-function-call z-perl&quot;&gt;&lt;span class=&quot;z-variable z-function z-perl&quot;&gt;chain&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-function-call z-perl&quot;&gt;&lt;span class=&quot;z-variable z-function z-perl&quot;&gt;certificate&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-string z-perl&quot;&gt;&lt;span class=&quot;z-string z-quoted z-double z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&#x2F;etc&#x2F;ssl&#x2F;example.net.fullchain.pem&lt;span class=&quot;z-punctuation z-definition z-string z-end z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;        &lt;span class=&quot;z-meta z-function-call z-perl&quot;&gt;&lt;span class=&quot;z-variable z-function z-perl&quot;&gt;sign&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-function-call z-perl&quot;&gt;&lt;span class=&quot;z-variable z-function z-perl&quot;&gt;with&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-function-call z-perl&quot;&gt;&lt;span class=&quot;z-variable z-function z-perl&quot;&gt;letsencrypt&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-block z-end z-perl&quot;&gt;}&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;div class=&quot;note&quot;&gt;&lt;small&gt;&lt;b&gt;Note:&lt;&#x2F;b&gt;
The example file includes more authority declarations, but we do not use them. They do not have to be removed.
&lt;&#x2F;small&gt;&lt;&#x2F;div&gt;
&lt;p&gt;We also need to adjust &lt;code&gt;httpd.conf&lt;&#x2F;code&gt; to accommodate HTTPS connections.
Here&#x27;s what the new configuration will look like.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;perl&quot; class=&quot;language-perl z-code&quot;&gt;&lt;code class=&quot;language-perl&quot; data-lang=&quot;perl&quot;&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;&lt;span class=&quot;z-meta z-comment z-perl&quot;&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-perl&quot;&gt;#&lt;&#x2F;span&gt; HTTP&#x2F;HTTPS
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-perl&quot;&gt;&lt;span class=&quot;z-variable z-function z-perl&quot;&gt;server&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-string z-perl&quot;&gt;&lt;span class=&quot;z-string z-quoted z-double z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;example.net&lt;span class=&quot;z-punctuation z-definition z-string z-end z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-punctuation z-section z-block z-begin z-perl&quot;&gt;{&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;    &lt;span class=&quot;z-meta z-function-call z-perl&quot;&gt;&lt;span class=&quot;z-variable z-function z-perl&quot;&gt;alias&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-string z-perl&quot;&gt;&lt;span class=&quot;z-string z-quoted z-double z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;www.example.net&lt;span class=&quot;z-punctuation z-definition z-string z-end z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;    &lt;span class=&quot;z-meta z-function-call z-perl&quot;&gt;&lt;span class=&quot;z-support z-function z-perl&quot;&gt;listen&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-other z-perl&quot;&gt;on&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-arithmetic z-perl&quot;&gt;*&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-function-call z-perl&quot;&gt;&lt;span class=&quot;z-variable z-function z-perl&quot;&gt;port&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-numeric z-integer z-decimal z-perl&quot;&gt;80&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;    &lt;span class=&quot;z-meta z-function-call z-perl&quot;&gt;&lt;span class=&quot;z-support z-function z-perl&quot;&gt;listen&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-other z-perl&quot;&gt;on&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-arithmetic z-perl&quot;&gt;*&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-function-call z-perl&quot;&gt;&lt;span class=&quot;z-variable z-function z-perl&quot;&gt;tls&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-function-call z-perl&quot;&gt;&lt;span class=&quot;z-variable z-function z-perl&quot;&gt;port&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-numeric z-integer z-decimal z-perl&quot;&gt;443&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;    &lt;span class=&quot;z-constant z-other z-perl&quot;&gt;tls&lt;&#x2F;span&gt; &lt;span class=&quot;z-punctuation z-section z-block z-begin z-perl&quot;&gt;{&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;        &lt;span class=&quot;z-meta z-function-call z-perl&quot;&gt;&lt;span class=&quot;z-variable z-function z-perl&quot;&gt;certificate&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-string z-perl&quot;&gt;&lt;span class=&quot;z-string z-quoted z-double z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&#x2F;etc&#x2F;ssl&#x2F;example.net.fullchain.pem&lt;span class=&quot;z-punctuation z-definition z-string z-end z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;        &lt;span class=&quot;z-meta z-function-call z-perl&quot;&gt;&lt;span class=&quot;z-variable z-function z-perl&quot;&gt;key&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-string z-perl&quot;&gt;&lt;span class=&quot;z-string z-quoted z-double z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&#x2F;etc&#x2F;ssl&#x2F;private&#x2F;example.net.key&lt;span class=&quot;z-punctuation z-definition z-string z-end z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;    &lt;span class=&quot;z-punctuation z-section z-block z-end z-perl&quot;&gt;}&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;    &lt;span class=&quot;z-meta z-function-call z-perl&quot;&gt;&lt;span class=&quot;z-variable z-function z-perl&quot;&gt;root&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-string z-perl&quot;&gt;&lt;span class=&quot;z-string z-quoted z-double z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&#x2F;htdocs&#x2F;example.net&lt;span class=&quot;z-punctuation z-definition z-string z-end z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;    &lt;span class=&quot;z-meta z-function-call z-perl&quot;&gt;&lt;span class=&quot;z-variable z-function z-perl&quot;&gt;location&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-string z-perl&quot;&gt;&lt;span class=&quot;z-string z-quoted z-double z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&#x2F;.well-known&#x2F;acme-challenge&#x2F;*&lt;span class=&quot;z-punctuation z-definition z-string z-end z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-punctuation z-section z-block z-begin z-perl&quot;&gt;{&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;        &lt;span class=&quot;z-meta z-function-call z-perl&quot;&gt;&lt;span class=&quot;z-variable z-function z-perl&quot;&gt;root&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-string z-perl&quot;&gt;&lt;span class=&quot;z-string z-quoted z-double z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&#x2F;acme&lt;span class=&quot;z-punctuation z-definition z-string z-end z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;        &lt;span class=&quot;z-meta z-function-call z-perl&quot;&gt;&lt;span class=&quot;z-variable z-function z-perl&quot;&gt;request&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-function-call z-perl&quot;&gt;&lt;span class=&quot;z-variable z-function z-perl&quot;&gt;strip&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-numeric z-integer z-decimal z-perl&quot;&gt;2&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;    &lt;span class=&quot;z-punctuation z-section z-block z-end z-perl&quot;&gt;}&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-block z-end z-perl&quot;&gt;}&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We quickly reload &lt;code&gt;httpd&lt;&#x2F;code&gt; so that the configuration is applied.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# rcctl reload httpd&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Next, we make sure that the ACME challenge directory and the certificate directory that we used in the configuration files exist (with correct permissions).&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# mkdir&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;p&lt;&#x2F;span&gt; &#x2F;var&#x2F;www&#x2F;acme&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# chmod 755 &#x2F;var&#x2F;www&#x2F;acme&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# mkdir&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;p&lt;&#x2F;span&gt; &#x2F;etc&#x2F;ssl&#x2F;private&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# chmod 700 &#x2F;etc&#x2F;ssl&#x2F;private&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We are now ready to generate certificates.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# acme-client&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;v&lt;&#x2F;span&gt; example.net&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Reload &lt;code&gt;httpd&lt;&#x2F;code&gt;, and everything should be working. Our website can be accessed at &quot;https:&#x2F;&#x2F;example.net&quot;&lt;&#x2F;p&gt;
&lt;h3 id=&quot;automatic-certificate-renewal&quot;&gt;Automatic Certificate Renewal&lt;&#x2F;h3&gt;
&lt;p&gt;The certificate is valid for 90 days. We can make a &lt;code&gt;crontab&lt;&#x2F;code&gt; entry to run &lt;code&gt;acme-client&lt;&#x2F;code&gt; regularly and make certificate renewal automatic.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# crontab&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;e&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We make the following entry to run &lt;code&gt;acme-client&lt;&#x2F;code&gt; and reload &lt;code&gt;httpd&lt;&#x2F;code&gt; at the start of every month.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt;     0     1     &lt;span class=&quot;z-keyword z-operator z-regexp z-quantifier z-shell&quot;&gt;*&lt;&#x2F;span&gt;     &lt;span class=&quot;z-keyword z-operator z-regexp z-quantifier z-shell&quot;&gt;*&lt;&#x2F;span&gt;     acme-client&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;v&lt;&#x2F;span&gt; example.net&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-logical z-and z-shell&quot;&gt;&amp;amp;&amp;amp;&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;rcctl&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; reload httpd&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
</description>
      </item>
      <item>
          <title>Deploying &amp; Securing a VPS</title>
          <pubDate>Thu, 24 Mar 2022 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://www.sinankurtulmus.net/handbook/vps/</link>
          <guid>https://www.sinankurtulmus.net/handbook/vps/</guid>
          <description xml:base="https://www.sinankurtulmus.net/handbook/vps/">&lt;p&gt; &lt;&#x2F;p&gt;
&lt;p&gt;Having a VPS may unlock numerous possibilities regarding the usage of online services for ordinary &lt;em&gt;internautes&lt;&#x2F;em&gt;.
I believe anyone who is somewhat tech-savvy should get one, provided that she can afford it.
This is a short guide that goes over the basic steps to quickly set up a VPS - either on OpenBSD or on Linux - and make it secure so that we can reliably run various services on it.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;First of all, we need to choose a VPS hosting provider to host our server and make an account.&lt;&#x2F;p&gt;
&lt;p&gt;After creating an account, we can provide the necessary payment info and deploy a new server with the preferred configuration.&lt;&#x2F;p&gt;
&lt;p&gt;The graphical Web interfaces are fairly straightforward and easy to navigate, but I will mention a few key points regarding the properties of the server.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;For your first VPS, choose the cheapest plan available.
This should give you a single core of shared vCPU, 512 or 1024 MB of RAM, some storage and bandwidth.
You don&#x27;t need a lot of resources for hosting simple services, and you can always upgrade later or use a snapshot to redeploy.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;The server location should not matter a whole lot, but it might be a good idea to choose a location that is close to you, or to other potential users who might connect to the server.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;As for the operating system, I would highly recommend OpenBSD if you just want a simple and secure system to work with and host your website as well as other services without hassle.
It is very pleasant and a great choice to become familiar with how a UNIX system works.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;If you want to use Linux or depend on software that runs on Linux, I would recommend that you go with Fedora if you need a fairly stable system with the latest software, or Rocky Linux which is downstream of Fedora and is considered to be even more stable.
Debian and Ubuntu should also be mentioned as they are the most popular distributions.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Choose the latest OS version, unless you have a reason not to.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;You may disable auto backups if you don&#x27;t wish to pay extra for them.
At your own risk, of course.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;You may still enable IPv6 as an additional option.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Choose a logical hostname and a label.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;div class=&quot;note&quot;&gt;&lt;small&gt;&lt;b&gt;Note:&lt;&#x2F;b&gt;
Make sure that the server size you choose is not for IPv6-only.
IPv4 is the standard for now, and you will need it.
&lt;&#x2F;small&gt;&lt;&#x2F;div&gt;
&lt;p&gt;After creating the server with these settings, information about the server including the public IP address and the root password should be available in the user panel of our VPS provider.
It might take a few minutes to finish running the initialization scripts, and we should be able to log in to the server after that.&lt;&#x2F;p&gt;
&lt;p&gt;In order to log in remotely and execute commands, we will be using &lt;code&gt;ssh&lt;&#x2F;code&gt;.
&lt;a href=&quot;https:&#x2F;&#x2F;www.openssh.com&#x2F;&quot;&gt;OpenSSH&lt;&#x2F;a&gt; should be pre-installed on most Linux, BSD and MacOS systems, and on more recent versions of Windows.
We can log in to the new server as the superuser using the public IP (Entering the root password when prompted).&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@void:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ ssh root@&lt;span class=&quot;z-keyword z-operator z-assignment z-redirection z-shell&quot;&gt;&amp;lt;&lt;&#x2F;span&gt;public-IP&lt;span class=&quot;z-keyword z-operator z-assignment z-redirection z-shell&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The server is now accessible. We can now do the following things to improve security.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Create a regular user on the system and disallow remote root logins (use &lt;code&gt;su&lt;&#x2F;code&gt; instead)&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Create an SSH keypair and log in as the user with an authorized key.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Change the default SSH port in order to mitigate automated bruteforce attacks.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;div class=&quot;note&quot;&gt;&lt;small&gt;&lt;b&gt;Note:&lt;&#x2F;b&gt;
Even though these attacks may not succeed, they will at least fill your firewall and sshd logs with hundreds of lines of bruteforce attempts from IPs in China.
It is best to change the default SSH port just to have cleaner logs.
&lt;&#x2F;small&gt;&lt;&#x2F;div&gt;
&lt;p&gt;We start by creating a regular user with a home directory.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# useradd&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;m&lt;&#x2F;span&gt; username&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;div class=&quot;note&quot;&gt;&lt;small&gt;&lt;b&gt;Note:&lt;&#x2F;b&gt;
The username here is &quot;username&quot;, but this is for demonstration purposes.
You should ideally set a username that is harder to guess.
&lt;&#x2F;small&gt;&lt;&#x2F;div&gt;
&lt;p&gt;We set a password for the new user.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# passwd username&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We also add the user to the &quot;wheel&quot; group for &lt;code&gt;su&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# usermod&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;G&lt;&#x2F;span&gt; wheel username&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We now go back to our client PC and create a keypair, preferably with the ed25519 algorithm. We may also add a comment to help identify it.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@void:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ ssh-keygen&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;t&lt;&#x2F;span&gt; ed25519&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;C&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-quoted z-double z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;My key&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;div class=&quot;note&quot;&gt;&lt;small&gt;&lt;b&gt;Note:&lt;&#x2F;b&gt;
It is possible to change the name&#x2F;location of the key when prompted, which will be helpful when creating multiple keys for different purposes and organizing them in a coherent manner.
I will change it to &lt;code&gt;.ssh&#x2F;id_ed25519_0&lt;&#x2F;code&gt;.
&lt;&#x2F;small&gt;&lt;&#x2F;div&gt;
&amp;nbsp;
&lt;div class=&quot;note&quot;&gt;&lt;small&gt;&lt;b&gt;Note:&lt;&#x2F;b&gt;
It is beneficial to also set a password for the key when prompted.
This provides an additional layer of security.&lt;br&gt;&lt;br&gt;
Losing the keyfile or the password to it will lock you out of the server, so it is important to make sure that they are safe.
&lt;&#x2F;small&gt;&lt;&#x2F;div&gt;
&lt;p&gt;We can add our public key to &lt;code&gt;.ssh&#x2F;authorized_keys&lt;&#x2F;code&gt; in the remote user&#x27;s home directory manually, but &lt;code&gt;ssh-copy-id&lt;&#x2F;code&gt; provides an easier way to copy keys to a remote host.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@void:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ ssh-copy-id&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;i&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&#x2F;.ssh&#x2F;id_ed25519_0.pub username@&lt;span class=&quot;z-keyword z-operator z-assignment z-redirection z-shell&quot;&gt;&amp;lt;&lt;&#x2F;span&gt;public-IP&lt;span class=&quot;z-keyword z-operator z-assignment z-redirection z-shell&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We need to make a few changes in the &lt;code&gt;&#x2F;etc&#x2F;sshd_config&lt;&#x2F;code&gt; file on the server.
Log in now as a regular user, and use &lt;code&gt;su&lt;&#x2F;code&gt; to gain root access.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@void:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ ssh username@&lt;span class=&quot;z-keyword z-operator z-assignment z-redirection z-shell&quot;&gt;&amp;lt;&lt;&#x2F;span&gt;public-IP&lt;span class=&quot;z-keyword z-operator z-assignment z-redirection z-shell&quot;&gt;&amp;gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-punctuation z-terminator z-file-descriptor z-shell&quot;&gt;-&lt;&#x2F;span&gt;i &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&#x2F;.ssh&#x2F;id_ed25519_0&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;username@server:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ su&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# vi &#x2F;etc&#x2F;ssh&#x2F;sshd_config&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We will disallow remote root logins and disable all password logins&#x2F;interactive keyboard logins. This leaves public key authentication as our only authentication method when logging in.
We may also change the default SSH port now (to 44400 in this example).
We find, uncomment or add the following lines, adjusting the settings as shown below.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;Port&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; 44400&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;PermitRootLogin&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; no&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;PasswordAuthentication&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; no&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;KbdInteractiveAuthentication&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; no&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;div class=&quot;note&quot;&gt;&lt;small&gt;&lt;b&gt;Note:&lt;&#x2F;b&gt;
Depending on how your system was set up, there might be files inside the &lt;code&gt;&#x2F;etc&#x2F;ssh&#x2F;sshd_config.d&#x2F;&lt;&#x2F;code&gt; directory overriding the settings we just defined in the &lt;code&gt;&#x2F;etc&#x2F;ssh&#x2F;sshd_config&lt;&#x2F;code&gt; file.
Make sure to check the contents of this directory and delete files&#x2F;lines where necessary.
&lt;&#x2F;small&gt;&lt;&#x2F;div&gt;
&lt;p&gt;&lt;code&gt;sshd&lt;&#x2F;code&gt; needs to be restarted so that the changes take effect.&lt;&#x2F;p&gt;
&lt;div class=&quot;note&quot;&gt;&lt;small&gt;&lt;b&gt;Note:&lt;&#x2F;b&gt;
&lt;b style=&quot;color: red;&quot;&gt;&lt;u&gt;Do not&lt;&#x2F;u&gt;&lt;&#x2F;b&gt; restart &lt;code&gt;sshd&lt;&#x2F;code&gt; yet if you have a firewall running.
You might get locked out if the new port is not open.
Temporarily disable the firewall, or check the firewall section of this guide first.
&lt;&#x2F;small&gt;&lt;&#x2F;div&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# rcctl restart sshd&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;div class=&quot;note&quot;&gt;&lt;small&gt;&lt;b&gt;Note:&lt;&#x2F;b&gt;
&lt;code&gt;rcctl&lt;&#x2F;code&gt; is for OpenBSD.
Use &lt;code&gt;systemctl restart sshd&lt;&#x2F;code&gt; on Fedora (and on all Linux distributions with systemd).
&lt;&#x2F;small&gt;&lt;&#x2F;div&gt;
&lt;p&gt;It is also possible to use a config file on our client for convenience.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@void:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ vim &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&#x2F;.ssh&#x2F;config&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We write the following entry and save the file.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; class=&quot;language-bash z-code&quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;Host&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; server&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;    &lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;HostName&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-keyword z-operator z-assignment z-redirection z-shell&quot;&gt;&amp;lt;&lt;&#x2F;span&gt;public-IP&lt;span class=&quot;z-keyword z-operator z-assignment z-redirection z-shell&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;    &lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;User&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; username&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;    &lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;Port&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; 44400&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;    &lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;IdentityFile&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&#x2F;.ssh&#x2F;id_ed25519_0&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We can now log in simply like this:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@void:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ ssh server&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Finally, we can set some firewall rules to further improve security. This part is platform-specific.&lt;&#x2F;p&gt;
&lt;div class=&quot;note&quot;&gt;&lt;small&gt;&lt;b&gt;Note:&lt;&#x2F;b&gt;
These are just some very basic rules for firewalls.
This is not a detailed firewall guide in any way.
&lt;&#x2F;small&gt;&lt;&#x2F;div&gt;
&lt;h3 id=&quot;firewall-for-openbsd&quot;&gt;Firewall for OpenBSD&lt;&#x2F;h3&gt;
&lt;p&gt;Firewalling on OpenBSD is handled by &lt;a href=&quot;https:&#x2F;&#x2F;www.openbsd.org&#x2F;faq&#x2F;pf&#x2F;&quot;&gt;pf&lt;&#x2F;a&gt;. All connections are passed by default. Rules can be defined in &lt;code&gt;&#x2F;etc&#x2F;pf.conf&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# vi &#x2F;etc&#x2F;pf.conf&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Here is a crude ruleset with some comments.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;ini&quot; class=&quot;language-ini z-code&quot;&gt;&lt;code class=&quot;language-ini&quot; data-lang=&quot;ini&quot;&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;&lt;span class=&quot;z-meta z-comment z-genconfig&quot;&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-genconfig&quot;&gt;# Define the ssh port as a variable
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;&lt;span class=&quot;z-meta z-param z-genconfig&quot;&gt;&lt;span class=&quot;z-variable z-parameter z-genconfig&quot;&gt;port_ssh&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-genconfig&quot;&gt;=&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-quoted z-double z-genconfig&quot;&gt;&amp;quot;{44400}&amp;quot;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;&lt;span class=&quot;z-meta z-comment z-genconfig&quot;&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-genconfig&quot;&gt;# Do not filter on the loopback interface
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;&lt;span class=&quot;z-meta z-param z-genconfig&quot;&gt;&lt;span class=&quot;z-variable z-parameter z-genconfig&quot;&gt;set&lt;&#x2F;span&gt; &lt;&#x2F;span&gt;skip &lt;span class=&quot;z-constant z-language z-genconfig&quot;&gt;on&lt;&#x2F;span&gt; { lo }
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;&lt;span class=&quot;z-meta z-comment z-genconfig&quot;&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-genconfig&quot;&gt;# Drop packets that are blocked
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;&lt;span class=&quot;z-meta z-comment z-genconfig&quot;&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-genconfig&quot;&gt;# This gives less information to potential attackers
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;&lt;span class=&quot;z-meta z-comment z-genconfig&quot;&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-genconfig&quot;&gt;# Also saves bandwidth
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;&lt;span class=&quot;z-meta z-param z-genconfig&quot;&gt;&lt;span class=&quot;z-variable z-parameter z-genconfig&quot;&gt;set&lt;&#x2F;span&gt; &lt;&#x2F;span&gt;block&lt;span class=&quot;z-keyword z-operator z-genconfig&quot;&gt;-&lt;&#x2F;span&gt;policy drop
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;&lt;span class=&quot;z-meta z-comment z-genconfig&quot;&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-genconfig&quot;&gt;# Block everything by default
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;&lt;span class=&quot;z-meta z-param z-genconfig&quot;&gt;&lt;span class=&quot;z-variable z-parameter z-genconfig&quot;&gt;block&lt;&#x2F;span&gt; &lt;&#x2F;span&gt;drop all
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;&lt;span class=&quot;z-meta z-comment z-genconfig&quot;&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-genconfig&quot;&gt;# Allow limited ICMP traffic (bleh)
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;&lt;span class=&quot;z-meta z-param z-genconfig&quot;&gt;&lt;span class=&quot;z-variable z-parameter z-genconfig&quot;&gt;pass&lt;&#x2F;span&gt; &lt;&#x2F;span&gt;in log &lt;span class=&quot;z-constant z-language z-genconfig&quot;&gt;on&lt;&#x2F;span&gt; egress proto icmp max&lt;span class=&quot;z-keyword z-operator z-genconfig&quot;&gt;-&lt;&#x2F;span&gt;pkt&lt;span class=&quot;z-keyword z-operator z-genconfig&quot;&gt;-&lt;&#x2F;span&gt;rate &lt;span class=&quot;z-constant z-numeric z-genconfig&quot;&gt;5&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-genconfig&quot;&gt;&#x2F;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric z-genconfig&quot;&gt;1&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;&lt;span class=&quot;z-meta z-comment z-genconfig&quot;&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-genconfig&quot;&gt;# Allow incoming ssh connections
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;&lt;span class=&quot;z-meta z-param z-genconfig&quot;&gt;&lt;span class=&quot;z-variable z-parameter z-genconfig&quot;&gt;pass&lt;&#x2F;span&gt; &lt;&#x2F;span&gt;in log &lt;span class=&quot;z-constant z-language z-genconfig&quot;&gt;on&lt;&#x2F;span&gt; egress proto tcp from any to any port &lt;span class=&quot;z-storage z-source z-genconfig&quot;&gt;$port_ssh&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;&lt;span class=&quot;z-meta z-comment z-genconfig&quot;&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-genconfig&quot;&gt;# Allow all outgoing connections
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-genconfig&quot;&gt;&lt;span class=&quot;z-meta z-param z-genconfig&quot;&gt;&lt;span class=&quot;z-variable z-parameter z-genconfig&quot;&gt;pass&lt;&#x2F;span&gt; &lt;&#x2F;span&gt;out &lt;span class=&quot;z-constant z-language z-genconfig&quot;&gt;on&lt;&#x2F;span&gt; egress from any to any
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;div class=&quot;note&quot;&gt;&lt;small&gt;&lt;b&gt;Note:&lt;&#x2F;b&gt;
Pay attention to the lines concerning ssh. You might lock yourself out of the server with a typo.
&lt;&#x2F;small&gt;&lt;&#x2F;div&gt;
&lt;p&gt;&lt;code&gt;pf&lt;&#x2F;code&gt; should be enabled by default. We check the configuration and then load the new ruleset.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# pfctl&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;nf&lt;&#x2F;span&gt; &#x2F;etc&#x2F;pf.conf&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# pfctl&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;f&lt;&#x2F;span&gt; &#x2F;etc&#x2F;pf.conf&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h3 id=&quot;firewall-for-fedora-linux&quot;&gt;Firewall for Fedora&#x2F;Linux&lt;&#x2F;h3&gt;
&lt;p&gt;Firewalld is the default firewall program on Fedora and other Linux distributions related to the RHEL ecosystem, and it uses &lt;code&gt;nftables&lt;&#x2F;code&gt; as a backend.
On other distributions with systemd, &lt;code&gt;firewalld&lt;&#x2F;code&gt; can be install through the package manager.
Using &lt;code&gt;ufw&lt;&#x2F;code&gt; or using &lt;code&gt;iptables&lt;&#x2F;code&gt;&#x2F;&lt;code&gt;nftables&lt;&#x2F;code&gt; directly are other options for firewalling on Linux, but this guide only covers some basic commands with &lt;code&gt;firewalld&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Here is how we can set up basic firewall functionality using &lt;code&gt;firewalld&lt;&#x2F;code&gt;&#x27;s command-line interface: &lt;code&gt;firewall-cmd&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;First of all, we check if &lt;code&gt;firewalld&lt;&#x2F;code&gt; is running.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# systemctl status firewalld&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If not, we enable and start it.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# systemctl enable&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; --&lt;&#x2F;span&gt;now&lt;&#x2F;span&gt; firewalld&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We can check the current configuration with:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# firewall-cmd&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; --&lt;&#x2F;span&gt;list-all&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This lists the active &lt;em&gt;zones&lt;&#x2F;em&gt; and their configurations. In &lt;code&gt;firewalld&lt;&#x2F;code&gt;, a network interface cannot be assigned to more than one zone. The external interface of your server should be assigned to the &quot;public&quot; zone, or some other custom zone. We can verify this by reading the output of the command above; under the zone name, it should contain a line that looks like:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;txt&quot; class=&quot;language-txt z-code&quot;&gt;&lt;code class=&quot;language-txt&quot; data-lang=&quot;txt&quot;&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;    interface: enp1s0
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;In this case, &lt;code&gt;enp1s0&lt;&#x2F;code&gt; is the external interface. We can make sure that the zone of this interface (I am assuming that it is &quot;public&quot;, but it could be something else on your system) is the default one for our commands.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# firewall-cmd&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; --&lt;&#x2F;span&gt;get-default-zone&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If not:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# firewall-cmd&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; --&lt;&#x2F;span&gt;set-default-zone&lt;&#x2F;span&gt; public&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Now that we have the active zone linked to our external interface as our default zone, we can proceed.
&lt;code&gt;firewall-cmd&lt;&#x2F;code&gt; will show us the services and the ports that are open.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# firewall-cmd&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; --&lt;&#x2F;span&gt;list-all&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Read the output, and look for lines starting with &quot;services&quot; and &quot;ports&quot;.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;txt&quot; class=&quot;language-txt z-code&quot;&gt;&lt;code class=&quot;language-txt&quot; data-lang=&quot;txt&quot;&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;    services: cockpit dhcpv6-client ssh
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;    ports:
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;First, we can remove the services that we don&#x27;t need.
Cockpit is a Web interface for servers.
Feel free to keep it enabled, but I will remove it as an example, since it is not necessary.
Here is how you remove services with &lt;code&gt;firewall-cmd&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# firewall-cmd&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; --&lt;&#x2F;span&gt;remove-service&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment z-option z-shell&quot;&gt;=&lt;&#x2F;span&gt;cockpit&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Next, we add our alternative ssh port (44400) to the list of allowed ports.
On Fedora, &lt;a href=&quot;https:&#x2F;&#x2F;www.redhat.com&#x2F;en&#x2F;topics&#x2F;linux&#x2F;what-is-selinux&quot;&gt;SELinux&lt;&#x2F;a&gt; might prevent ssh connections on different ports, so we need to let it know that we are explicitly allowing ssh on port 44400.&lt;&#x2F;p&gt;
&lt;p&gt;The default port for ssh is port 22.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# semanage port&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;l&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-logical z-pipe z-shell&quot;&gt;|&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;grep&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; ssh&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Output:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;txt&quot; class=&quot;language-txt z-code&quot;&gt;&lt;code class=&quot;language-txt&quot; data-lang=&quot;txt&quot;&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;ssh_port_t                      tcp      22
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We allow the new port:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# semanage port&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;a&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;t&lt;&#x2F;span&gt; ssh_port_t&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;p&lt;&#x2F;span&gt; 44000&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;And confirm that the new port was added:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# semanage port&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;l&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-logical z-pipe z-shell&quot;&gt;|&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;grep&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; ssh&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The output should contain the new port.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;txt&quot; class=&quot;language-txt z-code&quot;&gt;&lt;code class=&quot;language-txt&quot; data-lang=&quot;txt&quot;&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;ssh_port_t                      tcp      44000, 22
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We can now open the port with &lt;code&gt;firewall-cmd&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# firewall-cmd&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; --&lt;&#x2F;span&gt;add-port&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment z-option z-shell&quot;&gt;=&lt;&#x2F;span&gt;44000&#x2F;tcp&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We may check if everything was configured the way we intended.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# firewall-cmd&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; --&lt;&#x2F;span&gt;list-all&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;When satisfied, we can make the configuration persistent across reboots.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# firewall-cmd&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; --&lt;&#x2F;span&gt;runtime-to-permanent&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;Here are a few things you can do on your VPS (Updated list):&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Host a website (&lt;a href=&quot;https:&#x2F;&#x2F;www.sinankurtulmus.net&#x2F;handbook&#x2F;httpd&#x2F;&quot;&gt;OpenBSD httpd&lt;&#x2F;a&gt;).&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.sinankurtulmus.net&#x2F;handbook&#x2F;wireguard&#x2F;&quot;&gt;Set up a VPN and a DNS resolver&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.sinankurtulmus.net&#x2F;handbook&#x2F;umurmur&#x2F;&quot;&gt;Run a VoIP server&lt;&#x2F;a&gt; for voice chat.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</description>
      </item>
      <item>
          <title>New Software Project: refer-styles</title>
          <pubDate>Thu, 20 May 2021 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://www.sinankurtulmus.net/handbook/refer-styles/</link>
          <guid>https://www.sinankurtulmus.net/handbook/refer-styles/</guid>
          <description xml:base="https://www.sinankurtulmus.net/handbook/refer-styles/">&lt;p&gt; &lt;&#x2F;p&gt;
&lt;p&gt;Dealing with citations can become difficult as one gathers more and more resources and publications of different formats.
The &lt;code&gt;groff&lt;&#x2F;code&gt; document formatting system that is included by default in most Linux distributions is a very simple and powerful tool.
&lt;code&gt;refer&lt;&#x2F;code&gt; is a preprocessor for Groff which automatically generates bibliographic references, but it does not offer the best functionality when it comes to working with strict guidelines and formatting rules regarding citations.&lt;&#x2F;p&gt;
&lt;p&gt;I started this project while I was writing my thesis in my final year at university, and ended up relying on it for the final version of my thesis, which was written entirely in groff.
At the moment, it is a modest collection of custom citation styles for the groff and the refer preprocessor.
In-text citations and end references are generated in accordance with the preferred style.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Supported citation styles: &lt;em&gt;APA, MLA&lt;&#x2F;em&gt;.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Supported groff macro packages: &lt;code&gt;ms&lt;&#x2F;code&gt;, &lt;code&gt;me&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;skurtulmus&#x2F;refer-styles&quot;&gt;This Github Link&lt;&#x2F;a&gt; contains the necessary files and a comprehensive manual for formatting academic citations with &lt;code&gt;refer-styles&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt; &lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;div class=&quot;text_img&quot;&gt;&lt;img src=&quot;&#x2F;assets&#x2F;images&#x2F;default&#x2F;dove.png&quot;&gt;&lt;&#x2F;div&gt;
</description>
      </item>
      <item>
          <title>New Software Project: Blackbubble</title>
          <pubDate>Fri, 19 Mar 2021 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://www.sinankurtulmus.net/handbook/blackbubble/</link>
          <guid>https://www.sinankurtulmus.net/handbook/blackbubble/</guid>
          <description xml:base="https://www.sinankurtulmus.net/handbook/blackbubble/">&lt;p&gt; &lt;&#x2F;p&gt;
&lt;p&gt;I prefer using the Vim text editor with a fairly barebones setup for all of my coding needs.
I also use Vim for all document editing purposes, often coupled with groff or LaTeX for creating PDF files.
Since I like working with Vim so much, I decided to create a very simple Vim script called &lt;code&gt;blackbubble&lt;&#x2F;code&gt; for creating slides and presenting them from within Vim.
&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;skurtulmus&#x2F;blackbubble&quot;&gt;This Github link&lt;&#x2F;a&gt; contains the plugin files, installation instructions and a guide for basic usage.&lt;&#x2F;p&gt;
&lt;p&gt; &lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;div class=&quot;text_img&quot;&gt;&lt;img src=&quot;&#x2F;assets&#x2F;images&#x2F;default&#x2F;dove.png&quot;&gt;&lt;&#x2F;div&gt;
</description>
      </item>
      <item>
          <title>Three Arguments for the Elimination of DRM</title>
          <pubDate>Thu, 18 Feb 2021 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://www.sinankurtulmus.net/blog/drm/</link>
          <guid>https://www.sinankurtulmus.net/blog/drm/</guid>
          <description xml:base="https://www.sinankurtulmus.net/blog/drm/">&lt;p&gt; &lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;Today, the majority of the digital media content - including films, books,
video games and some music - that users can &quot;purchase&quot; online comes encumbered
with Digital Rights Management (DRM) systems. DRM systems are technologies,
based on encryption and generally implemented in software shipped with products
or services, that are meant to impose restrictions on how the user interacts
with or uses digital media content. They are used as a measure intended to try
to stop the illegal and unauthorized distribution of digital copies of
copyright protected material on the Internet.&lt;&#x2F;p&gt;
&lt;p&gt;Well-known companies like Google, Amazon, Apple, Netflix, Spotify, Steam and
Kobo all make use of DRM software to protect most or all of the copyrighted
content on their platforms. Yet, not many users are aware of the existence of
DRM. DRM prevents users from making copies of digital files, transferring them
to different personal devices, or accessing them using different devices or
applications that would have been able to open them if it was not for DRM.
Therefore, typically, content that is &quot;purchased&quot; - more precisely, made
accessible through authentication to a certain user for an undefined amount of
time - on one platform can only be accessed through the services provided or
supported by that platform.&lt;&#x2F;p&gt;
&lt;p&gt;Many objections have been raised to the widespread use of DRM systems. This article focuses on three main points.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;drm-puts-the-user-s-privacy-and-security-at-risk&quot;&gt;DRM Puts the User&#x27;s Privacy and Security at Risk&lt;&#x2F;h3&gt;
&lt;p&gt;Digital security is already a difficult problem to solve. Frequently, new
vulnerabilities and security holes are discovered in all kinds of
software that many people use on a daily basis. DRM software often introduces
new security risks, potentially leaving the user&#x27;s device vulnerable to
attacks. This is particularly worrisome, since DRM software often has direct
access to highly sensitive data, such as credentials, purchase details, and
many kinds of personal information. While the potentiality of unintentional
vulnerabilities in DRM software is problematic, what is more alarming is that
DRM software can contain intentional security holes, as was the case in the
Sony rootkit scandal. Since these kinds of implementations are closed-source,
and the disassembly of proprietary binaries may be obstructed in many ways,
there is no good way of making sure that DRM systems are unmalicious and&#x2F;or
secure.&lt;&#x2F;p&gt;
&lt;p&gt;Even if it were possible to ensure code security, DRM software could still be
fundamentally problematic in terms of privacy, because of how it fundamentally
operates. DRM systems do not specifically block illegal or unauthorized access;
this approach is not feasible. Instead, they block all access to a DRM protected
file by default, and then they allow access to certain users on a platform, if
and when they are able to authenticate, and prove that they have paid for access.
This means that the software has to have at least some information about the user,
and&#x2F;or access to locations in the file system where it can store and retrieve
cryptographic keys, and perhaps credentials. This also means that private
consumption is not really private if the material in question is protected by
DRM. Moreover, in many cases, the information that is collected is much more
than the minimum amount that is necessary.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;interoperability-and-drm-do-not-go-together&quot;&gt;Interoperability and DRM Do Not Go Together&lt;&#x2F;h3&gt;
&lt;p&gt;Interoperability is another issue when it comes to implementing DRM systems. A
digital file encoded in an open format compatible with any program and any
device that can open it cannot be used in, or even transferred to, other
&quot;unsupported&quot; programs and devices, simply because the DRM software does not
allow it. This is true even if the target device or program has a different DRM
implementation of its own; DRM systems do not work with each other, and the
files have to be transferred from a central server anyway. In fact, in the
early and middle 2000s - when DRM systems were not as prominent as they are
today, and their shortcomings and potential alternatives were more openly
discussed - interoperability between different DRM systems, among many other
flaws, was a big concern. Many experts have stated that DRM interoperability is
virtually impossible to achieve, as it introduces large-scale security hazards,
and a need for quick and seamless cooperation between competing entities
whenever something malfunctions.&lt;&#x2F;p&gt;
&lt;p&gt;Nowadays, discussions on interoperability seem to have come to a halt. Numerous
implementations of DRM systems exist, and ventures for an open standard have
largely been abandoned. Meanwhile, the lack of interoperability only hurts the
consumers who are willing to pay for digital media and to make online
&quot;purchases&quot; through legal means. The situation also introduces the risk of
losing access to acquired digital material in case the user wishes to leave the
platform or service from which he&#x2F;she has &quot;purchased&quot; digital content, or the
service decides to disallow access to some or all of its users, citing various
reasons. As a result of this, some companies enjoy a huge amount of control
over the distribution of digital media, as well as intellectual content, ideas
and criticisms. Content that is only available on a single platform can
effectively be banned, and &quot;purchased&quot; material can be rendered inaccessible
through software updates. This is rarely the case with hardcover books or DVDs.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;drm-does-not-prevent-reduce-the-illegal-use-of-copyrighted-works&quot;&gt;DRM Does Not Prevent&#x2F;Reduce the Illegal Use of Copyrighted Works&lt;&#x2F;h3&gt;
&lt;p&gt;Finally, there is no good reason to believe that DRM protection reduces the
illegal distribution and use of digital media content. DRM systems have been in
prevalent use globally for at least 15 years. Yet, digital piracy has not died.
While subscription based services that also employ DRM protections - like
Netflix, Spotify, and their competitors - have significantly decreased the
demand for pirated content in their respective industries for a certain amount
of time, this effect was arguably caused by the well-integrated user experience
that they were able to offer to the paying members of their platforms.&lt;&#x2F;p&gt;
&lt;p&gt;In fact, the implementation of DRM itself more than likely increases the
motivation for piracy, and decreases the amount of legal purchases. This is
because DRM discourages the legitimate buyer, but does nothing significant to
stop illegal copying and distribution. Many works that are distributed online
bundled with DRM software can easily be purchased in other digital or
non-digital formats that do not have DRM, and can easily be copied. Moreover,
there are many ways to decrypt DRM protected files, or to &quot;extract&quot; the
protected content through methods like stream-ripping. In addition, there
exists a fair amount of empirical evidence, which shows that many users are
more likely to purchase digital media content when it is DRM-free.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;DRM systems have many drawbacks that should concern the end user, and provide no apparent benefit to the parties combatting unauthorized copying and distribution.
While they might have seemed like a potential remedy for piracy concerns in the early 2000s, in reality they have become part of the problem as opposed to a feasible solution.&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Offline &amp; Encrypted Personal E-Mail</title>
          <pubDate>Tue, 16 Feb 2021 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://www.sinankurtulmus.net/handbook/mail/</link>
          <guid>https://www.sinankurtulmus.net/handbook/mail/</guid>
          <description xml:base="https://www.sinankurtulmus.net/handbook/mail/">&lt;p&gt; &lt;&#x2F;p&gt;
&lt;p&gt;I find most e-mail clients to be both complicated and restrictive.
I like being able to read, write and manage my e-mail offline.
I also like storing my e-mail in an encrypted mailbox, in case someone else gets access to my device.&lt;&#x2F;p&gt;
&lt;p&gt;In this guide, I will explain how I have configured my e-mail system, and how it can be implemented for other users.
I will be using an exemplary Yandex e-mail account (example@yandex.com).&lt;&#x2F;p&gt;
&lt;p&gt;The programs needed to replicate this setup are:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;mutt&lt;&#x2F;code&gt; (e-mail client)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;isync&lt;&#x2F;code&gt; (IMAP synchronizer)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;msmtp&lt;&#x2F;code&gt; (SMTP client)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;gnupg2&lt;&#x2F;code&gt; (encryption and signing tool)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;pass&lt;&#x2F;code&gt; (password manager)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;These programs are easily available in most Linux and BSD systems, even though their package names might be different.
For this guide, Void Linux is used.
Instructions for other Linux or BSD systems should be very similar.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;Before we begin, we need to install the required packages.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@void:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ doas xbps-install mutt isync msmtp gnupg2 pass&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We start by configuring &lt;code&gt;mutt&lt;&#x2F;code&gt;, which is a very flexible and customizable e-mail client with many options.
The lines below are the ones that are relevant to this guide.
If you are already a &lt;code&gt;mutt&lt;&#x2F;code&gt; user, then these lines should be enough.
If not, then you might need to tweak the configuration to make it more usable for you.&lt;&#x2F;p&gt;
&lt;p&gt;We open the configuration file in a text editor.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@void:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ vim &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&#x2F;.config&#x2F;mutt&#x2F;muttrc&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We add the following lines, which tell &lt;code&gt;mutt&lt;&#x2F;code&gt; how to send e-mail, and where to look for received e-mail.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-support z-function z-set z-shell&quot;&gt;set&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; folder = &lt;span class=&quot;z-string z-quoted z-double z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-group z-expansion z-parameter z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-variable z-shell&quot;&gt;$&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable z-other z-readwrite z-shell&quot;&gt;HOME&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&#x2F;.email&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; All e-mail&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-support z-function z-set z-shell&quot;&gt;set&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; spoolfile = &lt;span class=&quot;z-string z-quoted z-double z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-group z-expansion z-parameter z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-variable z-shell&quot;&gt;$&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable z-other z-readwrite z-shell&quot;&gt;HOME&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&#x2F;.email&#x2F;INBOX&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; &amp;quot;Inbox&amp;quot; folder&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-support z-function z-set z-shell&quot;&gt;set&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; record = &lt;span class=&quot;z-string z-quoted z-double z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-group z-expansion z-parameter z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-variable z-shell&quot;&gt;$&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable z-other z-readwrite z-shell&quot;&gt;HOME&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&#x2F;.email&#x2F;Sent&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; &amp;quot;Sent&amp;quot; folder&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-support z-function z-set z-shell&quot;&gt;set&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; sendmail = &lt;span class=&quot;z-string z-quoted z-double z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&#x2F;usr&#x2F;bin&#x2F;msmtp -a yandex&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; Use msmtp&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-support z-function z-set z-shell&quot;&gt;set&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; use_from = yes &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; Generate the &amp;quot;From:&amp;quot; header field&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-support z-function z-set z-shell&quot;&gt;set&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; from = example@yandex.com &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; E-mail address header field&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-support z-function z-set z-shell&quot;&gt;set&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; realname = &lt;span class=&quot;z-string z-quoted z-double z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;Example User&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; Real name&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-support z-function z-set z-shell&quot;&gt;set&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; mbox = &lt;span class=&quot;z-string z-quoted z-double z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-group z-expansion z-parameter z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-variable z-shell&quot;&gt;$&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable z-other z-readwrite z-shell&quot;&gt;HOME&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&#x2F;.mailbox&#x2F;Archives&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; Read e-mail&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-support z-function z-set z-shell&quot;&gt;set&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; mbox_type = Maildir &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; Preferred mailbox type&#x2F;format&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-support z-function z-set z-shell&quot;&gt;set&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; move &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; Automatically move read e-mail to &amp;quot;mbox&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Next, we configure &lt;code&gt;isync&lt;&#x2F;code&gt; to get e-mail from a remote IMAP server.
The binary for &lt;code&gt;isync&lt;&#x2F;code&gt; is called &lt;code&gt;mbsync&lt;&#x2F;code&gt;, and the default configuration file is &lt;code&gt;~&#x2F;.mbsyncrc&lt;&#x2F;code&gt;.
In this guide, we will put the configuration file in &lt;code&gt;~&#x2F;.config&#x2F;mbsync&#x2F;mbsyncrc&lt;&#x2F;code&gt;, and read the file when running &lt;code&gt;mbsync&lt;&#x2F;code&gt;.
This makes our home directory tidier.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@void:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ mkdir&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;p&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&#x2F;.config&#x2F;mbsync&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@void:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ vim &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&#x2F;.config&#x2F;mbsync&#x2F;mbsyncrc&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;A basic configuration looks something like this.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;IMAPStore&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; yandex-remote &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; Remote IMAP server name&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;Host&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; imap.yandex.com &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; Remote IMAP server address&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;Port&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; 993 &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; IMAP port&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;User&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; example@yandex.com &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; User e-mail account&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;PassCmd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-string z-quoted z-double z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;pass yandex&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; Command to get account password&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;SSLType&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; IMAPS &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; Connection security&#x2F;encryption method&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;CertificateFile&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &#x2F;etc&#x2F;ssl&#x2F;certs&#x2F;ca-certificates.crt&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;MaildirStore&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; yandex-local &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; Local e-mail folder name&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;Path&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&#x2F;.mailbox&#x2F; &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; Path to local e-mail folder&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;Inbox&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&#x2F;.mailbox&#x2F;INBOX &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; Path to local inbox&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;Subfolders&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; Verbatim &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; Local folder naming style&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;Channel&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; yandex &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; Synchronization channel&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;Master&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; :yandex-remote: &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; Remote server&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;Slave&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; :yandex-local &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; Local storage&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;Create&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; Both &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; Create missing mailboxes on both&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;Expunge&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; Both &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; Remove all e-mail marked for deletion&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;Patterns&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-keyword z-operator z-regexp z-quantifier z-shell&quot;&gt;*&lt;&#x2F;span&gt; &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; Synchronize all mailboxes&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;SyncState&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-keyword z-operator z-regexp z-quantifier z-shell&quot;&gt;*&lt;&#x2F;span&gt; &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; Hidden synchronization state file in mailbox&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Then, we open up the &lt;code&gt;msmtp&lt;&#x2F;code&gt; configuration file, which is read from &lt;code&gt;~&#x2F;.config&#x2F;msmtp&#x2F;config&lt;&#x2F;code&gt; by default.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@void:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ vim &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&#x2F;.config&#x2F;msmtp&#x2F;config&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Here is a simple configuration that works.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;defaults &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; Set defaults for all accounts&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;auth&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; on &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; Enable authentication&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;tls&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; on &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; Enable TLS for secure connections&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;tls_trust_file&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &#x2F;etc&#x2F;ssl&#x2F;certs&#x2F;ca-certificates.crt&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;logfile&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &#x2F;tmp&#x2F;msmtp.log &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; Enable logging (optional)&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;account&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; yandex &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; Start a new account&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;host&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; smtp.yandex.com &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; SMTP server&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;port&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; 465 &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; SMTP port&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;from&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; example@yandex.com &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; Set the &amp;quot;From:&amp;quot; address&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; example@yandex.com &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; User account&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;passwordeval&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-string z-quoted z-double z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;pass yandex&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; Command to get account password&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;tls_starttls&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; off &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; Tunnel session through TLS&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;account&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; default : yandex &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; Default account&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Next, we generate two RSA keypairs with &lt;code&gt;gnupg2&lt;&#x2F;code&gt; (one for the mailbox encryption, and one for the encrypted password storage).
The binary is called &lt;code&gt;gpg2&lt;&#x2F;code&gt; on Void Linux.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@void:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ gpg2&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; --&lt;&#x2F;span&gt;full-generate-key&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The program will ask us questions about the keys we are generating.
We need to:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Choose &quot;RSA and RSA&quot; keys (this is default)&lt;&#x2F;li&gt;
&lt;li&gt;Choose 4096 bits as the keysize for better security (type 4096 when prompted for the keysize)&lt;&#x2F;li&gt;
&lt;li&gt;Specify a duration of validity for the keys (this is optional, but is a good security measure, and the key can always be extended when necessary)&lt;&#x2F;li&gt;
&lt;li&gt;Confirm the choices&lt;&#x2F;li&gt;
&lt;li&gt;Enter a real name (Example User)&lt;&#x2F;li&gt;
&lt;li&gt;Enter an e-mail address (example@yandex.com)&lt;&#x2F;li&gt;
&lt;li&gt;Enter a comment (this is optional)&lt;&#x2F;li&gt;
&lt;li&gt;Press &quot;O&quot; for &quot;Okay&quot;&lt;&#x2F;li&gt;
&lt;li&gt;Enter the passphrase to protect the new keys&lt;&#x2F;li&gt;
&lt;li&gt;Perform random actions on the mouse and on the keyboard in order to gain entropy while generating the keys (this is optional, and fun).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Then, we enter the following command to see the secret key ID.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@void:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ gpg2&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; --&lt;&#x2F;span&gt;list-keys&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; --&lt;&#x2F;span&gt;keyid-format&lt;&#x2F;span&gt; LONG&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The line beginning with &lt;code&gt;pub&lt;&#x2F;code&gt; should contain the secret key ID (&lt;code&gt;rsa4096&#x2F;&amp;lt;key_id&amp;gt;&lt;&#x2F;code&gt;). We note this number.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;txt&quot; class=&quot;language-txt z-code&quot;&gt;&lt;code class=&quot;language-txt&quot; data-lang=&quot;txt&quot;&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;&#x2F;home&#x2F;example&#x2F;.gnupg&#x2F;pubring.kbx
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;--------------------------------
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;pub   rsa4096&#x2F;0000000000000000 2021-01-01 [SC] # The 16-digit number here is the secret key ID.
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;      0000000000000000000000000000000000000000
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;uid   [ultimate] Example User &amp;lt;example@yandex.com&amp;gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;sub   rsa4096&#x2F;0000000000000000 2021-01-01 [E]
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We then generate a new RSA keypair with the same process.
This time, we might provide a comment when prompted, in order to make the new keypair more recognizable.
When the generation is complete, we note the ID of the new key as well.&lt;&#x2F;p&gt;
&lt;p&gt;Next up, we initialize the password storage with &lt;code&gt;pass&lt;&#x2F;code&gt;, using one of the key IDs we have generated.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@void:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ pass init &lt;span class=&quot;z-string z-quoted z-double z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;0000000000000000&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;By default, &lt;code&gt;pass&lt;&#x2F;code&gt; saves passwords in a &lt;code&gt;gpg2&lt;&#x2F;code&gt; encrypted file in the &lt;code&gt;~&#x2F;.password-store&lt;&#x2F;code&gt; directory.
We are going to store our e-mail account password with &lt;code&gt;pass&lt;&#x2F;code&gt;, because it is more secure than storing it in plain text.
We can insert a new password with the following command (we enter the password when prompted).&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@void:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ pass insert yandex&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We can see the newly added password like this:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@void:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ pass ls&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We also need to make the mailbox directory, compress it into a &lt;code&gt;tar&lt;&#x2F;code&gt; archive, and encrypt it using the other RSA keypair.
We will be decrypting the mailbox whenever we synchronize with &lt;code&gt;mbsync&lt;&#x2F;code&gt; or run the &lt;code&gt;mutt&lt;&#x2F;code&gt; e-mail client, and encrypting it again when we are done.
I am using a different fake key ID this time, to differentiate it from the previous one.&lt;&#x2F;p&gt;
&lt;p&gt;We run the following commands first to make the encrypted &lt;code&gt;tar&lt;&#x2F;code&gt; archive containing the empty mailbox, and remove the unencrypted files.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@void:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ mkdir &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&#x2F;.mailbox&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@void:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ tar&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;cf&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&#x2F;.mailbox.tar&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;C&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&#x2F; .mailbox&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@void:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ rmdir &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&#x2F;.mailbox&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@void:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ gpg2&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;r&lt;&#x2F;span&gt; 1111111111111111&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;e&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&#x2F;.mailbox&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@void:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ rm &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&#x2F;.mailbox.tar&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Finally, we write a simple shell script that will run everything as required. Let&#x27;s call the script &lt;code&gt;mymail&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@void:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ vim mymail&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Our script will:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Decrypt the encrypted &lt;code&gt;tar&lt;&#x2F;code&gt; archive, and make a backup of the encrypted one, in case something goes wrong.&lt;&#x2F;li&gt;
&lt;li&gt;Extract the mailbox from the archive, and remove the archive.&lt;&#x2F;li&gt;
&lt;li&gt;Run &lt;code&gt;mbsync&lt;&#x2F;code&gt; to get the latest e-mail from the remote server.&lt;&#x2F;li&gt;
&lt;li&gt;Run &lt;code&gt;mutt&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;When &lt;code&gt;mutt&lt;&#x2F;code&gt; is closed, compress the mailbox into a &lt;code&gt;tar&lt;&#x2F;code&gt; archive, and remove the uncompressed mailbox.&lt;&#x2F;li&gt;
&lt;li&gt;Encrypt the archived mailbox, and remove the unencrypted one.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Here is the script:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;!&#x2F;bin&#x2F;sh&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-variable z-other z-readwrite z-assignment z-shell&quot;&gt;MBOX&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment z-shell&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-unquoted z-shell&quot;&gt;&lt;span class=&quot;z-string z-quoted z-double z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;~&#x2F;.mailbox&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;gpg2&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt;&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;o&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-group z-expansion z-parameter z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-variable z-shell&quot;&gt;$&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable z-other z-readwrite z-shell&quot;&gt;MBOX&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;.tar&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;d&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-group z-expansion z-parameter z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-variable z-shell&quot;&gt;$&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable z-other z-readwrite z-shell&quot;&gt;MBOX&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;.tar.gpg&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-logical z-and z-shell&quot;&gt;&amp;amp;&amp;amp;&lt;&#x2F;span&gt; &lt;span class=&quot;z-punctuation z-separator z-continuation z-line z-shell&quot;&gt;\
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;mv&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-parameter z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-variable z-shell&quot;&gt;$&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable z-other z-readwrite z-shell&quot;&gt;MBOX&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;.tar.gpg &lt;span class=&quot;z-meta z-group z-expansion z-parameter z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-variable z-shell&quot;&gt;$&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable z-other z-readwrite z-shell&quot;&gt;MBOX&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;.tar.gpg.bak&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;tar&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt;&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;xf&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-group z-expansion z-parameter z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-variable z-shell&quot;&gt;$&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable z-other z-readwrite z-shell&quot;&gt;MBOX&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;.tar&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;C&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&#x2F;&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-logical z-and z-shell&quot;&gt;&amp;amp;&amp;amp;&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;rm&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-parameter z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-variable z-shell&quot;&gt;$&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable z-other z-readwrite z-shell&quot;&gt;MBOX&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;.tar&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-support z-function z-test z-begin z-shell&quot;&gt;[&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt;-&lt;&#x2F;span&gt;d&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-quoted z-double z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-group z-expansion z-parameter z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-variable z-shell&quot;&gt;$&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable z-other z-readwrite z-shell&quot;&gt;MBOX&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-support z-function z-test z-end z-shell&quot;&gt;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-logical z-and z-shell&quot;&gt;&amp;amp;&amp;amp;&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;mbsync&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt;&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;c&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&#x2F;.config&#x2F;mbsync&#x2F;mbsyncrc&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;a&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;mutt&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;tar&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt;&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;cf&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-group z-expansion z-parameter z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-variable z-shell&quot;&gt;$&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable z-other z-readwrite z-shell&quot;&gt;MBOX&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;.tar&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;C&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&#x2F; .mailbox&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-logical z-and z-shell&quot;&gt;&amp;amp;&amp;amp;&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;rm&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt;&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;r&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-group z-expansion z-parameter z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-variable z-shell&quot;&gt;$&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable z-other z-readwrite z-shell&quot;&gt;MBOX&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;gpg2&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt;&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;r&lt;&#x2F;span&gt; example@yandex.com&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;e&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-group z-expansion z-parameter z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-variable z-shell&quot;&gt;$&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable z-other z-readwrite z-shell&quot;&gt;MBOX&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;.tar&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-logical z-and z-shell&quot;&gt;&amp;amp;&amp;amp;&lt;&#x2F;span&gt; &lt;span class=&quot;z-punctuation z-separator z-continuation z-line z-shell&quot;&gt;\
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;rm&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-parameter z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-variable z-shell&quot;&gt;$&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable z-other z-readwrite z-shell&quot;&gt;MBOX&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;.tar&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We save the script and make it executable.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@void:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ chmod +x mymail&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Then, we copy the script to a directory in our &lt;code&gt;$PATH&lt;&#x2F;code&gt;, or we just run it.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;user@void:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;$ .&#x2F;mymail&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
</description>
      </item>
      <item>
          <title>wpa_supplicant: Wireless Connections</title>
          <pubDate>Wed, 10 Feb 2021 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://www.sinankurtulmus.net/handbook/wpa-supplicant/</link>
          <guid>https://www.sinankurtulmus.net/handbook/wpa-supplicant/</guid>
          <description xml:base="https://www.sinankurtulmus.net/handbook/wpa-supplicant/">&lt;p&gt;&lt;em&gt;&lt;strong&gt;Updated: May 2, 2024&lt;&#x2F;strong&gt;&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;p&gt; &lt;&#x2F;p&gt;
&lt;p&gt;It is possible, and fairly easy, to manage wireless connections on a daily basis using only &lt;code&gt;wpa_supplicant&lt;&#x2F;code&gt;.
Besides, it is worthwhile to know how to use &lt;code&gt;wpa_supplicant&lt;&#x2F;code&gt;, as it is part of the base system on all Linux distributions, as well as on NetBSD and on FreeBSD, and it is usually the most reliable way of managing wireless connections on devices like the Raspberry Pi, or on certain installation media.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;Usually, the network SSID and the WPA password are required to connect to a password-protected Wi-Fi network.
We can either edit the &lt;code&gt;&#x2F;etc&#x2F;wpa_supplicant&#x2F;wpa_supplicant.conf&lt;&#x2F;code&gt; file manually to provide the required information, or we can use &lt;code&gt;wpa_passphrase&lt;&#x2F;code&gt; to generate a WPA PSK from the password, and append it to the configuration file.
Let&#x27;s try connecting to a network called &quot;Network&quot; with the password &quot;password&quot;.
First, we need to make the &lt;code&gt;&#x2F;etc&#x2F;wpa_supplicant&lt;&#x2F;code&gt; directory, if it doesn&#x27;t exist.
The commands are executed as root, but &lt;code&gt;doas&lt;&#x2F;code&gt; or &lt;code&gt;sudo&lt;&#x2F;code&gt; can be used instead.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@void&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# mkdir&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;p&lt;&#x2F;span&gt; &#x2F;etc&#x2F;wpa_supplicant&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Then, we need to save our network information to the configuration file.
The &lt;code&gt;wpa_passphrase&lt;&#x2F;code&gt; program requires the ssid and the wpa password.
The &lt;code&gt;wpa_passphrase&lt;&#x2F;code&gt; program writes to standard output.
We can take this output, remove the line containing the actual password with &lt;code&gt;sed&lt;&#x2F;code&gt;, and write (or, in most cases, append in order to avoid overwriting the existing configuration) it to the configuration file by piping it into &lt;code&gt;tee&lt;&#x2F;code&gt;.
Below is the command to do it.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@void&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# wpa_passphrase &lt;span class=&quot;z-string z-quoted z-double z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;Network&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-quoted z-double z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;password&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-logical z-pipe z-shell&quot;&gt;|&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;sed&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-string z-quoted z-single z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;3d&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-logical z-pipe z-shell&quot;&gt;|&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;tee&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt;&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;a&lt;&#x2F;span&gt; &#x2F;etc&#x2F;wpa_supplicant&#x2F;wpa_supplicant.conf&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This is actually all the configuration needed to connect to a wireless network.
This process can be repeated when it is needed to connect to another network.&lt;&#x2F;p&gt;
&lt;p&gt;The configuration file looks like this right now:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;perl&quot; class=&quot;language-perl z-code&quot;&gt;&lt;code class=&quot;language-perl&quot; data-lang=&quot;perl&quot;&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;&lt;span class=&quot;z-constant z-other z-perl&quot;&gt;network&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment z-perl&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-block z-begin z-perl&quot;&gt;{&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;    &lt;span class=&quot;z-constant z-other z-perl&quot;&gt;ssid&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment z-perl&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-string z-perl&quot;&gt;&lt;span class=&quot;z-string z-quoted z-double z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;Network&lt;span class=&quot;z-punctuation z-definition z-string z-end z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;    &lt;span class=&quot;z-constant z-other z-perl&quot;&gt;psk&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment z-perl&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-string z-perl&quot;&gt;&lt;span class=&quot;z-string z-quoted z-double z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;...&lt;span class=&quot;z-punctuation z-definition z-string z-end z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-block z-end z-perl&quot;&gt;}&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;div class=&quot;note&quot;&gt;&lt;small&gt;&lt;b&gt;Note:&lt;&#x2F;b&gt; &lt;code&gt;wpa_cli&lt;&#x2F;code&gt; is a text-based frontend for interacting with &lt;code&gt;wpa_supplicant&lt;&#x2F;code&gt;, which I typically do not use.
In order to be able to use it when needed (presumably as a user in the &quot;wheel&quot; group), the following lines should be added to the beginning of the configuration file:&lt;&#x2F;small&gt;&lt;&#x2F;div&gt;
&lt;pre data-lang=&quot;perl&quot; class=&quot;language-perl z-code&quot;&gt;&lt;code class=&quot;language-perl&quot; data-lang=&quot;perl&quot;&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;&lt;span class=&quot;z-constant z-other z-perl&quot;&gt;ctrl_interface&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment z-perl&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other z-perl&quot;&gt;DIR&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment z-perl&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-generic z-begin z-perl&quot;&gt;&#x2F;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-string z-perl&quot;&gt;&lt;span class=&quot;z-string z-regexp z-perl&quot;&gt;&lt;span class=&quot;z-source z-regexp&quot;&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;v&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;a&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;r&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-generic z-end z-perl&quot;&gt;&#x2F;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-language z-flags z-regexp z-perl&quot;&gt;run&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-generic z-begin z-perl&quot;&gt;&#x2F;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-string z-perl&quot;&gt;&lt;span class=&quot;z-string z-regexp z-perl&quot;&gt;&lt;span class=&quot;z-source z-regexp&quot;&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;w&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;p&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;a&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;_&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;s&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;u&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;p&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;p&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;l&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;i&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;c&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;a&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;n&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;t&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt; &lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;G&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;R&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;O&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;U&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;P&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;w&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;h&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;e&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;e&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;l&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;&lt;span class=&quot;z-meta z-string z-perl&quot;&gt;&lt;span class=&quot;z-string z-regexp z-perl&quot;&gt;&lt;span class=&quot;z-source z-regexp&quot;&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;u&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;p&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;d&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;a&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;t&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;e&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;_&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;c&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;o&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;n&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;f&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;i&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;g&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-literal z-regexp&quot;&gt;1&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We can now start &lt;code&gt;wpa_supplicant&lt;&#x2F;code&gt; using the command below.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@void&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# wpa_supplicant&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;B&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;i&lt;&#x2F;span&gt; wlan0&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;c&lt;&#x2F;span&gt; &#x2F;etc&#x2F;wpa_supplicant&#x2F;wpa_supplicant.conf&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;div class=&quot;note&quot;&gt;&lt;small&gt;&lt;b&gt;Note:&lt;&#x2F;b&gt; The &lt;code&gt;-i&lt;&#x2F;code&gt; option specifies the wireless interface.
The interface name can be obtained using the &lt;code&gt;ifconfig&lt;&#x2F;code&gt; command.
Wireless interface names on Linux typically start with &quot;w&quot;.&lt;&#x2F;small&gt;&lt;&#x2F;div&gt;
&lt;p&gt;Then we run a DHCP client to obtain an IP address. In this guide, &lt;code&gt;dhcpcd&lt;&#x2F;code&gt; is used.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@void&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# dhcpcd&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We can use &lt;code&gt;ping&lt;&#x2F;code&gt; to make sure that the connection is established.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@void&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# ping google.com&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We can also enable the &lt;code&gt;wpa_supplicant&lt;&#x2F;code&gt; service (and the DHCP client, if it has not already been enabled) to start wireless networking on boot.
This process depends on the system, and most Linux distributions will use &lt;code&gt;systemctl&lt;&#x2F;code&gt;.
Here is how to do it on Void Linux:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@void&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# ln&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;s&lt;&#x2F;span&gt; &#x2F;etc&#x2F;sv&#x2F;wpa_supplicant &#x2F;var&#x2F;service&#x2F;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@void&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# ln&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;s&lt;&#x2F;span&gt; &#x2F;etc&#x2F;sv&#x2F;dhcpcd &#x2F;var&#x2F;service&#x2F;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h3 id=&quot;eduroam-connections&quot;&gt;Eduroam Connections&lt;&#x2F;h3&gt;
&lt;p&gt;Eduroam connections require additional authentication information.
We can provide it by editing the configuration file manually.&lt;&#x2F;p&gt;
&lt;div class=&quot;note&quot;&gt;&lt;small&gt;&lt;b&gt;Note:&lt;&#x2F;b&gt; It is possible to provide passwords in plain text using a &lt;code&gt;psk=&quot;...&quot;&lt;&#x2F;code&gt; entry, instead of a WPA PSK generated by &lt;code&gt;wpa_passphrase&lt;&#x2F;code&gt;.&lt;&#x2F;small&gt;&lt;&#x2F;div&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@void:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# cd &#x2F;etc&#x2F;wpa_supplicant&#x2F;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@void:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# vim wpa_supplicant.conf&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;div class=&quot;note&quot;&gt;&lt;small&gt;&lt;b&gt;Note:&lt;&#x2F;b&gt; The exact configuration in this guide might not work for every institution, depending on how the network is implemented.
University websites usually provide information on the authentication methods and protocols used.
&lt;i&gt;PEAP&lt;&#x2F;i&gt; or &lt;i&gt;TTLS&lt;&#x2F;i&gt; (or both) may be supported as an authentication framework.
For the inner authentication (phase 2), you might need to use &lt;i&gt;MSCHAPv2&lt;&#x2F;i&gt; or &lt;i&gt;PAP&lt;&#x2F;i&gt; depending on the network.
A separate guide for &lt;code&gt;wpa_supplicant&lt;&#x2F;code&gt; might not be included, but the information should still be enough for a working configuration.&lt;&#x2F;small&gt;&lt;&#x2F;div&gt;
&lt;p&gt;We add the following network configuration to the file:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;perl&quot; class=&quot;language-perl z-code&quot;&gt;&lt;code class=&quot;language-perl&quot; data-lang=&quot;perl&quot;&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;&lt;span class=&quot;z-constant z-other z-perl&quot;&gt;network&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment z-perl&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-block z-begin z-perl&quot;&gt;{&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;    &lt;span class=&quot;z-constant z-other z-perl&quot;&gt;ssid&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment z-perl&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-string z-perl&quot;&gt;&lt;span class=&quot;z-string z-quoted z-double z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;eduroam&lt;span class=&quot;z-punctuation z-definition z-string z-end z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-comment z-perl&quot;&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-perl&quot;&gt;#&lt;&#x2F;span&gt; Eduroam network SSID
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;    &lt;span class=&quot;z-constant z-other z-perl&quot;&gt;key_mgmt&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment z-perl&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other z-perl&quot;&gt;WPA&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-arithmetic z-perl&quot;&gt;-&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other z-perl&quot;&gt;EAP&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-comment z-perl&quot;&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-perl&quot;&gt;#&lt;&#x2F;span&gt; Use EAP
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;    &lt;span class=&quot;z-constant z-other z-perl&quot;&gt;eap&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment z-perl&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other z-perl&quot;&gt;TTLS&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-comment z-perl&quot;&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-perl&quot;&gt;#&lt;&#x2F;span&gt; Use tunneled TLS for authentication
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;    &lt;span class=&quot;z-constant z-other z-perl&quot;&gt;phase2&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment z-perl&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-string z-perl&quot;&gt;&lt;span class=&quot;z-string z-quoted z-double z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;auth=PAP&lt;span class=&quot;z-punctuation z-definition z-string z-end z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-comment z-perl&quot;&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-perl&quot;&gt;#&lt;&#x2F;span&gt; Use PAP for phase 2 authentication
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;    &lt;span class=&quot;z-constant z-other z-perl&quot;&gt;identity&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment z-perl&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-string z-perl&quot;&gt;&lt;span class=&quot;z-string z-quoted z-double z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;user&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-interpolation z-perl&quot;&gt;&lt;span class=&quot;z-variable z-other z-readwrite z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-variable z-perl&quot;&gt;@&lt;&#x2F;span&gt;mail&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted z-double z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-end z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-comment z-perl&quot;&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-perl&quot;&gt;#&lt;&#x2F;span&gt; University username&#x2F;e-mail address
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;    &lt;span class=&quot;z-constant z-other z-perl&quot;&gt;anonymous_identity&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment z-perl&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-string z-perl&quot;&gt;&lt;span class=&quot;z-string z-quoted z-double z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;anonymous&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-interpolation z-perl&quot;&gt;&lt;span class=&quot;z-variable z-other z-readwrite z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-variable z-perl&quot;&gt;@&lt;&#x2F;span&gt;mail&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted z-double z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-end z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-comment z-perl&quot;&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-perl&quot;&gt;#&lt;&#x2F;span&gt; For phase 1 security
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;    &lt;span class=&quot;z-constant z-other z-perl&quot;&gt;password&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment z-perl&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-string z-perl&quot;&gt;&lt;span class=&quot;z-string z-quoted z-double z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;...&lt;span class=&quot;z-punctuation z-definition z-string z-end z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-comment z-perl&quot;&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-perl&quot;&gt;#&lt;&#x2F;span&gt; The password in plain text
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-block z-end z-perl&quot;&gt;}&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The password is now in the configuration file. It is a good idea to make sure that the file can only be read by the root user.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@void:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# chmod 600 wpa_supplicant.conf&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We should now be able to connect to the Eduroam network after restarting the &lt;code&gt;wpa_supplicant&lt;&#x2F;code&gt; service.
Again, &lt;code&gt;systemctl&lt;&#x2F;code&gt; will be used instead on most Linux distributions.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@void:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# sv restart wpa_supplicant&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h3 id=&quot;public-networks&quot;&gt;Public Networks&lt;&#x2F;h3&gt;
&lt;p&gt;It is possible to join public networks without a password. Authentication might then be handled by a captive portal. In this case, setting the &lt;code&gt;key_mgmt&lt;&#x2F;code&gt; option to &lt;code&gt;NONE&lt;&#x2F;code&gt; works.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;perl&quot; class=&quot;language-perl z-code&quot;&gt;&lt;code class=&quot;language-perl&quot; data-lang=&quot;perl&quot;&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;&lt;span class=&quot;z-constant z-other z-perl&quot;&gt;network&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment z-perl&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-block z-begin z-perl&quot;&gt;{&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;    &lt;span class=&quot;z-constant z-other z-perl&quot;&gt;ssid&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment z-perl&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-string z-perl&quot;&gt;&lt;span class=&quot;z-string z-quoted z-double z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;Public_Network&lt;span class=&quot;z-punctuation z-definition z-string z-end z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;    &lt;span class=&quot;z-constant z-other z-perl&quot;&gt;key_mgmt&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment z-perl&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other z-perl&quot;&gt;NONE&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-block z-end z-perl&quot;&gt;}&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h3 id=&quot;finding-networks-connecting-to-hidden-networks&quot;&gt;Finding Networks &amp;amp; Connecting to Hidden Networks&lt;&#x2F;h3&gt;
&lt;p&gt;If the exact name of the network is not known, a scan may be performed on the wireless interface to detect available networks using the &lt;code&gt;iw&lt;&#x2F;code&gt; command on Linux.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; class=&quot;language-sh z-code&quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;root@server:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;# iw dev wlan0 scan&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-logical z-pipe z-shell&quot;&gt;|&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;grep&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; SSID&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;In some cases, the SSID of the network might be hidden.
Hidden networks will obviously not appear in the scan results, but if they are known, &lt;code&gt;wpa_supplicant&lt;&#x2F;code&gt; can connect to them with the &lt;code&gt;scan_ssid&lt;&#x2F;code&gt; option.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;perl&quot; class=&quot;language-perl z-code&quot;&gt;&lt;code class=&quot;language-perl&quot; data-lang=&quot;perl&quot;&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;&lt;span class=&quot;z-constant z-other z-perl&quot;&gt;network&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment z-perl&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-block z-begin z-perl&quot;&gt;{&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;    &lt;span class=&quot;z-constant z-other z-perl&quot;&gt;ssid&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment z-perl&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-string z-perl&quot;&gt;&lt;span class=&quot;z-string z-quoted z-double z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;Hidden_Network&lt;span class=&quot;z-punctuation z-definition z-string z-end z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;    &lt;span class=&quot;z-constant z-other z-perl&quot;&gt;scan_ssid&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment z-perl&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric z-integer z-decimal z-perl&quot;&gt;1&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;    &lt;span class=&quot;z-constant z-other z-perl&quot;&gt;psk&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment z-perl&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-string z-perl&quot;&gt;&lt;span class=&quot;z-string z-quoted z-double z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;...&lt;span class=&quot;z-punctuation z-definition z-string z-end z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-block z-end z-perl&quot;&gt;}&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h3 id=&quot;prioritizing-connections&quot;&gt;Prioritizing Connections&lt;&#x2F;h3&gt;
&lt;p&gt;For times when multiple networks are available, we can set the &lt;code&gt;priority&lt;&#x2F;code&gt; option to tell &lt;code&gt;wpa_supplicant&lt;&#x2F;code&gt; which connection to prioritize. The default priority is 0. The network with the higher priority number will be prioritized.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;perl&quot; class=&quot;language-perl z-code&quot;&gt;&lt;code class=&quot;language-perl&quot; data-lang=&quot;perl&quot;&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;&lt;span class=&quot;z-constant z-other z-perl&quot;&gt;network&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment z-perl&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-block z-begin z-perl&quot;&gt;{&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;    &lt;span class=&quot;z-constant z-other z-perl&quot;&gt;ssid&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment z-perl&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-string z-perl&quot;&gt;&lt;span class=&quot;z-string z-quoted z-double z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;Home_Network&lt;span class=&quot;z-punctuation z-definition z-string z-end z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;    &lt;span class=&quot;z-constant z-other z-perl&quot;&gt;psk&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment z-perl&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-string z-perl&quot;&gt;&lt;span class=&quot;z-string z-quoted z-double z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;...&lt;span class=&quot;z-punctuation z-definition z-string z-end z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;    &lt;span class=&quot;z-constant z-other z-perl&quot;&gt;priority&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment z-perl&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric z-integer z-decimal z-perl&quot;&gt;1&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-block z-end z-perl&quot;&gt;}&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;&lt;span class=&quot;z-constant z-other z-perl&quot;&gt;network&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment z-perl&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-block z-begin z-perl&quot;&gt;{&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;    &lt;span class=&quot;z-constant z-other z-perl&quot;&gt;ssid&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment z-perl&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-string z-perl&quot;&gt;&lt;span class=&quot;z-string z-quoted z-double z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;Mobile_Phone&lt;span class=&quot;z-punctuation z-definition z-string z-end z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;    &lt;span class=&quot;z-constant z-other z-perl&quot;&gt;psk&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment z-perl&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-string z-perl&quot;&gt;&lt;span class=&quot;z-string z-quoted z-double z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;...&lt;span class=&quot;z-punctuation z-definition z-string z-end z-perl&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;    &lt;span class=&quot;z-constant z-other z-perl&quot;&gt;priority&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment z-perl&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric z-integer z-decimal z-perl&quot;&gt;9&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-perl&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-block z-end z-perl&quot;&gt;}&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
</description>
      </item>
      <item>
          <title>Thoughts on Feature Phones and KaiOS</title>
          <pubDate>Wed, 25 Nov 2020 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://www.sinankurtulmus.net/blog/phone/</link>
          <guid>https://www.sinankurtulmus.net/blog/phone/</guid>
          <description xml:base="https://www.sinankurtulmus.net/blog/phone/">&lt;p&gt; &lt;&#x2F;p&gt;
&lt;div class=&quot;note&quot;&gt;&lt;small&gt;As of November 2022, I began using a more popular and more capable mobile electronic telecommunication device, A.K.A. a smartphone. This article is not updated.&lt;&#x2F;small&gt;&lt;&#x2F;div&gt;
&lt;p&gt;Feature phones seem to be making a bit of a comeback.
I happen to have one of these devices, which I have used for over a year, and I would like to ramble a bit about my experience with it.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h3 id=&quot;why-consider-using-a-feature-phone&quot;&gt;Why Consider Using a Feature Phone?&lt;&#x2F;h3&gt;
&lt;p&gt;These devices sit somewhere in between older cell phones and modern
smartphones. They have the push-button interface which has mostly fallen out of
fashion in favor of touchscreens, even though they borrow some of their design
elements from contemporary touchscreen devices (which really only makes it
harder to push the buttons, and effectively use the device, but more on that
later). Despite that, it is possible to gain internet access with them using
the 3G&#x2F;4G network technologies. If the phone is running an operating system
called KaiOS - which, as of the writing of this article, is the third most
popular mobile operating system in the world out of nowhere,
running on more than 100 million devices - it is also possible to send and
receive e-mail, check the weather forecast, or use popular services&#x2F;
applications such as Facebook, Whatsapp and Youtube, even though they are not
fully-featured.&lt;&#x2F;p&gt;
&lt;p&gt;There are some reasons people choose to own and use one of these devices over a
smartphone. First of all, they are fairly cheap because of their hardware with
much lower specifications, but they aim to provide most of the features that
the regular user would expect to get from a smartphone. This is why many people
who can not afford high-end smartphones choose to buy feature phones &quot;with
smart features&quot;. Secondly, they have significantly improved battery life
compared to many lower-end smartphones, even though they can not compete with older
phones, which could go weeks without a recharge. Those were the days!
Another important point to mention is that they are &lt;u&gt;not exactly smartphones.&lt;&#x2F;u&gt;
They just offer a user experience that sits somewhere between old &quot;dumb&quot; phones and
new smartphones.
I believe that this is of particular importance, since there
exists a growing number of people who want to move away from the use of
smartphones - or &quot;smart&quot; devices in general - because they think that it is,
for the most part, detrimental. In this regard, breaches in digital safety,
security and privacy come to mind, as well as concerns about the general
direction in which technologically enhanced societal living is headed.
Although if you are too concerned about all of these things, feature phones are probably not the way to go.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;what-to-expect-from-the-device-itself&quot;&gt;What to Expect from the Device Itself&lt;&#x2F;h3&gt;
&lt;p&gt;I actually did not switch from using a smartphone to using a feature phone; I
switched to a feature phone, because my older cell phone stopped working. In
light of that, my expectations were quite low. What I needed was a small and
durable device, which could reliably make phone calls, send text messages and
not cause any distractions. I settled on an Alcatel 3088. It is not my
intention to present a detailed review of this product, however I would like to
mention a few points.&lt;&#x2F;p&gt;
&lt;p&gt;Feature phone devices, while being much smaller than smartphones, are
significantly larger in size compared to older phones, and I don&#x27;t feel like
this is justified. However, what is really bizarre is that this phone in
particular looks and feels a lot like a smartphone. The front and the back
sides are almost completely flat, and the screen - in my opinion - is much
bigger than it needs to be. This choice makes it unnecessariliy hard to get a
good grip of the device in order to push the buttons in an ergonomically sound
way, and the whole effort to achieve a more &quot;modern&quot; look and feel comes at a
great cost to usability. Many newer feature phones actually exhibit similar
design elements, whereas with older cell phones, one could see that
practicality was a bigger concern.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;the-operating-system-kaios&quot;&gt;The Operating System: KaiOS&lt;&#x2F;h3&gt;
&lt;p&gt;Nowadays, many feature phones come with KaiOS preinstalled, which is a
web-based mobile operating system, forked from B2G OS (which in turn is a fork
of the discontinued Firefox OS by Mozilla) and based on the Linux kernel. In my
experience, it is not the most stable operating system out there. The
performance in general is subpar. Updates tend to make it even worse, and the
fact that it runs web applications written in Javascript really doesn&#x27;t help.
Perhaps most importantly, it is largely a privacy nightmare.&lt;&#x2F;p&gt;
&lt;p&gt;The growing interest in &quot;non-smart&quot; solutions for daily communications by
digital means is in part due to the increasing number of privacy-conscious
users in light of the current state of data collection and surveillance
practices by a handful of big tech companies. Unfortunately, in this regard,
KaiOS is as poor a choice as it gets. It comes preinstalled with a plethora of
applications including Facebook and the KaiOS Store as well as the Google
Assistant, Google Maps, Google Search and Youtube applications developed by
Google, from which KaiOS has received a $22M investment. Moreover, the user
does not have root access on the phone by default, and the Google applications
can not be removed, even with root access, unless you are willing to basically
hack into your own phone, and remove the said applications every time after the
phone updates and reinstalls them. I myself have completed this process once,
removing the Google applications which were never used and&#x2F;or configured, and
effectively doubled the battery life on the phone as a result. I leave it to
the reader to form his or her opinion on what the purposes of these
applications are, and on which tasks they could be performing on a personal
device, in their uninitialized states, without the express consent of the user.
Privacy-wise, the only advantage of phones running KaiOS is that they usually
have removable batteries, unlike most smartphones.&lt;&#x2F;p&gt;
&lt;p&gt;Other difficulties might arise when trying to interface with a KaiOS phone,
which is unfortunate as there is a compelling argument that this should have
been prioritized, since users might more often that not need to connect to
other devices in order to extract data or perform various tasks, given the
computational limitations of feature phones. KaiOS is similar to Google&#x27;s
Android mobile operating system in how it tries to facilitate secure user
interactions, and borrows some of its implementations. Normally, users can only
download and install applications using the preinstalled application store.
&quot;Sideloading&quot; applications from another device is an involved process, which
requires multiple software tools, and may or may not be achievable depending on
the device. In order for it to work, the device in question must be capable of
enabling USB debugging through the use of adb (Android Debug Bridge). It is
also needed to download a very old version of Pale Moon or Firefox (a bad idea
for various reasons), or download the KaiOS simulator, which is available on
Linux but not on BSDs or the various versions of Windows and Macintosh
operating systems. Transferring files from a KaiOS phone is also complicated.
The system does not allow users to send files that are bigger than 10 MB over
bluetooth or e-mail. The device storage can only be accessed through the Media
Transfer Protocol, which is a solid security measure to have, but it requires
an MTPfs installation on the connected computer.&lt;&#x2F;p&gt;
&lt;p&gt;All things considered, it would be fair to say that KaiOS users are unable to
make full use of the many features that feature phones have to offer. Users are
not allowed to have root access on their own devices, remove certain
applications or install others, and they are locked out of most of the
filesystem. Feature phones, while they have their drawbacks, are remarkably
capable devices for their prices. However, they are also crippled by the software
that powers them.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;final-thoughts&quot;&gt;Final Thoughts&lt;&#x2F;h3&gt;
&lt;p&gt;Getting yourself a feature phone, perhaps with KaiOS on it, might be a tempting idea
for various reasons. Despite all the aforementioned points, for individuals who
can not afford a smartphone at the moment but absolutely need to use services
like Whatsapp, KaiOS-powered feature phones might be the best bet.
Nevertheless, it is crucial to be aware of the disadvantages. For individuals
who just want to stop using smartphones because they feel that they are
addicted, and that their productivity and social life are hindered, a device
like this might again be beneficial, because it would simply be unable to steal
the attention of the user for extended periods of time - like smartphones are
designed to do - due to its limitations. Despite that, feature phones still do
have many features that could potentially be time-consuming. Using an older
phone - or not using a mobile phone at all - should prove to be a much better
option in this regard. For privacy reasons, it would be safe to assume that
KaiOS phones are in no way better than smartphones running Android or iOS.&lt;&#x2F;p&gt;
</description>
      </item>
    </channel>
</rss>
