-
Notifications
You must be signed in to change notification settings - Fork 57
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
customization: sshkeys #1277
customization: sshkeys #1277
Conversation
The `sshkey` customization is documented [1] but was never plumbed through. Add it to the customizations struct initially. Signed-off-by: Simon de Vlieger <[email protected]>
Create a new `SSHKey` type in the customizations and allow it to be set on the `OSCustomizations` struct. Signed-off-by: Simon de Vlieger <[email protected]>
Make the various distros set the values for the ssh keys customizations based on the content in the blueprint. Signed-off-by: Simon de Vlieger <[email protected]>
8018e98
to
3b5af13
Compare
Apply the ssh key customizations from the os customizations if present to create relevant files and directories at the correct modes. Signed-off-by: Simon de Vlieger <[email protected]>
3b5af13
to
2de4592
Compare
This was removed from images a while ago on purpose as a way to simplify the backend blueprint implementation. It remains in osbuild-composer for backwards compatibility. I don't know how I feel about bringing it back. You can see the full reasoning here: #928 The idea was that frontends should be responsible for defining what they support wrt the blueprint. I would much rather we say this option is not supported anywhere (except in composer) than bring it back here. |
The important bit here is that this is supported by the [[customizations.user]]
user = "name"
keys = ["ssh-edsa XXX"] Will customize the user if it exists (and thus add the SSH keys) or create it if not (and add the SSH keys). In that case the above is purely due to the documentation not being super clear about this so I'll create PRs there instead. |
On Matrix it was figured out that our documented
SSHKey
customization doesn't work. After taking a look it seems like it wasn't actually ever plumbed through...Since we've documented it I assume we want to support it so here's an initial PR that does just that. This PR would close osbuild/image-builder-cli#142
After this PR the stages get injected to create files and directories:
Note that setting the SSH key for a nonexistent user will lead to a build failure.
As draft now as it needs tests, defensiveness in the customization parsing so we can fail earlier, and to move the filesystem generation to a helper function.
@achilleas-k how do we (or should we) handle the ostree case here? I see authorized keys is normally punted to a firstboot script.