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

Fix sshd configuration with pre-existing drop-in files #5879

Open
holmanb opened this issue Nov 15, 2024 · 2 comments
Open

Fix sshd configuration with pre-existing drop-in files #5879

holmanb opened this issue Nov 15, 2024 · 2 comments
Labels
bug Something isn't working correctly

Comments

@holmanb
Copy link
Member

holmanb commented Nov 15, 2024

Bug report

This was not reported as an issue in the wild, but as a hypothetical when discussion the impacts of drop in files on Launchpad.

Cloud-init uses a hard-coded drop-in file at /etc/ssh/sshd_config.d/50-cloud-init.conf to update the sshd configuration. Pre-existing drop-in files may supersede this file. Cloud-init's implementation is buggy in the case that another drop-in file takes priority.

@holmanb holmanb added bug Something isn't working correctly new An issue that still needs triage labels Nov 15, 2024
@TheRealFalcon
Copy link
Member

Pre-existing drop-in files may supersede this file. Cloud-init's implementation is buggy in the case that another drop-in file takes priority.

Why would that be considered buggy? If somebody drops in 01-mything.conf, they want that to take highest priority and should be able to override anything provided by cloud-init.

@holmanb
Copy link
Member Author

holmanb commented Nov 16, 2024

Pre-existing drop-in files may supersede this file. Cloud-init's implementation is buggy in the case that another drop-in file takes priority.

Why would that be considered buggy?

As written, the behavior doesn't match the docs.

If somebody drops in 01-mything.conf, they want that to take highest priority and should be able to override anything provided by cloud-init.

It just depends on how you think about it. There are tradeoffs both ways.

Cloud-init is a first-boot configuration tool. Would you rather expect the user to know what is provided on their filesystem before running cloud-init? If so, this puts more responsibility on the user to know and understand both 1) what is in their image and 2) how sshd_config works - recall that the referenced bug exists because users don't.

What if some other tool like packer decided that theirs should be 01-packer.conf, then cloud-init would be broken for a user that tries to use cloud-init to configure an image that was built with packer.

Either the docs should be updated to match the behavior, or the behavior should be updated to match the docs.

@holmanb holmanb removed the new An issue that still needs triage label Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly
Projects
None yet
Development

No branches or pull requests

2 participants