Home Server Worklog

  1. Introduction
    1. Prerequisites
    2. Installing Debian on MeLE PC
  2. Server Quality of Life

Introduction

Setting up a home server on an MeLE Fanless Mini PC.

Prerequisites

Download the Debian operating system from debian.org. As of writing, the current installation image is debian-12.5.0-amd64-netinst.iso. Verify the authenticity of this file.

wget http://debian.mirror.iweb.ca/debian-cd/current/amd64/iso-cd/debian-12.5.0-amd64-netinst.iso
wget http://debian.mirror.iweb.ca/debian-cd/current/amd64/iso-cd/SHA256SUMS
wget http://debian.mirror.iweb.ca/debian-cd/current/amd64/iso-cd/SHA256SUMS.sign

shasum -a 256 -c SHA256SUMS
# debian-12.5.0-amd64-netinst.iso: OK

gpg --keyserver keyring.debian.org --recv-keys 988021A964E6EA7D
gpg --keyserver keyring.debian.org --recv-keys DA87E80D6294BE9B
gpg --keyserver keyring.debian.org --recv-keys 42468F4009EA8AC3
gpg --verify SHA256SUMS.sign SHA256SUMS
# gpg: Signature made Sat 10 Feb 13:13:13 2024 MST
# gpg: using RSA key DF9B9C49EAA9298432589D76DA87E80D6294BE9B
# gpg: Good signature from "Debian CD signing key <[email protected]>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg: There is no indication that the signature belongs to the owner.
# Primary key fingerprint: DF9B 9C49 EAA9 2984 3258 9D76 DA87 E80D 6294 BE9B

Run diskutil list and find the appropriate /dev/disk# for the bootable USB. For example:

/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *1.0 TB disk0
1: Apple_APFS_ISC Container disk1 524.3 MB disk0s1
2: Apple_APFS Container disk3 994.7 GB disk0s2
3: Apple_APFS_Recovery Container disk2 5.4 GB disk0s3

/dev/disk3 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +994.7 GB disk3
Physical Store disk0s2
1: APFS Volume Macintosh HD 10.3 GB disk3s1
2: APFS Snapshot com.apple.os.update-... 10.3 GB disk3s1s1
3: APFS Volume Preboot 6.2 GB disk3s2
4: APFS Volume Recovery 939.1 MB disk3s3
5: APFS Volume Data 728.0 GB disk3s5
6: APFS Volume VM 20.5 KB disk3s6

/dev/disk4 (external, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *31.0 GB disk4
1: Microsoft Basic Data 229.4 KB disk4s1
2: EFI NO NAME 2.9 MB disk4s2
3: Apple_HFS PVE 1.2 GB disk4s3
4: Microsoft Basic Data 307.2 KB disk4s4
(free space) 29.8 GB -

In the above example, my USB is on /dev/disk4. Replace this with the appropriate number for your situation.

Unmount the disk using sudo diskutil unmountDisk /dev/disk4.
Copy the iso to /dev/disk4 using sudo dd if=debian-12.5.0-amd64-netinst.iso of=/dev/disk4 && sync.
Lastly, run sync and sudo diskutil eject /dev/disk4 before removing the USB.

Installing Debian on MeLE PC

Attach the USB drive and press and hold the delete key after seeing the intel logo appear on the screen.
This should open up the BIOS menu. Navigate to the Boot override and select the USB drive with the debian operating system. Select Install. Proceed through the installation steps as prompted.

Hostname: mele
Domain Name: home.udia.ca (no DNS record currently exists)

Do not set a root password. Proceed with setting up a user account.
I picked Guided - use entire disk for partitioning.

This device is intended to be a server, so do not install a Debian desktop environment. I choose to install an SSH server and the standard system utilities. Once this is complete, proceed with the reboot.

Server Quality of Life

Refer to the Server Quality of Life document for additional server setup. Specifically, refer to the SSH Daemon configuration.

ssh-copy-id -i ~/.ssh/id_ed25519.pub user@ip (from local machine to server)

sudo apt install vim
sudo vim /etc/ssh/sshd_config.d/99-harden.conf

DebianBanner no
PasswordAuthentication no
PermitRootLogin no
PubkeyAuthentication yes
LogLevel VERBOSE

sudo systemctl restart sshd

sudo vim /etc/sudoers.d/99-alexander

alexander ALL=(ALL:ALL) NOPASSWD:ALL