<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Linux &amp; Server on myl3z.me</title><link>https://myl3z.me/docs/linux/</link><description>Recent content in Linux &amp; Server on myl3z.me</description><generator>Hugo</generator><language>en</language><atom:link href="https://myl3z.me/docs/linux/index.xml" rel="self" type="application/rss+xml"/><item><title>Bootable USB from the Terminal</title><link>https://myl3z.me/docs/linux/bootable-usb/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://myl3z.me/docs/linux/bootable-usb/</guid><description>&lt;h1 id="bootable-usb-from-the-terminal"&gt;Bootable USB from the Terminal&lt;a class="anchor" href="#bootable-usb-from-the-terminal"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;A bootable USB stick from an ISO — no extra tooling, just &lt;code&gt;lsblk&lt;/code&gt;, &lt;code&gt;umount&lt;/code&gt; and &lt;code&gt;dd&lt;/code&gt;. The
example writes a Debian netinst installer, but the steps are the same for any hybrid ISO. For
what each command actually does, see &lt;a href="https://myl3z.me/docs/linux/disk-commands/"&gt;lsblk, umount, dd, sync&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote class='book-hint warning'&gt;
&lt;p&gt;&lt;code&gt;dd&lt;/code&gt; does not ask and has no undo. The wrong device name overwrites your system disk. Check
the target twice before running it.&lt;/p&gt;</description></item><item><title>lsblk, umount, dd, sync</title><link>https://myl3z.me/docs/linux/disk-commands/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://myl3z.me/docs/linux/disk-commands/</guid><description>&lt;h1 id="lsblk-umount-dd-sync"&gt;lsblk, umount, dd, sync&lt;a class="anchor" href="#lsblk-umount-dd-sync"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;The four commands you reach for when working with block devices on Linux: find one, release
it, write to it, and make sure the data actually landed. They are put to use in
&lt;a href="https://myl3z.me/docs/linux/bootable-usb/"&gt;Bootable USB from the Terminal&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="lsblk--list-block-devices"&gt;lsblk — list block devices&lt;a class="anchor" href="#lsblk--list-block-devices"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;lsblk&lt;/code&gt; reads the device tree from the kernel (&lt;code&gt;/sys/block&lt;/code&gt;) and prints it as a tree: physical
drives as roots, their partitions as children. It needs no root privileges and touches
nothing.&lt;/p&gt;</description></item><item><title>Static IP with ifupdown</title><link>https://myl3z.me/docs/linux/static-ip/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://myl3z.me/docs/linux/static-ip/</guid><description>&lt;h1 id="static-ip-with-ifupdown"&gt;Static IP with ifupdown&lt;a class="anchor" href="#static-ip-with-ifupdown"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;A server other devices are supposed to reach needs an address that does not change. DHCP
hands it whatever is free — possibly a different one after the router reboots, and every
configuration pointing at the old one breaks. For a DNS server in particular that is not an
option: its address is what every client has hardcoded.&lt;/p&gt;
&lt;p&gt;A Debian install without a desktop manages networking through &lt;strong&gt;ifupdown&lt;/strong&gt; and
&lt;code&gt;/etc/network/interfaces&lt;/code&gt;. NetworkManager and &lt;code&gt;systemd-networkd&lt;/code&gt; solve the same problem but
are not in play on a netinst system.&lt;/p&gt;</description></item><item><title>SSH Config and Key Login</title><link>https://myl3z.me/docs/linux/ssh-config/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://myl3z.me/docs/linux/ssh-config/</guid><description>&lt;h1 id="ssh-config-and-key-login"&gt;SSH Config and Key Login&lt;a class="anchor" href="#ssh-config-and-key-login"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;Without configuration every connection is the same typing exercise:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#e2e4e5;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ssh -i ~/.ssh/id_rsa xander@10.10.10.3&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Address, user and key do not belong on the command line but in the client configuration at
&lt;code&gt;~/.ssh/config&lt;/code&gt;. It states per host what the connection should look like — after that the
alias is enough:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#e2e4e5;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ssh dns01&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="the-entry"&gt;The entry&lt;a class="anchor" href="#the-entry"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#e2e4e5;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Host dns01
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; HostName 10.10.10.3
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; IdentityFile /home/xander/.ssh/id_rsa
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; IdentitiesOnly yes&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;table&gt;
	&lt;thead&gt;
			&lt;tr&gt;
					&lt;th&gt;Line&lt;/th&gt;
					&lt;th&gt;Meaning&lt;/th&gt;
			&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tbody&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;Host dns01&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;the name you type on the command line. Freely chosen and independent of the real hostname; everything up to the next &lt;code&gt;Host&lt;/code&gt; belongs to this block&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;HostName 10.10.10.3&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;where the connection actually goes — IP or DNS name&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;IdentityFile&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;the &lt;strong&gt;private&lt;/strong&gt; key for this connection. Its public counterpart (&lt;code&gt;.pub&lt;/code&gt;) lives on the server&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;IdentitiesOnly yes&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;offer this key and nothing else&lt;/td&gt;
			&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The block is a set of defaults, not a connection in itself. It applies to anything matching
the alias — including &lt;code&gt;scp&lt;/code&gt;, &lt;code&gt;rsync&lt;/code&gt; and &lt;code&gt;git&lt;/code&gt;, which all use the same SSH client:&lt;/p&gt;</description></item><item><title>Adding sudo</title><link>https://myl3z.me/docs/linux/sudo-setup/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://myl3z.me/docs/linux/sudo-setup/</guid><description>&lt;h1 id="adding-sudo"&gt;Adding sudo&lt;a class="anchor" href="#adding-sudo"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;A fresh Debian install may have no &lt;code&gt;sudo&lt;/code&gt; at all — and which way it goes depends on a choice
made during installation whose consequence is never spelled out:&lt;/p&gt;
&lt;table&gt;
	&lt;thead&gt;
			&lt;tr&gt;
					&lt;th&gt;Root password in the installer&lt;/th&gt;
					&lt;th&gt;Result&lt;/th&gt;
			&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tbody&gt;
			&lt;tr&gt;
					&lt;td&gt;set&lt;/td&gt;
					&lt;td&gt;root is enabled, &lt;code&gt;sudo&lt;/code&gt; is &lt;strong&gt;not&lt;/strong&gt; installed&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;left empty&lt;/td&gt;
					&lt;td&gt;root is locked, &lt;code&gt;sudo&lt;/code&gt; is installed and the first user is added to the &lt;code&gt;sudo&lt;/code&gt; group&lt;/td&gt;
			&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;So if you set a root password, you are met with &lt;code&gt;sudo: command not found&lt;/code&gt; afterwards and have
to add it yourself.&lt;/p&gt;</description></item><item><title>Base Packages After the Install</title><link>https://myl3z.me/docs/linux/base-packages/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://myl3z.me/docs/linux/base-packages/</guid><description>&lt;h1 id="base-packages-after-the-install"&gt;Base Packages After the Install&lt;a class="anchor" href="#base-packages-after-the-install"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;A netinst installation without a desktop deliberately ships very little. That is the right
starting point for a server — it keeps the attack surface and the update workload small — but
it means tools only become noticeable when you need them. This page collects what was added
to the homelab machine after the fact.&lt;/p&gt;
&lt;p&gt;Whether something is missing at all is answered by:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#e2e4e5;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#ff5c57"&gt;command&lt;/span&gt; -v curl &lt;span style="color:#78787e"&gt;# path if present, otherwise empty and exit code 1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;dpkg -l curl &lt;span style="color:#78787e"&gt;# package status: ii = installed and configured&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="curl"&gt;curl&lt;a class="anchor" href="#curl"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#e2e4e5;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo apt install curl&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;curl&lt;/code&gt; fetches data over HTTP, HTTPS and a dozen other protocols and writes it to stdout by
default. On a server without a browser it is the standard tool for anything arriving over the
network: install scripts, API calls, the quick check whether a service answers at all.&lt;/p&gt;</description></item><item><title>Pi-hole as a DNS Server</title><link>https://myl3z.me/docs/linux/pihole/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://myl3z.me/docs/linux/pihole/</guid><description>&lt;h1 id="pi-hole-as-a-dns-server"&gt;Pi-hole as a DNS Server&lt;a class="anchor" href="#pi-hole-as-a-dns-server"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;Pi-hole is a DNS server with a filter. When a device asks for a domain that sits on a
blocklist, Pi-hole does not pass the query on to the upstream but answers it itself — with an
address that leads nowhere. The advantage over a blocker in the browser is where the filtering
happens: name resolution is used by every device on the network, including the TV and a
visitor&amp;rsquo;s phone, neither of which lets you install anything.&lt;/p&gt;</description></item><item><title>Choosing an Upstream DNS</title><link>https://myl3z.me/docs/linux/dns-upstream/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://myl3z.me/docs/linux/dns-upstream/</guid><description>&lt;h1 id="choosing-an-upstream-dns"&gt;Choosing an Upstream DNS&lt;a class="anchor" href="#choosing-an-upstream-dns"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;&lt;a href="https://myl3z.me/docs/linux/pihole/"&gt;Pi-hole&lt;/a&gt; does not know the addresses of the world. It
knows blocklists and a cache — everything else it forwards to an &lt;strong&gt;upstream&lt;/strong&gt;, and hands that
answer back to the client. This makes the upstream the point at which the whole household&amp;rsquo;s
name resolution leaves the local network.&lt;/p&gt;
&lt;p&gt;The installer asks the question once, with Google as its first suggestion, and confirming it
means making a decision without making one.&lt;/p&gt;</description></item></channel></rss>