Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openssh
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Merge requests 5
    • Merge requests 5
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • Debian SSH Maintainers
  • openssh
  • Merge requests
  • !11

Regenerate SSH host keys if missing before starting sshd under systemd

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Hoi Sing Edison Wong requested to merge hswong3i/ssh-team-openssh:master-ssh-keygen into master Dec 30, 2020
  • Overview 5
  • Commits 1
  • Pipelines 3
  • Changes 1

Refer to https://github.com/vagrant-libvirt/vagrant-libvirt/pull/1184#event-4119515011, we should always remove existing SSH host keys before virt-sysprep VM as a new image, which is the default behavior for virt-sysprep with --operations +ssh-hostkeys.

For Fedora/openSUSE, the missing of SSH host keys will be regenerated before sshd getting started, therefore sshd could start correctly; by the way, corresponding logic is currently missing for Debian/Ubuntu, therefore result as a non-accessible Vagrant box after a simple vagrant up command.

This PR simply add ExecStartPre=/usr/bin/ssh-keygen -A for above missing feature; moreover, the configuration check with /usr/sbin/sshd -t should also replaced as /usr/sbin/sshd -t $SSHD_OPTS which synchronize with corrsponding ExecStart=/usr/sbin/sshd -D $SSHD_OPTS command.

Signed-off-by: Wong Hoi Sing Edison hswong3i@pantarei-design.com

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: master-ssh-keygen