Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

osconfig: install root ssh keys to /var/roothome #407

Merged
merged 1 commit into from
Mar 21, 2024

Conversation

mvo5
Copy link
Contributor

@mvo5 mvo5 commented Mar 20, 2024

The current location via tmpfiles.d to install the root ssh keys seems to be not working on firstboot. There is an error that /root/.ssh does not exist from systemd-tmpfiles-setup and indeed the authorized_keys file is on in /root/.ssh.

It seems like everything else in the firstboot in
tmpfiles.d is refering to /var/roothome instead of /root and switching to this for the location of the ssh keys solves the issue.

I tested this via bib and a local container using the new bootc install to-filesystem pipeline :) So hopefully it should finally work.

@mvo5 mvo5 changed the title osconfig: install ssh keys to /var/roothome osconfig: install root ssh keys to /var/roothome Mar 20, 2024
@cgwalters cgwalters added area/install Issues related to `bootc install` triaged This looks like a valid issue reviewed/needs-rework Needs changes labels Mar 20, 2024
Copy link
Contributor Author

@mvo5 mvo5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! This looks great and works well in my test. There is a tiny tweak in the tests needed it seems though.

lib/src/install/osconfig.rs Outdated Show resolved Hide resolved
lib/src/install/osconfig.rs Show resolved Hide resolved
The current location via tmpfiles.d to install the root ssh keys
seems to be not working. There is an error that `/root/.ssh` does
not exist from `systemd-tmpfiles-setup` and indeed the authorized_keys
file is on in `/root/.ssh`.

It seems like everything else in the firstboot in
tmpfiles.d is refering to `/var/roothome` instead of `/root` and
switching to this for the location of the ssh keys solves the
issue.

Co-authored-by: Colin Walters <[email protected]>
Signed-off-by: Colin Walters <[email protected]>
Copy link
Contributor Author

@mvo5 mvo5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much! 👍 for all the change that I did not make (which are all relevant ones ;)

@cgwalters cgwalters merged commit e01a518 into containers:main Mar 21, 2024
14 of 15 checks passed
@cgwalters cgwalters removed the reviewed/needs-rework Needs changes label Mar 21, 2024
@mvo5 mvo5 deleted the tweak-root-ssh-keys branch April 17, 2024 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/install Issues related to `bootc install` triaged This looks like a valid issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants