Skip to content

cloud-init regenerating ssh-keys #3753

@ubuntu-server-builder

Description

@ubuntu-server-builder

This bug was originally filed in Launchpad as LP: #1885527

Launchpad details
affected_projects = ['cloud-init (Ubuntu)']
assignee = lp-markusschade
assignee_name = Markus Schade
date_closed = 2020-11-24T17:58:47.047974+00:00
date_created = 2020-06-29T08:16:26.428564+00:00
date_fix_committed = 2020-10-29T15:06:45.344303+00:00
date_fix_released = 2020-11-24T17:58:47.047974+00:00
id = 1885527
importance = medium
is_complete = True
lp_url = https://bugs.launchpad.net/cloud-init/+bug/1885527
milestone = None
owner = smoser
owner_name = Scott Moser
private = False
status = fix_released
submitter = hadmut
submitter_name = Hadmut Danisch
tags = []
duplicates = []

Launchpad user Hadmut Danisch(hadmut) wrote on 2020-06-29T08:16:26.428564+00:00

Hi,

I made some experiments with virtual machines with Ubuntu-20.04 at a german cloud provider (Hetzner), who uses cloud-init to initialize machines with a basic setup such as ip and ssh access.

During my installation tests I had to reboot the virtual machines several times after installing or removing packages.

Occassionally (not always) I noticed that the ssh host keys have changed, ssh complained. After accepting the new host keys (insecure!) I found, that all key files in /etc/ssh had fresh mod times, i.e. were freshly regenerated.

This reminds me to a bug I had reported about cloud-init some time ago, where I could not change the host name permanently, because cloud-init reset it to it's initial configuration at every boot time (highly dangerous, because it seemed to reset passwords to their original state as well.

Although cloud-init is intended to do an initial configuration for the first boot only, it seems to remain on the system and – even worse: occasionally – change configurations.

I've never understood what's the purpose of cloud-init remaining active once after the machine is up and running.

Metadata

Metadata

Assignees

No one assigned

    Labels

    launchpadMigrated from Launchpad

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions