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 handling of /etc/dropbear #119

Merged
merged 1 commit into from
Aug 6, 2024
Merged

Fix handling of /etc/dropbear #119

merged 1 commit into from
Aug 6, 2024

Conversation

osfrickler
Copy link
Contributor

buildroot starts out with /etc/dropbear being a symlink to /var/run/dropbear in order to allow dropbear to start even when /etc is located on a RO filesystem. The startup script is then to check whether the symlink can be replaced by an actual directory, which then allows to permanently store the hostkeys that dropbear generates, ensuring the keys will persist across reboots. This patch amends the S50dropbear init script to copy this functionality from the original buildroot script.

Also add ed25519 to the list of hostkey types that are generated before dropbear starts.

Fixes: #118

buildroot starts out with /etc/dropbear being a symlink to
/var/run/dropbear in order to allow dropbear to start even when /etc is
located on a RO filesystem. The startup script is then to check whether
the symlink can be replaced by an actual directory, which then allows to
permanently store the hostkeys that dropbear generates, ensuring the
keys will persist across reboots. This patch amends the S50dropbear init
script to copy this functionality from the original buildroot script.

Also add ed25519 to the list of hostkey types that are generated before
dropbear starts.

Fixes: #118

Signed-off-by: Dr. Jens Harbott <[email protected]>
Copy link
Member

@smoser smoser left a comment

Choose a reason for hiding this comment

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

I'm overal good with this, but one minor request.

src/etc/init.d/S50dropbear Show resolved Hide resolved
Copy link
Member

@smoser smoser left a comment

Choose a reason for hiding this comment

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

approve. if you want to change to re-use 'dropbear_key_dir' or rename to 'dbkeyd' or just take this as it is i'm fine with all of those.

@osfrickler osfrickler merged commit 4ceb60c into main Aug 6, 2024
4 checks passed
@osfrickler
Copy link
Contributor Author

let's take this as is for now, will recheck when we do the next buildroot update (rsn)

@osfrickler osfrickler deleted the fix-dropbear branch August 6, 2024 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0.6.2: SSH hostkeys are regenerated after reboot
2 participants