<div dir="ltr">Thanks for the hint. I think it would make sense to fix this in vmdebootstrap itself, because it isn’t a Raspberry Pi-specific issue.</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 24, 2017 at 7:09 PM, Valentin Lorentz <span dir="ltr"><<a href="mailto:progval@progval.net" target="_blank">progval@progval.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I could not check it because I do not have a serial console, but it<br>
looks like the preview image in<br>
<a href="https://people.debian.org/~stapelberg/raspberrypi3/2017-03-22/" rel="noreferrer" target="_blank">https://people.debian.org/~<wbr>stapelberg/raspberrypi3/2017-<wbr>03-22/</a> contains<br>
SSH keys, and they are not generated on first boot.<br>
This means that all systems installed from this image will have the same<br>
private keys, which is highly insecure.<br>
<br>
I suggest that you generate SSH keys on first boot.<br>
<br>
<br>
I wrote a systemd service able to do that, which I successfully tested<br>
on regular Debian with only Raspbian's kernel (compiled from<br>
<a href="https://github.com/raspberrypi/linux" rel="noreferrer" target="_blank">https://github.com/<wbr>raspberrypi/linux</a> in arm64 mode) in order to get HDMI<br>
output.<br>
<br>
To use it, you have to:<br>
* copy the attached .service file to /etc/systemd/system/<br>
* copy the attached rng-tools file to /etc/default/ (in order to use the<br>
Raspi's hardware random number generator),<br>
* add rng-tools to the list of packages installed by vmdebootstrap, and<br>
* run this command in customize-rpi3.sh:<br>
  chroot ${rootdir} systemctl enable regen-ssh-keys<br>
<br>
This last command is used to make the ssh server depend on this new<br>
service. For homogeneity with your current customize-rpi3.sh, you may<br>
want to use “ln -s” instead (or add<br>
RequiredBy=systemd-remount-fs.<wbr>service your resizerootfs and use<br>
systemctl enable).<br>
<br>
Best regards,<br>
Valentin<br>
<br>______________________________<wbr>_________________<br>
Pkg-raspi-maintainers mailing list<br>
<a href="mailto:Pkg-raspi-maintainers@lists.alioth.debian.org">Pkg-raspi-maintainers@lists.<wbr>alioth.debian.org</a><br>
<a href="https://lists.alioth.debian.org/mailman/listinfo/pkg-raspi-maintainers" rel="noreferrer" target="_blank">https://lists.alioth.debian.<wbr>org/mailman/listinfo/pkg-<wbr>raspi-maintainers</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Best regards,<br>Michael</div>
</div>