The Omarchy machine at home has an encrypted root. After a reboot it sits on the passphrase screen, and SSH is not running yet. If nobody is there to type, it just waits.
The login screen is fine. Once the disk opens, SSH comes up with the rest of the system. The missing piece is earlier than that. This one is an Intel Mac, and Omarchy unlocks through the busybox hook and cryptdevice=. Leave the systemd hook alone. The distro replaces the whole hook list.
The Arch note also describes a systemd early userspace. This machine cannot use it. On Intel, Omarchy hard-wires the busybox hook and cryptdevice=, and the systemd encrypt hook cannot parse that parameter. That path also gives up after 90 seconds and drops into emergency mode, which locks you out from anywhere but the keyboard. The local passphrase has to stay.
So follow the busybox section as it is written now. mkinitcpio-extras brings up the network and TinySSH. mkinitcpio-utils replaces the login shell with the passphrase prompt. Skip the old hooks with the same names. They are unmaintained, and they mint broken host keys or reuse the system ones.
1. Check the NIC first
Look at the running system. Do not guess. A boot image aimed at a NIC that is not there comes up with no network, and the passphrase screen is unreachable.
ip -br link
lspci -nn | grep -Ei 'net|wireless'
This one is a 2018 Mac mini. Ethernet is a BCM57766 on tg3. After boot the interface is enp4s0. Wireless is a BCM4364. brcmfmac is loaded, but brcmfmac4364b2-pcie.bin is missing, so no interface appears and no network is saved. Only ethernet goes into the boot image. Writing the wireless chip in would be a wrong config.
2. Install the packages
TinySSH and the passphrase hook are in the repos. The network and TinySSH hooks come from mkinitcpio-extras in the AUR. That package ships its own early ipconfig and conflicts with mkinitcpio-nfs-utils. The older note tells you to install that package too. Do not, with this one.
sudo pacman -S --needed tinyssh mkinitcpio-utils base-devel git
git clone https://aur.archlinux.org/mkinitcpio-extras.git
cd mkinitcpio-extras && makepkg -Cfs --noconfirm
sudo pacman -U mkinitcpio-extras-*.pkg.tar.zst
3. Install the public keys
Early SSH accepts public keys only, from this one file. TinySSH takes Ed25519 and ECDSA only. An RSA key in that file does nothing. It does not do password login. The disk passphrase is asked by the shell after login. Rebuild the image after you change the public keys, or the boot image keeps the old copy.
sudo install -d -m 700 /etc/tinyssh
sudo install -m 600 ~/.ssh/authorized_keys /etc/tinyssh/root_key
4. Swap the encrypt hook
The hook list in /etc/mkinitcpio.conf is replaced by the distro. A later drop-in swaps encrypt for network, Nebula, TinySSH, then the passphrase. The order matters. TinySSH gives root no shell unless you ask it to. The passphrase hook has to come after it, so that hook is the one that sets root’s shell to the unlock program. Do not turn on TinySSH’s shell option. That overwrites the passphrase shell. Drop nebula from the list if you are not adding it in the next step.
/etc/mkinitcpio.conf.d/zz-remote-unlock.conf
_remote_unlock_hooks=()
for _remote_unlock_hook in "${HOOKS[@]}"; do
if [[ ${_remote_unlock_hook} == encrypt ]]; then
_remote_unlock_hooks+=(netconf nebula tinyssh encryptssh)
else
_remote_unlock_hooks+=("${_remote_unlock_hook}")
fi
done
HOOKS=("${_remote_unlock_hooks[@]}")
MODULES+=(tg3)
tg3 is here because the ethernet chip is a BCM57766. That driver also needs the tg357766 firmware, or the module loads and the link never comes up. On another machine, use that NIC’s driver.
5. Set the early address
Early userspace has no predictable-name rules, so the enp4s0 you see after boot is eth0 here. Use a static address, not DHCP. DHCP through this early network hook is unreliable, this machine has one ethernet NIC, and the address and gateway are fixed, so static is faster. If the cable is wrong it waits out the timeout, and the local keyboard still works. Put your own address in.
/etc/limine-entry-tool.d/remote-unlock.conf
KERNEL_CMDLINE[default]+=" ip=192.0.2.40::192.0.2.1:255.255.255.0:box:eth0:none netconf_timeout=30"
6. Start Nebula in the same stage
LAN alone is useless when you are not on that network. Nebula has to wait until ethernet has an address, or it cannot reach a lighthouse, so it comes after the network step. Wait a short while, then continue anyway. The local keyboard and the LAN unlock port still work. Stop it before entering the real system, because the later service has to create that interface itself. Use the config the system already has. The certificate does land in the unencrypted boot image. That part you accept.
/etc/initcpio/hooks/nebula
#!/usr/bin/ash
run_hook() {
modprobe -a -q tun
if [ ! -c /dev/net/tun ]; then
mkdir -p /dev/net
mknod /dev/net/tun c 10 200
fi
nebula -config /etc/nebula/config.yml >/run/nebula-initramfs.log 2>&1 &
echo $! >/run/nebula-initramfs.pid
i=0
while [ "$i" -lt 15 ]; do
ip -4 addr show dev nebula1 2>/dev/null | grep -q 'inet ' && return 0
sleep 1
i=$((i + 1))
done
}
run_cleanuphook() {
if [ -r /run/nebula-initramfs.pid ]; then
kill "$(cat /run/nebula-initramfs.pid)" 2>/dev/null || true
fi
killall nebula 2>/dev/null || true
}
/etc/initcpio/install/nebula
#!/usr/bin/env bash
build() {
add_module tun
add_binary nebula
add_binary ip
add_binary killall
add_file /etc/nebula/config.yml
add_file /etc/nebula/ca.crt
add_file /etc/nebula/host.crt /etc/nebula/host.crt 600
add_file /etc/nebula/host.key /etc/nebula/host.key 600
add_runscript
}
Use the certificate paths from your own config. If the firewall already allows the overlay range, the temporary port needs no extra rule.
7. Pick two different high ports
The hook listens on a low, well-known port by default. Scanners know it. Worse, it must not be the same port as normal SSH. The client decides whether to unlock or log in by which port is open. One port for both, and it cannot tell. The numbers can be anything, as long as they differ and both are high. Below, 39441 means unlock and 51222 means after the system is up.
echo tinyssh_port=39441 | sudo tee /etc/tinyssh/tinyssh.initcpio
8. Rebuild the kernel image only
This is a T2 Mac. Run limine-mkinitcpio. It rebuilds the kernel image. Do not run limine-install without the flag that skips firmware registration. That writes boot entries.
sudo limine-mkinitcpio
The image should contain tinysshd, nebula, tinyssh_port=39441, plus tg3 and its firmware. Then reboot. Stay near the machine the first time. If the network does not come up, the local keyboard still takes the passphrase.
9. Unlock when locked, log in when open
If the normal port is open, log in. If only the unlock port is open, ask for the disk passphrase in the terminal, wait for the system, then go in. The two host keys are not the same, so keep them in separate files. Otherwise the early key gets trusted as the system’s.
~/.ssh/box-autounlock
#!/bin/sh
set -eu
host=$1
port=$2
unlock_alias=$3
unlock_port=39441
port_open() { nc -z -G 2 "$1" "$2" >/dev/null 2>&1; }
proxy() { exec nc -G 5 "$host" "$port"; }
if port_open "$host" "$port"; then proxy; fi
if ! port_open "$host" "$unlock_port"; then
# Unlock closes this port before the normal sshd is listening.
deadline=$(( $(date +%s) + 150 ))
while [ "$(date +%s)" -lt "$deadline" ]; do
port_open "$host" "$port" && proxy
port_open "$host" "$unlock_port" && break
sleep 2
done
port_open "$host" "$port" && proxy
port_open "$host" "$unlock_port" || exit 1
fi
while port_open "$host" "$unlock_port" && ! port_open "$host" "$port"; do
ssh -tt -o ControlMaster=no -o ControlPath=none \
"$unlock_alias" </dev/tty >/dev/tty || exit $?
sleep 1
done
n=0
while [ "$n" -lt 90 ]; do
port_open "$host" "$port" && proxy
n=$((n + 1))
sleep 1
done
exit 1
Give the unlock connection its own alias in ~/.ssh/config, on port 39441, user root. The everyday alias uses port 51222 and points at the script with ProxyCommand. On the first connection, check the fingerprint and store it in a separate known_hosts file.
After the passphrase succeeds you may see cryptsetup: no process found. The passphrase hook tries to stop another cryptsetup after the disk opens. Nothing was left to stop, so that line is printed. The unlock has finished, and the connection closes on its own. A moment later the usual alias gets you in.
10. After a system update
omarchy update does not delete these files. They are not part of the distro package. A kernel upgrade rebuilds the image from the same fragments. The AUR hook package is upgraded by that same update flow.
Do not hand-edit /boot/limine.conf. Refreshing the boot loader config overwrites that file, then rewrites it from the fragments under /etc. The address parameter survives only if it lives in a fragment.
What fails quietly is a later distro release that renames the encrypt hook. The swap then matches nothing, and the next image has no remote unlock. The local keyboard still works. After an update, check that the final hook list still contains netconf, tinyssh and encryptssh, and that the image still contains tinysshd. If any of those are gone, do not reboot. Fix the fragment, then run limine-mkinitcpio.
