ubuntu-image leaving machine-id and host SSH keys in images

Bug #2039434 reported by Dave Jones
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
ubuntu-image (Ubuntu)
Fix Released
High
Paul Mars

Bug Description

The mantic pi images (both server and desktop) have pre-generated machine-id values in /etc/machine-id and /var/lib/dbus/machine-id. In livecd-rootfs this is taken care of with a live-build hook [1][2] but I don't believe there's an equivalent in the current ubuntu-image implementation (or none that I could find).

More seriously, the mantic pi server images also have pre-generated SSH host keys. Thankfully, the default cloud-init configuration regenerates these on first boot before SSH comes up, but again these should not be shipped in the images, and again this was taken care of previously with a live-build hook [3][4].

[1]: https://git.launchpad.net/ubuntu/+source/livecd-rootfs/tree/live-build/auto/config#n1238

[2]: https://git.launchpad.net/ubuntu/+source/live-build/tree/share/hooks/004-remove-dbus-machine-id.chroot

[3]: https://git.launchpad.net/ubuntu/+source/livecd-rootfs/tree/live-build/auto/config#n1239

[4]: https://git.launchpad.net/ubuntu/+source/live-build/tree/share/hooks/006-remove-openssh-server-host-keys.chroot

Tags: raspi-image
Revision history for this message
Dave Jones (waveform) wrote :

I should add a note of thanks to ^AT^ on the #ubuntu-server channel who first pointed out the issue with the pre-generated machine-id, which then led me to investigate what else was not being reset by the new image build process.

Changed in ubuntu-image (Ubuntu):
importance: Undecided → High
status: New → Confirmed
Dave Jones (waveform)
tags: added: foundations-todo raspi-image
Paul Mars (upils)
Changed in ubuntu-image (Ubuntu):
assignee: nobody → Paul Mars (upils)
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

The respective fix PR has been merged! https://github.com/canonical/ubuntu-image/pull/155
Switching to Fix Committed and removing foundations-todo.

Changed in ubuntu-image (Ubuntu):
status: Confirmed → Fix Committed
tags: removed: foundations-todo
Paul Mars (upils)
Changed in ubuntu-image (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.