Skip to content

install: --root-ssh-authorized-keys is silently ignored with --composefs-backend #2535

Closed

Description

@andrewdunndev

With --composefs-backend, bootc install to-disk accepts --root-ssh-authorized-keys and exits 0, but no key is installed. The output has no Injected: line, the disk has no bootc-root-ssh.conf tmpfiles drop-in, and root key login fails on the booted system. The same command without --composefs-backend writes the drop-in and root login works.

Reproduced with quay.io/fedora/fedora-bootc:44@sha256:5ab8ee5189bb0f3870279723f5343474df002d8d6f46564702b3ad3ba7382d98 (bootc 1.16.13) and podman 5.8.7:

ssh-keygen -t ed25519 -N '' -f k
truncate -s 20G a.raw b.raw
podman run --rm --privileged --pid=host --security-opt label=type:unconfined_t \
  -v /dev:/dev -v /var/lib/containers:/var/lib/containers -v $PWD:/out $IMG \
  bootc install to-disk --via-loopback --filesystem ext4 --generic-image --wipe \
  --root-ssh-authorized-keys /out/k.pub --composefs-backend /out/a.raw 2>&1 | tee a.log
# the same again without --composefs-backend, writing b.raw and b.log
$ grep -i inject a.log
$ grep -i inject b.log
Injected: etc/tmpfiles.d/bootc-root-ssh.conf

I mounted each root partition and ran find -name bootc-root-ssh.conf. It finds nothing on the composefs disk. On the ostree disk the drop-in is in the deployment's etc/tmpfiles.d/ and contains f~ /var/roothome/.ssh/authorized_keys 600 root root - <base64 of k.pub>. After booting both under UEFI, ssh -i k root@... fails on the composefs install with Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password) and succeeds on the ostree one.

In the source, the only call to osconfig::inject_root_ssh_authorized_keys is in install_container (install.rs L1238-L1240 at v1.16.13), which is reached through ostree_install. The composefs branch (L2024-L2076) never calls it, and main at 66d4e4d still has only that one call site. I'd expect the keys to be injected on the composefs path too, or the flag to be rejected when combined with --composefs-backend.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions