Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
root; `/var` is writable and survives reboots and OS updates. Ship keys with
the runtime's `var_files` or write them at provisioning.
- CI builds against the 2026 feed as well as 2024.
- A tmpfiles.d entry resets `/var/lib/ssh/authorized_keys.d` to root:root 0755
and its files to 0644, so keys shipped with `var_files` are not refused by
sshd's StrictModes when the build host's owner and mode were kept.

## [0.1.0]

Expand Down
1 change: 1 addition & 0 deletions avocado.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ extensions:
- sshd.socket

on_merge:
- systemd-tmpfiles --create /usr/lib/tmpfiles.d/avocado-sshd-keys.conf
- systemctl start --no-block sshd.socket

packages:
Expand Down
9 changes: 9 additions & 0 deletions overlay/usr/lib/tmpfiles.d/avocado-sshd-keys.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Keys shipped with the runtime's var_files keep the build host's owner and
# mode, and sshd's StrictModes refuses a key file or parent directory that is
# not owned by root (or the user) or that is group or world writable. Reset
# the directory to root:root 0755 and its files to root:root 0644 on every boot.
# StrictModes checks every directory on the key path up to /, so the parent of
# authorized_keys.d is reset too, before the entries below.
d /var/lib/ssh 0755 root root -
d /var/lib/ssh/authorized_keys.d 0755 root root -
Z /var/lib/ssh/authorized_keys.d ~0755 root root -