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

0.6.2: SSH hostkeys are regenerated after reboot #118

Closed
osfrickler opened this issue Jul 31, 2024 · 1 comment · Fixed by #119
Closed

0.6.2: SSH hostkeys are regenerated after reboot #118

osfrickler opened this issue Jul 31, 2024 · 1 comment · Fixed by #119

Comments

@osfrickler
Copy link
Contributor

After a reboot, ssh to the cirros instance is failing because the hostkeys have changed. The reason seems to be that /etc/dropbear is a symlink to /var/run/dropbear, and /var/run again is a symlink to /run, which is a tmpfs. The expected result would be for the hostkeys to be stored permanently so that they are persisted after a reboot.

This may also be related to #110.

@osfrickler
Copy link
Contributor Author

Seems the current handling was introduced in #45 , which missed the "remove the symlink on RW fs" part introduced in buildroot/buildroot@e7d04dd. Will create a patch that tries to do both, although I'm not sure where in the cirros context the root fs would actually be RO.

osfrickler added a commit that referenced this issue Jul 31, 2024
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]>
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 a pull request may close this issue.

1 participant