feat: root adds the ssh keys, mkosi ssh for the test VM
The setup no longer asks for an ssh key. Root logs in on the console and adds keys for claude and root to /var/lib/agent. Root may log in with ssh, and its home is a tmpfs that is wiped at every boot. The test VM uses mkosi ssh instead of a forwarded port, so the agent.ssh-key credential is gone. Also mount /var with noatime, move STYLE.md into AGENTS.md and rewrite comments to start with the name of what they describe. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
15 files changed
+218
-180
No files matched your search
@@ -1,5 +1,11 @@
|
||||
# Mounts
|
||||
#
|
||||
# /var is the only partition on disk that is written (mkosi.repart/30-var.conf).
|
||||
# x-systemd.growfs grows its filesystem to fill the partition at boot.
|
||||
PARTLABEL=var /var ext4 x-systemd.growfs 0 2
|
||||
# x-systemd.growfs grows its filesystem to fill the partition at boot. noatime
|
||||
# skips the write that the default (relatime) makes at the first read of a file
|
||||
# each day. Images that podman unpacks are full of such files; nothing here uses
|
||||
# access times.
|
||||
PARTLABEL=var /var ext4 noatime,x-systemd.growfs 0 2
|
||||
# /root is in memory, so root has a writable home that is wiped at every boot.
|
||||
# Root's ssh key lives on /var (mkosi.extra/etc/ssh/sshd_config.d).
|
||||
tmpfs /root tmpfs mode=0700 0 0
|
||||
@@ -1,11 +1,22 @@
|
||||
# ssh login
|
||||
#
|
||||
# Only the user claude may log in, only with the key asked at setup. The host
|
||||
# key lives on /var (agent-boot makes it), so it stays the same across reboots.
|
||||
# The first value wins, and this file sorts before Fedora's 50-redhat.conf.
|
||||
# Login is with keys only, for root and the user claude. Neither has a key
|
||||
# until root adds one (README.md). The first value wins, and this file sorts
|
||||
# before Fedora's 50-redhat.conf.
|
||||
|
||||
# HostKey lives on /var (agent-boot makes it), so it stays the same across
|
||||
# reboots.
|
||||
HostKey /var/lib/agent/ssh_host_ed25519_key
|
||||
AuthorizedKeysFile /var/lib/agent/authorized_keys
|
||||
AllowUsers claude
|
||||
PermitRootLogin no
|
||||
PasswordAuthentication no
|
||||
KbdInteractiveAuthentication no
|
||||
|
||||
# AuthorizedKeysFile of the user claude is owned by root, so Claude can't add
|
||||
# keys.
|
||||
Match User claude
|
||||
AuthorizedKeysFile /var/lib/agent/authorized_keys
|
||||
|
||||
# AuthorizedKeysFile of root is on /var, because its home is wiped at every
|
||||
# boot (/etc/fstab). It also reads the default file, which the
|
||||
# ssh.authorized_keys.root credential fills, such as for mkosi ssh.
|
||||
Match User root
|
||||
AuthorizedKeysFile /var/lib/agent/root_authorized_keys .ssh/authorized_keys
|
||||
Reference in new issue
Block a user