When the rootfs is read-only, keys will be generated in a volatile
location, which is inherently bad as host keys will change on each boot,
rendering them virtually useless.
Add a warning so the user is at least aware of the issue.
Hide the rm output to avoid noisy output, now that we have a proper warning.
Move the starting message after the symlink-block, to avoid messages
collision. Move the umask as well, since /etc/dropbear/ may be world
readable; just the private host keys should be ?00 (and dropbear handles
that by itself).
[Peter: minor tweaks to commit message]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Peter Korsgaard <jacmet@uclibc.org>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Busybox "readlink -f" does not canonicalise paths when the target is
missing, while coreutils do.
Fix that by:
- making an absolute symlink
- dropping "-f" when calling readlink
Fixes#8276.
Reported-by: Jason Tang <tang@jtang.org>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Paul Cercueil <paul@crapouillou.net>
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Tested-by: Jason Tang <tang@jtang.org>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit ensures that the /etc/dropbear symlink won't be removed if
it points elsewhere than /var/run/dropbear.
[Thomas:
- fix indentation / too long lines as suggested by Yann E. Morin.]
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
dropbear generates its keys at the first connection, and wants to save
them in /etc/dropbear (not configurable).
Currently, our /etc/dropbear is a directory.
When the filesystem is read-only, dropbear can't save its keys, so
refuses all connections.
Fix that with:
- at build time, create /etc/dropbear as a symlink to
/var/run/dropbear
- at runtime, if the filesystem is RW (we can rm /etc/dropbear),
we replace the symlink with an actual directory; otherwise,
when the filesystem is RO (we can't rm /etc/dropbear), we create
/var/run/dropbear so the symlink points to an existing directory
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Acked-by: "Maxime Hadjinlian" <maxime.hadjinlian@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Bump to version 2013.62 with ECC support.
Switch the initscript to on-demand key generation and add systemd unit
file.
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>