Skip to content

Conversation

@AndrewKvalheim
Copy link
Member

Techniques that leverage the openssh-server package’s postinst script risk two conflicts:

  • When ssh.service has been started by APT, attempting to trigger the postinst script by starting another instance of APT deadlocks.

  • When ssh.service has been started manually, the postinst run via ssh-hostkey-generate.service causes the proximal activation of ssh.service to be canceled, and e.g. Ansible tasks to fail.

To avoid these complications, invoke ssh-keygen directly. The -A option does exactly what we need:

Generate host keys of all default key types (rsa, ecdsa, and ed25519) if they do not already exist.

Techniques that leverage the openssh-server package’s postinst script
risk two conflicts:

  - When ssh.service has been started by APT, attempting to trigger the
    postinst script by starting another instance of APT deadlocks.

  - When ssh.service has been started manually, the postinst script in
    the unit dependency causes the proximal activation to be canceled.

To avoid these complications, invoke ssh-keygen directly. The -A option
does exactly what we need:

> Generate host keys of all default key types (rsa, ecdsa, and ed25519)
> if they do not already exist.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant