Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Persistent dropbear keys
@ 2016-01-08 13:43 Thomas De Schampheleire
  2016-01-08 17:45 ` Peter Korsgaard
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas De Schampheleire @ 2016-01-08 13:43 UTC (permalink / raw)
  To: buildroot

Hello,

Commit e7d04dd2df8bb935c61f7c814ee88eba7e75b5e4 (package/dropbear: fix
generating keys on RO file systems) (+ some subsequent commits)
changed the handling of the /etc/dropbear directory. Previously
/etc/dropbear was a real directory in the rootfs, now it initially is
a link to /var/run/dropbear. During S50dropboar, the link is replaced
with a real (empty) directory (if rootfs is writable) or a warning is
given.

I understand all this. However, what I do not understand is how you
are then creating persistent dropbear keys. From how I understand the
code, the keys are persistent across reboots, but not between upgrades
of the rootfs, because after an upgrade a new empty /etc/dropbear is
created.

In my case, the rootfs is an initramfs, but mounted rw at boot time.

The solution I have been using is with an S49dropbear_keys script that:
- at 'stop', verifies the correctness of the keys in /etc/dropbear
(with dropbearkey) and if ok copies them to a real persistent medium,
- at 'start', verifies if there are any keys on the persistent medium,
verify their correctness, and if ok copies them to /etc/dropbear.

I will now need to adapt this script S49dropbear_keys to first remove
the /etc/dropbear link, to keep its functionality.

But it pops up the question how other people are handling this.

Thanks,
Thomas

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-01-14 12:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-08 13:43 [Buildroot] Persistent dropbear keys Thomas De Schampheleire
2016-01-08 17:45 ` Peter Korsgaard
2016-01-09  1:10   ` Arnout Vandecappelle
2016-01-11  8:56   ` Thomas De Schampheleire
2016-01-11  9:49     ` Peter Korsgaard
2016-01-13  8:16       ` Thomas De Schampheleire
2016-01-14 12:11         ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox